UNPKG

sryd-charts-enterprise

Version:

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

23 lines 1.59 MB
var N_=Object.defineProperty,w_=Object.getOwnPropertyDescriptor,y=(t,e,i,s)=>{for(var n=s>1?void 0:s?w_(e,i):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(n=(s?a(e,i,n):a(n))||n);return s&&n&&N_(e,i,n),n},O_=Object.defineProperty,zT=(t,e)=>{for(var i in e)O_(t,i,{get:e[i],enumerable:!0})},$={};zT($,{error:()=>_T,errorOnce:()=>B_,log:()=>E_,logGroup:()=>F_,reset:()=>z_,table:()=>R_,warn:()=>FT,warnOnce:()=>P_});var xu=new Set;function E_(...t){console.log(...t)}function FT(t,...e){console.warn(`AG Charts - ${t}`,...e)}function _T(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function R_(...t){console.table(...t)}function P_(t,...e){const i=`Logger.warn: ${t}`;xu.has(i)||(FT(t,...e),xu.add(i))}function B_(t,...e){const i=`Logger.error: ${t}`;xu.has(i)||(_T(t,...e),xu.add(i))}function z_(){xu.clear()}function F_(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var ln={};zT(ln,{detectChartDefinition:()=>W_,getAxisModule:()=>U_,getSeriesModule:()=>H_,hasModule:()=>V_,listModulesByType:()=>j_,register:()=>GT,registerMany:()=>__,reset:()=>G_});var df=(t=>(t.Axis="axis",t.Chart="chart",t.Preset="preset",t.Plugin="plugin",t.Series="series",t))(df||{}),Or=new Map;function GT(t){const e=Or.get(t.name);if(e&&(e.enterprise||!t.enterprise))throw new Error(`AG Charts - Module '${t.name}' already registered`);Or.set(t.name,t)}function __(t){for(const e of t)GT(e)}function G_(){Or.clear()}function V_(t){return Or.has(t)}function*j_(t){for(const e of Or.values())e.type===t&&(yield e)}function W_(t){for(const e of Or.values())if(Y_(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 H_(t){const e=Or.get(t);if($_(e))return e}function U_(t){const e=Or.get(t);if(K_(e))return e}function Y_(t){return t?.type==="chart"}function K_(t){return t?.type==="axis"}function $_(t){return t?.type==="series"}var IS=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 TS(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 o=t.length-(s-1);return`${t.slice(0,s-1).join(", ")}, and ${o} more ${e} ${n}`}return`${t.join(", ")} ${e} ${n}`}function kS(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 X_(t){let e=1;for(let i=0;i<t.length;i++)t.charCodeAt(i)===10&&e++;return e}function Z_(t,e){if(t===e)return 0;const[i,s]=t.length<e.length?[t,e]:[e,t],n=i.length,o=s.length;let a=new Array(n+1).fill(0).map((l,c)=>c),r=new Array(n+1);for(let l=1;l<=o;l++){r[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;r[c]=Math.min(a[c]+1,r[c-1]+1,a[c-1]+h)}[a,r]=[r,a]}return a[n]}var Uo={};typeof window<"u"?Uo.window=window:typeof global<"u"&&(Uo.window=global.window),typeof document<"u"?Uo.document=document:typeof global<"u"&&(Uo.document=global.document);function Ea(t){return t?Uo.document?.[t]:Uo.document}function re(t){return t?Uo.window?.[t]:Uo.window}function Q_(t){Uo.document=t}function q_(t){Uo.window=t}function Mt(t,e,i){const s=Ea().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 Bi(t){return Ea().createElementNS("http://www.w3.org/2000/svg",t)}function J_(t,e){const i=Ea("body"),s=Mt("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function tG(t){const e=re("Option"),{style:i}=new e;return i.color=t,i.color||null}function $e(t){return t!=null}function wt(t){return Array.isArray(t)}function VT(t){return typeof t=="boolean"}function Yo(t){return t instanceof Date}function Er(t){return Yo(t)&&!isNaN(Number(t))}function eG(t){return t instanceof RegExp}function Rr(t){return typeof t=="function"}function Rt(t){return typeof t=="object"&&t!==null&&!wt(t)}function Xe(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function Ti(t){return typeof t=="string"}function pe(t){return typeof t=="number"}function Pt(t){return Number.isFinite(t)}function iG(t){return typeof window<"u"&&t instanceof HTMLElement}function CS(t,e){return Object.values(t).includes(e)}function sG(t){return typeof t=="symbol"}function jT(t){return Ti(t)&&tG(t)!=null}var $l=Symbol("description"),WT=Symbol("required"),uf=class{constructor(t,e,i,s){this.message=t,this.path=e,this.required=i,this.unknown=s}toString(){return this.message}};function wn(t,e,i=""){if(!Rt(t)){const l=HT(i,t,"an object",!0);return{valid:null,errors:[new uf(l,i,!0)]}}const s=[],n=new Set(Object.keys(t)),o=[],a={};function r(l){return wt(e)?`${i}[${l}]`:i?`${i}.${l}`:l}for(const l of Object.keys(e)){const c=e[l],h=t[l],d=c[WT];if(n.delete(l),typeof h>"u"&&(s.push(l),!d))continue;const u=r(l);if(Rr(c)){const p={options:t,path:u};if(c(h,p))a[l]=p.result?.valid??h;else if(!p.result){const g=HT(u,h,c,d);o.push(new uf(g,i,d))}p.result&&o.push(...p.result.errors)}else{const p=wn(h,c,u);p.valid!=null&&(a[l]=p.valid),o.push(...p.errors)}}for(const l of n){if(typeof t[l]>"u")continue;const h=nG(l,r(l),s);o.push(new uf(h,i,void 0,!0))}return{valid:a,errors:o}}function HT(t,e,i,s){const n=Ti(i)?i:i[$l],o=n?`; expecting ${n}`:"",a=t?`Option \`${t}\``:"Value";return s&&e==null?`${a} is required and has not been provided${o}, ignoring.`:`${a} cannot be set to \`${kS(e,50)}\`${o}, ignoring.`}function nG(t,e,i){const s=oG(t,i),n=s?`; Did you mean \`${s}\`? Ignoring.`:", ignoring.";return`Unknown option \`${e}\`${n}`}function oG(t,e,i=2){let s=1/0;const n=t.toLowerCase();return e.reduce((o,a)=>{const r=Z_(n,a.toLowerCase());return s>r&&r<=i?(s=r,a):o},null)}function ne(t,e){return Object.assign(Rr(t)?(i,s)=>t(i,s):{...t},{[$l]:e})}function K(t){return Object.assign(Rr(t)?(e,i)=>t(e,i):Ra(t),{[WT]:!0,[$l]:t[$l]})}var Ra=(t,e="an object")=>ne((i,s)=>(s.result=wn(i,t,s.path),!s.result.errors.some(n=>n.required&&n.path===s.path)),e),aG=(t,e="an object")=>ne((i,s)=>(s.result=wn(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),Ze=(...t)=>ne((e,i)=>t.every(s=>{const n=s(e,i);return i.result&&!n&&delete i.result,n}),t.map(e=>e[$l]).filter(Boolean).join(" and ")),Qt=(...t)=>ne((e,i)=>t.some(s=>{const n=s(e,i);return i.result&&!n&&delete i.result,n}),t.map(e=>e[$l]).filter(Boolean).join(" or ")),pf=t=>Pt(t)||Er(t),rG=t=>Yo(t)||(Pt(t)||Ti(t))&&Er(new Date(t)),On=ne(wt,"an array"),j=ne(VT,"a boolean"),bt=ne(Rr,"a function"),dt=ne(jT,"a color string"),Xl=ne(rG,"a date"),cn=ne($e,"a defined value"),J=ne(Pt,"a number"),Ko=ne(Rt,"an object"),E=ne(Ti,"a string"),bu=(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`,ne(s=>wt(s)&&s.length>=t&&s.length<=e,i)},UT=(t,e=!0)=>ne(i=>Pt(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),lG=(t,e)=>ne(i=>Pt(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),H=UT(0),gf=UT(0,!1),Tt=lG(0,1),Zl=t=>ne((e,{options:i})=>!pf(e)||!pf(i[t])||e<i[t],`the value to be less than \`${t}\``),Su=t=>ne((e,{options:i})=>!pf(e)||!pf(i[t])||e>i[t],`the value to be greater than \`${t}\``);function st(...t){Rt(t[0])&&(t=Object.values(t[0]));const e=TS(t,"or",i=>`'${i}'`);return ne(i=>t.includes(i),`a keyword such as ${e}`)}var Ct=t=>ne(e=>t===e,`the value ${JSON.stringify(t)}`),cG=(t,e)=>ne(i=>i instanceof t,e??`an instance of ${t.name}`),mt=(t,e)=>ne((i,s)=>wt(i)&&i.every(n=>{const o=t(n,s);return delete s.result,o}),e??`${t[$l]} array`),gs=(t,e="an object array")=>ne((i,s)=>{if(!wt(i))return!1;const n=[],o=[];for(let a=0;a<i.length;a++){const r=`${s.path}[${a}]`,l=wn(i[a],t,r);o.push(...l.errors),l.errors.some(c=>c.required&&c.path===r)||n.push(l.valid)}return s.result={valid:n,errors:o},!0},e),vu=(t,e="an object")=>{const i=aG({type:K(st(...Object.keys(t)))});return ne((s,n)=>{if(i(s,n)){const o=s.type,a={type:K(Ct(o)),...t[o]},r=Ra(a)(s,n);if(n.result)for(const l of n.result.errors)l.message+=` (type="${o}")`;return r}return!1},e)},hG=Ra({color:dt,stop:Tt},""),dG=ne(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"),ff=Ze(bu(2),Ze(mt(hG),dG)),LS=st("axis","item","series"),NS=vu({gradient:{gradient:st("linear","radial","conic"),bounds:LS,colorStops:K(ff),rotation:J,reverse:j}},"a gradient object with color stops"),rt={stroke:dt,strokeWidth:H,strokeOpacity:Tt},yf=Ra({type:K(Ct("gradient")),gradient:K(st("linear","radial","conic")),bounds:K(LS),colorStops:K(Qt(ff,Ze(bu(2),mt(dt)))),rotation:K(J),reverse:K(j)}),mf=Ra({type:K(Ct("pattern")),pattern:K(st("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),width:K(H),height:K(H),fill:K(dt),fillOpacity:K(Tt),backgroundFill:K(dt),backgroundFillOpacity:K(Tt),padding:K(H),rotation:K(J),stroke:K(dt),strokeWidth:K(H),strokeOpacity:K(Tt)}),uG={gradient:st("linear","radial","conic"),bounds:LS,reverse:j},pG={rotation:J,padding:H},gG=vu({gradient:{...uG,colorStops:ff,rotation:J},pattern:{...pG,pattern:st("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),width:H,height:H,fill:dt,fillOpacity:Tt,backgroundFill:dt,backgroundFillOpacity:Tt,...rt}},"a color object"),$o=Qt(dt,gG),St={fill:$o,fillOpacity:Tt};St.fillGradientDefaults=yf,St.fillPatternDefaults=mf;var Ot={lineDash:mt(H),lineDashOffset:J},ge={color:dt,fontFamily:E,fontSize:H,fontStyle:st("normal","italic","oblique"),fontWeight:Qt(H,st("normal","bold","bolder","lighter"))};function xf(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}function YT(t){return Array.from(new Set(t))}function wS(t,e){return t.reduce((i,s)=>{const n=e(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function Xo(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(!Xo(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function Mu(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 fG(t,e){const i=new Map;return e.forEach((s,n)=>{i.set(s,n)}),t.sort((s,n)=>{const o=i.get(s)??1/0,a=i.get(n)??1/0;return o-a})}function KT(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 $T(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 XT(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),o=i(n);o==null?e=n-1:(s=o,t=n+1)}return s}function yG(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),o=i(n);o==null?t=n+1:(s=o,e=n-1)}return s}function mG(t,e){const i=Math.max(t.length,e.length),s=new Set,n=new Set;for(let o=0;o<i;o++){const a=t[o],r=e[o];a!==r&&(n.has(r)?n.delete(r):r&&s.add(r),s.has(a)?s.delete(a):a&&n.add(a))}return{changed:s.size>0||n.size>0,added:s,removed:n}}function xG(t,e=0,i){const{leading:s=!1,trailing:n=!0,maxWait:o=1/0}=i??{};let a,r;if(o<e)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!r){r=Date.now(),a=setTimeout(()=>r=null,e),t(...c);return}let h=e;if(o!==1/0&&r){const d=Date.now()-r;e>o-d&&(h=o-d)}clearTimeout(a),r??(r=Date.now()),a=setTimeout(()=>{r=null,n&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),r=null}})}function ZT(t,e,i){const{leading:s=!0,trailing:n=!0}=i??{};let o,a,r=!1;function l(){n&&a?(o=setTimeout(l,e),t(...a)):r=!1,a=null}function c(...h){r?a=h:(r=!0,o=setTimeout(l,e),s?t(...h):a=h)}return Object.assign(c,{cancel(){clearTimeout(o),r=!1,a=null}})}function*Pr(...t){for(const e of t)yield*e}function bG(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function Du(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*ke(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}function ft(t,e,i){return Math.min(i,Math.max(t,e))}function SG(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function de(t,e,i=1e-10){return t===e||Math.abs(t-e)<i}function OS(t){return Math.sign(t)===-1||Object.is(t,-0)}function QT(t){return t%1===0}function ES(t,e=2){const i=10**e;return Math.round(t*i)/i}function qT(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function Au(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 JT=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,tk=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function vG(t){if(!Ti(t))return!1;const e=tk.exec(t);return JT.test(e?e[2]:t)}function ek(t){let e,i;const s=tk.exec(t);s&&([,e,t,i]=s);const n=JT.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,o,a,r,l,c,h,d,u,p,g]=n;return{fill:o,align:a,sign:r,symbol:l,zero:c,width:parseInt(h),comma:d,precision:parseInt(u),trim:!!p,type:g,prefix:e,suffix:i}}function ik(t){const e=typeof t=="string"?ek(t):t,{fill:i,align:s,sign:n="-",symbol:o,zero:a,width:r,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=e;let{trim:p}=e;const g=u==null||isNaN(u);let f;if(!c)f=En.g,p=!0;else if(c in En&&c in Lh)f=g?Lh[c]:En[c];else if(c in En)f=En[c];else if(c in Lh)f=Lh[c];else throw new Error(`The number formatter type is invalid: ${c}`);let x;return g?x=c?6:12:x=u,m=>{let b=f(m,x);return p&&(b=AG(b)),l&&(b=IG(b,l)),b=kG(m,b,n),o&&o!=="#"&&(b=`${o}${b}`),o==="#"&&c==="x"&&(b=`0x${b}`),c==="s"&&(b=`${b}${TG(m)}`),(c==="%"||c==="p")&&(b=`${b}%`),r!=null&&!isNaN(r)&&(b=CG(b,r,i??a,s)),b=`${h}${b}${d}`,b}}var Lh={b:t=>bf(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>bf(t).toString(8),x:t=>bf(t).toString(16),X:t=>Lh.x(t).toUpperCase(),n:t=>Lh.d(t),"%":t=>`${bf(t*100).toFixed(0)}`},En={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>En.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>En.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)=>En.g(t,e).toUpperCase(),n:(t,e)=>En.g(t,e),p:(t,e)=>En.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 o=10**n;return(Math.round(i/o)*o).toFixed()},s:(t,e)=>{const i=ok(t);return En.r(t/10**i,e)},"%":(t,e)=>En.f(t*100,e)},sk=-24,nk=24,MG={[sk]:"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",[nk]:"Y"},DG="\u2212";function bf(t){return Math.floor(Math.abs(t))}function AG(t){return t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function IG(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let o=s.length-3;o>0;o-=3)s.splice(o,0,e);return`${s.join("")}${n}`}function TG(t){return MG[ok(t)]}function ok(t){return ft(sk,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,nk)}function kG(t,e,i=""){if(i==="(")return t>=0?e:`(${e})`;const s=i==="+"?"+":"";return`${t>=0?s:DG}${e}`}function CG(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 o=Math.max(0,e-n.length),a=Math.ceil(o/2),r=Math.floor(o/2);n=n.padStart(a+n.length,i),n=n.padEnd(r+n.length,i)}return n}var ak=Object.defineProperty,LG=Object.getOwnPropertyDescriptor,ho=(t,e)=>{for(var i in e)ak(t,i,{get:e[i],enumerable:!0})},v=(t,e,i,s)=>{for(var n=s>1?void 0:s?LG(e,i):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(n=(s?a(e,i,n):a(n))||n);return s&&n&&ak(e,i,n),n},Sf=class{constructor(){this.destroyFns=[]}destroy(){for(const t of this.destroyFns)t()}},NG=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(o=>t.includes(o.type)),s=o=>{const a=this.dependencies.get(o);return a?.flatMap(s).concat(a)??[]},n=[];for(const o of i){const a="optionsKey"in o?o.optionsKey:o.contextKey;if(!e.has(a)){for(const r of s(a)){if(e.has(r))continue;const l=this.modulesByOptionKey.get(r);if(!l){n.push(r);continue}t.includes(l.type)&&(yield l,e.add(r))}yield o,e.add(a)}}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)}},Zo=new NG,vf={containsPoint:wG,isEmpty:OG,normalize:EG};function wG(t,e,i){return e>=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function OG(t){return t==null||t.height===0||t.width===0||isNaN(t.height)||isNaN(t.width)}function EG(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 Mf=Symbol("interpolate"),Df=t=>t[Mf]!=null;function Af(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const o of i){const a=o.distanceSquared(t,e);if(a===0)return{nearest:o,distanceSquared:0};a<n.distanceSquared&&(n.nearest=o,n.distanceSquared=a)}return n}function RG(t,e,i,s=1/0){const{x:n=t,y:o=e}=i.transformPoint?.(t,e)??{},a={nearest:void 0,distanceSquared:s};for(const r of i.children){const{nearest:l,distanceSquared:c}=r.nearestSquared(n,o,a.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<a.distanceSquared&&(a.nearest=l,a.distanceSquared=c)}return a}var Iu=class mu{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 mu(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,o=-1/0;for(const a of e)a.x<i&&(i=a.x),a.y<s&&(s=a.y),a.x+a.width>n&&(n=a.x+a.width),a.y+a.height>o&&(o=a.y+a.height);return new mu(i,s,n-i,o-s)}static nearestBox(e,i,s){return Af(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 mu(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 vf.containsPoint(this,e,i)}intersection(e){if(!this.collidesBBox(e))return;const i=ft(e.x,this.x,e.x+e.width),s=ft(e.y,this.y,e.y+e.height),n=ft(e.x,this.x+this.width,e.x+e.width),o=ft(e.y,this.y+this.height,e.y+e.height);return new mu(i,s,n-i,o-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-ft(this.x,e,this.x+this.width),n=i-ft(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}[Mf](e,i){return new mu(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)}};Iu.zero=Object.freeze(new Iu(0,0,0,0)),Iu.NaN=Object.freeze(new Iu(NaN,NaN,NaN,NaN));var pt=Iu,PG=2e3,rk=Date.now(),BG=()=>{const t=Date.now()-rk;if(t>PG){const e=(Math.floor(t/100)/10).toFixed(1);$.log(`**** ${e}s since last log message ****`)}rk=Date.now()},qt={create(...t){return Object.assign((...i)=>{qt.check(...t)&&(typeof i[0]=="function"&&(i=xf(i[0]())),BG(),$.log(...i))},{check:()=>qt.check(...t),group:(i,s)=>qt.check(...t)?$.logGroup(i,s):s()})},check(...t){return t.length===0&&t.push(!0),xf(re("agChartsDebug")).some(i=>t.includes(i))},inDevelopmentMode(t){if(qt.check("dev"))return t()}};function lk({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 ck(t){if(qt.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 hk(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var RS=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[o,a]=hk(e,i,s);this.canvas=new OffscreenCanvas(o,a),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),ck(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[o,a]=hk(t,e,i);s.width=o,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){lk(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)}},PS=new Map;function zG(){PS.clear()}function hn(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=(PS.get(i)??0)+1;return PS.set(i,s),`${i}-${s}`}function BS(){return crypto.randomUUID?.()??FG()}function FG(){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 gt(t){return function(e,i){const s=`__${i}`;e[i]||_G(e,i,s,t)}}function _G(t,e,i,s){const{type:n="normal",changeCb:o,convertor:a,checkDirtyOnAssignment:r=!1}=s??{},l={type:n,changeCb:o,checkDirtyOnAssignment:r,convertor:a};let c;switch(n){case"normal":c=WG(i,l);break;case"transform":c=HG(i);break;case"path":c=UG(i);break}c=jG(i,VG(GG(c,l),l),l),Object.defineProperty(t,e,{set:c,get:function(){return this[i]},enumerable:!0,configurable:!0})}function GG(t,e){const{convertor:i}=e;return i?function(s){t.call(this,i(s))}:t}var If=Symbol("no-change");function VG(t,e){const{changeCb:i}=e;return i?function(s){const n=t.call(this,s);return n!==If&&i.call(this,this),n}:t}function jG(t,e,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const o=e.call(this,n);return n?._dirty===!0&&this.markDirty(t),o}:e}function WG(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):If}}function HG(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this.markDirtyTransform(),e):If}}function UG(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this._dirtyPath||(this._dirtyPath=!0,this.markDirty(t)),e):If}}var dk=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(dk||{}),Tu=class NT{constructor(e){this.serialNumber=NT._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=hn(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??NT._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 o=Bi("svg");if(o.setAttribute("width",String(i)),o.setAttribute("height",String(s)),o.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const a=Bi("defs");a.append(...n.defs),o.append(a)}return o.append(...n.elements),o.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 bG(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 o=s[n].pickNode(e,i);if(o)return o}}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(){}};Tu._nextSerialNumber=0,Tu._debugEnabled=!1,v([gt()],Tu.prototype,"visible",2),v([gt({changeCb:t=>t.onZIndexChange()})],Tu.prototype,"zIndex",2);var Pa=Tu,Tf=Symbol("BREAK"),Nh="__decorator_config";function YG(t,e){zS(t,e).optional=!0}function zS(t,e){Object.getOwnPropertyDescriptor(t,Nh)==null&&Object.defineProperty(t,Nh,{value:{}});const i=t[Nh],s=e.toString();if(typeof i[s]<"u")return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const o=Object.getOwnPropertyDescriptor(t,e),a=o?.set,r=o?.get;return Object.defineProperty(t,e,{set:function(h){const{setters:d,observers:u}=i[s];let p;d.some(g=>g.length>2)&&(p=r?r.call(this):n.get(this));for(const g of d)if(h=g(this,e,h,p),h===Tf)return;a?a.call(this,h):n.set(this,h);for(const g of u)g(this,h,p)},get:function(){let h=r?r.call(this):n.get(this);for(const d of i[s].getters)if(h=d(this,e,h),h===Tf)return;return h},enumerable:!0,configurable:!1}),i[s]}function Ba(t,e,i){return(s,n)=>{const o=zS(s,n);o.setters.push(t),e&&o.getters.unshift(e),i&&Object.assign(o,i)}}function uk(t){return(e,i)=>{zS(e,i).observers.push(t)}}function ku(t){return typeof t<"u"&&Nh in t}function Br(t){const e=new Set;for(;ku(t);)e.add(t?.[Nh]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function pk(t){return Br(t).reduce((e,i)=>(e[i]=t[i]??null,e),{})}function KG(t,e){const i=e.toString();for(;ku(t);){const s=t[Nh];if(Object.hasOwn(s,i))return s[i];t=Object.getPrototypeOf(t)}}function Qo(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>Qo(i,e[s])):Xe(t)?Xe(e)?FS(t,e,Qo):!1:t===e}function FS(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 jt(...t){const e={};for(const i of t){if(!Rt(i))continue;const s=ku(i)?Br(i):Object.keys(i);for(const n of s)Xe(e[n])&&Xe(i[n])?e[n]=jt(e[n],i[n]):e[n]??(e[n]=i[n])}return e}function Cu(...t){const e={};for(const i of t){if(!Rt(i))continue;const s=ku(i)?Br(i):Object.keys(i);for(const n of s)Xe(e[n])&&Xe(i[n])?e[n]=Cu(e[n],i[n]):n in e||(e[n]??(e[n]=i[n]))}return e}function kf(t,...e){return e&&wt(t)?t.map(i=>jt(i,...e)):t}function gk(t,e){const i={};for(const[s,n]of ke(t))i[s]=e(n,s,t);return i}function zr(t,e){const i={...t};for(const s of e)delete i[s];return i}function wh(t,e){return(wt(e)?e:e.split(".")).reduce((s,n)=>s[n],t)}var _S=new Set(["__proto__","constructor","prototype"]);function GS(t,e,i){const s=wt(e)?e.slice():e.split("."),n=s.pop();if(s.some(a=>_S.has(a)))return;const o=s.reduce((a,r)=>a[r],t);return o[n]=i,o[n]}function VS(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 Ql(t){return t==null||typeof t!="object"||!Xe(t)||(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Ql(i)})),t}var Rn=Math.PI*2,Lu=Math.PI/2;function me(t){return t%=Rn,t+=Rn,t%=Rn,t}function $G(t){return t%=Rn,t+=Rn,t!==Rn&&(t%=Rn),t}function Nu(t){return t%=Rn,t<-Math.PI?t+=Rn:t>=Math.PI&&(t-=Rn),t}function Fr(t,e,i){const s=me(t),n=me(e),o=me(i);return n<o?n<=s&&s<=o:n>o?n<=s||s<=o:!0}function Me(t){return t/180*Math.PI}function XG(t){return t/Math.PI*180}function Cf(t,e){return t=me(t),e=me(e),e-t+(t>e?Rn:0)}function fk(t){const e=me(t);return e<=Lu?e/Lu:e<=Math.PI?(Math.PI-e)/Lu:e<=1.5*Math.PI?(e-Math.PI)/Lu:(Rn-e)/Lu}var ql=(t,e,i)=>t*(1-i)+e*i,jS=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},WS=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},yk=class se{constructor(e,i,s,n=1){this.r=ft(0,e||0,1),this.g=ft(0,i||0,1),this.b=ft(0,s||0,1),this.a=ft(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!se.parseHex(e):e.indexOf("rgb")>=0?!!se.stringToRgba(e):se.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return se.fromHexString(e);const i=se.nameToHex.get(e.toLowerCase());if(i)return se.fromHexString(i);if(e.indexOf("rgb")>=0)return se.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=se.parseHex(e);if(i){const[s,n,o,a]=i;return new se(s/255,n/255,o/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,s=-1;for(let r=0;r<e.length;r++){const l=e[r];if(i===-1&&l==="(")i=r;else if(l===")"){s=r;break}}if(i===-1||s===-1)return;const o=e.substring(i+1,s).split(","),a=[];for(let r=0;r<o.length;r++){const l=o[r];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=ft(0,c,100),c/=100):r===3?c=ft(0,c,1):(c=ft(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(e){const i=se.stringToRgba(e);if(i){if(i.length===3)return new se(i[0],i[1],i[2]);if(i.length===4)return new se(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 se(e[0],e[1],e[2],e[3]);if(e.length===3)return new se(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 o=se.HSBtoRGB(e,i,s);return new se(o[0],o[1],o[2],n)}static fromHSL(e,i,s,n=1){const o=se.HSLtoRGB(e,i,s);return new se(o[0],o[1],o[2],n)}static fromOKLCH(e,i,s,n=1){const o=se.OKLCHtoRGB(e,i,s);return new se(o[0],o[1],o[2],n)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+se.padHex(Math.round(this.r*255).toString(16))+se.padHex(Math.round(this.g*255).toString(16))+se.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=se.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 se.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,s){const n=jS(e),o=jS(i),a=jS(s),r=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),l=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a),h=.2104542553*r+.793617785*l-.0040720468*c,d=1.9779984951*r-2.428592205*l+.4505937099*c,u=.0259040371*r+.7827717662*l-.808675766*c,p=Math.atan2(u,d)*180/Math.PI,g=h,f=Math.hypot(d,u),x=p>=0?p:p+360;return[g,f,x]}static OKLCHtoRGB(e,i,s){const n=e,o=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*o+.2158037573*a)**3,l=(n-.1055613458*o-.0638541728*a)**3,c=(n-.0894841775*o-1.291485548*a)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,d=-1.2684380046*r+2.6097574011*l-.3413193965*c,u=-.0041960863*r-.7034186147*l+1.707614701*c,p=WS(h),g=WS(d),f=WS(u);return[p,g,f]}static RGBtoHSL(e,i,s){const n=Math.min(e,i,s),o=Math.max(e,i,s),a=(o+n)/2;let r,l;if(o===n)r=0,l=0;else{const c=o-n;l=a>.5?c/(2-o-n):c/(o+n),o===e?r=(i-s)/c+(i<s?6:0):o===i?r=(s-e)/c+2:r=(e-i)/c+4,r*=360/6}return[r,l,a]}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,o=2*s-n;function a(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?o+(n-o)*6*h:h<1/2?n:h<2/3?o+(n-o)*(2/3-h)*6:o}const r=a(e/360+1/3),l=a(e/360),c=a(e/360-1/3);return[r,l,c]}static RGBtoHSB(e,i,s){const n=Math.min(e,i,s),o=Math.max(e,i,s),a=o===0?0:(o-n)/o;let r=0;if(n!==o){const l=o-n,c=(o-e)/l,h=(o-i)/l,d=(o-s)/l;e===o?r=d-h:i===o?r=2+c-d:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,a,o]}static HSBtoRGB(e,i,s){e=(e%360+360)%360/360;let n=0,o=0,a=0;if(i===0)n=o=a=s;else{const r=(e-Math.floor(e))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),d=s*(1-i*(1-l));switch(r>>0){case 0:n=s,o=d,a=c;break;case 1:n=h,o=s,a=c;break;case 2:n=c,o=s,a=d;break;case 3:n=c,o=h,a=s;break;case 4:n=d,o=c,a=s;break;case 5:n=s,o=c,a=h;break}}return[n,o,a]}static mix(e,i,s){return new se(ql(e.r,i.r,s),ql(e.g,i.g,s),ql(e.b,i.b,s),ql(e.a,i.a,s))}static lighten(e,i){const s=se.RGBtoOKLCH(e.r,e.g,e.b);return se.fromOKLCH(ft(0,s[0]+i,1),s[1],s[2])}static darken(e,i){const s=se.RGBtoOKLCH(e.r,e.g,e.b);return se.fromOKLCH(ft(0,s[0]-i,1),s[1],s[2])}static interpolate(e,i){const s=1/(e.length-1),n=e.map(o=>se.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:i},(o,a)=>{const r=a/(i-1),l=e.length<=2?0:Math.min(Math.floor(r*(e.length-1)),e.length-2),c=(r-l*s)/s,h=n[l],d=n[l+1];return se.fromOKLCH(ql(h[0],d[0],c),ql(h[1],d[1],c),ql(h[2],d[2],c))})}};yk.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 oe=yk,Lf=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}tickFormatter(t){}datumFormatter(t){}get bandwidth(){}get step(){}get inset(){}},Oh=(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})},mk=t=>{const e=oe.fromString(t),[i,s,n]=oe.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},HS=1e-6,xk=t=>t.c<HS||t.l<HS||t.l>1-HS,ZG=(t,e,i)=>{i=ft(0,i,1);let s;if(xk(t))s=e.h;else if(xk(e))s=t.h;else{const r=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,o=t.l*(1-i)+e.l*i,a=t.a*(1-i)+e.a*i;return oe.fromOKLCH(o,n,s,a)},Eh=class extends Lf{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(mk)}update(){const{domain:t,range:e}=this;t.length<2&&($.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){$.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((o,a)=>o-a);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(mk)}normalizeDomains(...t){return{domain:t.flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],o=e.at(-1),a=i[0],r=i[i.length-1];if(t<=n)return a;if(t>=o)return r;let l,c;if(e.length===2){const u=(t-n)/(o-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-l*p)/p}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const u=e[l],p=e[l+1];c=(t-u)/(p-u)}const h=s[l],d=s[l+1];return ZG(h,d,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&$.warnOnce("Expected update to not invalidate scale"))}};v([Oh],Eh.prototype,"domain",2),v([Oh],Eh.prototype,"range",2);var Nf=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:o}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let a=this.createCanvasGradient(t,s,i);if(a==null)return;const r=o==="oklch",l=.05;let c=n[0];a.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(r){const u=new Eh;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)a.addColorStop(p,u.convert(p))}a.addColorStop(d.stop,d.color),c=d}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:t,bbox:s,gradient:a},a}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);return this.stops.forEach(({stop:s,color:n})=>{const o=Bi("stop");o.setAttribute("offset",`${s}`),o.setAttribute("stop-color",`${n}`),i.appendChild(o)}),i}},bk=class extends Nf{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e,i){const{angle:n}=this,o=me(Me(n+-90)),a=i?.centerX??e.x+e.width*.5,r=i?.centerY??e.y+e.height*.5;return t.createConicGradient(o,a,r)}createSvgGradient(t){return Bi("linearGradient")}},Sk=class extends Nf{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}getGradientPoints(t){const{angle:i}=this,s=me(Me(i+90)),n=Math.cos(s),o=Math.sin(s),a=t.width,r=t.height,l=t.x+a*.5,c=t.y+r*.5,h=Math.sqrt(r*r+a*a)/2,d=Math.atan2(r,a);let u;s<Math.PI/2?u=s:s<Math.PI?u=Math.PI-s:s<1.5*Math.PI?u=s-Math.PI:u=2*Math.PI-s;const p=h*Math.abs(Math.cos(u-d));return{x0:l+n*p,y0:c+o*p,x1:l-n*p,y1:c-o*p}}createCanvasGradient(t,e){const{x0:i,y0:s,x1:n,y1:o}=this.getGradientPoints(e);return t.createLinearGradient(i,s,n,o)}createSvgGradient(t){const{x0:e,y0:i,x1:s,y1:n}=this.getGradientPoints(t),o=Bi("linearGradient");return o.setAttribute("x1",String(e)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(s)),o.setAttribute("y2",String(n)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},QG=class extends Nf{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,o=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(s,n,o,s,n,a)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,s=Bi("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}},kt=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(typeof t!="object")return $.warn(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const s of Br(this))if(i.has(s)){const n=t[s],o=this;if(Pn(o[s]))if(o[s]instanceof wu){const a=o[s].reset(n);a!=null?o[s]=a:$.warn(`unable to set [${s}] - expecting a properties array`)}else o[s].set(n);else Xe(n)?o[s]=Cu(n,o[s]??{}):o[s]=n;i.delete(s)}this.handleUnknownProperties(i,t);for(const s of i)$.warn(`unable to set [${s}] in ${e} - property is unknown`);return this}isValid(t){return Br(this).every(e=>{const i=KG(this,e);if(i==null)return!0;const s=i.optional===!0||typeof this[e]<"u";return s||$.warnOnce(`${t??""}[${e}] is required.`),s})}toJson(){return Br(this).reduce((t,e)=>{const i=this[e];return t[e]=Pn(i)?i.toJson():i,t},{})}},wu=class u_ extends Array{constructor(e,...i){super(i.length);const n=(o=>!!o?.prototype?.constructor?.name)(e)?o=>new e().set(o):e;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(wt(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 u_(this.itemFactory,...e)}toJson(){return this.map(e=>e?.toJson?.()??e)}};function Pn(t){return t instanceof kt||t instanceof wu}function qG(t,e={}){const{optional:i=!1}=e;return Ba((s,n,o)=>{const a={...e,target:s,property:n};if(i&&typeof o>"u"||t(o,a))return Pn(s[n])&&!Pn(o)?(s[n].set(o),s[n]):o;const r=kS(o,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${Rh(t,a)}`:"";return $.warn(`Property [${l}] of [${c}] cannot be set to [${r}]${h}, ignoring.`),Tf},void 0,{optional:i})}var JG=!1,A=JG?(t,e={})=>{const{optional:i=!1}=e;return Ba((s,n,o)=>{const a={...e,target:s,property:n};if(i&&typeof o>"u"||t(o,a)){if(Pn(s[n])&&!Pn(o))return s[n].set(o),s[n]}else{const r=kS(o,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${Rh(t,a)}`:"";$.warn(`TempValidation!!! Property [${l}] of [${c}] cannot be set to [${r}]${h}, ignoring.`)}return o},void 0,{optional:i})}:()=>YG,_r=(...t)=>{const e=[];return ce((i,s)=>(e.length=0,t.every(n=>{const o=n(i,s);return o||e.push(Rh(n,s)),o})),()=>e.filter(Boolean).join(" AND "))},Zi=(...t)=>ce((e,i)=>t.some(s=>s(e,i)),e=>t.map(c4(e)).filter(Boolean).join(" OR ")),at=Ff(ce((t,e)=>Pn(t)||Rt(t)&&Pn(e.target[e.property]),"a properties object")),vk=Ff(ce(t=>Rt(t),"an object")),xt=ce(VT,"a boolean"),Ls=ce(Rr,"a function"),et=ce(Ti,"a string"),Et=d4(ce(Pt,"a number")),Mk=ce(t=>pe(t)&&!isNaN(t),"a real number"),wf=ce(t=>pe(t)&&isNaN(t),"NaN"),ot=Et.restrict({min:0}),ae=Et.restrict({min:0,max:1}),Of=Zi(Et,wf),Jl=h4(ce(wt,"an array")),ki=(t,e)=>ce((i,s)=>wt(i)&&i.every(n=>t(n,s)),i=>{const s=Rh(Jl,i)??"";return typeof e=="function"?`${s} of ${e(i)}`:e?`${s} of ${e}`:s}),Ef=t=>Pt(t)||Er(t),Rf=t=>ce((e,i)=>!Ef(e)||!Ef(i.target[t])||e<i.target[t],`to be less than ${t}`),Pf=t=>ce((e,i)=>!Ef(e)||!Ef(i.target[t])||e>i.target[t],`to be greater than ${t}`),US=ce(Er,"Date object"),YS=Zi(US,ot),Dk="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",zt=ce(jT,`color string. ${Dk}`),qo=Ff(ce(t=>Rt(t)&&t.type==="gradient","a color gradient object")),Jo=Ff(ce(t=>Rt(t)&&t.type==="pattern","a color pattern object")),Gr=ce(ki(zt),`color strings. ${Dk}`),t4=ki(xt,"boolean values"),Ak=ki(Et,"numbers"),Ik=ki(et,"strings"),e4=ce(ki(US),"Date objects"),KS=ce(ki(at),"objects"),i4=le(["butt","round","square"],"a line cap"),s4=le(["round","bevel","miter"],"a line join"),n4=le(["solid","dashed","dotted"],"a line style"),ta=ce(ki(ot),"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."),$S=le(["top","right","bottom","left"],"a position"),za=le(["normal","italic","oblique"],"a font style"),Fa=Zi(le(["normal","bold","bolder","lighter"],"a font weight"),Et.restrict({min:1,max:1e3})),Bf=le(["never","always","hyphenate","on-space"],"a text wrap strategy"),Tk=le(["left","center","right"],"a text align"),o4=le(["top","middle","bottom"],"a vertical align"),a4=le(["ellipsis","hide"],"an overflow strategy"),kk=le(["horizontal","vertical"],"a direction"),r4=le(["inside","outside"],"a placement"),zf=Zi(le(["exact","nearest"],"interaction range"),Et),XS=le(["top","bottom","left","right"]);function le(t,e="a"){return ce((i,s)=>{const n=t.find(o=>{const a=typeof o=="string"?o:o.value;return i===a});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const o=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&o.push(`Use ${n.deprecatedTo} instead.`),$.warnOnce(o.join(" "),s.property)}return!0},`${e} keyword such as ${l4(t)}`)}var Ck=Zi(_r(Et.restrict({min:1}),Rf("maxSpacing")),wf),Lk=Zi(_r(Et.restrict({min:1}),Pf("minSpacing")),wf);function ce(t,e){return t.message=e,t}function l4(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 Rh(t,e){return Rr(t.message)?t.message(e):t.message}function c4(t){return e=>Rh(e,t)}function h4(t){return Object.assign(t,{restrict({length:e,minLength:i}={}){let s="an array";return pe(i)&&i>0?s="a non-empty array":pe(e)&&(s=`an array of length ${e}`),ce(n=>wt(n)&&(pe(e)?n.length===e:!0)&&(pe(i)?n.length>=i:!0),s)}})}function d4(t){return Object.assign(t,{restrict({min:e,max:i}={}){const s=["a number"],n=pe(e),o=pe(i);return n&&o?s.push(`between ${e} and ${i} inclusive`):n?s.push(`greater than or equal to ${e}`):o&&s.push(`less than or equal to ${i}`),ce(a=>Pt(a)&&(n?a>=e:!0)&&(o?a<=i:!0),s.join(" "))}})}function Ff(t){return Object.assign(t,{restrict(e){return ce(i=>i instanceof e,i=>Rh(t,i)??`an instance of ${e.name}`)}})}var ZS=class extends kt{constructor(){super(...arguments),this.color="black"}};v([A(Et,{optional:!0})],ZS.prototype,"stop",2),v([A(zt,{optional:!0})],ZS.prototype,"color",2);function u4(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 Nk(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 p4(t,e){const i=e==="discrete"?1:0,s=t.map((n,o,{length:a})=>({stop:(o+i)/(a-1+i),color:n}));return e==="discrete"?Nk(s):s}function wk(t,e,i,s="continuous"){const n=t.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return p4(e,s);if(!u4(n))return $.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),a=Math.max(...i),r=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g<n.length;g+=1){const f=n[g];if(g>=h){h=n.length-1;for(let m=g+1;m<n.length;m+=1)if(n[m]?.stop!=null){h=m;break}}let x=f?.stop;if(x==null){const m=n[c]?.stop,b=n[h]?.stop,S=m??o,M=b??a,D=r&&m==null?1:0;x=S+(M-S)*(g-c+D)/(h-c+D)}else c=g;l[g]=Math.max(0,Math.min(1,(x-o)/(a-o)))}let d=n.find(g=>g.color!=null)?.color,u;const p=n.map((g,f)=>{let x=g?.color;const m=l[f];return x!=null?d=x:d!=null?x=d:(u==null&&(u=new Eh,u.domain=[0,1],u.range=e),x=u.convert(m)),{stop:m,color:x}});return s==="discrete"?Nk(p):p}function Ou(t,e,i,s){const n=t-i,o=e-s;return n*n+o*o}function Eu(t,e,i,s,n,o,a){if(i===n&&s===o)return Math.min(a,Ou(t,e,i,s));const r=n-i,l=o-s,c=Math.max(0,Math.min(1,((t-i)*r+(e-s)*l)/(r*r+l*l))),h=i+c*r,d=s+c*l;return Math.min(a,Ou(t,e,h,d))}function g4(t,e,i,s,n,o,a,r,l){r&&([a,o]=[o,a]);const c=Math.atan2(e-s,t-i);if(!Fr(c,o,a)){const d=i+Math.cos(o)*n,u=s+Math.sin(o)*n,p=i+Math.cos(o)*n,g=s+Math.sin(o)*n;return Math.min(l,Ou(t,e,d,u),Ou(t,e,p,g))}const h=n-Math.sqrt(Ou(t,e,i,s));return Math.min(l,h*h)}function f4(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function y4(t,e,i){if(t===0)return f4(e,i);const s=e*e-4*t*i,n=[];if(s===0){const o=-e/(2*t);o>=0&&o<=1&&n.push(o)}else if(s>0){const o=Math.sqrt(s),a=(-e-o)/(2*t),r=(-e+o)/(2*t);a>=0&&a<=1&&n.push(a),r>=0&&r<=1&&n.push(r)}return n}function m4(t,e,i,s){if(t===0)return y4(e,i,s);const n=e/t,o=i/t,a=s/t,r=(3*o-n*n)/9,l=(9*n*o-27*a-2*n*n*n)/54,c=r*r*r+l*l,h=1/3,d=[];if(c>=0){const u=Math.sqrt(c),p=Math.sign(l+u)*Math.pow(Math.abs(l+u),h),g=Math.sign(l-u)*Math.pow(Math.abs(l-u),h),f=Math.abs(Math.sqrt(3)*(p-g)/2),x=-h*n+(p+g);if(x>=0&&x<=1&&d.push(x),f===0){const m=-h*n-(p+g)/2;m>=0&&m<=1&&d.push(m)}}else{const u=Math.acos(l/Math.sqrt(-r*r*r)),p=h*n,g=2*Math.sqrt(-r),f=g*Math.cos(h*u)-p,x=g*Math.cos(h*(u+2*Math.PI))-p,m=g*Math.cos(h*(u+4*Math.PI))-p;f>=0&&f<=1&&d.push(f),x>=0&&x<=1&&d.push(x),m>=0&&m<=1&&d.push(m)}return d}function Ph(t,e,i,s,n,o,a,r){const l=(i-t)*(r-o)-(s-e)*(a-n);if(l===0)return 0;const c=((a-n)*(e-o)-(t-n)*(r-o))/l,h=((i-t)*(e-o)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function x4(t,e,i,s,n,o,a,r,l,c,h,d){let u=0;const p=c-d,g=h-l,f=l*(d-c)-c*(h-l),x=Ok(t,i,n,a),m=Ok(e,s,o,r),b=p*x[0]+g*m[0],S=p*x[1]+g*m[1],M=p*x[2]+g*m[2],D=p*x[3]+g*m[3]+f,C=m4(b,S,M,D);for(const k of C){const I=k*k,L=k*I,N=x[0]*L+x[1]*I+x[2]*k+x[3],O=m[0]*L+m[1]*I+m[2]*k+m[3];let w;l===h?w=(O-c)/(d-c):w=(N-l)/(h-l),w>=0&&w<=1&&u++}return u}function Ok(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function Ek(t,e,i,s,n,o,a,r,l,c){if(isNaN(t)||isNaN(e))return 0;o&&([n,s]=[s,n]);const h=(c-r)/(l-a),d=r-h*a,u=Math.pow(h,2)+1,p=2*(h*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),f=Math.pow(p,2)-4*u*g;if(f<0)return 0;const x=(-p+Math.sqrt(f))/2/u,m=(-p-Math.sqrt(f))/2/u;let b=0;return[x,m].forEach(S=>{if(!(S>=Math.min(a,l)&&S<=Math.max(a,l)))return;const D=h*S+d,C=S-t,k=D-e,I=Math.atan2(k,C);Fr(I,s,n)&&b++}),b}function _f(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 Gf(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 o=0,a=1,r=NaN;for(let l=0;l<12;l+=1)r=(o+a)/2,_f(t,e,i,s,r)<n?o=r:a=r;return r}function Vf(t,e,i,s,n,o,a,r,l){const c=(1-l)*t+l*i,h=(1-l)*e+l*s,d=(1-l)*i+l*n,u=(1-l)*s+l*o,p=(1-l)*n+l*a,g=(1-l)*o+l*r,f=(1-l)*c+l*d,x=(1-l)*h+l*u,m=(1-l)*d+l*p,b=(1-l)*u+l*g,S=(1-l)*f+l*m,M=(1-l)*x+l*b;return[[{x:t,y:e},{x:c,y:h},{x:f,y:x},{x:S,y:M}],[{x:S,y:M},{x:m,y:b},{x:p,y:g},{x:a,y:r}]]}function QS(t,e,i,s){const n=-t+3*e-3*i+s,o=3*t-6*e+3*i,a=-3*t+3*e;if(n===0){if(o!==0){const l=-a/o;if(l>0&&l<1)return[l]}return[]}const r=o*o-4*n*a;if(r>=0){const l=Math.sqrt(r),c=(-o+l)/(2*n),h=(-o-l)/(2*n);return[c,h].filter(d=>d>0&&d<1)}return[]}function Rk(t,e,i,s,n,o,a,r){const l=QS(t,i,n,a),c=QS(e,s,o,r);return[...l,...c]}var Bh=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,o){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,o),this.commands.push(2),this.params.push(t,e,i,s,n,o?1:0)}cubicCurveTo(t,e,i,s,n,o){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,o),this.commands.push(3),this.params.push(t,e,i,s,n,o)}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,o=-1e4,a=-1e4;let r=NaN,l=NaN,c=0,h=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=Ph(r,l,c,h,o,a,t,e),c=s[p++],r=c,h=s[p++],l=h;break;case 1:d+=Ph(c,h,s[p++],s[p++],o,a,t,e),c=s[p-2],h=s[p-1];break;case 3:d+=x4(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],o,a,t,e),c=s[p-2],h=s[p-1];break;case 2:{const g=s[p++],f=s[p++],x=s[p++],m=s[p++],b=s[p++],S=!!s[p++];if(d+=Ek(g,f,x,m,b,S,o,a,t,e),!isNaN(r)){const M=g+Math.cos(m)*x,D=f+Math.sin(m)*x;d+=Ph(c,h,M,D,o,a,t,e)}c=g+Math.cos(b)*x,h=f+Math.sin(b)*x;break}case 4:d+=Ph(r,l,c,h,o,a,t,e);break}return d%2===1}distanceSquared(t,e){let i=1/0;const s=this.commands,n=this.params,o=s.length;let a=NaN,r=NaN,l=0,c=0;for(let h=0,d=0;h<o;h++)switch(s[h]){case 0:l=a=n[d++],c=r=n[d++];break;case 1:{const u=n[d++],p=n[d++];i=Eu(t,e,l,c,u,p,i);break}case 3:$.error("Command.Curve distanceSquare not implemented");break;case 2:{const u=n[d++],p=n[d++],g=n[d++],f=n[d++],x=n[d++],m=u+Math.cos(f)*g,b=p+Math.sin(f)*g,S=!!n[d++];i=Eu(t,e,l,c,m,b,i),i=g4(t,e,u,p,g,f,x,S,i),l=u+Math.cos(x)*g,c=p+Math.sin(x)*g;break}case 4:i=Eu(t,e,l,c,a,r,i);break}return i}toSVG(t=(e,i)=>({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(a,...r)=>{e.push(a);for(let l=0;l<r.length;l+=2){const{x:c,y:h}=t(r[l],r[l+1]);e.push(c,h)}};let o=0;for(const a of i)switch(a){case 0:n("M",s[o++],s[o++]);break;case 1:n("L",s[o++],s[o++]);break;case 3:n("C",s[o++],s[o++],s[o++],s[o++],s[o++],s[o++]);break;case 2:{const r=s[o++],l=s[o++],c=s[o++],h=s[o++],d=s[o++],u=s[o++];let p=u?h-d:d-h;p<0&&(p+=Math.ceil(-p/(2*Math.PI))*2*Math.PI),u&&(p=-p);const g=Math.max(Math.ceil(Math.abs(p)/(Math.PI/2)),1),f=p/g,x=4/3*Math.tan(f/4),m=e.length===0?"M":"L";n(m,r+Math.cos(h)*c,l+Math.sin(h)*c);for(let b=0;b<g;b+=1){const S=h+f*(b+0),M=h+f*(b+1),D=c*Math.sin(S),C=c*Math.cos(S),k=c*Math.sin(M),I=c*Math.cos(M);n("C",r+C-x*D,l+D+x*C,r+I+x*k,l+k-x*I,r+I,l+k)}break}case 4:e.push("Z");break}return e.join(" ")}computeBBox(){const{commands:t,params:e}=this;let[i,s,n,o]=[1/0,1/0,-1/0,-1/0],[a,r]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(u,p,g)=>{i=Math.min(p,i),s=Math.min(u,s),n=Math.max(u,n),o=Math.max(p,o),g&&([a,r]=[u,p])};let d=0;for(const u of t)switch(u){case 0:h(e[d++],e[d++],!0),[l,c]=[a,r];break;case 1:h(e[d++],e[d++],!0);break;case 3:{const p=e[d++],g=e[d++],f=e[d++],x=e[d++],m=e[d++],b=e[d++];h(m,b,!0),Rk(a,r,p,g,f,x,m,b).forEach(M=>{const D=_f(a,p,f,m,M),C=_f(r,g,x,b,M);h(D,C)});break}case 2:{const p=e[d++],g=e[d++],f=e[d++];let x=me(e[d++]),m=me(e[d++]);e[d++]&&([x,m]=[m,x]);const S=(D,C)=>{const k=p+f*Math.cos(D),I=g+f*Math.sin(D);h(k,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:[a,r]=[l,c];break}return new pt(s,i,n-s,o-i)}};function Ci(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 Pk(t,e){return Math.floor(e*t)/t}function qS(t,e,i){const{width:s,height:n,padding:o,strokeWidth:a}=e,r=s/2,l=n/2,c=Math.max(1,s-o-a/2),h=Math.max(1,n-o-a/2);let d=!1;for(const[u,p]of i){const g=r+(u-.5)*c,f=l+(p-.5)*h;d?t.lineTo(g,f):t.moveTo(g,f),d=!0}t.closePath()}var b4={circles(t,{width:e,strokeWidth:i,padding:s}){const n=e/2,o=Math.max(1,n-s-i/2);t.arc(n,n,o,0,Math.PI*2)},squares(t,{width:e,height:i,pixelRatio:s,padding:n,strokeWidth:o}){const a=n+o/2;t.moveTo(Ci(s,a),Ci(s,a)),t.lineTo(Ci(s,e-a),Ci(s,a)),t.lineTo(Ci(s,e-a),Ci(s,i-a)),t.lineTo(Ci(s,a),Ci(s,i-a)),t.closePath()},triangles(t,e){qS(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){qS(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:s}){const o=Math.max(1,(e-s)/2),a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=e/2+Math.cos(h)*c,u=i/2+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},hearts(t,{width:e,height:i,padding:s}){const n=Math.max(1,e/4-s/2),o=e/2,a=i/2+n/2;t.arc(o-n,a-n,n,Me(130),Me(330)),t.arc(o+n,a-n,n,Me(220),Me(50)),t.lineTo(o,a+n),t.closePath()},crosses(t,e){qS(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 o=Ci(s,e/2)-n%2/2;t.moveTo(o,0),t.lineTo(o,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const o=Ci(s,i/2)-n%2/2;t.moveTo(0,o),t.lineTo(e,o)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),o=s*Math.cos(n),a=s*Math.sin(n);t.moveTo(-o,a),t.lineTo(o,-a),t.moveTo(-o,i+a),t.lineTo(e+o,-a),t.moveTo(e-o,i+a),t.lineTo(e+o,i-a)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),o=s*Math.cos(n),a=s*Math.sin(n);t.moveTo(e-o,-a),t.lineTo(e+o,a),t.moveTo(-o,-a),t.lineTo(e+o,i+a),t.moveTo(-o,i-a),t.lineTo(o,i+a)}},S4=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:o}=this,a=new Bh;return b4[t](a,{width:e,height:i,pixelRatio:o,strokeWidth:n,padding:s}),a}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:o,rotation:a}=this,r=new RS({width:e,height:i,pixelRatio:o}),l=r.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(r.canvas,"repeat"),d=me(Me(a)),u=1/o,p=Math.cos(d)*u,g=Math.sin(d)*u;return h?.setTransform(new DOMMatrix([p,g,-g,p,0,0])),r.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:o,stroke:a,strokeWidth:r,strokeOpacity:l,rotation:c}=this,h=Bi("pattern");h.setAttribute("viewBox",`0 0 ${t} ${e}`),h.setAttribute("width",String(t)),h.setAttribute("height",String(e)),h.setAttribute("patternUnits","userSpaceOnUse");const d=Bi("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(t)),d.setAttribute("height",String(e)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(o)),h.appendChild(d);const u=Bi("path");return u.setAttribute("fill",i),u.setAttribute("fill-opacity",String(s)),u.setAttribute("stroke-opacity",String(l)),u.setAttribute("stroke",a),u.setAttribute("stroke-width",String(r)),u.setAttribute("transform",`rotate(${c})`),u.setAttribute("d",this.getPath().toSVG()),h.appendChild(u),h}};function uo(t){return Rt(t)&&t.type=="gradient"}function Bk(t){return wt(t)&&t.every(e=>typeof e=="string")}function tc(t){return t!==null&&Rt(t)&&t.type=="pattern"}function v4(t){return uo(t)||tc(t)}var fs=class wa extends Pa{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=wa.defaultStyles.fill,this.stroke=wa.defaultStyles.stroke,this.strokeWidth=wa.defaultStyles.strokeWidth,this.lineDash=wa.defaultStyles.lineDash,this.lineDashOffset=wa.defaultStyles.lineDashOffset,this.lineCap=wa.defaultStyles.lineCap,this.lineJoin=wa.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=wa.defaultStyles.opacity,this.fillShadow=wa.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){if(uo(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:o=0,reverse:a=!1}=e;if(n==null)return;let r=wk(n,["black"],[0,1]);switch(a&&(r=r.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new Sk(i,r,o);case"radial":return new QG(i,r);case"conic":return new bk(i,r,o)}}getPattern(e){if(tc(e))return this.createPattern(e)}createPattern(e){const i=this.layerManager?.canvas?.pixelRatio??1;return new S4(e,i)}onFillChange(){typeof this.fill=="object"&&Qo(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 Ci(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:o}=this,a=n?s?.createGradient(e,n,o):void 0,r=this.fillPattern?.createPattern(e);e.fillStyle=r??a??(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(uo(s)&&this.fillGradient){i??(i=[]);const o=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=BS();o.setAttribute("id",a),i.push(o),e.setAttribute("fill",`url(#${a})`)}else if(tc(s)&&this.fillPattern){i??(i=[]);const o=this.fillPattern.toSvg(),a=BS();o.setAttribute("id",a),i.push(o),e.setAttribute("fill",`url(#${a})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=this;if(i!=null&&(e.setAttribute("stroke",typeof i=="string"?i:"none"),e.setAttribute("stroke-opacity",String(s)),e.setAttribute("stroke-width",String(n))),o?.some(r=>r!==0)===!0){const r=o.length%2===1?[...o,...o]:o;e.setAttribute("stroke-dasharray",r.join(" ")),e.setAttribute("stroke-dashoffset",String(a))}}};fs.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},v([gt()],fs.prototype,"fillOpacity",2),v([gt()],fs.prototype,"strokeOpacity",2),v([gt({changeCb:t=>t.onFillChange()})],fs.prototype,"fill",2),v([gt({changeCb:t=>t.onStrokeChange()})],fs.prototype,"stroke",2),v([gt()],fs.prototype,"strokeWidth",2),v([gt()],fs.prototype,"lineDash",2),v([gt()],fs.prototype,"lineDashOffset",2),v([gt()],fs.prototype,"lineCap",2),v([gt()],fs.prototype,"lineJoin",2),v([gt()],fs.prototype,"miterLimit",2),v([gt({convertor:t=>ft(0,t,1)})],fs.prototype,"opacity",2),v([gt({checkDirtyOnAssignment:!0})],fs.prototype,"fillShadow",2),v([gt({changeCb:t=>t.onFillChange()})],fs.prototype,"fillBBox",2),v([gt({changeCb:t=>t.onFillChange()})],fs.prototype,"fillParams",2);var Bn=fs,zk=[1,0,0,1,0,0],po=class vS{get e(){return[...this.elements]}constructor(e=zk){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 de(e[0],1)&&de(e[1],0)&&de(e[2],0)&&de(e[3],1)&&de(e[4],0)&&de(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],o=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],r=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]=o,s[2]=a,s[3]=r,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 vS?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 vS(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],o=e[3];const a=e[4],r=e[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,new vS([o,-s,-n,i,n*r-o*a,s*a-i*r])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],o=e[3];const a=e[4],r=e[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,e[0]=o,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*r-o*a,e[5]=s*a-i*r,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],o=s[1],a=s[2],r=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,d=e.y+c,u=Math.abs(l*n)+Math.abs(c*a),p=Math.abs(l*o)+Math.abs(c*r);return i??(i=new pt(0,0,0,0)),i.x=h*n+d*a+s[4]-u,i.y=h*o+d*r+s[5]-p,i.width=u+u,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,o,a,r){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=r?.scalingCenterX??0,d=r?.scalingCenterY??0);const u=n,p=Math.cos(u),g=Math.sin(u);let f,x;u===0?(f=0,x=0):(f=r?.rotationCenterX??0,x=r?.rotationCenterY??0);const m=o,b=a,S=h*(1-l)-f,M=d*(1-c)-x;return e.setElements([p*l,g*l,-g*c,p*c,p*S-g*M+f+m,g*S+p*M+x+b]),e}};function Vr(t){return _k(t.constructor)}var Fk=Symbol("isMatrixTransform");function _k(t){return t[Fk]===!0}function JS(t){var e,i;const s=t;if(_k(t))return t;const n=Symbol("matrix_combined_transform");class o extends s{constructor(){super(...arguments),this[i]=new po,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(zk),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNode(r,l)}pickNodes(r,l,c){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNodes(r,l,c)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[n];let h=!1;c.identity||(l.save(),h=!0,c.toContext(l)),super.render(r),h&&l.restore()}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[n];if(l.identity||r==null)return r;const c=Bi("g");c.append(...r.elements);const[h,d,u,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${g} ${f})`),{elements:[c],defs:r.defs}}}return e=Fk,i=n,o[e]=!0,o}function zh(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends JS(i){constructor(){super(...arguments),this[e]=new po,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(po.updateTransformMatrix(this[s],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[s]))}}return e=s,v([gt({type:"transform"})],n.prototype,"rotationCenterX",2),v([gt({type:"transform"})],n.prototype,"rotationCenterY",2),v([gt({type:"transform"})],n.prototype,"rotation",2),n}function tv(t){var e;const i=t,s=Symbol("matrix_scale");class n extends JS(i){constructor(){super(...arguments),this[e]=new po,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(a){super.updateMatrix(a);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;r===1&&l===1||(po.updateTransformMatrix(this[s],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),a.multiplySelf(this[s]))}}return e=s,v([gt({type:"transform"})],n.prototype,"scalingX",2),v([gt({type:"transform"})],n.prototype,"scalingY",2),v([gt({type:"transform"})],n.prototype,"scalingCenterX",2),v([gt({type:"transform"})],n.prototype,"scalingCenterY",2),n}function ec(t){var e;const i=t,s=Symbol("matrix_translation");class n extends JS(i){constructor(){super(...arguments),this[e]=new po,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:r,translationY:l}=this;r===0&&l===0||(po.updateTransformMatrix(this[s],1,1,0,r,l),a.multiplySelf(this[s]))}}return e=s,v([gt({type:"transform"})],n.prototype,"translationX",2),v([gt({type:"transform"})],n.prototype,"translationY",2),n}var Be=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())Vr(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return Vr(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():Vr(t)&&(e=t.toParent(e));for(const i of t.traverseUp())Vr(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())Vr(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return Vr(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){Vr(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())Vr(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},ev=(t,e)=>Math.sign(t-e);function Gk(t,e){if(typeof t=="number"&&typeof e=="number")return ev(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let o=0;o<n;o+=1){const a=ev(i[o],s[o]);if(a!==0)return a}return ev(i.length,s.length)}var Ru,iv=class of extends Pa{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 of}static computeChildrenBBox(e,i=!0){return pt.merge(Pa.extractBBoxes(e,i))}static compareChildren(e,i){return Gk(e.zIndex,i.zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return of.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(!i.isFinite())return;let s=0;const n=4;for(const u of this.descendants())u instanceof Bn&&(s=Math.max(s,u.strokeWidth));const o=Math.max(1,s/2*n),{x:a,y:r}=Be.toCanvasPoint(this,0,0),l=Pk(e,a+i.x-o)-a,c=Pk(e,r+i.y-o)-r,h=Math.ceil(i.x+i.width-l+o),d=Math.ceil(i.y+i.height-c+o);return new pt(l,c,h,d)}prepareSharedCanvas(e,i,s){return Ru==null||Ru.pixelRatio!==s?Ru=new RS({width:e,height:i,pixelRatio:s}):Ru.resize(e,i,s),Ru}isDirty(e){const{width:i,height:s,devicePixelRatio:n}=e,{dirty:o,dirtyZIndex:a,layer:r}=this,l=r!=null&&(this._lastWidth!==i||this._lastHeight!==s),c=this._lastDevicePixelRatio!==n;if(this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,o||a||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:o,stats:a,devicePixelRatio:r}=e;let{image:l}=this;if(this.isDirty(e)){l?.bitmap.close(),l=void 0;const h=i?void 0:this.computeSafeClippingBBox(r),d=(u,...p)=>{const g=u.context;n.ctx=g,u.clear(),g.save(),g.setTransform(...p),g.globalAlpha=1,this.renderInContext(n),g.restore(),g.verifyDepthZero?.()};if(i)d(i,o.getTransform());else if(h){const{x:u,y:p,width:g,height:f}=h,x=this.prepareSharedCanvas(g,f,r);d(x,r,0,0,r,-u*r,-p*r),l={bitmap:x.transferToImageBitmap(),x:u,y:p,width:g,height:f}}else this.dirtyZIndex&&this.sortChildren(of.compareChildren);this.image=l,a&&a.layersRendered++}else this.skipRender(n),a&&a.layersSkipped++;const{globalAlpha:c}=o;if(o.globalAlpha=c*this.opacity,i)o.save(),o.resetTransform(),i.drawImage(o),o.restore();else if(l){const{bitmap:h,x:d,y:u,width:p,height:g}=l;o.drawImage(h,0,0,p*r,g*r,d,u,p,g)}o.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:o,height:a}=i;e.beginPath(),e.rect(s,n,o,a),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&this.sortChildren(of.compareChildren),i.save(),i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Be.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?Be.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}}};iv.className="Group",v([gt({convertor:t=>ft(0,t,1)})],iv.prototype,"opacity",2);var It=iv,M4=class extends tv(It){},D4=class extends zh(It){},Ns=class extends ec(It){},Pu=class extends zh(ec(It)){},Vk=class{constructor(){this.queue=[]}await(t=50){return new Promise(e=>{const i=()=>{clearTimeout(n),e(!0)},n=setTimeout(()=>{const o=this.queue.indexOf(i);o<0||(this.queue.splice(o,1),e(!1))},t);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(t=>t())}};function A4(){return new Promise(t=>{setTimeout(t,0)})}function jf(t,e){t&&(e=vf.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 jk(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 I4(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const e=Ea().createRange();e.setStart(t.lastChild,t.lastChild.textContent.length),e.setEnd(t.lastChild,t.lastChild.textContent.length);const i=re().getSelection();i?.removeAllRanges(),i?.addRange(e)}var T4=0;function k4(t){return`${t??"ag-charts-element"}-${T4++}`}function Wk(){const t=re("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function Wf(t){return`ag-charts-icon ag-charts-icon-${t}`}var sv="class-instance";function ea(t,e,i){if(wt(e)){if(!wt(t)||t.length!==e.length||e.some((s,n)=>ea(t[n],s,i)!=null))return e}else if(Xe(e)){if(!Xe(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const o of n)if(t[o]!==e[o])if(i?.has(o))s[o]=e[o];else if(typeof t[o]==typeof e[o]){const a=ea(t[o],e[o],i);a!==null&&(s[o]=a)}else s[o]=e[o];return Object.keys(s).length?s:null}else if(t!==e)return e;return null}function Hk(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function Se(t,e){return wt(t)?t.map(i=>Se(i,e)):Xe(t)?C4(t,e):t instanceof Map?new Map(Se(Array.from(t))):nv(t)}function C4(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]=nv(t[s]):i[s]=Se(t[s],e);return i}function nv(t){return wt(t)?t.slice(0):Xe(t)?{...t}:Yo(t)?new Date(t):eG(t)?new RegExp(t.source,t.flags):t}function _a(t,e,i,s,n,o){if(wt(t)){o=e(t,s,n,o);let a=0;for(const r of t)o=_a(r,e,i,s?.[a],n,o),a++}else if(Xe(t)){o=e(t,s,n,o);for(const a of Object.keys(t)){if(i?.has(a))continue;const r=t[a];o=_a(r,e,i,s?.[a],n,o)}}return o}function Bu(t,e,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(e==null)return t;if(Pn(t))return t.set(e);const a=t,r=ov(t);for(const l of Object.keys(e)){if(_S.has(l))continue;const c=`${n?n+".":""}${l}`;if(o.includes(c))continue;const h=e[l],d=`${s?s+".":""}${l}`,u=a.constructor,p=a[l];try{const g=ov(p),f=ov(h);if(r===sv&&!(l in t||l==="context")){if(h===void 0)continue;$.warn(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}if(g!=null&&f!=null&&f!==g&&(g!==sv||f!=="object")){$.warn(`unable to set [${d}] in ${u?.name} - can't apply type of [${f}], allowed types are: [${g}]`);continue}if(Pn(p))a[l].set(h);else if(f==="object"&&l!=="context"){if(p==null){$.warn(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}Bu(p,h,{...i,path:d,matcherPath:c})}else a[l]=h}catch(g){$.warn(`unable to set [${d}] in [${u?.name}]; nested error is: ${g.message}`)}}return t}function ov(t){return t==null?null:iG(t)||Yo(t)?"primitive":wt(t)?"array":Rt(t)?Xe(t)?"object":sv:Rr(t)?"function":"primitive"}function Hf(t,e,i,s){return rv(t,e,s??t,{matches:new Map},i)}var av=Symbol("operation-resolved-undefined");function rv(t,e,i,s,n,o=[],a={}){if(wt(t)){Uk(t,e,i,s,o,a);let r=0;for(const l of t)rv(l,e,i,s,n,[...o,`${r}`],a),r++}else if(Xe(t)){Uk(t,e,i,s,o,a);for(const r of Object.keys(t)){if(n?.has(r))continue;const l=t[r];rv(l,e,i,s,n,[...o,r],a)}}return a}function Uk(t,e,i,s,n,o){if(wt(t))for(let a=0;a<t.length;a++)t[a]=Yk(t[a],e,i,s,[...n,`${a}`],o),t[a]===av&&(t[a]=void 0);else{let a=!1;for(const r of Object.keys(t))t[r]=Yk(t[r],e,i,s,[...n,r],o),a||(a=go(r,Yf)),t[r]===av&&delete t[r];if(a&&Object.keys(t).length>1)for(const r of Object.keys(t))go(r,Yf)&&delete t[r]}}function Yk(t,e,i,s,n,o){const a=jr(t);if(!a)return t;o[n.join(".")]=t;const r=zu(a.operation,a.values,e,i,n,s);return r===void 0?av:r}function jr(t){if(!Xe(t))return;const[e]=Object.keys(t);if(go(e,Yf))return{operation:e,values:t[e]}}function zu(t,e,i,s,n,o){o.referencedParams??(o.referencedParams=new Set);const a=["$find","$map"];wt(e)&&!a.includes(t)&&(e=e.map(l=>{const c=jr(l);return c?zu(c.operation,c.values,i,s,n,o):l}));const r=Yf[t];return r(e,n,i,s,o)}function go(t,e){return Ti(t)&&(Rt(e)||wt(e))&&t in e}function Uf(t){return pe(t)&&t>=0&&t<=1}function Kk(t){return Rt(t)&&t.type=="gradient"}function L4(t){return t!==null&&Rt(t)&&t.type=="pattern"}function $k(t,e){const i=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],i.shift());let n=!1;for(const o of i){if(o==="..")s.pop(),n||s.pop();else if(o===".")s.pop();else if(o==="$index"){const a=t.findLast(r=>!isNaN(Number(r)));a!=null&&s.push(a)}else if(o==="$prevIndex"){const a=t.findLast(r=>!isNaN(Number(r)));a!=null&&s.push(`${Number(a)-1}`)}else o.length!==0&&s.push(o);n=o===".."}return s}var N4={$ref:Xk,$path:z4,$palette:B4},w4={$if:([t,e,i])=>t?e:i,$eq:([t,e])=>t===e,$not:([t])=>!t,$or:t=>wt(t)&&t.some(Boolean),$and:t=>wt(t)&&t.every(Boolean),$switch:()=>{},$isOperation:F4},O4={$isEven:_4,$mul:G4,$round:V4},E4={$map:j4,$find:W4,$merge:H4,$omit:U4,$value:Y4},R4={$rem:K4},P4={$mix:$4,$foregroundBackgroundMix:X4,$foregroundBackgroundAccentMix:Z4,$interpolate:Q4,$isGradient:([t])=>Kk(t),$isPattern:([t])=>L4(t)},Yf={...N4,...w4,...O4,...E4,...R4,...P4};function Xk(t,e,i,s,n){if(!go(t,i)){$.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting one of [${Object.keys(i).join(", ")}].`);return}const o=jr(i[t]);if(o?.operation!=="$ref")return i[t];if(n.referencedParams?.has(o.values)){$.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${e.join(".")}], circular reference detected with [${[...n.referencedParams].join(", ")}].`);return}return n.referencedParams?.add(o.values),Xk(o.values,e,i,s,n)}function B4(t,e,i,s){if(!Ti(t))return;const n=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(t)){const a=e.findLastIndex(d=>!isNaN(Number(d)));let r=Number(e[a]);if(isNaN(r))return;const l=e.slice(0,a),c=["map-shape-background","map-line-background"],h=wh(s,l).slice(0,r).filter(d=>c.includes(d.type)).length;switch(r-=h,t){case"fill":return Mu(n.fills,1,r)[0];case"fillFallback":return Mu(n.fillsFallback,1,r)[0];case"stroke":return Mu(n.strokes,1,r)[0];case"gradient":return Mu(n.sequentialColors,1,r)[0];case"range2":return Mu(n.fills,2,r)}return}return t==="gradients"?n.sequentialColors:wh(n,t)}function z4(t,e,i,s){let n=!1,o,a=!1,r=s;if(wt(t))n=!0,o=t[1],a=t.length===3,r=a?t[2]:r,t=t[0];else if(!Ti(t)){$.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a string.`);return}const l=$k(a?[]:e,t);let c=r;for(const h of l){if(!go(h,c)){if(n)return o;$.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)?Se(c):c}function F4(t,e,i,s){const n=Ti(t)?$k(e,t):e,o=n.length===0?s:wh(s,n);return jr(o)!=null}function _4([t],e){if(typeof t=="number")return t%2===0;$.warnOnce(`\`$isEven\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function G4([t,e],i){if(typeof t=="number"&&typeof e=="number")return t*e;$.warnOnce(`\`$mul\` json operation failed on [${String(t)}] and [${String(e)}] at [${i.join(".")}], expecting two numbers.`)}function V4([t],e){if(typeof t=="number")return Math.round(t);$.warnOnce(`\`$round\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function j4([t,e],i,s,n,o){const a=jr(e);if(a&&(e=zu(a.operation,a.values,s,n,i,o)),!wt(e))return[];const r=jr(t);return r?(o.matches.set(i.join("."),e),e.map(()=>({[r.operation]:r.values}))):[]}function W4([t,e],i,s,n,o){const a=jr(e);if(a&&(e=zu(a.operation,a.values,s,n,i,o)),!wt(e))return;const r=jr(t);return r?e.find(l=>zu(r.operation,r.values,s,l,[],o)):t?e[0]:void 0}function H4(t){if(wt(t)){for(const e of t)if(!Xe(e))return;return jt(...t)}}function U4([t,e]){if(!(!wt(t)||!Xe(e)))return zr(e,t)}function Y4(t,e,i,s,n){if(t!=="$1"&&t!=="$index")return t;const o=e.findLastIndex(l=>!isNaN(Number(l)));if(o===-1)return t;const a=Number(e[o]);if(t==="$index")return a;const r=e.slice(0,o).join(".");return n.matches.get(r)?.at(a)}function K4([t],e,i){const s="fontSize";if(go(s,i)&&typeof i[s]=="number"&&typeof t=="number")return Math.round(t*i[s]);$.warnOnce(`\`$rem\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function $4([t,e,i],s){const n=`\`$mix\` json operation failed on [${String(t)}, ${String(e)}, ${String(i)}] at [${s.join(".")}], expecting`,o=`${n} two colors and a number between 0 and 1.`;if(typeof e!="string"||!Uf(i)){$.warnOnce(o);return}if(typeof t=="string")try{return oe.mix(oe.fromString(t),oe.fromString(e),i).toString()}catch{$.warnOnce(o);return}if(!Kk(t)){$.warnOnce(o);return}let a=t.colorStops;try{a=a?.map(r=>{let l;return typeof r.color=="string"&&(l=oe.mix(oe.fromString(r.color),oe.fromString(e),i).toString()),{...r,color:l}})}catch{$.warnOnce(`${n} a gradient, a color and a number between 0 and 1.`);return}return{...t,colorStops:a}}function X4([t],e,i){const s="foregroundColor",n="backgroundColor";if(go(s,i)&&go(n,i)&&typeof i[s]=="string"&&typeof i[n]=="string"&&Uf(t))return oe.mix(oe.fromString(i[s]),oe.fromString(i[n]),t).toString();$.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(t)}}}] at [${e.join(".")}], expecting a number between 0 and 1.`)}function Z4([t,e],i,s){const n="foregroundColor",o="backgroundColor",a="accentColor";if(go(n,s)&&go(o,s)&&go(a,s)&&typeof s[n]=="string"&&typeof s[o]=="string"&&typeof s[a]=="string"&&Uf(t)&&Uf(e))return oe.mix(oe.mix(oe.fromString(s[n]),oe.fromString(s[o]),t),oe.fromString(s[a]),e).toString();$.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(t)}, ${String(e)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)}function Q4([t,e]){if(!(!wt(t)||!pe(e)))return oe.interpolate(t.map(i=>oe.fromString(i)),e).map(i=>i.toString())}var q4=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(i=>$.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){$.error("mutex callback error",i),e?.()}[t,e]=this.acquireQueue.shift()??[]}this.available=!0}},Zk=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))}},Wr=class extends kt{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}};v([A(ot)],Wr.prototype,"top",2),v([A(ot)],Wr.prototype,"right",2),v([A(ot)],Wr.prototype,"bottom",2),v([A(ot)],Wr.prototype,"left",2);function ue(t,e){const i=wt(t)?t:t.split(".");if(i.length===1){const[s]=i;return Ba((n,o,a)=>n[s]=a,n=>n[s],e)}return Ba((s,n,o)=>GS(s,i,o),s=>wh(s,i),e)}function J4(t){return Ba((e,i,s)=>e[t]=s)}function zi(t,e){return Ba((i,s,n)=>i[t][e??s]=n)}function Hs(t){const{newValue:e,oldValue:i,changeValue:s}=t;return Ba((n,o,a,r)=>(a!==r&&(r!==void 0&&i?.call(n,r),a!==void 0&&e?.call(n,a),s?.call(n,a,r)),a))}function Hr(t){return uk(t)}function tV(t){return Qk((e,i)=>re().requestAnimationFrame(e),t)}function eV(t){return Qk((e,i=0)=>{i===0?queueMicrotask(e):setTimeout(e,i)},t)}function Qk(t,e){let i=0,s=!1,n,o;const a=()=>s,r=()=>{s=!1,o?.(),o=void 0,n=void 0,i>0&&t(l)},l=()=>{const c=i;i=0,s=!0;const h=e({count:c});if(!h){r();return}h.then(r,r)};return{schedule(c){i===0&&!a()&&t(l,c),i++},async await(){if(a())for(n==null&&(n=new Promise(c=>{o=c}));a();)await n}}}function ic(t){return t==="true"}function iV(t){return Number(t)}function fo(t){return t}var sV={role:fo,"aria-checked":ic,"aria-controls":fo,"aria-describedby":fo,"aria-disabled":ic,"aria-expanded":ic,"aria-haspopup":ic,"aria-hidden":ic,"aria-label":fo,"aria-labelledby":fo,"aria-live":fo,"aria-orientation":fo,"aria-selected":ic,"data-preventdefault":ic,class:fo,id:fo,tabindex:iV,title:fo,placeholder:fo};function fe(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function sc(t,e){if(e!=null)for(const[i,s]of ke(e))i!=="class"&&fe(t,i,s)}function Kf(t,e,i){if(!(t instanceof HTMLElement))return;const s=t.getAttribute(e);return s===null?i:sV[e]?.(s)??void 0}function yo(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function nV(t,e){for(const[i,s]of ke(e))yo(t,i,s)}var lv=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function Fh(t,e,i){const{offsetX:s,offsetY:n,clientX:o,clientY:a}=e,{currentX:r,currentY:l}=Ga.calcCurrentXY(i,e);return{type:t,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:e}}function $f(t,e,i){return{type:t,sourceEvent:e}}var oV={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>Fh("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>Fh("click",t,e),dblclick:(t,e)=>Fh("dblclick",t,e),mouseenter:(t,e)=>Fh("mouseenter",t,e),mousemove:(t,e)=>Fh("mousemove",t,e),mouseleave:(t,e)=>Fh("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,o=t.deltaMode===0?.01:1,a=t.deltaX*o,r=t.deltaY*o;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:a,deltaY:r,sourceEvent:t}},touchstart:(t,e)=>$f("touchstart",t,e),touchmove:(t,e)=>$f("touchmove",t,e),touchend:(t,e)=>$f("touchend",t,e),touchcancel:(t,e)=>$f("touchcancel",t,e)},Ga=class{static alloc(t,e,i){return oV[t](e,i)}static isHTMLEvent(t){return lv.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},aV=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=o=>{const a=Ga.alloc(t,o,e.getElement());for(const r of this.widgetListeners?.[t]??[])r(a,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 ke(this.sourceListeners??{}))t.getElement().removeEventListener(e,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},rV=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.window=re(),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:o,mousemove:a,mouseup:r}=this;n.addEventListener("mousedown",o,{capture:!0}),n.addEventListener("mouseenter",o,{capture:!0}),n.addEventListener("mouseleave",o,{capture:!0}),n.addEventListener("mouseout",o,{capture:!0}),n.addEventListener("mouseover",o,{capture:!0}),n.addEventListener("mousemove",a,{capture:!0}),n.addEventListener("mouseup",r,{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 lV(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new rV(t,e,i,s)}var cV=500,hV=100;function dV(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}var cv=!1,uV=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:r,initialTouch:l}=this;if(!this.longTapInterrupted){r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),cv=!0;const c=g=>{g.preventDefault()},h=g=>{cv=!1,g.preventDefault(),r.removeEventListener("touchmove",c),r.removeEventListener("touchend",h),r.removeEventListener("touchcancel",h)};r.addEventListener("touchmove",c,{passive:!1}),r.addEventListener("touchend",h,{passive:!1}),r.addEventListener("touchcancel",h,{passive:!1});const{clientX:d,clientY:u}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:re(),clientX:d,clientY:u,pointerType:"touch"});r.dispatchEvent(p)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(r.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||dV(h,d)>hV,c.dragTouchEnabled&&d!=null&&l.globalTouchDragCallbacks?.touchmove(r,d))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,cV);const{touchmove:o,touchend:a}=this;n.addEventListener("touchmove",o,{passive:!1}),n.addEventListener("touchstart",a,{passive:!1}),n.addEventListener("touchend",a,{passive:!1}),n.addEventListener("touchcancel",a,{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 pV(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||cv))return new uV(t,e,i,s,n)}function hv(t,e,i,s){const{currentX:n,currentY:o}=Ga.calcCurrentXY(t.getElement(),s),a=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+a,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:o,originDeltaX:a,originDeltaY:r,sourceEvent:s}}function gV(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function dv(t,e,i,s,n){const{currentX:o,currentY:a}=Ga.calcCurrentXY(t.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:o,currentY:a,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var qk={},Jk=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};VS(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const o=hv(t,"drag-start",i,n);this.dispatch("drag-start",t,o)},mousemove:n=>{const o=hv(t,"drag-move",i,n);this.dispatch("drag-move",t,o)},mouseup:n=>{const o=hv(t,"drag-end",i,n);this.dispatch("drag-end",t,o),this.endDrag(t,o)}};this.mouseDragger=lV(qk,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),o=n.getBoundingClientRect();vf.containsPoint(o,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,...gV(t,i)};VS(["pageX","pageY"],s,i);const n={touchmove:(r,l)=>{const c=dv(t,"drag-move",s,r,l);this.dispatch("drag-move",t,c)},touchend:(r,l)=>{const c=dv(t,"drag-end",s,r,l);this.dispatch("drag-end",t,c)}},o=t.getElement();this.touchDragger=pV(qk,this,n,i,o);const a=dv(t,"drag-start",s,e,i);this.dispatch("drag-start",t,a)}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)}},fV=class{constructor(t){this.elem=t}setBounds(t){jf(this.elemContainer??this.elem,t)}getBounds(){return jk(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();jf(e,i),nV(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},ia=class extends fV{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){yo(this.elem,"display",t?"none":void 0)}isHidden(){return re()?.getComputedStyle?.(this.elem).display==="none"}setCursor(t){yo(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){fe(this.elem,"aria-describedby",t)}setAriaHidden(t){fe(this.elem,"aria-hidden",t)}setAriaLabel(t){fe(this.elem,"aria-label",t)}setInnerHTML(t){this.elem.innerHTML=t}isDisabled(){return Kf(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){fe(this.elem,"data-preventdefault",t)}setTabIndex(t){fe(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 Ga.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new aV),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new Jk(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){Ga.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Jk(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,...Ga.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=s=>{s.persisted||e()};return re().addEventListener("pagehide",i),()=>re().removeEventListener("pagehide",i)}};function yV(t=0,e=0){return new OffscreenCanvas(t,e).getContext("2d")}var uv=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()}},Va=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:De.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=yV();s.font=t,s.textAlign=e.textAlign??"start",s.textBaseline=e.textBaseline??"alphabetic";const n=new tC(s,e);return this.instanceMap.set(i,n),n}};Va.instanceMap=new uv(10);var tC=class{constructor(t,e){this.ctx=t,this.measureMap=new uv(100),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline),t.font=typeof e.font=="string"?e.font:De.toFontString(e.font),this.textMeasurer=new pv(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)}},De=class{static toFontString({fontSize:t=10,fontStyle:e,fontWeight:i,fontFamily:s,lineHeight:n}){let o="";return e&&(o+=`${e} `),i&&(o+=`${i} `),o+=`${t}px`,n&&(o+=`/${n}px`),o+=` ${s}`,o.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}}};De.EllipsisChar="\u2026",De.defaultLineHeight=1.15,De.lineSplitter=/\r?\n/g;var pv=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,o=0;const a=De.getVerticalModifier(this.textBaseline),r=[];let l=0;const c=t.length;for(const h of t){const d=this.measureTextFn(h);d.fontBoundingBoxAscent??(d.fontBoundingBoxAscent=d.emHeightAscent),d.fontBoundingBoxDescent??(d.fontBoundingBoxDescent=d.emHeightDescent),e<d.width&&(e=d.width),n<d.actualBoundingBoxLeft&&(n=d.actualBoundingBoxLeft),l===0?(i+=d.actualBoundingBoxAscent,s+=d.actualBoundingBoxAscent):o+=d.fontBoundingBoxAscent,l===c-1?i+=d.actualBoundingBoxDescent:o+=d.fontBoundingBoxDescent,r.push({text:h,width:d.width,height:d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,lineHeight:d.fontBoundingBoxAscent+d.fontBoundingBoxDescent,offsetTop:d.actualBoundingBoxAscent,offsetLeft:d.actualBoundingBoxLeft}),l++}return i+=o,s+=o*a,{width:e,height:i,offsetTop:s,offsetLeft:n,lineMetrics:r}}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(De.lineSplitter):t;return this.getMultilineMetrics(e)}charWidth(t){const{width:e}=this.measureTextFn(t);return this.charMap.set(t,e),e}},dn=class MS extends Bn{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=MS.defaultStyles.textAlign,this.textBaseline=MS.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(`
`).map(e=>e.trim())??[]}static computeBBox(e,i,s,n){const{offsetTop:o,offsetLeft:a,width:r,height:l}=Va.measureLines(e,n);return new pt(i-a,s-o,r,l)}computeBBox(){const{x:e,y:i,lines:s,textBaseline:n,textAlign:o}=this;return MS.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:o})}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:o,strokeWidth:a}=this,{pixelRatio:r}=this.layerManager.canvas;if(!n&&!(o!=null&&a>0))return super.render(e);const l=De.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*r,i.shadowOffsetY=c.yOffset*r,i.shadowBlur=c.blur*r),this.renderLines((h,d,u)=>i.fillText(h,d,u))}if(o&&a){this.applyStroke(i),i.lineWidth=a,i.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:c,lineDashOffset:h,lineCap:d,lineJoin:u}=this;c&&i.setLineDash(c),h&&(i.lineDashOffset=h),d&&(i.lineCap=d),u&&(i.lineJoin=u),this.renderLines((p,g,f)=>i.strokeText(p,g,f))}super.render(e)}renderLines(e){const{lines:i,x:s,y:n}=this,o=this.lineHeight??De.getLineHeight(this.fontSize);let a=(o-o*i.length)*De.getVerticalModifier(this.textBaseline);for(const r of i)e(r,s,n+a),a+=o}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=Bi("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]}}};dn.className="Text",dn.defaultStyles={...Bn.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},v([gt()],dn.prototype,"x",2),v([gt()],dn.prototype,"y",2),v([gt({changeCb:t=>t.onTextChange()})],dn.prototype,"text",2),v([gt()],dn.prototype,"fontStyle",2),v([gt()],dn.prototype,"fontWeight",2),v([gt()],dn.prototype,"fontSize",2),v([gt()],dn.prototype,"fontFamily",2),v([gt()],dn.prototype,"textAlign",2),v([gt()],dn.prototype,"textBaseline",2),v([gt()],dn.prototype,"lineHeight",2);var Li=dn,eC=class extends zh(Li){},_h=class extends zh(ec(Li)){},gv=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(De.EllipsisChar))?[]:i}static appendEllipsis(t){return t.replace(/[.,]{1,5}$/,"")+De.EllipsisChar}static truncateLine(t,e,i,s){const n=e.textWidth(De.EllipsisChar);let o=0,a=0;for(;a<t.length;a++){const r=e.textWidth(t.charAt(a));if(o+r>i)break;o+=r}if(t.length===a&&(!s||o+n<=i))return s?t+De.EllipsisChar:t;for(t=t.slice(0,a).trimEnd();t.length&&e.textWidth(t)+n>i;)t=t.slice(0,-1).trimEnd();return t+De.EllipsisChar}static textWrap(t,e){const i=t.split(De.lineSplitter),s=Va.getMeasurer(e);if(e.textWrap==="never")return i.map(r=>this.truncateLine(r.trimEnd(),s,e.maxWidth));const n=[],o=e.textWrap==="hyphenate",a=e.textWrap==null||e.textWrap==="on-space";for(const r of i){let l=r.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,d=0;for(;c<l.length;){const u=l.charAt(c);if(h+=s.textWidth(u),u===" "&&(d=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(d){const x=this.getWordAt(l,d+1),m=s.textWidth(x);if(m<=e.maxWidth){n.push(l.slice(0,d).trimEnd()),l=l.slice(d).trimStart(),c=0,h=0,d=0;continue}else a&&m>e.maxWidth&&n.push(l.slice(0,d).trimEnd(),this.truncateLine(l.slice(d).trimStart(),s,e.maxWidth,!0))}else a&&n.push(this.truncateLine(l,s,e.maxWidth,!0));if(a){l="";break}const g=o?"-":"";let f=l.slice(0,c).trim();for(;f.length&&s.textWidth(f+g)>e.maxWidth;)f=f.slice(0,-1).trimEnd();if(n.push(f+g),!f.length){l="";break}l=l.slice(f.length).trimStart(),c=-1,h=0,d=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 o=0,a=0;o<n.length;o++){const{lineHeight:r}=n[o];if(a+=r,a>i.maxHeight){if(i.overflow==="hide")return[];const l=t.slice(0,o||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],o=t[s-2];if(o.length<n.length)return;const a=o.lastIndexOf(" ");if(a===-1||a===o.indexOf(" ")||n.includes(" "))return;const r=o.slice(a+1);e.textWidth(n+r)<=i.maxWidth&&(t[s-2]=o.slice(0,a),t[s-1]=r+" "+n)}},Ae=class extends kt{constructor(){super(...arguments),this.id=hn(this),this.node=new eC({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,o=Math.min(this.maxWidth??1/0,t)-s*2,a=this.maxHeight??e-s*2;if(!isFinite(o)&&!isFinite(a)){this.node.text=i;return}const r=gv.wrapText(i??"",{maxWidth:o,maxHeight:a,font:this,textWrap:n});this.node.text=r,this.truncated=r.includes(De.EllipsisChar)}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(this.enabled&&this.text){const s=Be.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",o=>this.handleMouseMove(t,o)),this.proxyText.addListener("mouseleave",o=>this.handleMouseLeave(t,o))}}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}=Be.toCanvas(this.node),n=e.sourceEvent.offsetX+i,o=e.sourceEvent.offsetY+s;t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:o,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};Ae.SMALL_PADDING=10,v([A(xt),zi("node","visible")],Ae.prototype,"enabled",2),v([A(et,{optional:!0}),zi("node")],Ae.prototype,"text",2),v([A(Tk,{optional:!0}),zi("node")],Ae.prototype,"textAlign",2),v([A(za,{optional:!0}),zi("node")],Ae.prototype,"fontStyle",2),v([A(Fa,{optional:!0}),zi("node")],Ae.prototype,"fontWeight",2),v([A(ot),zi("node")],Ae.prototype,"fontSize",2),v([A(et),zi("node")],Ae.prototype,"fontFamily",2),v([A(zt,{optional:!0}),zi("node","fill")],Ae.prototype,"color",2),v([A(ot,{optional:!0})],Ae.prototype,"spacing",2),v([A(ot,{optional:!0})],Ae.prototype,"maxWidth",2),v([A(ot,{optional:!0})],Ae.prototype,"maxHeight",2),v([A(Bf)],Ae.prototype,"wrapping",2),v([A(ot)],Ae.prototype,"padding",2),v([A(et)],Ae.prototype,"layoutStyle",2);var fv=(t=>(t.X="x",t.Y="y",t))(fv||{}),yv=(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))(yv||{}),iC=class{constructor(){this.events=new IS,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 mV(t,e);for(const s of Object.values(yv))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})}},mV=class{constructor(t,e){this.width=t,this.height=e,this.layoutBox=new pt(0,0,t,e)}},Xf=class{constructor(){this.title=new Ae,this.subtitle=new Ae,this.footnote=new Ae}positionCaptions(t){const{title:e,subtitle:i,footnote:s}=this,n=t.layoutBox.height/10;if(e.enabled){const{spacing:o}=e;this.positionCaption("top",e,t.layoutBox,n),this.shrinkLayoutByCaption("top",e,t.layoutBox,o)}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 o of[e,i,s])if(o.layoutStyle==="overlay"){if(o.textAlign==="left")o.node.x=n.x+o.padding;else if(o.textAlign==="right"){const a=o.node.getBBox();o.node.x=n.x+n.width-a.width-o.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(De.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)}}};v([A(at)],Xf.prototype,"title",2),v([A(at)],Xf.prototype,"subtitle",2),v([A(at)],Xf.prototype,"footnote",2);var xV=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],bV=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||xV.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>$.error("error restoring state",n))}},sC=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)}},nc="11.2.3",nC=Symbol("previous-memento-not-found"),SV=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=qt.create(!0,"history"),this.destroyFns=new sC,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===nC)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):nC}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(nc,nc,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},oC=class wT{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"){$.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`);return}if(e==null){$.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in e)||typeof e.version!="string"){$.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]),o=[];if(!s.guardMemento(n,o)){const a=o.length>0?`

${o.join(`

`)}

`:"";$.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${a}`,n);return}s.restoreMemento(this.version,e.version,n)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,wT.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),wT.decodeTypes)}catch(s){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(e,i){return Yo(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return Rt(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}},vV=class{constructor(){this.caretaker=new oC(nc),this.state=new Map}setState(t,e){Qo(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)}},MV=`.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}
`,ja=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){$.errorOnce(String(s))}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},Ur=class{constructor(){this.listeners=new ja,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}},DV=class DS{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;fe(this.topTabGuard,"tabindex",i),fe(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=re();return Array.from(e.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const o=s.getComputedStyle(n);return o.display!=="none"&&o.visibility!=="none"}return!1})}findEnterTarget(e){const i=DS.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=DS.queryFocusable(Ea(),"[tabindex]").filter(o=>o.tabIndex>0).sort((o,a)=>o.tabIndex-a.tabIndex),{before:s,after:n}=DS.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,o,a;for(;s<=n;){const r=Math.floor((s+n)/2),l=e[r].tabIndex;if(l===i){o=e[r-1]||void 0,a=e[r+1]||void 0;break}else l<i?(o=e[r],s=r+1):(a=e[r],n=r-1)}return{before:o,after:a}}};function mo(t,e,i,s,n){e.addEventListener(i,s);const o=()=>e.removeEventListener(i,s,n);return t.push(o),o}function aC(t,e,i){mo(t,e,"keydown",s=>{s.key==="Escape"&&i(s)})}function AV(t,e,i){const s=mo(t,window,"mousedown",n=>{[0,2].includes(n.button)&&!rC(e,n)&&(i(),s())});return s}function IV(t,e,i){const s=mo(t,window,"touchstart",n=>{Array.from(n.targetTouches).some(a=>!rC(e,a))&&(i(),s())});return s}function rC(t,e){if(e.target instanceof Element){const{x:i,y:s,width:n,height:o}=t.getBoundingClientRect(),{clientX:a,clientY:r}=e;return a>=i&&r>=s&&a<=i+n&&r<=s+o}return!1}function Zf(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function mv(t,e,...i){return Zf(t)&&(t.key===e||i.some(s=>t.key===s))}function lC(t,e,i,s){i&&mo(t,e,"keydown",n=>{mv(n,s)&&i.focus()})}function TV(t,e,i,s,n,o){lC(t,e,n,o),lC(t,e,i,s),mo(t,e,"keydown",a=>{mv(a,s,o)&&a.preventDefault()})}var Gh={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function cC(t){const{orientation:e,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:o,onBlur:a}=t,{nextKey:r,prevKey:l}=Gh[e],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[h,d]=s?[i.length,i.length]:[0,1/0],u=[];for(let p=0;p<i.length;p++){const g=i[(h+p-1)%d],f=i[p],x=i[(h+p+1)%d];mo(u,f,"focus",c),o&&mo(u,f,"focus",o),a&&mo(u,f,"blur",a),n&&aC(u,f,n),TV(u,f,x,r,g,l),f.tabIndex=p===0?0:-1}return u}var kV=class{constructor(t,e,i){this.lastFocus=e,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(AV(this.destroyFns,t,()=>this.close(!0))),this.destroyFns.push(IV(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,fe(this.lastFocus,"aria-expanded",!1),t||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function hC(t){const{sourceEvent:e,orientation:i,menu:s,buttons:n,closeCallback:o,overrideFocusVisible:a,autoCloseOnBlur:r=!1}=t,{nextKey:l,prevKey:c}=Gh[i],h=bv(e);fe(h,"aria-expanded",!0);const d=new kV(s,h,o),u=()=>d.close(),{destroyFns:p}=d;if(s.role="menu",s.ariaOrientation=i,p.push(...cC({orientation:i,buttons:n,onEscape:u,wrapAround:!0})),s.tabIndex=-1,aC(p,s,u),mo(p,s,"keydown",g=>{g.target===s&&(g.key===l||g.key===c)&&(g.preventDefault(),n[0]?.focus())}),r){const g=f=>{!n.includes(f.relatedTarget)&&u()};for(const f of n)mo(p,f,"blur",g)}return n[0]?.focus({preventScroll:!0}),a!==void 0&&(n.forEach(f=>f.setAttribute("data-focus-visible-override",a.toString())),mo(p,s,"keydown",()=>{n.forEach(f=>f.setAttribute("data-focus-visible-override","true"))},{once:!0})),d}function CV(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function xv(t){return"button"in t?t.button===0:Zf(t)&&(t.code==="Space"||t.key==="Enter")}function bv(t){if(t?.target instanceof HTMLElement&&"tabindex"in t.target.attributes)return t.target}function dC(t){const e=i=>{if(i.defaultPrevented)return;Kf(i.target,"data-preventdefault",!0)&&mv(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}var LV=class{constructor(t){this.callback=t,this.devicePixelRatio=re("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=re("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=re("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},uC=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 o=this.elements.get(i);this.checkSize(o,i,s,n)}}));let t;this.pixelRatioObserver=new LV(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=Ea("readyState")==="complete",this.documentReady?this.observeWindow():re()?.addEventListener("load",this.onLoad)}destroy(){re()?.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)}},Vh=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}},NV='<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>',wV=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],pC={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},OV=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 EV(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 gC={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return gC}};function fC(t,e){const i=Mt("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var Sv=class Th extends Ur{constructor(e,i,s="normal"){super(),this.styleContainer=i,this.mode=s,this.anchorName=`--${hn(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 uC,this.cursorState=new Vh("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=EV(this.element,o=>{o===0&&!n&&this.listeners.dispatch("hidden",{type:"hidden"}),n=o===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",MV),this.setContainer(e),this.destroyFns.push(dC(this.element)),this.mode==="normal"){const o=this.rootElements["canvas-center"].element;if(o==null)throw new Error("Error initializing tab guards");const a=fC(o,"beforebegin"),r=fC(o,"afterend");this.tabGuards=new DV(o,a,r)}}initDOM(){if(this.mode==="normal"){const s=Mt("div");return s.innerHTML=NV,s.firstChild}const e=Mt("div");e.role="presentation",e.classList.add("ag-charts-canvas-container","ag-charts-canvas","ag-charts-tooltip-container");const i=Mt("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){return wV.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=Mt("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||(Th.batchedUpdateContainer.length===0&&re().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Th.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of Th.batchedUpdateContainer)e.destroyed||e.updateContainer();Th.batchedUpdateContainer.splice(0)}setSizeOptions(e=300,i=300,s,n){const{style:o}=this.element;o.width=`${s??e}px`,o.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,o]of ke(e)){let a=`${o}`;s.includes(n)&&(a=`${o}px`),this.element.style.setProperty(`--ag-charts-${i[n]}`,a)}}updateCanvasLabel(e){fe(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=re(),i=new pt(0,0,e.innerWidth,e.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??gC}getRawOverlayClientRect(){let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let o;if(i!=null&&e===i)o=!0;else{const r=e.computedStyleMap?.()?.get("overflow-y")?.toString();o=r==="auto"||r==="scroll"}if(o)return pt.fromDOMRect(e.getBoundingClientRect());e=e.parentElement}if(this.documentRoot!=null)return pt.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=re();return new pt(0,0,s,n)}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??Ea("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(pt.fromDOMRect(n.getBoundingClientRect()));return pt.merge(s)}isManagedChildDOMElement(e,i,s){const{children:n}=this.rootElements[i],o=n?.get(s);return o!=null&&e.contains(o)}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=r=>r.getAttribute(s)===e,o=r=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of r.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=Mt("style");return h==null?r.prepend(d):r.insertBefore(d,h.nextSibling),d};let a;this.styleContainer?a=o(this.styleContainer):this.initiallyConnected===!1?a=this.addChild("styles",e):this.documentRoot==null&&!Th.headStyles.has(e)?(a=o(Ea("head")),Th.headStyles.add(e)):this.documentRoot!=null&&(a=this.addChild("styles",e)),!(a==null||n(a))&&(a.setAttribute(s,e),a.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:o,children:a,listeners:r}=this.rootElements[e];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(i))return a.get(i);const{childElementType:l="div"}=OV.get(e)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??Mt(l);for(const[h,d,u]of r)c.addEventListener(h,d,u);if(a.set(i,c),n){const h=o.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else o?.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(pC.safeHorizontal,s>=(i?.width??1/0)),e.classList.toggle(pC.safeVertical,n>=(i?.height??1/0))}};Sv.batchedUpdateContainer=[],Sv.headStyles=new Set;var yC=Sv,RV=class extends ia{constructor(){super(Mt("div")),this.textElement=Bi("text"),this.textElement.role="presentation",this.svgElement=Bi("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(){}},Fu=class extends ia{constructor(){super(Mt("button")),this.setEnabled(!0)}destructor(){}setEnabled(t){fe(this.elem,"aria-disabled",!t),yo(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)})}},PV=class extends ia{constructor(){super(Mt("div")),fe(this.elem,"role","group")}destructor(){}},mC=class extends ia{constructor(t,e){super(Mt("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,[o,a]=n==="both"?[Gh.horizontal,Gh.vertical]:[Gh[n],void 0];let r=-1;if(Zf(i.sourceEvent)){const l=i.sourceEvent.key;l===o.nextKey||l===a?.nextKey?r=s.index+1:(l===o.prevKey||l===a?.prevKey)&&(r=s.index-1)}this.children[r]?.focus()},this.orientation=t,fe(this.elem,"role",e)}get orientation(){return Kf(this.elem,"aria-orientation")??"both"}set orientation(t){fe(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 o=i[n];o.index===e&&(this.focusedChildIndex=n),o.index=n}if(s){const n=i[e]??i[e-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},BV=class extends mC{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(t=>t.getElement().parentElement.remove())}addChildToDOM(t,e){const i=Mt("div");fe(i,"role","listitem"),yo(i,"position","absolute"),ia.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)}},jh=class extends ia{constructor(t){super(t)}destructor(){}},zV=new Intl.NumberFormat("en-US",{style:"percent"});function Wa(t,e=2){return typeof t=="number"?SC(t,e):typeof t=="string"?t:String(t??"")}function xC(t){return zV.format(t)}var bC=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function SC(t,e){let i=bC.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),bC.set(e,i)),i.format(t)}var vv=class af extends ia{constructor(){super(Mt("input")),this._step=af.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 Kf(this.elem,"aria-orientation")??"both"}set orientation(e){fe(this.elem,"aria-orientation",e!=="both"?e:void 0),af.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=ft(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:o=xC(n/s)}=i??{},a=this.getElement();a.value=`${n}`,a.ariaValueText=o}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",af.onKeyDown):e.addListener("keydown",af.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()}};vv.STEP_ONE={attributeValue:"1",divider:1},vv.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Mv=vv,FV=class extends Fu{constructor(){super(),fe(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){fe(this.elem,"aria-checked",t)}},Qf=class extends mC{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function Wh(t,e){return e.params?.type===t}function _V(t){if(t==="button")return new Fu;if(t==="slider")return new Mv;if(t==="toolbar")return new Qf;if(t==="group")return new PV;if(t==="list")return new BV;if(t==="region")return new jh(Mt("div"));if(t==="text")return new RV;if(t==="listswitch")return new FV;throw Error("AG Charts - error allocating meta")}function vC(t){const e={params:t,result:void 0};return e.result=_V(e.params.type),e}var MC=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=vC(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),Wh("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=vC(t);if(Wh("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:o}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(o.id,o.params)})}this.setParent(e.params,e.result)}if(Wh("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(Wh("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(Wh("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(Wh("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 fe(i,"id",t.id),yo(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)}}},DC={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]"},GV=/\$\{(\w+)}(?:\[(\w+)])?/gi,Dv={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"})},VV=({defaultValue:t,variables:e})=>t?.replaceAll(GV,(i,s,n)=>{const o=e[s],a=n!=null?Dv[n]:null;return n!=null&&a==null&&$.warnOnce(`Format style [${n}] is not supported`),a!=null?a.format(o):typeof o=="number"?Dv.number.format(o):o instanceof Date?Dv.datetime.format(o):String(o)}),jV=class extends ja{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=DC,getLocaleText:s}=this,n=i[t];return s?.({key:t,defaultValue:n,variables:e})??VV({key:t,defaultValue:n,variables:e})??t}},Av=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??re("devicePixelRatio")??1,this.element=s??Mt("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),ck(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(){lk(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")}};v([Hr(t=>t.onEnabledChange())],Av.prototype,"enabled",2);var WV=class{constructor(t){this.canvas=t,this.debug=qt.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,o=new RS({width:e,height:i,pixelRatio:s});return this.layersMap.set(o,{id:this.nextLayerId++,name:n,canvas:o}),this.debug("Scene.addLayer() - layers",this.layersMap),o}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()}};function HV(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 UV(){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(HV(n));return`Heap ${s.join(" / ")}`}function AC(t,e,i,s,n={},o=pt.zero){if(!qt.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:r=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:d=0}=s??{},u=performance.now(),{start:p,...g}=e,f=Object.entries(g).map(([N,O])=>TC(N,O)).filter(N=>N!=null).join(" + "),x=Object.entries(n).map(([N,O])=>`${N}: ${JSON.stringify(O)}`).join(" ; "),m=qt.check("scene:stats:verbose"),b=UV(),S=[`${TC("\u23F1\uFE0F",p,u)} (${f})`,`${x}`,`Layers: ${m?Iv(a,r):t.size}`,m?`Nodes: ${Iv(l,c)}`:null,m?`Ops: ${Iv(h,d)}`:null,m&&b?b:null].filter(Ti),M=new pv(N=>i.measureText(N)),D=new Map(S.map(N=>[N,M.measureLines(N)])),C=Math.max(...Array.from(D.values(),N=>N.width)),k=QV(D.values(),N=>N.height),I=2+o.x;i.save(),i.fillStyle="white",i.fillRect(I,0,C,k),i.fillStyle="black";let L=0;for(const[N,O]of D.entries())L+=O.height,i.fillText(N,I,L);i.restore()}function YV(t){const e=xf(re("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);t.debugNodeSearch=i}function KV(t,e){t.save();for(const[i,s]of Object.entries(e)){const n=Be.toCanvas(s);if(!n){$.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 $V=new Set,XV=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function ZV(t){const{...e}=t;for(const i of Object.keys(e))XV.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&($V.add(i),delete e[i]);return e}function qf(t,e){if(!qt.check(!0,"scene"))return{};let i=0;return{node:e==="json"?ZV(t):t,name:t.name??t.id,dirty:t.dirty,...Array.from(t.children(),s=>qf(s,e)).reduce((s,n)=>{let{name:o}=n;const{node:{visible:a,opacity:r,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:g}=n;(!a||r<=0)&&(o=`(${o})`),It.is(g)&&g.renderToOffscreenCanvas&&(o=`*${o}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,x=[`${(i++).toString().padStart(3,"0")}|`,`${o??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(S=>!!S).join(" ");let m=x,b=1;for(;s[m]!=null&&b<100;)m=`${x} (${b++})`;return s[m]=n,s},{})}}function IC(t){if(!t.dirty)return{dirtyTree:{},paths:[]};const e=Array.from(t.children(),n=>IC(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,o)=>(n[o.name??"<unknown>"]=o,n),{})},paths:s}}function Iv(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function TC(t,e,i){const s=i!=null?i-e:e;return`${t}: ${Math.round(s*100)/100}ms`}function QV(t,e){let i=0;for(const s of t)i+=e(s);return i}var Jf=class{constructor(t){this.debug=qt.create(!0,"scene"),this.id=hn(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.updateDebugFlags(),this.canvas=new Av(t),this.layersManager=new WV(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(){qt.inDevelopmentMode(()=>Pa._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){J_(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:o}={},root:a,pendingSize:r,width:l,height:c,pixelRatio:h}=this;if(!o)return;const d=performance.now();let u=!1;if(r&&(u=!0,this.layersManager.resize(...r),this.pendingSize=null),a&&!a.visible){this.isDirty=!1;return}if(a?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:qf(a,"console")}),AC(this.layersManager,e,o,void 0,i,s);return}const p={ctx:o,width:l,height:c,devicePixelRatio:h,debugNodes:{}};qt.check("scene:stats:verbose")&&(p.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),YV(p);let g=!1;if((a?.dirty!==!1||u)&&(g=!0,n.clear()),a&&qt.check("scene:dirtyTree")){const{dirtyTree:f,paths:x}=IC(a);qt.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:f,paths:x})}if(a&&g){if(a.visible&&a.preRender(p),this.debug.check()){const f=qf(a,"console");this.debug("Scene.render() - before",{canvasCleared:g,tree:f})}a.visible&&(o.save(),a.render(p),o.restore())}e["\u270D\uFE0F"]=performance.now()-d,o.verifyDepthZero?.(),this.isDirty=!1,AC(this.layersManager,e,o,p.stats,i,s),KV(o,p.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:qf(a,"console"),canvasCleared:g})}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return Pa.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})}};Jf.className="Scene";function qV(t,e){return"context"in t}function Tv(t,e,i){return qV(t,i)&&i[0]!=null&&typeof i[0]=="object"&&(i[0].context=t.context),e(...i)}var JV=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 o=Tv(t,e,i);return s&&n!=null&&s.set(n,o),o}catch(o){$.warnOnce("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}},tj=class extends Ur{constructor(t,e){super(),this.annotationRoot=t,this.fireChartEvent=e,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||wt(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return jt(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:Se([...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}},kC=(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))(kC||{}),ej=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)}},ty=class extends ja{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=qt.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 ZT(e=>this.fetch(e).catch(i=>$.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return ZT((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(o){this.debug(`DataService - request failed | ${i}`),$.errorOnce(`DataService - request failed | [${o}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(o=>o===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")}};v([Hs({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],ty.prototype,"dispatchThrottle",2),v([Hs({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],ty.prototype,"requestThrottle",2);function ij(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function CC(t,e){if(typeof t=="string")try{t=oe.fromString(t)}catch{t=oe.fromArray([0,0,0])}if(typeof e=="string")try{e=oe.fromString(e)}catch{e=oe.fromArray([0,0,0])}return i=>oe.mix(t,e,i).toRgbaString()}var kv={};ho(kv,{easeIn:()=>sj,easeInOut:()=>nj,easeInOutQuad:()=>rj,easeInQuad:()=>oj,easeOut:()=>_u,easeOutQuad:()=>aj,inverseEaseOut:()=>NC,linear:()=>LC});var LC=t=>t,sj=t=>1-Math.cos(t*Math.PI/2),_u=t=>Math.sin(t*Math.PI/2),nj=t=>-(Math.cos(t*Math.PI)-1)/2,oj=t=>t*t,aj=t=>1-(1-t)**2,rj=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,NC=t=>2*Math.asin(t)/Math.PI,ey=.2,Hh=["initial","remove","update","add","trailing","end","none"],Gu={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:ey,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+ey,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},wC=(t=>(t.Loop="loop",t.Reverse="reverse",t))(wC||{});function lj(t){return t.every(e=>e instanceof Pa)}function iy(t){return lj(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function Cv(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>Cv(i,e[s])):Df(t)&&Df(e)?t.equals(e):Xe(t)&&Xe(e)?FS(t,e,Cv):!1}var OC=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??LC,this.phase=t.phase;const e=t.duration??Gu[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 Cv(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(ft(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||Df(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[o,a]of i)n[o]=a(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(Df(t))return i=>t[Mf](e,i);try{switch(typeof t){case"number":return ij(t,e);case"string":return CC(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},EC=class{constructor(t){this.maxAnimationTime=t,this.debug=qt.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Hh.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(Hh[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(Hh.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=Hh[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Gu[c]}};let{phase:s,phaseControllers:n,phaseMeta:o}=i();const a=()=>Hh[this.currentPhase]==null,r=()=>{for({phase:s,phaseControllers:n,phaseMeta:o}=i();!a()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:o}=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=o.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():e=Math.min(u.update(c),e),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(e>0&&!a());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&&Gu[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){$.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()}},RC=(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))(RC||{}),PC=class{constructor(){this.stateQueue=34}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}};function BC(t){return t==null?!0:!isNaN(t)&&t>=0&&t<=2}var zC=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new EC(this.defaultDuration*1.5),this.debug=qt.create(!0,"animation"),this.events=new IS,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(r){this.failsafeOnError(r);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:o}=t;if(!BC(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!BC(o))throw new Error(`Animation duration of ${o} is unsupported (${i})`);const a=new OC({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(a,this.defaultDuration))return this.batch.addAnimation(a),a}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=re().requestAnimationFrame(e=>{t(e).catch(i=>$.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(o){this.failsafeOnError(o)}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){$.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 EC(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()}},FC=class extends Ur{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 o={type:"legend-item-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",o)}legendItemDoubleClick(t,e,i,s,n,o){const a={type:"legend-item-double-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:o,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",a)}},_C=class{constructor(){this.defaultActions=[],this.disabledActions=new Set,this.hiddenActions=new Set,this.listeners=new ja}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 o=s?.x??e.canvasX,a=s?.y??e.canvasY,r={type:t,x:o,y:a,context:i,sourceEvent:n};this.listeners.dispatch("",r)}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)}},GC=class extends Ur{constructor(){super(...arguments),this.highlightStates=new Vh}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}};function VC(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 o=s.valueOf(),a=n.valueOf();return o>a&&([o,a]=[a,o]),[i===o,i===a]}function Yr(t,e,i,s,n){const{xValue:o,yValue:a}=t,[r,l]=VC(a,n),[c,h]=VC(o,s);return{xKey:e,yKey:i,xValue:o,yValue:a,first:c,last:h,min:r,max:l}}function jC(t,[e,i],s){const n=$T(0,t-1,a=>{const r=s(a)?.[1]??NaN;return!Number.isFinite(r)||r>e})??0;let o=KT(0,t-1,a=>{const r=s(a)?.[0]??NaN;return!Number.isFinite(r)||r<i})??t-1;return o=Math.min(o+1,t),[n,o]}function Lv(t,e,i){if(i){const{x:n,y:o,width:a,height:r}=i;return{canvasX:n+a/2,canvasY:o+r/2}}const s=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(s){const{x:n,y:o}=Be.toCanvasPoint(t.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(o)}}}function WC(t,e,i,s,n){let o=-1,a=0,r=0,l=!1;for(;a<s&&o<=e-t;){o+=1;const c=i+r;if(l||(r*=-1),r>=0&&(r+=1),l&&r<0&&(r-=1),c<t||c>e){l=!0;continue}n(c)&&(a+=1)}return a}var sy=class{constructor(t,e,i){this.domManager=e,this.tooltip=i,this.stateTracker=new Vh,this.suppressState=new Vh(!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:o}=t,a=e.properties.tooltip,{placement:r,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:d,yOffset:u}=a.position,p=Lv(e,i,s);return{canvasX:n,canvasY:o,nodeCanvasX:p?.canvasX??n,nodeCanvasY:p?.canvasY??o,enableInteraction:a.interaction?.enabled??!1,showArrow:a.showArrow,position:{placement:r,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:d,yOffset:u}}}isEnteringInteractiveTooltip(t){const{tooltip:e}=this,i=t.relatedTarget;return e.interactive&&e.enabled&&e.isVisible()&&e.contains(i)}},HC=3,cj=505,UC=30;function Nv(t,e,i){const{offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}=i;return{type:e,device:t,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}}function YC(t,e){const i=t*t+e*e,s=HC*HC;return i>=s}function hj(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY,n=i*i+s*s,o=UC*UC;return n<o}var KC=class{constructor(t){this.destroyFns=[],this.listeners=new ja,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&&YC(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=Nv("mouse","click",t);this.dispatch(e)}else if(t.sourceEvent.type==="touchend"){if(YC(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=Nv("touch","click",t);this.dispatch(e);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=cj&&hj(this.lastClick,t)){const s=Nv(t.device,"dblclick",t);this.dispatch(s),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},wv=class extends jh{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},dj=class{constructor(t){this.seriesWidget=new wv(t.getParent("series-area")),this.chartWidget=new wv(t.getParent("canvas-proxy")),this.containerWidget=new wv(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new KC(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function Ov(t,e){const[i,s]=oi(e);return ft(i,t,s)}function oi(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 Uh(t){const[e,i]=oi(t);return i-e}var $C=class p_ extends Lf{constructor(e=[],i=[]){super(),this.domain=e,this.range=i,this.defaultClamp=!1}static is(e){return e instanceof p_}normalizeDomains(...e){let i,s=1/0,n,o=-1/0;for(const a of e)for(const r of a){const l=r.valueOf();l<s&&(s=l,i=r),l>o&&(o=l,n=r)}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,o=Math.floor(s),a=Math.min(n,o);return s/Math.max(1,a)}convert(e,i=this.defaultClamp){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=Number(this.transform(s[0])),o=Number(this.transform(s[1])),a=Number(this.transform(e)),{range:r}=this,[l,c]=r;if(i){const[h,d]=oi([n,o]);if(a<h)return l;if(a>d)return c}return n===o?(l+c)/2:a===n?l:a===o?c:l+(a-n)/(o-n)*(c-l)}invert(e,i){const s=this.domain.map(h=>this.transform(h)),[n,o]=s,{range:a}=this,[r,l]=a;let c;return r===l?c=this.toDomain((Number(n)+Number(o))/2):c=this.toDomain(Number(n)+(e-r)/(l-r)*(Number(o)-Number(n))),this.transformInvert(c)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};$C.defaultTickCount=5;var he=$C;function XC(t,e){return t.valueOf()-e.valueOf()}function uj(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 Ev(t){const e=t.slice().sort(XC);return Rv(e)==null?uj(e):e}function Rv(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 ny={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 Pv(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 ZC(t,e){const s=new Date(t.getFullYear(),0,1).getDay(),n=(e-s+7)%7,o=new Date(t.getFullYear(),0,n+1);return o<=t?Math.floor(Pv(t,o)/7)+1:0}var pj=0,QC=1,qC=4;function JC(t,e=t.getFullYear()){const s=new Date(e,0,1).getDay(),n=(qC-s+7)%7,o=new Date(e,0,n-(qC-QC)+1);return o<=t?Math.floor(Pv(t,o)/7)+1:JC(t,e-1)}function gj(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${Qi(Math.floor(i/60),2,"0")}${Qi(Math.floor(i%60),2,"0")}`}var fj={a:t=>ny.shortDays[t.getDay()],A:t=>ny.days[t.getDay()],b:t=>ny.shortMonths[t.getMonth()],B:t=>ny.months[t.getMonth()],c:"%x, %X",d:(t,e)=>Qi(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>Qi(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>Qi(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":Qi(i,2,e??"0")},j:(t,e)=>Qi(Pv(t)+1,3,e??"0"),m:(t,e)=>Qi(t.getMonth()+1,2,e??"0"),M:(t,e)=>Qi(t.getMinutes(),2,e??"0"),L:(t,e)=>Qi(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)=>Qi(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>Qi(ZC(t,pj),2,e??"0"),V:(t,e)=>Qi(JC(t),2,e??"0"),w:(t,e)=>Qi(t.getDay(),2,e??"0"),W:(t,e)=>Qi(ZC(t,QC),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>Qi(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>Qi(t.getFullYear(),4,e??"0"),Z:t=>gj(t),"%":()=>"%"},yj={_:" ",0:"0","-":""};function Qi(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function Vu(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const r=i>0?t.substring(0,i):t;e.push(r)}if(i<0)break;const s=t[i+1],n=yj[s];n!=null&&i++;const o=t[i+1],a=fj[o];if(typeof a=="function")e.push([a,n]);else if(typeof a=="string"){const r=Vu(a);e.push([r,n])}else e.push(`${n??""}${o}`);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 tL={};ho(tL,{TimeInterval:()=>oc,day:()=>oy,friday:()=>wj,hour:()=>Xh,millisecond:()=>eL,minute:()=>$h,monday:()=>kj,month:()=>rc,saturday:()=>Oj,second:()=>Kh,sunday:()=>Wu,thursday:()=>Nj,tuesday:()=>Cj,utcDay:()=>Uj,utcHour:()=>jj,utcMinute:()=>_j,utcMonth:()=>$j,utcYear:()=>Qj,wednesday:()=>Lj,year:()=>ay});var oc=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 o=this._rangeCallback?.(t,e),a=this._encode(i?this.floor(t):this.ceil(t)),r=this._encode(i?this.ceil(e):this.floor(e));if(r<a)return[];const l=r-a;let c,h;n?(c=Math.ceil(a+(1-s[1])*l),h=Math.floor(a+(1-s[0])*l)):(c=Math.floor(a+s[0]*l),h=Math.ceil(a+s[1]*l));const d=[];for(let u=c;u<=h;u+=1){const p=this._decode(u);d.push(p)}return o?.(),d}},un=class extends oc{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&&$.warnOnce(`interval step of [${n}] rounded to [${t}].`);const{snapTo:o="start"}=e??{};if(typeof o=="string"){const l=i;s=(c,h)=>{const d=o==="start"?c:h;return i=this.getOffset(d,t),()=>i=l}}else typeof o=="number"?i=this.getOffset(new Date(o),t):o instanceof Date&&(i=this.getOffset(o,t));const a=l=>Math.floor((this._encode(l)-i)/t),r=l=>this._decode(l*t+i);return new oc(a,r,s)}};function mj(t){return t.getTime()}function xj(t){return new Date(t)}var eL=new un(mj,xj),Kr=1e3,qi=Kr*60,ws=qi*60,zn=ws*24,Ha=zn*7,ju=zn*30,Yh=zn*365,iL=new Date().getTimezoneOffset()*qi;function bj(t){return Math.floor((t.getTime()-iL)/Kr)}function Sj(t){return new Date(iL+t*Kr)}var Kh=new un(bj,Sj),sL=new Date().getTimezoneOffset()*qi;function vj(t){return Math.floor((t.getTime()-sL)/qi)}function Mj(t){return new Date(sL+t*qi)}var $h=new un(vj,Mj),nL=new Date().getTimezoneOffset()*qi;function Dj(t){return Math.floor((t.getTime()-nL)/ws)}function Aj(t){return new Date(nL+t*ws)}var Xh=new un(Dj,Aj);function Ij(t){const e=t.getTimezoneOffset()*qi;return Math.floor((t.getTime()-e)/zn)}function Tj(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}var oy=new un(Ij,Tj);function ac(t){const i=(7+t-4)%7;function s(o){const a=o.getTimezoneOffset()*qi;return Math.floor((o.getTime()-a)/Ha-i/7)}function n(o){const a=new Date(1970,0,1);return a.setDate(a.getDate()+o*7+i),a}return new un(s,n)}var Wu=ac(0),kj=ac(1),Cj=ac(2),Lj=ac(3),Nj=ac(4),wj=ac(5),Oj=ac(6);function Ej(t){return t.getFullYear()*12+t.getMonth()}function Rj(t){const e=Math.floor(t/12),i=t-e*12;return new Date(e,i,1)}var rc=new un(Ej,Rj);function Pj(t){return t.getFullYear()}function Bj(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}var ay=new un(Pj,Bj);function zj(t){return Math.floor(t.getTime()/qi)}function Fj(t){return new Date(t*qi)}var _j=new un(zj,Fj);function Gj(t){return Math.floor(t.getTime()/ws)}function Vj(t){return new Date(t*ws)}var jj=new un(Gj,Vj);function Wj(t){return Math.floor(t.getTime()/zn)}function Hj(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}var Uj=new un(Wj,Hj);function Yj(t){return t.getUTCFullYear()*12+t.getUTCMonth()}function Kj(t){const e=Math.floor(t/12),i=t-e*12;return new Date(Date.UTC(e,i,1))}var $j=new un(Yj,Kj);function Xj(t){return t.getUTCFullYear()}function Zj(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}var Qj=new un(Xj,Zj);function ys(t){return t instanceof Date?t.getTime():t}function Bv(t,e,i){const s=oL(t,e,i),n=Vu(s);return o=>n(o)}function oL(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,o]=e.length===0?[0,0]:oi([e[0].valueOf(),e[e.length-1].valueOf()]),a=new Date(n).getFullYear(),l=new Date(o).getFullYear()-a>0,c=isFinite(s)?qj(s,t):Jj(t[0]);return e3(Math.max(c-i,0),l,t)}function qj(t,e){return t<Kr?0:t<qi?1:t<ws?2:t<zn?3:t<Ha?4:t<zn*28||t<zn*31&&t3(e)?5:t<Yh?6:7}function Jj(t){return Kh.floor(t)<t?0:$h.floor(t)<t?1:Xh.floor(t)<t?2:oy.floor(t)<t?3:rc.floor(t)<t?Wu.floor(t)<t?4:5:ay.floor(t)<t?6:7}function t3(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 e3(t,e,i){const s=ys(i[0]),n=ys(i.at(-1)),o=Math.abs(n-s),a=e||t===7,r=o===0,c=[["hour",6*ws,14*zn,3,"%I %p"],["hour",qi,6*ws,3,"%I:%M"],["second",1e3,6*ws,1,":%S"],["ms",0,6*ws,0,".%L"],["am/pm",qi,6*ws,3,"%p"]," ",["day",zn,Ha,4,"%a"],["month",r?0:Ha,52*Ha,5,"%b %d"],["month",5*Ha,10*Yh,6,"%B"]," ",["year",a?0:Yh,1/0,7,"%Y"]].filter(u=>{if(typeof u=="string")return!0;const[p,g,f,x]=u;return x>=t&&g<=o&&o<f}).reduce((u,p)=>(typeof p=="string"?u.result.push(p):u.used.has(p[0])||(u.result.push(p),u.used.add(p[0])),u),{result:[],used:new Set}).result,h=c.findIndex(u=>typeof u!="string"),d=c.findLastIndex(u=>typeof u!="string");return c.slice(h,d+1).map(u=>typeof u=="string"?u:u[4]).join("").replaceAll(/\s+/g," ").trim()}function aL(t,e,i){if(i==null||i[0]===0&&i[1]===1)return t;const s=ft(0,Math.floor(i[0]*t.length),t.length),n=ft(0,Math.ceil(i[1]*t.length),t.length),o=e?t.length-n:s,a=e?t.length-s:n;return t.slice(o,a)}var ry=class g_ extends Lf{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 g_}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=ft(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=ft(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=ft(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&$.warnOnce("Expected update to not invalidate scale"))}ticks(e,i=this.domain,s){return aL(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,o=1/0,a=0;for(;s<=n;){const r=(n+s)/2|0,l=this.ordinalRange(r),c=Math.abs(l-e);if(c===0)return r;c<o&&(o=c,a=r),l<e?s=r+1:n=r-1}return a}update(){const e=this.domain.length;if(e===0)return;const[i,s]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:o,round:a}=this,r=s-i;let l;e===1?(n=0,l=r*(1-o*2)):l=r/Math.max(1,e-n+o*2);const c=a?Math.floor(l):l;let h=i+(r-c*(e-n))/2,d=c*(1-n);a&&(h=Math.round(h),d=Math.round(d)),this._step=c,this._inset=h,this._bandwidth=d,this._rawBandwidth=l*(1-n)}ordinalRange(e){const{_inset:i,_step:s,range:n}=this,o=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return ft(o,i+s*e,a)}};v([Oh],ry.prototype,"range",2),v([Oh],ry.prototype,"round",2),v([Oh],ry.prototype,"interval",2);var Hu=ry,ze=(t,e,i)=>({duration:e*i,timeInterval:t,step:i}),Uu=[ze(Kh,Kr,1),ze(Kh,Kr,5),ze(Kh,Kr,15),ze(Kh,Kr,30),ze($h,qi,1),ze($h,qi,5),ze($h,qi,15),ze($h,qi,30),ze(Xh,ws,1),ze(Xh,ws,3),ze(Xh,ws,6),ze(Xh,ws,12),ze(oy,zn,1),ze(oy,zn,2),ze(Wu,Ha,1),ze(Wu,Ha,2),ze(Wu,Ha,3),ze(rc,ju,1),ze(rc,ju,2),ze(rc,ju,3),ze(rc,ju,4),ze(rc,ju,6),ze(ay,Yh,1)],rL=[1,2,5,10];function lL(t,e){return Math.abs(Math.round(t)-t)<e}function zv(t,e,i,s,n,o){if(i<2)return[t,e];const a=Yu(t,e,i,s,n);if(!Number.isFinite(a))return[];if(lL(t/a,1e-12)||(t=Math.ceil(t/a)*a),lL(e/a,1e-12)||(e=Math.floor(e/a)*a),o!=null&&o[0]!==0&&o[1]!==1){const r=e-t,l=t+r*o[0],c=e-r*(1-o[1]);return Ku(l-l%a,c+c%a,a)}return Ku(t,e,a)}function cL(t,e,i,s,n,o){const a=o??Math.abs(e-t)/Math.max(i,1);let r=0;for(const u of Uu){if(a<=u.duration)break;r++}if(r===0){const u=Math.max(Yu(t,e,i,s,n),1);return eL.every(u)}else if(r===Uu.length){const u=o==null?Yu(t/Yh,e/Yh,i,s,n):1;return ay.every(u)}const l=Uu[r-1],c=Uu[r],{timeInterval:h,step:d}=a-l.duration<c.duration-a?l:c;return h.every(d)}function Yu(t,e,i,s=0,n=1/0){if(t===e)return ft(1,s,n);if(i<1)return NaN;const o=Math.abs(e-t),a=10**Math.floor(Math.log10(o/i));let r=NaN,l=1/0,c=!1;for(const h of rL){const d=Math.ceil(o/(h*a)),u=d>=s&&d<=n;if(c&&!u)continue;const p=Math.abs(d-i);(l>p||c!==u)&&(c||(c=u),l=p,r=h)}return r*a}function hL(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function dL(t,e){const i=ek(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[o,a]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(o!=="1"&&o!=="-1"?1:0)+hL(a)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const o=Math.floor(Math.log10(Math.abs(n))),a=i.type?6:12,r=n.toExponential(a-1).split(/[.e]/g)[1],l=hL(r);return Math.max(0,l-o)}))));const s=ik(i);return n=>s(Number(n))}function Ku(t,e,i){if(!Number.isFinite(i)||i<=0)return[];const s=10**Au(i),n=Math.min(t,e),o=Math.max(t,e),a=[];for(let r=0;;r+=1){const l=Math.round((n+i*r)*s)/s;if(l>o)break;a.push(l)}return a}function Zh(t,e){return t>=e?($.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function i3(t,e){const i=Math.abs(e-t),s=10**Math.floor(Math.log10(i));let n=1/0,o=[t,e];for(const a of rL){const r=a*s,l=Math.floor(t/r)*r,c=Math.ceil(e/r)*r,h=1-i/Math.abs(c-l);n>h&&(n=h,o=[l,c])}return o}function uL(t,e,i,s,n,o){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,t/(n+1)),i??(i=o),s??(s=t),i>s&&(i===o?i=s:s=i);const a=Math.max(1,Math.floor(t/(e*i))),r=Math.min(a,Math.ceil(t/(e*s))),l=ft(r,Math.floor(n/e),a);return{minTickCount:r,maxTickCount:a,tickCount:l}}var pL=class extends he{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,o=this.getPixelRange();for(let a=0;a<n;a++){const[r,l]=s3(i,s,t,o);if(ys(i)===ys(r)&&ys(s)===ys(l))break;i=r,s=l}return[i,s]}ticks(t,e=this.domain,i=[0,1]){const{nice:s,interval:n,tickCount:o=he.defaultTickCount,minTickCount:a,maxTickCount:r}=t;if(e.length<2)return[];const l=e.map(ys),c=l[0],h=l[l.length-1];if(n!=null){const d=this.getPixelRange();return Fv({start:c,stop:h,interval:n,availableRange:d,visibleRange:i})??gL({start:c,stop:h,tickCount:o,minTickCount:a,maxTickCount:r,visibleRange:i})}else{if(s&&o===2)return e;if(s&&o===1)return e.slice(0,1)}return gL({start:c,stop:h,tickCount:o,minTickCount:a,maxTickCount:r,visibleRange:i})}_tickFormatter({domain:t,ticks:e,specifier:i},s){return i!=null?Vu(i):Bv(e,t,s)}tickFormatter(t){return this._tickFormatter(t)}datumFormatter(t){return this._tickFormatter(t,1)}};function gL({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:o}){const a=cL(t,e,i,s,n);return a?a.range(new Date(t),new Date(e),{visibleRange:o}):[]}function Fv({start:t,stop:e,interval:i,availableRange:s,visibleRange:n}){if(!i)return[];if(i instanceof oc){const h=i.range(new Date(t),new Date(e),{visibleRange:n});return Zh(h.length,s)?void 0:h}const o=Math.abs(i);if(Zh(Math.abs(e-t)/o,s))return;const a=Uu.findLast(h=>o%h.duration===0);if(a)return a.timeInterval.every(o/(a.duration/a.step)).range(new Date(t),new Date(e),{visibleRange:n});let r=new Date(Math.min(t,e));const l=new Date(Math.max(t,e)),c=[];for(;r<=l;)c.push(r),r=new Date(r),r.setMilliseconds(r.getMilliseconds()+o);return c}function s3(t,e,i,s){const{interval:n}=i,o=Math.min(ys(t),ys(e)),a=Math.max(ys(t),ys(e));let r;if(n instanceof oc)r=n;else{let l;typeof n=="number"&&(l=(a-o)/Math.max(n,1),Zh(l,s)&&(l=null)),l??(l=i.tickCount??he.defaultTickCount),r=cL(o,a,l,i.minTickCount,i.maxTickCount)}if(r){const l=r.range(new Date(o),new Date(a),{extend:!0});return t>e&&l.reverse(),[l[0],l.at(-1)]}else return[t,e]}var Ua=class f_ extends Hu{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(e){return e instanceof f_}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=Rv(s);return n===-1?s=s.slice().reverse():n==null&&(s=Ev(s.slice())),{domain:s,animatable:!0}}return{domain:Ev(i.flat()),animatable:!0}}ticks({interval:e,maxTickCount:i},s=this.domain,n=[0,1]){if(!s.length)return[];this.refresh();const{isReversed:o}=this;if(e==null)return fL(s,i,o,n);const[a,r]=[s[0].valueOf(),s.at(-1).valueOf()],l=Math.min(a,r),c=Math.max(a,r),[h,d]=this.range,u=Math.abs(d-h),p=Fv({start:l,stop:c,interval:e,availableRange:u,visibleRange:n})??fL(s,i,o,n);let g=-1;return p.filter(f=>{const x=this.findInterval(f.valueOf()),m=x===g;return g=x,!m})}getSortedTimestamps(){let{sortedTimestamps:e}=this;return e==null&&(e=this.domain.map(ys),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 o=n[0],r=n[n.length-1]-o,l=0,c=n.length-1;for(let h=0;h<i.length;h+=1)i[h]=this.findIntervalInRange(o+h/s*r,l,c);this.precomputedSteps=i}findIntervalInRange(e,i,s){const n=this.getSortedTimestamps();for(;i<=s;){const o=(i+s)/2|0;if(n[o]===e)return o;n[o]<e?i=o+1:s=o-1}return i}findInterval(e){const i=this.getPrecomputedSteps();let s,n;if(i==null)s=0,n=this.domain.length-1;else{const o=this.getSortedTimestamps(),a=o[0],r=o[o.length-1],l=Math.min((e-a)/(r-a)*i.length|0,i.length-1|0);s=i[l],n=l<i.length-2?i[l+1]:o.length-1}return this.findIntervalInRange(e,s,n)}tickFormatter({domain:e,ticks:i,specifier:s}){return s!=null?Vu(s):Bv(i,e)}datumFormatter(e){return this.tickFormatter(e)}invert(e,i=!1){this.refresh();const{domain:s}=this;if(i){const o=this.invertNearestIndex(e-this.bandwidth/2);return o!=null?s[o]:void 0}return yG(0,s.length-1,o=>this.ordinalRange(o)>=e?s[o]: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 fL(t,e,i,s){const n=[],o=Math.ceil(t.length/e),a=Math.floor(o/2),r=Math.floor(s[0]*t.length),l=Math.ceil(s[1]*t.length);for(let c=r;c<l;c+=1){const h=i?t.length-1-c:c;(o<=0||(h+a)%o===0)&&n.push(t[c])}return i&&n.reverse(),n}var $u={bottomCenter:l3,center:r3,clone:u3,collides:p3,end:o3,from:g3,height:h3,round:d3,start:n3,topCenter:a3,origin:f3,width:c3};function n3(t){return{x:t.x1,y:t.y1}}function o3(t){return{x:t.x2,y:t.y2}}function a3(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function r3(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function l3(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function c3(t){return Math.abs(t.x2-t.x1)}function h3(t){return Math.abs(t.y2-t.y1)}function d3(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function u3(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function p3(t,e){const i=_v(t),s=_v(e);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function _v(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 g3(t,e,i,s){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:s};if("width"in t)return _v({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 f3(){return{x1:0,y1:0,x2:0,y2:0}}function ly(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function yL(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function mL(t,e,i){return[yL(t,i.min,e,i.max,0),yL(t,i.min,e,i.max,1)]}function y3(t,e,i){const[s,n]=mL(t.x1,t.x2,e),[o,a]=mL(t.y1,t.y2,i);return{x1:s,x2:n,y1:o,y2:a}}function xL(t,e,i,s,n,o){if(i<=n&&o<=s)return i;const a=n-i,r=o-s,l=Math.abs(a)<Math.abs(r)?a:r;return ft(t,i+l,e)}function m3(t,e,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=e,o=$u.from(i),a=$u.from(t),r=y3(a,s,n),l=xL(r.x1,r.x2,a.x1,a.x2,o.x1,o.x2),c=xL(r.y1,r.y2,a.y1,a.y2,o.y1,o.y2),h={x:{min:ly(a.x1,s.min,a.x2,s.max,l),max:ly(a.x1,s.min,a.x2,s.max,l+t.width)},y:{min:ly(a.y1,n.min,a.y2,n.max,c),max:ly(a.y1,n.min,a.y2,n.max,c+t.height)}},d=h.x.max-h.x.min,u=h.y.max-h.y.min;return h.x.min=ft(0,h.x.min,1-d),h.x.max=h.x.min+d,h.y.min=ft(0,h.y.min,1-u),h.y.max=h.y.min+u,h}var x3=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],b3=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},bL=t=>ne((e,{options:i})=>!he.is(t?.scale)&&!Ua.is(t?.scale)||e==null||i.end==null?!0:e<=i.end,"to be less than end"),SL=class extends Ur{constructor(t,e){super(),this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Vh(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new b3,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(!Rt(t))return!1;for(const a of Object.keys(t))if(!x3.includes(a))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:Ze(Qt(J,Xl),bL(i)),end:Qt(J,Xl)},rangeY:{start:Ze(Qt(J,Xl),bL(s)),end:Qt(J,Xl)},ratioX:{start:Ze(Tt,Zl("end")),end:Tt},ratioY:{start:Ze(Tt,Zl("end")),end:Tt},autoScaledAxes:mt(st("y"))},o=wn(t,n);return o.errors.length>0?(e.push(...o.errors.map(a=>a.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 r=i?.autoScaledAxes?.includes("y");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},r??(r=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},r??(r=!1)):(n.y={min:0,max:1},r??(r=!0)),n.autoScaleYAxis=r}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const o=this.getPrimaryAxis("x"),a=this.getPrimaryAxis("y");for(const r of[o,a])r&&this.updateAxisZoom("zoom-manager",r.id,n[r.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 S3(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)&&($.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)&&($.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 o=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!o}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 $.warnOnce("cannot pan to target BBox - chart too small?"),!1;const o=m3(e,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(t,"x",o.x),this.updatePrimaryAxisZoom(t,"y",o.y)):this.updateZoom(t,o),!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[,o]=n,a=i(o),r=this.rangeToRatio({start:a,end:o},e);r&&this.updateZoom(t,{[e]:r})}updateWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[o,a]=n;[o,a]=i(o,a);const r=this.rangeToRatio({start:o,end:a},e);r&&this.updateZoom(t,{[e]:r})}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 o=0;const a=[t.x.min,t.x.max],r=[t.y.min,t.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=e-(o??0),h=l.getVisibleItems(a,r,c);if(o+=h,o>=e)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=e-(o??0),h=l.getVisibleItems(a,r,c);if(o+=h,o>=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:o}=s;let a;if(n.x?.min===0&&n.x?.max===1?a={min:0,max:1}:i?a=this.primaryAxisZoom("y",n.x,{padding:o}):a=this.combinedAxisZoom("y",n.x,{padding:o}),a!=null){if(i){const r=this.getPrimaryAxis("y");(r==null?void 0:this.axisZoomManagers.get(r.id))?.updateZoom("zoom-manager",a)}else for(const r of this.axisZoomManagers.values())r.getDirection()==="y"&&r.updateZoom("zoom-manager",a);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||!he.is(i.scale)&&!Ua.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,o]=s;let a,r;return n<=o?(a=i.scale.invert(0),r=i.scale.invert(n+(o-n)*t.max)):(a=i.scale.invert(n-(n-o)*t.min),r=i.scale.invert(0)),{start:a,end:r}}rangeToRatio(t,e){const i=this.getPrimaryAxis(e);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,o]=s;let a=t.start==null?n:i.scale.convert?.(t.start),r=t.end==null?o:i.scale.convert?.(t.end);if(!Pt(a)||!Pt(r))return;const[l,c]=[Math.min(n,o),Math.max(n,o)];if(a<l||a>c){$.warnOnce(`Invalid range start [${t.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(o)}], ignoring.`);return}if(r<l||r>c){$.warnOnce(`Invalid range end [${t.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(o)}], ignoring.`);return}a=Math.min(c,Math.max(l,a)),r=Math.min(c,Math.max(l,r));const h=o-n,d=Math.abs((a-n)/h),u=Math.abs((r-n)/h);return{min:d,max:u}}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(!(!Pt(i)||!Pt(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,o=n.range;n.range=[0,1];const a=e.scale,r=a.range;a.range=[0,1];let l=1,c=!1,h=0,d=!1;for(const g of e.boundSeries){const{connectsToYAxis:f}=g,x=g.getRange("y",[i.min,i.max]);for(const m of x){const b=a.convert(m);Number.isFinite(b)&&(b<l&&(l=b,c=!f||m<0),b>h&&(h=b,d=!f||m>0))}}if(Pt(e.min)&&(l=0),Pt(e.max)&&(h=1),n.range=o,a.range=r,l>=h)return;const u=(c?s:0)+(d?s:0),p=Math.min((h-l)*(1+u),1);if(!(p<=0)){if(c&&d){const g=(h+l)/2;l=g-p/2,h=g+p/2}else!c&&d?h=l+p:c&&!d&&(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),o=this.getPrimaryAxis(t);if(!(n==null||o==null))return this.zoomBounds(n,o,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 o=1,a=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 d=this.zoomBounds(h,l,e,i);if(d==null)return;o=Math.min(o,d.min),a=Math.max(a,d.max)}const r=1e-6;if(o<r&&(o=0),a>1-r&&(a=1),!(o>a))return{min:o,max:a}}},S3=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new Vh({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return Se(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 v3(t,e,i,s,n,o){if(t.size===0)return!1;let a=t.x,r=t.y;e!=null&&(a-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=a;a<i?l=i:a>i+n&&(l=i+n);let c=r;r<s?c=s:r>s+o&&(c=s+o);const h=a-l,d=r-c;return Math.sqrt(h*h+d*d)<=t.size*.5}function vL(t,e,i,s,n){const o=t.x+t.width>e&&t.x<e+s,a=t.y+t.height>i&&t.y<i+n;return o&&a}function M3(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 D3(t){return t!=null&&typeof t.point=="object"&&typeof t.label=="object"}var A3={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 I3(t,e,i=5){const s=new Map,n=[],o=new Map([...t.entries()].map(([r,l])=>[r,l.toSorted((c,h)=>h.point.size-c.point.size)])),a=[...o.values()].flat();for(const[r,l]of o.entries()){const c=[];if(l[0]?.label){for(let h=0,d=l.length;h<d;h++){const u=l[h],{point:p,label:g,anchor:f}=u,{text:x,width:m,height:b}=g,S=p.size*.5;let M=0,D=0;if(S>0&&u.placement!=null){const w=A3[u.placement];M=(m*.5+S+i)*w.x,D=(b*.5+S+i)*w.y}const C=p.x-m*.5+M-((f?.x??.5)-.5)*p.size,k=p.y-b*.5+D-((f?.y??.5)-.5)*p.size;if(!(!e||M3(e,C,k,m,b))||a.some(w=>v3(w.point,w.anchor,C,k,m,b))||n.some(w=>vL(w,C,k,m,b)))continue;const O={index:h,text:x,x:C,y:k,width:m,height:b,datum:u};c.push(O),n.push(O)}s.set(r,c)}}return s}function T3(t,e=0){const i=[];for(let s=0;s<t.length;s++){const n=t[s],{point:{x:o,y:a},label:{text:r}}=n;let{width:l,height:c}=n.label;if(l+=e,c+=e,i.some(h=>vL(h,o,a,l,c)))return!0;i.push({index:s,text:r,x:o,y:a,width:l,height:c,datum:n})}return!1}var k3=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=pt.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(a=>a.id));for(const a of this.labelData.keys())n.has(a)||this.labelData.delete(a);for(const a of t){const r=a.getLabelData();r.every(D3)&&this.labelData.set(a.id,r)}const o=I3(this.labelData,s,5);for(const a of t)a.updatePlacedLabelData?.(o.get(a.id)??[])}},C3=class extends Ur{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||wt(t)}restoreMemento(t,e,i){i?.forEach(s=>{const{seriesId:n,data:o}=this.getRestoredData(s)??{};!n||!o||this.updateData(n,o)}),this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const a=(this.legendDataMap.get(e)??[]).map(r=>{const l=r.seriesId===e&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:n}:r});return{seriesId:e,data:a}}if(!(i==null&&s==null))for(const o of this.getData()){if(i!=null&&o.itemId!==i||s!=null&&o.legendItemName!==s)continue;if(o.isFixed){this.warnFixed(o.seriesId,i);return}const a=(this.legendDataMap.get(o.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===s?{...r,enabled:n}:r);return{seriesId:o.seriesId,data:a}}}warnFixed(t,e){$.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(r=>{const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(r.seriesId,l)});return}const n=this.getData(e),o=n.length===1,a=n.map(r=>i==null&&o||r.itemId===i?{...r,enabled:t}:r);this.updateData(e,a)}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}},L3=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 a of Object.values(this.groups[t]??{}))a.visible&&(s.add(a.grouping.groupIndex),a.grouping.groupIndex===e.groupIndex&&n.add(a.grouping.stackIndex));const o=Array.from(s);return o.sort((a,r)=>a-r),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(e.groupIndex)}}},Xu=(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))(Xu||{}),ML=class{constructor(t){this.updateCallback=t,this.events=new IS}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})}},N3=class{constructor(t,e){this.callbackCache=new JV,this.chartEventManager=new FC,this.highlightManager=new GC,this.layoutManager=new iC,this.localeManager=new jV,this.seriesStateManager=new L3,this.stateManager=new vV,this.seriesLabelLayoutManager=new k3,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:o,fireEvent:a,updateCallback:r,updateMutex:l,styleContainer:c,chartType:h,domMode:d}=e;this.chartService=t,this.syncManager=n,this.domManager=new yC(o,c,d),this.widgets=new dj(this.domManager);const u=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Jf({canvasElement:u}),this.scene.setRoot(s),this.axisManager=new ej(s),this.legendManager=new C3,this.annotationManager=new tj(t.annotationRoot,a),this.chartTypeOriginator=new bV(t),this.interactionManager=new PC,this.contextMenuRegistry=new _C,this.updateService=new ML(r),this.proxyInteractionService=new MC(this.localeManager,this.domManager),this.historyManager=new SV(this.chartEventManager),this.animationManager=new zC(this.interactionManager,l),this.dataService=new ty(this.animationManager),this.tooltipManager=new sy(this.localeManager,this.domManager,t.tooltip),this.zoomManager=new SL(a,this.layoutManager);for(const p of Zo.byType("context")){if(!p.chartTypes.includes(h))continue;const g=p.moduleFactory(this);this.contextModules.push(g),this[p.contextKey]=g}}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())}},DL=class extends kt{constructor(){super(...arguments),this.range="tooltip"}};v([A(le(["tooltip","node"],"a range"))],DL.prototype,"range",2);function w3(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function O3(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||!w3(s,n))return!1}return!0}function E3(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:s,idsMap:n,scopes:o,data:a,...r}=t[i],{type:l,idsMap:c,scopes:h,data:d,...u}=e[i];if(s!==l||o&&h&&!Xo(o,h)||a&&d&&a!==d||!Qo(r,u)||!O3(n,c))return!1}return!0}function R3(t,e){const{props:i,...s}=t,{props:n,...o}=e;return Qo(s,o)&&E3(i,n)}function P3(t,e,i,s){return e===t.data&&Xo(i,t.ids)&&R3(s,t.opts)}var AL=class y_{constructor(){this.domain=new Set}static is(e){return e instanceof y_}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},$r=class m_{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof m_}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]}},Qh=0,qh=1,sa=2,B3=class{constructor(t){const e=t.reduce((o,a)=>Math.max(o,a.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 o of t)for(let a=0;a<o.length;a+=1){const r=Number(o[a]),l=s+a-1,c=(l*sa|0)+Qh,h=(l*sa|0)+qh,d=n[c],u=n[h];(!Number.isFinite(d)||r<d)&&(n[c]=r),(!Number.isFinite(u)||r>u)&&(n[h]=r)}for(let o=s/2|0;o>=1;o=o/2|0){const a=o-1|0,r=a+o|0;for(let l=0;l<o;l+=1){const c=a+l,h=r+l*2,d=h+1,u=n[(h*sa|0)+Qh],p=n[(d*sa|0)+Qh];n[(c*sa|0)+Qh]=!Number.isFinite(p)||u<p?u:p;const g=n[(h*sa|0)+qh],f=n[(d*sa|0)+qh];n[(c*sa|0)+qh]=!Number.isFinite(f)||g>f?g:f}}this.buffer=n}computeRangeInto(t,e,i,s,n,o,a){const r=n+o-1;if(r<e||n>=i)return a;if(n>=e&&r<i){const l=t[(s*sa|0)+Qh],c=t[(s*sa|0)+qh];Number.isFinite(l)&&(a[0]=Math.min(a[0],l)),Number.isFinite(c)&&(a[1]=Math.max(a[1],c))}else o>1&&(s=s*2|0,o=o/2|0,this.computeRangeInto(t,e,i,s+1|0,n,o,a),this.computeRangeInto(t,e,i,s+2|0,n+o,o,a));return a}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[Qh],t[qh]]}},IL=Symbol("domain-ranges");function z3(t){return t.map(e=>Rt(e)?JSON.stringify(e):e).join("-")}function Us(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function Gv(t,e){return e?.get(t.id)??0}function F3(t){return"scopes"in t&&Array.isArray(t.scopes)}function Vv(t,e){const i=[];for(let s=0;s<t;s+=1)i[s]=e;return i}function cy(t,e,i){const s=[];for(const n of t){const o=n.get(e)?.[i];if(o==null)return;s.push(o)}return s}function TL(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 o=s[1].trim();if(o.startsWith("."))e.push(o.slice(1).trim());else if(o.startsWith("[")){const a=o.slice(1,-1).trim();a.startsWith("'")?e.push(a.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):a.startsWith('"')?e.push(a.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):e.push(a)}else e.push(o)}if(i===t.length)return e}function _3(t){return e=>{let i=e;for(const s of t)i=i[s];return i}}var kL=class{constructor(t,e="standalone",i=!1){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.debug=qt.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(r,l,c,h){for(const d of r)h.has(d)||h.set(d,Vv(l.length,!1)),h.get(d)[c]=!0};let s=!0;for(const r of t.props){if(r.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");r.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:r=[]})=>{for(const l of r)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},o=new Set,a=new Set;for(const r of t.props){const l=r.type==="key"?o:a;switch(F3(r)&&r.scopes?.forEach(c=>l.add(c)),r.type){case"key":this.keys.push({...r,index:this.keys.length,missing:new Map});break;case"value":if(r.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(r)}`);this.values.push({...r,index:this.values.length,missing:new Map});break;case"aggregate":n(r),this.aggregates.push({...r,index:this.aggregates.length});break;case"group-value-processor":n(r),this.groupProcessors.push({...r,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...r,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...r,index:this.reducers.length});break;case"processor":this.processors.push({...r,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const r=new Set(a.values());if(o.forEach(l=>r.delete(l)),r.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...r.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(o=>o.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const o of e.groups){s.group=o;let a=0;for(const r of o.datumIndices[i]??n)s.datumIndex=r,s.valueIndex=a++,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 o=e.map(c=>this.resolveProcessedDataIndexById(t,c)),a=o.join(":"),r=n[IL];let l=r.get(a);if(l==null){const c=o.map(h=>n.columns[h]);l=new B3(c),r.set(a,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:o,processors:a,propertyProcessors:r}=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),r.length>0&&this.postProcessProperties(c),o.length>0&&this.reduceData(c),a.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,this.debug.check()&&G3(c),this.processScopeCache(),c}warnDataMissingProperties(t){if(t.size!==0)for(const e of Pr(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}`;$.warnOnce(`the key '${e.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const t of Pr(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=a=>{if(a.idsMap){for(const[r,l]of a.idsMap)if(t?.includes(r)&&l.has(s))return!0}return!1},o=this.values.reduce((a,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(h=>t?.includes(h)))&&(r.property===s||r.id===s||n(r))&&a.push(l),a),[]);if(o.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return o}extractData(t){const{dataDomain:e,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:o}=this,{invalidData:a,invalidKeys:r,allKeyMappings:l}=this.extractKeys(n,t,i),{columns:c,columnScopes:h,partialValidDataCount:d,maxDataLength:u}=this.extractValues(a,o,t,r,i),p=g=>{const f=e.get(g),x=f.getDomain();return $r.is(f)&&x[0]>x[1]?[]:x};return{type:"ungrouped",input:{count:u},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:r,invalidData:a,domain:{keys:n.map(p),values:o.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:o},partialValidDataCount:d,time:0,[IL]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,o=new Map;let a,r;const l=(c,h)=>{const d=r.get(c);a.set(h,a.get(d)),s.has(d)&&(s.set(h,s.get(d)),n.set(h,n.get(d)))};for(const c of t){const{invalidValue:h,scopes:d}=c;a=new Map,r=new Map,o.set(c,a);for(const u of d??[]){const p=e.get(u)??[];if(r.has(p)){l(p,u);continue}const g=[];a.set(u,g),r.set(p,u);let f,x;for(let m=0;m<p.length;m++){if(p[m]==null||typeof p[m]!="object")continue;const b=i(c,p[m],m,u);if(b.valid){g.push(b.value);continue}g.push(h),f??(f=Vv(p.length,!1)),x??(x=Vv(p.length,!1)),f[m]=!0,x[m]=!0}f&&x&&(s.set(u,f),n.set(u,x))}}return{invalidData:n,invalidKeys:s,allKeyMappings:o}}extractValues(t,e,i,s,n){let o=0;const a=[],r=[];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 u=new Set(c.scopes),p=Du(c.scopes),g=i.get(p),f=new Array;for(let x=0;x<g.length;x++){if(g[x]==null||typeof g[x]!="object")continue;const m=g[x],b=s.get(p)?.[x],S=n(c,m,x,c.scopes);let M=S.value;(b||!S.valid)&&this.markScopeDatumInvalid(c.scopes,g,x,t),b?M=h:S.valid||(o+=1,M=h),f[x]=M}a.push(f),r.push(u),l=Math.max(l,f.length)}return{columns:a,columnScopes:r,partialValidDataCount:o,maxDataLength:l}}groupData(t,e){var i;const s=new Map,{keys:n,columns:o,columnScopes:a,invalidKeys:r,invalidData:l}=t,c=t.scopes,h=new Set;for(const p of c){const g=o.map((M,D)=>D).filter(M=>!h.has(M)&&a[M].has(p));if(g.length===0)continue;for(const M of g)h.add(M);const f=new Set;for(const M of g)for(const D of a[M])f.add(D);const x=n.map(M=>M.get(p)).filter(M=>M!=null),m=o[Du(g)],b=l?.get(p),S=r?.get(p);for(let M=0;M<m.length;M++){if(S?.[M]===!0)continue;const D=x.map(L=>L[M]);if(D==null||D.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const C=e?.(D)??D,k=z3(C),I=s.get(k)??{keys:C,datumIndices:[],validScopes:c};if(s.has(k)||s.set(k,I),b?.[M]===!0){I.validScopes===c&&(I.validScopes=new Set(c.values()));for(const L of f)I.validScopes.delete(L)}for(const L of g)(i=I.datumIndices)[L]??(i[L]=[]),I.datumIndices[L].push(M)}}const d=[],u=[];for(const{keys:p,datumIndices:g,validScopes:f}of s.values())d.push(p),u.push({datumIndices:g,keys:p,aggregation:[],validScopes:f});return{...t,type:"grouped",domain:{...t.domain,groups:d},groups:u}}aggregateUngroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{keys:i,columns:s,dataSources:n}=t,o=Du(n.keys()),a=n.get(o);t.aggregation=a?.map((r,l)=>{const c=[];for(const[h,d]of this.aggregates.entries()){const u=this.valueGroupIdxLookup(d);let p=d.groupAggregateFunction?.()??[1/0,-1/0];const g=u.map(b=>s[b][l]),f=cy(i,o,l),x=f!=null?d.aggregateFunction(g,f):void 0;x&&(p=d.groupAggregateFunction?.(x,p)??$r.extendDomain(x,p));const m=d.finalFunction?.(p)??p;c[h]=m,$r.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 o=this.valueGroupIdxLookup(n);for(const a of t.groups){a.aggregation??(a.aggregation=[]);const r=a.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...o.map(d=>a.datumIndices[d]?.length??0));for(let d=0;d<c;d++){const u=o.map(g=>i[g][a.datumIndices[g]?.[d]]),p=n.aggregateFunction(u,r);p&&(l=n.groupAggregateFunction?.(p,l)??$r.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;a.aggregation[s]=h,$r.extendDomain(h,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this,{columnScopes:i,columns:s,invalidData:n}=t;for(const o of e){const a=this.valueGroupIdxLookup(o),r=o.adjust()();for(const l of t.groups)r(s,a,l);for(const l of a){const h=this.values[l].valueType==="category",d=s[l],u=Du(i[l]),p=n?.get(u),g=h?new AL:new $r;for(let f=0;f<d.length;f+=1)p?.[f]!==!0&&g.extend(d[f]);t.domain.values[l]=g.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 o=s.initialValue;if(t.type==="grouped")for(const a of t.groups)o=n(o,a.keys);else{const a=Du(e.keys()),r=i.map(h=>h.get(a)).filter(h=>h!=null),l=r.map(()=>{}),c=e.get(a);for(let h=0;h<c.length;h+=1){for(let d=0;d<l.length;d++)l[d]=r[d]?.[h];o=n(o,l)}}t.reduced[s.property]=o}}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 d of h.scopes)i.add(d);const s=new Map,n=new Map;let o=!0;const a=()=>{for(const h of Pr(t,e))h.valueType==="category"?s.set(h,new AL):(s.set(h,new $r),o&&(o=(h.scopes??[]).length===i.size))};a();const r=this.buildAccessors(Pr(t,e)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,d,u,p)=>{let g,f;if(r.has(h.property)){try{f=r.get(h.property)(d)}catch{}g=f!=null}else g=h.property in d,f=g?d[h.property]:h.missingValue;h.forceValue!=null&&(f=g&&OS(f)?-1*h.forceValue:h.forceValue,g=!0),l.missing=!g;const x="missingValue"in h;if(!g&&!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 b=h.missing.get(m)??0;h.missing.set(m,b+1)}if(s.has(h)||a(),g&&h.validation?.(f,d,u)===!1)if(l.valid=!1,"invalidValue"in h)f=h.invalidValue;else return this.mode!=="integrated"&&$.warnOnce(`invalid value of type [${typeof f}] for [${h.scopes} / ${h.id}] ignored:`,`[${f}]`),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)),f=m(f,u)}return s.get(h)?.extend(f),l.value=f,l},initDataDomain:a,scopes:i,allScopesHaveSameDefs:o}}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=TL(i.property);if(n==null){$.warnOnce("Invalid property path [%s]",i.property);continue}const o=_3(n);e.set(i.property,o)}return e}};function G3(t){const e=(i,s)=>{s.length>0&&($.log(`DataModel.processData() - ${i}`),$.table(s))};$.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 CL=class Nr{constructor(e,i){this.mode=e,this.suppressFieldDotNotation=i,this.debug=qt.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,o)=>{this.requested.push({id:e,opts:s,data:i,resolve:n,reject:o})})}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()&&(re().processedData=[]);const n=[];for(const{data:o,ids:a,opts:r,resolves:l,rejects:c}of s){const h=e?.find(p=>P3(p,o,a,r));let d,u;if(h==null)try{d=new kL(r,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));u=d.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:d,processedData:u}=h);n.push({opts:r,data:o,ids:a,dataModel:d,processedData:u}),this.debug.check()&&re("processedData").push(u),u?.partialValidDataCount===0?l.forEach(p=>p({dataModel:d,processedData:u})):u?this.splitResult(d,u,a,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(Nr.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Nr.mergeRequests)}splitResult(e,i,s,n){for(let o=0;o<s.length;o++){const a=n[o];a({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:o=!1,groupByFn:a,props:r}=i,l=s(r);return([c])=>(n===!1||c.data===e)&&(c.opts.groupByKeys??!1)===o&&c.opts.groupByFn===a&&s(c.opts.props)===l}static mergeRequests(e){const i=new Set(["key","group-value-processor"]);return e.reduce((s,{id:n,data:o,resolve:a,reject:r,opts:{props:l,...c}})=>{s.ids.push(n),s.rejects.push(r),s.resolves.push(a),s.data??(s.data=o),s.opts??(s.opts={...c,props:[]});for(const h of l){const d={...h,scopes:[n],data:o};Nr.createIdsMap(n,d);const u=s.opts.props.find(p=>p.type===d.type&&(i.has(p.type)||p.data===d.data)&&Nr.deepEqual(p,d));if(!u){s.opts.props.push(d);continue}u.scopes??(u.scopes=[]),u.scopes.push(...d.scopes??[]),(u.type==="key"||u.type==="value")&&d.idsMap?.size&&Nr.mergeIdsMap(d.idsMap,u.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,i){for(const[s,n]of e){const o=i.get(s);if(o==null)i.set(s,new Set(n));else for(const a of n)o.add(a)}}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(!Nr.deepEqual(e[s],i[s]))return!1;return!0}const o=Object.keys(e);if(n=o.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const a=o[s];if(!Nr.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!Nr.deepEqual(e[a],i[a])))return!1}return!0}return!1}};CL.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var LL=CL,V3=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)}},lc=new V3,Zu=[{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 cc(t){return Zu.find(e=>e.type==="series"&&e.identifier===t)?.chartTypes}function j3(t){return cc(t)?.find(i=>i==="cartesian")==="cartesian"}function W3(t){return cc(t)?.find(i=>i==="polar")==="polar"}function H3(t){return cc(t)?.find(i=>i==="hierarchy")==="hierarchy"}function U3(t){return cc(t)?.find(i=>i==="topology")==="topology"}function Y3(t){return cc(t)?.find(i=>i==="flow-proportion")==="flow-proportion"}function K3(t){return cc(t)?.find(i=>i==="standalone")==="standalone"}function $3(t){return cc(t)?.find(i=>i==="gauge")==="gauge"}function X3(t){return t.packageType==="enterprise"}function Z3(t){if(!X3(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=Zu.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 Q3(){return Zu.filter(({useCount:t})=>t==null||t===0)}var q3=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),{})}},jv=new q3,NL=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))}},J3=class extends Map{set(t,e){return super.set(t,jt(e,this.get(t)))}},Ce=new NL,tW=new NL,Wv=new J3,eW=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:o,solo:a,stackable:r,groupable:l,stackedByDefault:c,hidden:h}){this.setThemeTemplate(t,o),this.seriesMap.set(t,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,solo:a,stackable:r,groupable:l,stackedByDefault:c}),Ce.set(t,e),h||tW.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:Se(e)}}setThemeTemplate(t,e){const i=this.themeTemplates.get(t);this.themeTemplates.set(t,jt(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}},Fn=new eW,Hv=class kh extends Ur{constructor(e){super(),this.chart=e}subscribe(e=kh.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,kh.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=kh.DEFAULT_GROUP){return this.get(e)?.delete(this.chart),this}getChart(){return this.chart}getGroup(e=kh.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=kh.DEFAULT_GROUP){return this.getGroup(e).filter(i=>i!==this.chart)}get(e){return kh.chartsGroups.get(e)}};Hv.chartsGroups=new Map,Hv.DEFAULT_GROUP=Symbol("sync-group-default");var iW=Hv,Uv=class extends kt{constructor(){super(...arguments),this.enabled=!1}};v([A(xt)],Uv.prototype,"enabled",2),v([A(Et)],Uv.prototype,"tabIndex",2);var wL={};ho(wL,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>xo,fromToMotion:()=>Fe,staticFromToMotion:()=>Ya});var xo={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Fe(t,e,i,s,n,o,a){const{fromFn:r,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=n,{nodes:h,selections:d}=iy(s),u=(g,f)=>{let x,m=0,b=0;for(const S of f){const M=g[m]===S,D={last:b>=f.length-1,lastLive:m>=g.length-1,prev:f[b-1],prevFromProps:x,prevLive:g[m-1],next:f[b+1],nextLive:g[m+(M?1:0)]},C=`${t}_${e}_${S.id}`;i.stopByAnimationId(C);let k="unknown";M?o&&a&&(k=sW(S,S.datum,o,a)):k="removed",S.transitionOut=k==="removed";const{phase:I,start:L,finish:N,delay:O,duration:w,...R}=r(S,S.datum,k,D),{phase:G,start:B,finish:P,delay:V,duration:W,...F}=l(S,S.datum,k,D),_=N==null;i.animate({id:C,groupId:t,phase:I??G??"update",duration:w??W,delay:O??V,from:R,to:F,ease:_u,collapsable:_,onPlay:()=>{const z={...L,...B,...R};c(S,z,"start")},onUpdate(z){c(S,z,"update")},onStop:()=>{const z={...L,...B,...R,...F,...N,...P};c(S,z,"end")}}),M&&m++,b++,x=R}};let p=0;for(const g of d){const f=g.nodes(),x=f.filter(m=>!g.isGarbage(m));u(x,f),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:_u,onStop(){g.cleanup()}}),p++}u(h,h)}function Ya(t,e,i,s,n,o,a){const{nodes:r,selections:l}=iy(s),{start:c,finish:h,phase:d}=a;i.animate({id:`${t}_${e}`,groupId:t,phase:d??"update",from:n,to:o,ease:_u,onPlay:()=>{if(c){for(const u of r)u.setProperties(c);for(const u of l)for(const p of u.nodes())p.setProperties(c)}},onUpdate(u){for(const p of r)p.setProperties(u);for(const p of l)for(const g of p.nodes())g.setProperties(u)},onStop:()=>{for(const u of r)u.setProperties({...o,...h});for(const u of l){for(const p of u.nodes())p.setProperties({...o,...h});u.cleanup()}}})}function sW(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var OL={};ho(OL,{resetMotion:()=>Fi});function Fi(t,e){const{nodes:i,selections:s}=iy(t);for(const n of s){for(const o of n.nodes()){const a=e(o,o.datum);o.setProperties(a)}n.cleanup()}for(const n of i){const o=e(n,n.datum);n.setProperties(o)}}var Yv="color: green",Kv="color: grey";function nW(){return uk(()=>{})}function $v(t,e){const i=Br(e);if(i.length===0)return;const s=pk(t);for(const n of i)n in s&&(e[n]=s[n])}var EL=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},Xv=class an extends EL{constructor(e,i,s){super(),this.defaultState=e,this.states=i,this.enterEach=s,this.debug=qt.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,Yv)}transition(e,i){if(!this.transitionChild(e,i)||this.state===an.child||this.state===an.parent)return;const n=this.state,o=this.states[this.state];let a=o[e];const r=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(a))a=a.find(h=>{if(!h.guard)return!0;const d=h.guard(i);return d||this.debug(`${r} (guarded)`,h.target,Kv),d});else if(typeof a=="object"&&!(a instanceof an)&&a.guard&&!a.guard(i)){this.debug(`${r} (guarded)`,a.target,Kv);return}if(!a){this.debug(`${r} ${this.state}`,Kv);return}const l=this.getDestinationState(a),c=l===this.state?void 0:o.onExit;this.debug(`${r} ${l}`,Yv),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof an)&&a.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==an.child&&l!==an.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===an.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!==an.child||!this.childState||($v(this,this.childState),this.childState.transition(e,i),!this.childState.is(an.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,Yv),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 an?(this.childState=e,this.childState.parent=this,i=an.child):typeof e=="object"&&(e.target instanceof an?(this.childState=e.target,this.childState.parent=this,i=an.child):e.target!=null&&(i=e.target)),i}};Xv.child="__child",Xv.parent="__parent";var Qu=Xv,oW=class extends EL{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)$v(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)$v(this,i),i.transitionAsync(t,e)}},Zv=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=Ti(t)?t:t.optionsKey;this.moduleMap.get(e)?.moduleInstance.destroy(),this.moduleMap.delete(e)}getModule(t){return this.moduleMap.get(Ti(t)?t:t.optionsKey)?.moduleInstance}isEnabled(t){return this.moduleMap.has(Ti(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()}},ai=class Ch{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=qt.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Pa,i)?()=>new i:i}static select(e,i,s=!0){return new Ch(e,i,s)}static selectAll(e,i){const s=[],n=o=>{i(o)&&s.push(o);for(const a of o.children())n(a)};return n(e),s}static selectByClass(e,...i){return Ch.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return Ch.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((o,a)=>[s(o),[o,a]]));for(const[o,a]of this._nodesMap.entries())if(n.has(a)){const[r]=n.get(a);o.datum=r,this.garbageBin.delete(o),n.delete(a)}else this.garbageBin.add(o);for(const[o,[a,r]]of n.entries())this._nodesMap.set(this.createNode(a,i,r),o)}else{const n=Math.max(e.length,this.data.length);for(let o=0;o<n;o++)o>=e.length?this.garbageBin.add(this._nodes[o]):o>=this._nodes.length?this.createNode(e[o],i):(this._nodes[o].datum=e[o],this.garbageBin.delete(this._nodes[o]))}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 Ch.selectAll(this.parentNode,e)}selectByClass(e){return Ch.selectByClass(this.parentNode,e)}selectByTag(e){return Ch.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}},pn=class extends Bn{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 pt(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:o}=this;return Eu(t,e,i,s,n,o,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;let{x1:s,y1:n,x2:o,y2:a}=this;if(s===o){const{strokeWidth:r}=this,l=Math.round(s*i)/i+Math.trunc(r*i)%2/(i*2);s=l,o=l}else if(n===a){const{strokeWidth:r}=this,l=Math.round(n*i)/i+Math.trunc(r*i)%2/(i*2);n=l,a=l}e.beginPath(),e.moveTo(s,n),e.lineTo(o,a),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=Bi("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]}}};pn.className="Line",pn.defaultStyles={...Bn.defaultStyles,fill:void 0,strokeWidth:1},v([gt()],pn.prototype,"x1",2),v([gt()],pn.prototype,"y1",2),v([gt()],pn.prototype,"x2",2),v([gt()],pn.prototype,"y2",2);var bo=class extends Bn{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 pt(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:o}=this;i=this.align(i),s=this.align(s),n=this.align(n),o=this.align(o);const{fill:a,opacity:r,isRange:l}=this;if(!!(l&&a)){const{fillOpacity:f}=this;this.applyFill(e),e.globalAlpha=r*f,e.beginPath(),e.moveTo(i,s),e.lineTo(n,s),e.lineTo(n,o),e.lineTo(i,o),e.closePath(),e.fill()}const{stroke:h,strokeWidth:d,startLine:u,endLine:p}=this;if(!!((u||p)&&h&&d)){const{strokeOpacity:f,lineDash:x,lineDashOffset:m,lineCap:b,lineJoin:S}=this;this.applyStroke(e),e.globalAlpha=r*f,e.lineWidth=d,x&&e.setLineDash(x),m&&(e.lineDashOffset=m),b&&(e.lineCap=b),S&&(e.lineJoin=S),e.beginPath(),u&&(e.moveTo(i,s),e.lineTo(n,s)),p&&(e.moveTo(n,o),e.lineTo(i,o)),e.stroke()}this.fillShadow?.markClean(),super.render(t)}};bo.className="Range",bo.defaultStyles={...Bn.defaultStyles,strokeWidth:1},v([gt()],bo.prototype,"x1",2),v([gt()],bo.prototype,"y1",2),v([gt()],bo.prototype,"x2",2),v([gt()],bo.prototype,"y2",2),v([gt()],bo.prototype,"startLine",2),v([gt()],bo.prototype,"endLine",2),v([gt()],bo.prototype,"isRange",2);var Ni=class extends kt{constructor(){super(...arguments),this.enabled=!0}getFont(){return De.toFontString(this)}};v([A(xt)],Ni.prototype,"enabled",2),v([A(zt,{optional:!0})],Ni.prototype,"color",2),v([A(za,{optional:!0})],Ni.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],Ni.prototype,"fontWeight",2),v([A(ot)],Ni.prototype,"fontSize",2),v([A(et)],Ni.prototype,"fontFamily",2),v([A(Ls,{optional:!0})],Ni.prototype,"formatter",2);function hy(t){const{parallelFlipRotation:e=0,regularFlipRotation:i=0}=t,s=t.rotation?me(Me(t.rotation)):0,n=!s&&e>=0&&e<=Math.PI?-1:1,o=!s&&i>=0&&i<=Math.PI?-1:1;let a=0;return t.parallel?a=n*Math.PI/2:o===-1&&(a=Math.PI),{configuredRotation:s,defaultRotation:a,parallelFlipFlag:n,regularFlipFlag:o}}function aW(t,e){return t??(e?0:10)}function rW(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}function RL(t,e,i,s,n){const o=e>0&&e<=Math.PI,a=i>0&&i<=Math.PI,r=o||a?-1:1;if(t)if(e||i){if(s*r===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function lW(t,e,i,s){const n=[];for(const{tickLabel:o,translationY:a}of t){if(!o)continue;const{width:r,height:l}=s.measureLines(o),c=new pt(e,a,r,l),h=new pt(e,a,0,0);i.transformBBox(h,c);const{x:d,y:u}=c;n.push({point:{x:d,y:u},label:{text:o,width:r,height:l}})}return n}function cW(t){return t!=null&&Object.hasOwn(t,"toString")&&Ti(t.toString())}function hW(t){return t!=null&&Object.hasOwn(t,"valueOf")&&Pt(t.valueOf())}function dy(t){return Pt(t)||Er(t)||hW(t)}function dW(t,e){return t!=null&&(!e||dy(t))}function Qv(t){return cW(t)&&Object.hasOwn(t,"id")?t.id:t}var qv=t=>t==="value"?ce((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'"):ce((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 PL(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function BL(t,e){if(t==null)return!1;const i=he.is(e)||Ua.is(e),s=n=>dW(n,i)&&!isNaN(e.convert(n));if(wt(t)){const[n,o]=t;return s(n)&&s(o)}else return s(t)}var uW={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}},pW={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 Jv({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?uW:pW,{xTranslationDirection:o,yTranslationDirection:a}=n[i],r=o*(e+s.width/2),l=a*(e+s.height/2);return{xTranslation:r,yTranslation:l}}function zL({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 uy=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},FL=({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},_L=({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},GL=({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},gW=({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2}),VL=({direction:t,xStart:e,xEnd:i,yStart:s})=>t==="y"?{x:e/2,y:s}:{x:i,y:s},jL=({direction:t,xStart:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},WL=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},HL=({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},UL={top:{c:uy},bottom:{c:GL},left:{c:FL},right:{c:_L},"top-left":{c:VL},"top-right":{c:WL},"bottom-left":{c:jL},"bottom-right":{c:HL},inside:{c:gW},"inside-left":{c:FL},"inside-right":{c:_L},"inside-top":{c:uy},"inside-bottom":{c:GL},"inside-top-left":{c:VL},"inside-bottom-left":{c:jL},"inside-top-right":{c:WL},"inside-bottom-right":{c:HL}},fW=le(["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"),_n=class extends kt{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};v([A(xt,{optional:!0})],_n.prototype,"enabled",2),v([A(et,{optional:!0})],_n.prototype,"text",2),v([A(za,{optional:!0})],_n.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],_n.prototype,"fontWeight",2),v([A(ot)],_n.prototype,"fontSize",2),v([A(et)],_n.prototype,"fontFamily",2),v([A(Et)],_n.prototype,"padding",2),v([A(zt,{optional:!0})],_n.prototype,"color",2),v([A(fW,{optional:!0})],_n.prototype,"position",2),v([A(Et,{optional:!0})],_n.prototype,"rotation",2),v([A(xt,{optional:!0})],_n.prototype,"parallel",2);var Os=class extends kt{constructor(){super(),this.id=hn(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new _n,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 bo,this.crossLineLabel=new _h,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()||!BL(PL(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 o=i==="range";o!==this._isRange&&(o?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=o}calculateLayout(t,e){if(!t)return;const{type:i,range:s,value:n,scale:o,gridLength:a,sideFlag:r,direction:l,label:{position:c="top"},clippedRange:h,strokeWidth:d=0}=this;if(this.data=void 0,!o)return;const u=o.bandwidth??0,p=o.step??0,g=(e?-1:1)*(o instanceof Hu?(p-u)/2:0),[f,x]=[0,r*a];let m,b,S,M;if(i==="line"){const L=u/2;m=o.convert(n)+L,b=NaN,S=o.convert(n,!0)+L,M=NaN}else if(s){const[L,N]=s,O=L?.valueOf()===N?.valueOf()&&Ua.is(o)?u/2+g:0;m=o.convert(L)+O,b=o.convert(N)+u,S=o.convert(L,!0)+O-g,M=o.convert(N,!0)+u+g}else return;S=Ov(S,h),M=Ov(M,h);const D=(m===S||b===M||S!==M)&&Math.abs(M-S)>0;if(D&&S>M&&([S,M]=[M,S],[m,b]=[b,m]),m-g>=S&&(m-=g),b+g<=M&&(b+=g),this.startLine=d>0&&m>=S&&m<=S+g,this.endLine=d>0&&b>=M-u-g&&b<=M,i==="range"&&!D&&!this.startLine&&!this.endLine||(this.data=[S,M],this.label.enabled===!1||!this.label.text))return;const{c:C=uy}=UL[c]??{},{x:k,y:I}=C({direction:l,xStart:f,xEnd:x,yStart:S,yEnd:M});this.labelPoint={x:k,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:o,endLine:a,fill:r,fillOpacity:l,stroke:c,strokeWidth:h,lineDash:d}=this;e.x1=0,e.x2=i*s,e.y1=n?.[0]??0,e.y2=n?.[1]??0,e.startLine=o,e.endLine=a,e.isRange=t==="range",e.fill=r,e.fillOpacity=l??1,e.stroke=c,e.strokeWidth=h??1,e.strokeOpacity=this.strokeOpacity??1,e.lineDash=d}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:o="top",padding:a=0},direction:r,parallelFlipRotation:l,regularFlipRotation:c}=this;if(e===void 0||i===void 0)return;const{defaultRotation:h,configuredRotation:d}=hy({rotation:n,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});t.rotation=h+d,t.textBaseline="middle",t.textAlign="center";const u=t.getBBox();if(!u)return;const p=r==="y",{xTranslation:g,yTranslation:f}=Jv({yDirection:p,padding:a,position:o,bbox:u});t.translationX=e+g,t.translationY=i+f}computeLabelBBox(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new _h;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:o,position:a="top",padding:r=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(i===void 0||s===void 0)return;const{configuredRotation:d}=hy({rotation:o,parallel:n,regularFlipRotation:h,parallelFlipRotation:c});e.rotation=d,e.textBaseline="middle",e.textAlign="center";const u=e.getBBox();if(!u)return;const p=l==="y",{xTranslation:g,yTranslation:f}=Jv({yDirection:p,padding:r,position:a,bbox:u});return e.x=i+g,e.y=s+f,e.getBBox()}calculatePadding(t){const{data:e,direction:i,label:{padding:s=0,position:n="top"}}=this;if(e==null)return;const o=this.computeLabelBBox();if(o?.x==null||o?.y==null)return;const a=zL({yDirection:i==="y",padding:s,position:n,bbox:o});t.left=Math.max(t.left??0,a.left??0),t.right=Math.max(t.right??0,a.right??0),t.top=Math.max(t.top??0,a.top??0),t.bottom=Math.max(t.bottom??0,a.bottom??0)}};Os.className="CrossLine",v([A(xt,{optional:!0})],Os.prototype,"enabled",2),v([A(le(["range","line"],"a crossLine type"))],Os.prototype,"type",2),v([A(_r(qv("range"),Jl.restrict({length:2})),{optional:!0})],Os.prototype,"range",2),v([A(qv("value"),{optional:!0})],Os.prototype,"value",2),v([A(Gr)],Os.prototype,"defaultColorRange",2),v([A(zt)],Os.prototype,"fill",2),v([A(ae,{optional:!0})],Os.prototype,"fillOpacity",2),v([A(zt,{optional:!0})],Os.prototype,"stroke",2),v([A(Et,{optional:!0})],Os.prototype,"strokeWidth",2),v([A(ae,{optional:!0})],Os.prototype,"strokeOpacity",2),v([A(ta,{optional:!0})],Os.prototype,"lineDash",2),v([A(at)],Os.prototype,"label",2);var yW=["stroke","lineDash"],mW=ki(t=>Rt(t)&&Object.keys(t).every(e=>yW.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),py=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};v([A(xt)],py.prototype,"enabled",2),v([A(ot)],py.prototype,"width",2),v([A(mW)],py.prototype,"style",2);var YL=ce(t=>Pt(t)&&t>0||t instanceof oc,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),hc=class extends kt{};v([A(YL,{optional:!0})],hc.prototype,"step",2),v([A(Jl,{optional:!0})],hc.prototype,"values",2),v([A(Ck,{optional:!0})],hc.prototype,"minSpacing",2),v([A(Lk,{optional:!0})],hc.prototype,"maxSpacing",2);var wi=class extends kt{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 De.toFontString(this)}};v([A(xt)],wi.prototype,"enabled",2),v([A(za,{optional:!0})],wi.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],wi.prototype,"fontWeight",2),v([A(Et.restrict({min:1}))],wi.prototype,"fontSize",2),v([A(et)],wi.prototype,"fontFamily",2),v([A(ot)],wi.prototype,"spacing",2),v([A(Of,{optional:!0})],wi.prototype,"minSpacing",2),v([A(zt,{optional:!0})],wi.prototype,"color",2),v([A(Et,{optional:!0})],wi.prototype,"rotation",2),v([A(xt)],wi.prototype,"avoidCollisions",2),v([A(xt)],wi.prototype,"mirrored",2),v([A(xt)],wi.prototype,"parallel",2),v([A(Ls,{optional:!0})],wi.prototype,"itemStyler",2),v([A(Ls,{optional:!0})],wi.prototype,"formatter",2),v([A(et,{optional:!0})],wi.prototype,"format",2);var gy=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};v([A(xt)],gy.prototype,"enabled",2),v([A(ot)],gy.prototype,"width",2),v([A(zt,{optional:!0})],gy.prototype,"stroke",2);var Jh=class extends kt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};v([A(xt)],Jh.prototype,"enabled",2),v([A(ot)],Jh.prototype,"width",2),v([A(ot)],Jh.prototype,"size",2),v([A(zt,{optional:!0})],Jh.prototype,"stroke",2);var So=class extends kt{constructor(){super(...arguments),this.caption=new Ae,this.enabled=!1,this.spacing=Ae.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};v([A(xt)],So.prototype,"enabled",2),v([A(et,{optional:!0})],So.prototype,"text",2),v([A(ot,{optional:!0})],So.prototype,"spacing",2),v([A(za,{optional:!0})],So.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],So.prototype,"fontWeight",2),v([A(ot)],So.prototype,"fontSize",2),v([A(et)],So.prototype,"fontFamily",2),v([A(zt,{optional:!0})],So.prototype,"color",2),v([A(Bf)],So.prototype,"wrapping",2),v([A(Ls,{optional:!0})],So.prototype,"formatter",2);var KL=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(KL||{});function fy(t){const[e,i]=oi(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var t0=Math.PI*2,xW=t0/2;function bW(t,e){return Math.abs(e-t)<xW?e:t>e?e+t0:e-t0}function $L(t){const e=(a,r)=>{const[l=t.min,c=t.max]=oi(r??[]);return a<l||a>c};return{tick:{fromFn(a,r,l){let c=a.y1+a.translationY,h=a.opacity;return(l==="added"||e(a.datum.translationY,a.datum.range))&&(c=r.translationY,h=0),{y:0,translationY:c,opacity:h,phase:xo[l]}},toFn(a,r,l){const c=r.translationY;let h=1;return l==="removed"&&(h=0),{y:0,translationY:c,opacity:h,finish:{y:c,translationY:0}}},applyFn(a,r){a.setProperties(r),a.visible=!e(a.y)}},line:{fromFn(a,r){return{...a.previousDatum??r,phase:xo.updated}},toFn(a,r){return{...r}}},label:{fromFn(a,r,l){const c=a.previousDatum??r,h=c.x,d=c.y,u=c.rotationCenterX;let p=Math.round(a.translationY),g=c.rotation,f=a.opacity;return l==="removed"||e(c.y,c.range)?g=r.rotation:(l==="added"||e(a.datum.y,a.datum.range))&&(p=Math.round(c.translationY),f=0,g=r.rotation),{x:h,y:d,rotationCenterX:u,translationY:p,rotation:g,opacity:f,phase:xo[l]}},toFn(a,r,l){const c=r.x,h=r.y,d=r.rotationCenterX,u=Math.round(r.translationY);let p=0,g=1;return l==="added"?p=r.rotation:l==="removed"?(g=0,p=r.rotation):p=bW(a.previousDatum?.rotation??r.rotation,r.rotation),{x:c,y:h,rotationCenterX:d,translationY:u,rotation:p,opacity:g,finish:{rotation:r.rotation}}}},group:{fromFn(a,r){const{rotation:l,translationX:c,translationY:h}=a;return{rotation:l,translationX:c,translationY:h,phase:xo.updated}},toFn(a,r){const{rotation:l,translationX:c,translationY:h}=r;return{rotation:l,translationX:c,translationY:h}}}}}function XL(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function e0(t){const{visible:e,min:i,max:s}=t;return(n,o)=>{const a=o.translationY,r=e&&a>=i&&a<=s;return{y:a,translationY:0,opacity:1,visible:r}}}function i0(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function ZL(){return(t,e)=>({...e})}var yy=class extends ec(pn){},QL=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(QL||{}),Ka=class x_{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id=hn(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new hc,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 Pu({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 Pu({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new It({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Pu({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new Pu({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new Pu({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLineGroupSelection=ai.select(this.tickLineGroup,yy,!1),this.tickLabelGroupSelection=ai.select(this.tickLabelGroup,_h,!1),this.gridLineGroupSelection=ai.select(this.gridLineGroup,yy,!1),this._crossLines=[],this.line=new gy,this.tick=new Jh,this.gridLine=new py,this.label=this.createLabel(),this.defaultTickMinSpacing=x_.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 So,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._scaleNiceDomainInputDomain=void 0,this._scaleNiceDomainRangeExtent=NaN,this.moduleMap=new Zv,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]),o=n*i[0],a=e[0]-o;s.range=[a,a+n],this.crossLines.forEach(r=>{r.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]=oi(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]),[o,a]=oi([i[0]-n*s[0],i[0]-n*s[0]+n]);return e<o?e-o:e>a?e-a:0}defaultDatumFormatter(e,i){return Wa(e,i+1)}defaultLabelFormatter(e,i){return Wa(e,i)}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new wi}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]=oi(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 o;s.itemStyler&&(o=this.moduleCtx.callbackCache.call(this,s.itemStyler,{...e,...n}));const{color:a,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,spacing:d}=jt(o,i,n);return{fill:a,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,spacing:d}}getTickSize(){return this.tick.enabled?this.tick.size:0}processData(){const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,o=(e?i:i.filter(a=>a.isEnabled())).map(a=>a.getDomain(s));this.setDomains(...o)}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:o}=this;this.updateScale();const a=Uh(this.range),r=this.dataDomain.domain;let l;n[0]===0&&n[1]===1?l=void 0:o?this._scaleNiceDomainInputDomain===r&&this._scaleNiceDomainRangeExtent===a?l=this.scale.domain:l=this.calculateTickLayout(r,0,[0,1]).niceDomain:l=r;let c;o?l==null?c=0:c=1:c=2;const{niceDomain:h,primaryTickCount:d,ticks:u,tickDomain:p,fractionDigits:g,bbox:f}=this.calculateTickLayout(l??r,c,n,e);this.scale.domain=h,this._scaleNiceDomainInputDomain=o?r:void 0,this._scaleNiceDomainRangeExtent=o?a:NaN;const x=s.format;this.labelFormatter=i.tickFormatter({domain:p,specifier:x,ticks:u,fractionDigits:g})??(C=>this.defaultLabelFormatter(C,g)),this.datumFormatter=i.datumFormatter({domain:p,specifier:x,ticks:u,fractionDigits:g})??(C=>this.defaultDatumFormatter(C,g)),this.scaleFormatterParams={domain:p,ticks:u,fractionDigits:g},this.layout.label={fractionDigits:g,spacing:this.label.spacing,format:this.label.format};const m=s.getSideFlag(),b=this.isAnySeriesActive(),{rotation:S,parallelFlipRotation:M,regularFlipRotation:D}=this.calculateRotations();return this.crossLines.forEach(C=>{var k;C.sideFlag=-m,C.direction=S===-Math.PI/2?"x":"y",C instanceof Os&&((k=C.label).parallel??(k.parallel=s.parallel)),C.parallelFlipRotation=M,C.regularFlipRotation=D,C.calculateLayout?.(b,this.reverse)}),{primaryTickCount:d,bbox:f}}getTransformBox(e){const i=new po,{rotation:s,translationX:n,translationY:o}=this.getAxisTransform();return po.updateTransformMatrix(i,1,1,s,n,o),i.transformBBox(e)}calculateRotations(){const e=Me(this.rotation),i=me(e),s=me(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,o)=>{n.strokeWidth=o.tickWidth??e.width,n.stroke=o.tickStroke??e.stroke,n.x1=s*(o.tickSize??this.getTickSize()),n.x2=0})}getAxisTransform(){return{rotation:Me(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:o}=this,{rotation:a}=this.calculateRotations(),r=Math.floor(o.x),l=Math.floor(o.y);e.setProperties({rotation:a,translationX:r,translationY:l}),i.setProperties({rotation:a,translationX:r,translationY:l}),s.setProperties({rotation:a,translationX:r,translationY:l}),n.setProperties({rotation:a,translationX:r,translationY:l})}updateGridLines(){const e=this.label.getSideFlag(),{gridLine:{style:i,width:s},gridPadding:n,gridLength:o}=this;o===0||i.length===0||this.gridLineGroupSelection.each((a,r,l)=>{const{stroke:c,lineDash:h}=i[l%i.length];a.setProperties({x1:n,x2:-e*o+n,stroke:c,strokeWidth:s,lineDash:h})})}formatTick(e,i,s,n,o){const{labelFormatter:a,label:{formatter:r},moduleCtx:{callbackCache:l}}=this;let c;if(r){const h=this.getFormatterBoundSeries();c=l.call(this,r,{value:e,index:i,domain:s,fractionDigits:n,boundSeries:h})}else o?c=o(e):a&&(c=a(e));return String(c??e)}formatDatum(e){const{label:{formatter:i},moduleCtx:{callbackCache:s},datumFormatter:n=this.labelFormatter}=this;let o;if(i){const{domain:a}=this.scale,r=this.getFormatterBoundSeries();o=s.call(this,i,{value:e,index:NaN,domain:a,boundSeries:r})}else n?o=s.call(this,n,e):wt(e)&&(o=e.filter(Boolean).join(" - "));return String(o??e)}getScaleValueFormatter(e){const{scaleFormatterParams:i}=this;let s;try{e!=null&&i!=null&&(s=this.scale.tickFormatter({...i,specifier:e}))}catch{$.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 pt(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new pt(e,i,s,n))}getFormatterBoundSeries(){const{direction:e}=this,i=[];for(const s of this.boundSeries){const n=s.getKeys(e),o=s.getNames(e);for(let a=0;a<n.length;a++)i.push({key:n[a],name:o[a]})}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:he.is(e)||Ua.is(e),getCanvasBounds:()=>Be.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(o=>i.add(o)),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}};Ka.defaultTickMinSpacing=50,Ka.CrossLineConstructor=Os,v([A(xt)],Ka.prototype,"nice",2),v([A(xt)],Ka.prototype,"reverse",2),v([A(Ik)],Ka.prototype,"keys",2),v([A(at)],Ka.prototype,"interval",2),v([A(at)],Ka.prototype,"title",2),v([Hr((t,e,i)=>t.onGridLengthChange(e,i))],Ka.prototype,"gridLength",2);var s0=Ka;function SW(t,e,i){let[s,n]=oi(t);s=vW(Math.floor(s),n,e);const o=DW(s,n,e),a=e-1;n=s+a*o;const r=i?[n,s]:[s,n],l=MW(s,o,e);return{domain:r,ticks:l}}function vW(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return Math.floor(t/o)*o}function MW(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,o=Math.pow(10,n),a=[];for(let r=0;r<i;r++){const l=t+e*r;a[r]=Math.round(l*o)/o}return a}function DW(t,e,i){const s=i-1,n=(e-t)/s;return AW(n)}function AW(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 n0(){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 qL=class{constructor(t){this.axis=t}estimateTickCount(t,e,i){return uL(Uh(this.axis.range),Uh(t),e,i,he.defaultTickCount,this.axis.defaultTickMinSpacing)}filterTicks(t,e){const{minSpacing:i,maxSpacing:s}=this.axis.interval,o=i!=null||s!=null?Math.ceil(t.length/e):2,a=t.length%o?-1:0;return t.filter((r,l)=>(l+a)%o===0)}generateTicks({domain:t,primaryTickCount:e,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:o,labelX:a,sideFlag:r}){const{scale:l,label:c,interval:{minSpacing:h,maxSpacing:d}}=this.axis,{parallel:u,rotation:p,fontFamily:g,fontSize:f,fontStyle:x,fontWeight:m}=c,b=e!==void 0,{defaultRotation:S,configuredRotation:M,parallelFlipFlag:D,regularFlipFlag:C}=hy({rotation:p,parallel:u,regularFlipRotation:o,parallelFlipRotation:n}),k=M+S,I=new po,{maxTickCount:L}=this.estimateTickCount(i,h,d),O=!(he.is(l)||Ua.is(l))||isNaN(L)?10:L;let w=RL(u,M,0,r,C);const R=rW(u,M,r,D),G=De.toFontString({fontFamily:g,fontSize:f,fontStyle:x,fontWeight:m}),B=Va.getMeasurer({font:G}),P={fontFamily:g,fontSize:f,fontStyle:x,fontWeight:m,textBaseline:R,textAlign:w},V=c.enabled&&c.avoidCollisions,W=({ticks:q},Q)=>{if(!V)return!1;const tt=M!==0||Q!==0,X=k+Q,it=aW(c.minSpacing,tt);po.updateTransformMatrix(I,1,1,X,0,0);const nt=lW(q,a,I,B);return T3(nt,it)};let F={tickDomain:[],ticks:[],rawTicks:[],fractionDigits:0,niceDomain:void 0},_=0,z=0,U=!0,Y=!1;for(;!Y&&U&&_<=O;){z=0;for(const q of this.getTickStrategies({domain:t,niceMode:s,secondaryAxis:b,index:_}))({tickData:F,index:_,autoRotation:z,terminate:Y}=q({index:_,tickData:F,textProps:P,terminate:Y,primaryTickCount:e,visibleRange:i,get labelOverlap(){return W(F,z)}}));U=W(F,z)}w=RL(u,M,z,r,C);const Z=S+M+z;return!b&&F.rawTicks.length>0&&(e=F.rawTicks.length),{tickData:F,primaryTickCount:e,combinedRotation:Z,textBaseline:R,textAlign:w}}getTickStrategies({domain:t,niceMode:e,index:i,secondaryAxis:s}){const{scale:n,label:o,interval:a}=this.axis,{minSpacing:r}=a,l=he.is(n)||Ua.is(n),c=o.enabled&&o.avoidCollisions,h=!l&&i!==0&&c,d=o.autoRotate===!0&&o.rotation===void 0,u=[];let p;a.values?p=3:s?p=1:h?p=2:p=0;const g=({index:f,tickData:x,primaryTickCount:m,visibleRange:b,terminate:S})=>this.createTickData(t,e,b,m,p,f,x,S);if(u.push(g),!l&&r!=null){const f=({index:x,tickData:m,primaryTickCount:b,visibleRange:S,terminate:M})=>this.createTickData(t,e,S,b,2,x,m,M);u.push(f)}if(c&&d){const f=({index:x,tickData:m,labelOverlap:b,terminate:S})=>({index:x,tickData:m,autoRotation:b?me(Me(o.autoRotateAngle??0)):0,terminate:S});u.push(f)}return u}createTickData(t,e,i,s,n,o,a,r){const{scale:l,interval:c}=this.axis,{step:h,values:d,minSpacing:u,maxSpacing:p}=c,{maxTickCount:g,minTickCount:f,tickCount:x}=this.estimateTickCount(i,u,p),m=he.is(l)||Ua.is(l),b=!m||isNaN(g)?10:g,S=D=>m?Math.max(x-D,f):g,M=h==null&&d==null&&S(o)>f&&(m||n===2);for(;o<=b;){const D=a.rawTicks;if(a=this.getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:n,previousTicks:D,minTickCount:f,maxTickCount:g,primaryTickCount:s,tickCount:S(o)}),o++,!M||!Xo(a.rawTicks,D))break}return r||(r=h!=null||d!=null),{tickData:a,index:o,autoRotation:0,terminate:r}}getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:s,previousTicks:n,tickCount:o,minTickCount:a,maxTickCount:r,primaryTickCount:l}){const{axis:c}=this,{label:h,range:d,scale:u,interval:p}=c,g=n0(),f={nice:e===0,interval:p.step,tickCount:o,minTickCount:a,maxTickCount:r},x={...f,nice:e===0||e===1};let m=e===0?u.niceDomain(f,t):t,b=m,S;switch(s){case 3:if(b=p.values,S=p.values,he.is(u)){const[N,O]=oi(m.map(Number));S=S.filter(w=>Number(w)>=N&&Number(w)<=O).sort((w,R)=>Number(w)-Number(R))}break;case 1:if(he.is(u)){const N=SW(t.map(Number),l??0,c.reverse);S=N.ticks,m=N.domain.map(O=>u.toDomain(O))}else S=u.ticks(x,m,i)??[];break;case 2:S=this.filterTicks(n,o);break;default:S=u.ticks(x,m,i)??[]}const M=S.reduce((N,O)=>Math.max(N,typeof O=="number"?Au(O):0),0),D={domain:b,ticks:S,fractionDigits:M,specifier:h.format},C=u.tickFormatter(D),k=u.domain;u.domain=m;const I=(u.bandwidth??0)/2,L=[];for(let N=0;N<S.length;N++){const O=S[N],w=u.convert(O)+I;if(d.length>0&&!c.inRange(w,.001))continue;const R=h.enabled?c.formatTick(O,N,m,M,C):"";L.push({tick:O,tickId:g(R),tickLabel:R,translationY:Math.floor(w)})}return u.domain=k,{tickDomain:b,rawTicks:S,fractionDigits:M,ticks:L,niceDomain:m}}},o0=class extends wi{constructor(){super(...arguments),this.autoRotateAngle=335}};v([A(xt,{optional:!0})],o0.prototype,"autoRotate",2),v([A(Et)],o0.prototype,"autoRotateAngle",2);var a0=class b_ extends s0{constructor(e,i){super(e,i),this.lineNode=this.axisGroup.appendChild(new yy({name:`${this.id}-Axis-line`,zIndex:1})),this.tempText=new _h({debugDirty:!1}),this.tempCaption=new Ae,this.tickGenerator=new qL(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new Qu("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 o=[n.chart.width,n.chart.height];s!=null&&!Xo(o,s)&&this.animationState.transition("resize"),s=o}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof b_}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 o0}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 o=this.label.getSideFlag(),{parallelFlipRotation:a,regularFlipRotation:r}=this.calculateRotations(),l=o*(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:a,regularFlipRotation:r,labelX:l,sideFlag:o}),{tickData:h,primaryTickCount:d=n}=c,{ticks:u,tickDomain:p,rawTicks:g,fractionDigits:f,niceDomain:x=e}=h,m=u.map(S=>this.getTickLabelProps(S,c)),b=this.tickBBox(p,u,m);return this.generatedTicks={ticks:u,labels:m},{ticks:g,tickDomain:p,niceDomain:x,primaryTickCount:d,fractionDigits:f,bbox:b}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.datum.tickId);if(super.update(),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:o}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const a=o.map(l=>l.tickId),r=mG(e,a);this.animationState.transition("update",r)}}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(),o=[],{x:a,y1:r,y2:l}=this.getAxisLineCoordinates(),c=new pt(a+Math.min(n*this.seriesAreaPadding,0),r,this.seriesAreaPadding,l-r);if(o.push(c),this.tick.enabled)for(const u of i){const{x1:p,x2:g,y:f}=this.getTickLineCoordinates(u),x=new pt(p,f,g-p,0);o.push(x)}const{tempText:h}=this;if(this.label.enabled)for(const u of s){if(!u.visible)continue;h.setProperties({...u,translationY:Math.round(u.translationY)});const p=h.getBBox();p&&o.push(p)}if(this.title?.enabled){const u=pt.merge(o).width;this.setTitleProps(this.tempCaption,{domain:e,spacing:u});const p=this.tempCaption.node.getBBox();p&&o.push(p)}const d=pt.merge(o);return this.getTransformBox(d)}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,o=(s.spacing??0)+i.spacing,a=this.label.getSideFlag(),r=me(this.rotation),l=a===-1&&r>Math.PI&&r<Math.PI*2?-1:1,c=l*a*Math.PI/2,h=l===1?"bottom":"top",{range:d}=this,u=Math.floor(l*a*(d[0]+d[1])/2),p=Math.floor(a===-1?l*-o:-o),{callbackCache:g}=this.moduleCtx,{formatter:f=m=>m.defaultValue}=s,x=g.call(this,f,this.getTitleFormatterParams(i.domain));e.text=x,n.setProperties({visible:!0,text:x,textBaseline:h,x:u,y:p,rotation:c})}getTickLabelProps(e,i){const{combinedRotation:s,textBaseline:n,textAlign:o}=i,{range:a}=this.scale,r=e.tickLabel,c=this.label.getSideFlag()*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),h=r!==""&&r!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:s,rotationCenterX:c,translationY:e.translationY,text:r,textAlign:o,textBaseline:n,visible:h,x:c,y:0,range:a}}getTickLineCoordinates(e){const s=this.label.getSideFlag()*this.getTickSize(),n=Math.min(0,s),o=n+Math.abs(s),a=e.translationY;return{x1:n,x2:o,y:a}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{ticks:i,labels:s}=this.generatedTicks,n=o=>o.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:o,tickLabelGroup:a,lineNode:r}=this;n.enabled&&!i&&s==null&&(s=It.computeChildrenBBox([o,a,r]).width+(a.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=fy(this),n=$L(s);Fe(this.id,"axis-group",i,[this.axisGroup],n.group),Fe(this.id,"line",i,[this.lineNode],n.line),Fe(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(o,a)=>a.tickId,e),Fe(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(o,a)=>a.tickId,e)}resetSelectionNodes(){const e=fy(this);Fi([this.axisGroup],XL()),Fi([this.gridLineGroupSelection,this.tickLineGroupSelection],e0(e)),Fi([this.tickLabelGroupSelection],i0()),Fi([this.lineNode],ZL())}};v([A(ot,{optional:!0})],a0.prototype,"thickness",2),v([A($S)],a0.prototype,"position",2);var qu=a0,JL=["top","right","bottom","left"];function IW(t){return typeof t=="string"&&JL.includes(t)}function TW(t){const e=[],i=[],s=[...JL];for(const n of t)n instanceof qu&&(IW(n.position)?i.push(n.position):e.push(n));for(const n of e){let o;do o=s.pop();while(o&&i.includes(o));if(o==null)break;n.position=o}}var kW=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function CW(t,e,i){const s=(c,h,d)=>{const u=[c];for(const p of kW)p in h&&h[p]!=null&&u.push(`${p}=${h[p]}`);return d?.seriesGrouping&&u.push(`seriesGrouping.groupId=${d?.seriesGrouping.groupId}`),u.join(";")},n=new Map;let o=0;for(const c of t){const h=s(c.type,c.properties,i?.[o]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,o++])}const a=new Map;o=0;for(const c of e){const h=s(c.type,c,c);a.has(h)||a.set(h,[]),a.get(h)?.push([c,o++])}if(![...n.keys()].some(c=>a.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:a.keys()};const l=[];for(const[c,h]of a.entries())for(const[d,u]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:d,targetIdx:u,idx:u,status:"add"}),n.delete(c);continue}const[g,f]=p.shift(),x=i?.[f]??{},m=ea(x,d??{}),{groupIndex:b,stackIndex:S}=m?.seriesGrouping??{};b!=null||S!=null?l.push({opts:d,series:g,diff:m,targetIdx:u,idx:f,status:"series-grouping"}):m?l.push({opts:d,series:g,diff:m,targetIdx:u,idx:f,status:"update"}):l.push({opts:d,series:g,targetIdx:u,idx:f,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,d]of c)l.push({series:h,idx:d,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function $a(t){const{series:e}=t;return e?.[0]?.type??"line"}function r0(t){const e=$a(t);return Ce.isCartesian(e)||j3(e)}function tN(t){const e=$a(t);return Ce.isPolar(e)||W3(e)}function eN(t){const e=$a(t);return Ce.isHierarchy(e)||H3(e)}function iN(t){const e=$a(t);return Ce.isTopology(e)||U3(e)}function sN(t){const e=$a(t);return Ce.isFlowProportion(e)||Y3(e)}function l0(t){const e=$a(t);return Ce.isStandalone(e)||K3(e)}function c0(t){const e=$a(t);return Ce.isGauge(e)||$3(e)}function LW(t){const e=$a(t);return tN(t)&&e!=="pie"&&e!=="donut"}var NW=class extends Zv{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&Pn(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})}},h0="ag-charts-overlay",nN="ag-charts-dark-overlay",dc=class extends kt{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=Mt("div");n.innerHTML=s,this.content=n.firstElementChild}}else{const s=Mt("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}}};v([A(xt)],dc.prototype,"enabled",2),v([A(et,{optional:!0})],dc.prototype,"text",2),v([A(Ls,{optional:!0})],dc.prototype,"renderer",2);var td=class extends kt{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new dc("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new dc("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new dc("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new dc("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()}};v([A(xt)],td.prototype,"darkTheme",2),v([A(at)],td.prototype,"loading",2),v([A(at)],td.prototype,"noData",2),v([A(at)],td.prototype,"noVisibleSeries",2),v([A(at)],td.prototype,"unsupportedBrowser",2);function wW(t,e){const{animationDuration:i}=Gu.add,s=i*e,n=Mt("div",`${h0}--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`}),o=Mt("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"}),a=Mt("p",{marginTop:"1em"});a.innerText=t;const r=Mt("div",`${h0}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=Mt("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,o,a,r),n}var oN=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(oN||{}),aN=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(aN||{});function uc(t,e,i){if(uo(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(tc(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 o=t.width??t.height??i.width,a=t.height??t.width??i.height;return{type:"pattern",pattern:s,width:o,height:a,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 na(t,e,i){return!uo(t?.fill)&&!tc(t?.fill)?t:{...t,fill:uc(t.fill,e,i)}}function my(t,e,i,s){i==null||!uo(e)||e.bounds==null||e.bounds==="item"?t.fillBBox=void 0:t.fillBBox=i[e.bounds],t.fillParams=s}function pc(t,e,i,s,n){const o=i?.fill??e.fill;t.fill=o,my(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 rN=(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))(rN||{}),OW=.25,EW=.125,Ju=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}},d0=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},xy=class extends Zk{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=Ju,this.internalId=hn(this),this.contentGroup=new Ns({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Ns({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new Ns({name:`${this.internalId}-annotation`}),this.labelGroup=new Ns({name:`${this.internalId}-series-labels`}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Zv,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new ja,this._pickNodeCache=new uv;const{moduleCtx:e,pickModes:i,directionKeys:s={},directionNames:n={},canHaveAxes:o=!1,usesPlacedLabels:a=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=o,this.usesPlacedLabels=a,this.highlightGroup=new Ns({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 d0(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 o=(...a)=>{for(const r of a)Array.isArray(r)?o(...r):typeof r=="object"?o(...Object.values(r)):n.push(r)};return o(...s.map(a=>this.properties[a])),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:o,contentGroup:a}=this;if(!o||!a.visible||e==="highlight"&&!this.properties.highlight.enabled||e==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let r=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:u}=this.properties;r=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:u}=this.properties;r=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=t,d=JSON.stringify({x:c,y:h,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const g=this.pickNodesExactShape(t);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(t),f=g?.distance===0?this.pickNodesExactShape(t):void 0;f!=null&&f.length!==0?p={datums:f,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n!=null?this.pickNodeMainAxisFirst(t,n==="main-category"):void 0;p=g!=null?{datums:[g.datum],distance:g.distance}:void 0;break}}if(p&&p.distance<=r)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,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=Af(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,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=o!=null&&o===t.legendItemName;(s.id===this.id||r||a!=null)&&this.toggleSeriesItem(e,n,i,o,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:o}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=a!=null&&a===t.legendItemName;s.id===this.id||l||r!=null?this.toggleSeriesItem(!0,o,i,a,t):e&&n===1?this.toggleSeriesItem(!0,o,void 0,a):this.toggleSeriesItem(!1,o,void 0,a)}toggleSeriesItem(t,e,i,s,n){const o=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:o,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(a),this.ctx.legendManager.toggleItem(t,o,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,e,i=Wa){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,o){const{itemStyler:a,fillGradientDefaults:r,fillPatternDefaults:l}=t;let h=na(jt({size:n},o,t.getStyle()),r,l);if(a&&i){const d=this.ctx.callbackCache.call(this.properties,a,{seriesId:this.id,...h,...i,highlighted:s,datum:e});h=na(jt(d,h),r,l)}return h}updateMarkerStyle(t,e,i,s,n,o,a,r,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(t,i,n,o,s?.size,a),{shape:d,size:u}=h,p=this.visible&&u>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(pc(e,h,void 0,r),l?e.setProperties({visible:p,shape:d,size:u,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):e.setProperties({visible:p,shape:d,size:u}),c||(e.fillOpacity*=OW,e.strokeOpacity*=EW),typeof t.shape=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const g=e.getBBox();if(s!==void 0&&g.isFinite()){const f=g.computeCenter(),[x,m]=["x","y"].map(b=>(h.strokeWidth??0)+Math.abs(f[b]-s[b]));s.focusSize=Math.max(g.width+x,g.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=ea(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){$.error(String(n))}}callWithContext(t,...e){return Tv(this.properties,t,e)}};v([Hs({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],xy.prototype,"seriesGrouping",2);function Lt(t){const{changeCb:e,convertor:i}=t??{};return gt({type:"path",convertor:i,changeCb:e})}var Es=class extends Bn{constructor(){super(...arguments),this.path=new Bh,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 Bh),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=Bi("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};Es.className="Path",v([Lt()],Es.prototype,"clip",2),v([Lt()],Es.prototype,"clipX",1),v([Lt()],Es.prototype,"clipY",1);var RW=class{constructor(t){this.swapChain=t,this.hasBeenActivated=!1,this.div=Mt("div"),this.svg=Bi("svg"),this.outerPath=Bi("path"),this.innerPath=Bi("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=Mt("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 Es){const s=(o,a)=>{let{x:r,y:l}=Be.toCanvasPoint(t,o,a);return r-=e.x??0,l-=e.y??0,{x:r,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),o=Math.max(t.y-e.y,0),a=Math.min(t.x+t.width-e.x,e.width),r=Math.min(t.y+t.height-e.y,e.height);s=new pt(n,o,a-n,r-o)}else s=new pt(t.x-e.x,t.y-e.y,t.width,t.height);jf(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&&re().getComputedStyle(e).opacity==="1"}},PW=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=>(yo(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(yo(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),fe(this.label1,"id",`${i}-label1`),fe(this.label2,"id",`${i}-label2`),yo(this.label1,"display","none"),yo(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(s),this.inactiveAnnouncer=this.createAnnouncer(s),fe(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(t){const e=Mt("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],sc(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),sc(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},BW={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 zW(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 FW(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of ke(BW))if(zW(t,s))return{name:e,activatesFocusIndicator:i}}function _W(t,e,i){const s=Lv(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 pt){const{x:o,y:a}=n.computeCenter();return{x:e.x+o,y:e.y+a}}return Be.toCanvas(n).computeCenter()}}function GW({bounds:t}){return t instanceof pt?t:t!=null?Be.toCanvas(t):pt.NaN}function VW(t,e,i){const{x:s,y:n}=_W(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}function u0(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");$.warnOnce(i)}}function lN(t,e){const i=u0(),s=e?.default;return Ba((n,o,a)=>(a!==s&&i(o.toString(),t),a))}function jW(t,e){const i=u0();return Ba((s,n,o)=>(o!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),GS(s,t,e?e(o):o)),Tf),(s,n)=>(i(n.toString(),`Use [${t}] instead.`),wh(s,t)))}function cN(t,e,i,s){let{top:n,right:o,bottom:a,left:r,width:l,height:c}=s;return r!=null?l!=null?o=i.width-r+l:o!=null&&(l=i.width-r-o):o!=null&&l!=null&&(r=i.width-o-l),n!=null?c!=null?a=i.height-n-c:a!=null&&(c=i.height-a-n):a!=null&&c!=null&&(n=i.height-a-c),l==null?c==null?(l=t,c=e):l=Math.ceil(t*c/e):c==null&&(c=Math.ceil(e*l/t)),r==null&&(o==null?r=Math.floor((i.width-l)/2):r=i.width-o-l),n==null&&(a==null?n=Math.floor((i.height-c)/2):n=i.height-c-a),{x:r,y:n,width:l,height:c}}var hN=.1,dN=200,uN=12,WW=.5,HW=class extends ja{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 o=.001,a=Math.ceil(n/(o*1e3))|0;let{x:r,y:l,vx:c,vy:h}=this;for(let d=0;d<a;d+=1){const u=r-t,p=l-e,g=-(dN*u+uN*c)/hN,f=-(dN*p+uN*h)/hN;c+=g*o,h+=f*o,r+=c*o,l+=h*o}Math.hypot(r-t,l-e)<WW?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=r,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})}},by=null;function tp(t){return t===""?"":(by??(by=Mt("div")),by.textContent=String(t),by.innerHTML.replace(/\n/g,"<br>"))}function ep(t,e){const{path:i,size:s}=t,{x:n,y:o}=t;i.clear();let a=!1;for(const[r,l]of e){const c=n+(r-.5)*s,h=o+(l-.5)*s;a?i.lineTo(c,h):i.moveTo(c,h),a=!0}i.closePath()}var UW={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){ep(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){ep(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,Me(130),Me(330)),t.arc(e+n,i-n,n,Me(220),Me(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){ep(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 o=s/2;t.clear(),t.moveTo(Ci(n,e-o),Ci(n,i-o)),t.lineTo(Ci(n,e+o),Ci(n,i-o)),t.lineTo(Ci(n,e+o),Ci(n,i+o)),t.lineTo(Ci(n,e-o),Ci(n,i+o)),t.closePath()},star({path:t,x:e,y:i,size:s}){const o=s/2,a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=e+Math.cos(h)*c,u=i+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},triangle(t){ep(t,[[.5,0],[1,.87],[0,.87]])}},ip=class extends Es{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,o=this.layerManager?.canvas?.pixelRatio??1,a=Oi.anchor(e),r={path:t,x:i-(a.x-.5)*n,y:s-(a.y-.5)*n,size:n,pixelRatio:o};t.clear(),typeof e=="string"?UW[e](r):typeof e=="function"&&e(r)}computeBBox(){const{x:t,y:e,size:i}=this,s=Oi.anchor(this.shape);return new pt(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)}};v([Lt()],ip.prototype,"shape",2),v([Lt()],ip.prototype,"x",2),v([Lt()],ip.prototype,"y",2),v([Lt({convertor:Math.abs})],ip.prototype,"size",2);var Oi=class extends zh(tv(ec(ip))){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 pN(t,e,i=e*(5/3)){const s=new It,n=Math.min(t.marker.strokeWidth??1,2),o=Math.min(t.line?.strokeWidth??0,2),a=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),r=Math.max(t.marker.enabled===!1?0:e,o);if(t.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,d=new pn;d.x1=0,d.y1=r/2,d.x2=a,d.y2=r/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=o,d.lineDash=h,s.append(d)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:g}=t.marker,f=new Oi;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h??1,f.stroke=d,f.strokeOpacity=u??1,f.strokeWidth=n,f.lineDash=p,f.lineDashOffset=g??0;const x=Oi.anchor(l),m=a/2+(x.x-.5)*e,b=r/2+(x.y-.5)*e,S=e/(e+n);f.x=m,f.y=b,f.scalingCenterX=m,f.scalingCenterY=b,f.scalingX=S,f.scalingY=S,s.append(f)}return It.toSVG(s,a,r)}var _i="ag-charts-tooltip",gN="ag-charts-tooltip--dark";function fN(t){const e=[],i=new Map;for(const s of t)if(s.type==="structured"){const{heading:n}=s,o=n!=null?i.get(n):void 0,a={type:"structured",heading:n,items:[s]};o==null?(i.set(n,a),e.push(a)):o.items.push(s)}else e.push(s);return e}function yN(t){const e=fN(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(o=>{i.push(o.label??o.fallbackLabel,o.value)})})}),i.join("; ")}function p0(t,e,i){let s="";t==null?s+=`<span class="${_i}-label">${tp(e)}</span>`:(s+=`<span class="${_i}-label">${tp(t)}</span>`,s+=" ",s+=`<span class="${_i}-value">${tp(e)}</span>`);const n=[`${_i}-row`];return i&&n.push(`${_i}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function YW(t){let e="";const i=t.title==null&&t.data?.length===1,s=t.symbol==null?void 0:pN(t.symbol,12);return s!=null&&(t.title!=null||t.data?.length)&&(e+=`<span class="${_i}-symbol">${s}</span>`),t.title!=null&&(e+=`<span class="${_i}-title">${tp(t.title)}</span>`,e+=" "),t.data?.forEach(n=>{e+=p0(n.label??n.fallbackLabel,n.value,i),e+=" "}),e}function mN(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${_i}-footer">${i}</div>`}function xN(t,e,i,s){const n=e.items.length===1?e.items[0]:void 0;let o,a,r;switch(i){case"compact":o=!0,a=n?.title;break;case"single":o=n!=null&&(e.heading==null||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,r=e.heading??n?.title;break;case"shared":o=!1}let l="";if(o&&n!=null?(a!=null&&(l+=p0(void 0,a,!1)),n.data?.forEach(h=>{l+=p0(h.label??r,h.value,!1),l+=" "})):(e.heading!=null&&(l+=`<span class="${_i}-heading">${tp(e.heading)}</span>`,l+=" "),e.items.forEach(h=>{l+=YW(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?mN(t,s):void 0;return c+null&&(l+=c),l=`<div class="${_i}-content">${l.trimEnd()}</div>`,l}function KW(t,e){const i=e==null?void 0:mN(t,e);return i==null?"":`<div class="${_i}-content">${i}</div>`}function bN(t,e,i,s){const n=fN(e);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return xN(t,n[0],i,s);{const o=n.map(a=>a.type==="structured"?xN(t,a,i):a.rawHtmlString);return s!=null&&o.push(KW(t,s)??""),o.join("")}}}var $W={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},XW={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},ZW={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},SN={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},QW=le(["single","shared","compact"]),vN=le(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"),qW=le(["pointer","node","chart"],"an anchorTo"),MN=le(["top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"],"a placement"),JW=Zi(MN,ki(MN)),Xa=class extends kt{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}};v([A(vN,{optional:!0}),lN("Use `anchorTo` and/or `placement` options instead.")],Xa.prototype,"type",2),v([A(vN,{optional:!0})],Xa.prototype,"_seriesOverrideType",2),v([A(Et)],Xa.prototype,"xOffset",2),v([A(Et)],Xa.prototype,"yOffset",2),v([A(qW,{optional:!0})],Xa.prototype,"anchorTo",2),v([A(JW,{optional:!0})],Xa.prototype,"placement",2);var Gn=class extends kt{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Xa,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new HW,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new uC,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 re().HTMLElement.prototype&&(this.element=e.addChild("tooltip-container",_i),this.element.setAttribute("popover","manual"),this.element.className=_i,this.element.style.positionAnchor=e.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=t,()=>{e.removeChild("tooltip-container",_i),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:o}=i,{x:a,y:r}=this.springAnimation;let l=o.position?.placement??this.position.placement??o.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(l)||(l=[l]);const c=o.position?.anchorTo??this.position.anchorTo??o.position?.defaultAnchorTo??this.position.defaultAnchorTo,h=o.position?.xOffset??0,d=o.position?.yOffset??0,u=n.x,p=n.y,g=n.width-e.width-1+u,f=n.height-e.height+p;let x=0,m,b,S=!1;do{m=l[x],x+=1;const I=this.getTooltipBounds({elementSize:e,placement:m,anchorTo:c,canvasX:a,canvasY:r,yOffset:d,xOffset:h,canvasRect:s});b=cN(e.width,e.height,n,I),S=!1,SN[m]&1&&(S||(S=b.x<u||b.x>g)),SN[m]&2&&(S||(S=b.y<p||b.y>f))}while(x<l.length&&S);const M=ft(u,b.x,g),D=ft(p,b.y,f);S||(S=M!==b.x||D!==b.y);const C=c!=="chart"&&!S&&!h&&!d,k=o.showArrow??this.showArrow??C;this.arrowPosition=k?ZW[m]:void 0,this.updateClassModifiers(),t.style.translate=`${M}px ${D}px`}show(t,e,i,s,n,o=!1){const{element:a}=this;if(a!=null&&s!=null&&s.length!==0){const c=bN(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){this.toggle(!1);return}a.innerHTML=c}else if(a==null||a.innerHTML===""){this.toggle(!1);return}const r={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};switch(this.positionParams={canvasRect:e,relativeRect:r,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,a.style.pointerEvents="auto",a.removeAttribute("aria-hidden"),a.tabIndex=-1):(this.enableInteraction=!1,a.style.pointerEvents="none",a.setAttribute("aria-hidden","true"),a.removeAttribute("tabindex")),a.style.setProperty("--top",`${e.top}px`),a.style.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,o)}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(`${_i}--${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(gN,this.darkTheme);for(const i of this.wrapTypes)t.toggle(`${_i}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:s,canvasX:n,canvasY:o,yOffset:a,xOffset:r,canvasRect:l}=t,{width:c,height:h}=e,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=$W[s],p=XW[s];return d.top=o+a+h*(p-1)/2+8*p,d.left=n+r+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=a,d.left=l.width/2-c/2+r,d;case"right":return d.top=l.height/2-h/2+a,d.left=l.width-c/2+r,d;case"left":return d.top=l.height/2-h/2+a,d.left=r,d;case"bottom":return d.top=l.height-h+a,d.left=l.width/2-c/2+r,d;case"top-left":return d.top=a,d.left=r,d;case"top-right":return d.top=a,d.left=l.width-c+r,d;case"bottom-right":return d.top=l.height-h+a,d.left=l.width-c+r,d;case"bottom-left":return d.top=l.height-h+a,d.left=r,d}return d}};v([A(xt)],Gn.prototype,"enabled",2),v([A(QW)],Gn.prototype,"mode",2),v([A(xt,{optional:!0})],Gn.prototype,"showArrow",2),v([A(ot)],Gn.prototype,"delay",2),v([A(zf,{optional:!0})],Gn.prototype,"range",2),v([A(Bf)],Gn.prototype,"wrapping",2),v([A(at)],Gn.prototype,"position",2),v([A(xt)],Gn.prototype,"pagination",2),v([A(xt)],Gn.prototype,"darkTheme",2),v([A(le(["extended","canvas"]))],Gn.prototype,"bounds",2);function g0(t,e){return t.series===e.series&&Qo(t.datumIndex,e.datumIndex)}var tH=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=>g0(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=>g0(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}}},eH=class extends Ur{constructor(t){super(),this.chart=t,this.id=hn(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=tV(()=>{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 tH;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 PW(e,i,this.id,"img"),this.swapChain.addListener("blur",a=>this.onBlur(a)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new RW(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:o}=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",a=>this.onHover(a)),n.addListener("wheel",a=>this.onWheel(a)),n.addListener("mouseleave",a=>this.onLeave(a)),n.addListener("keydown",a=>this.onKeyDown(a)),n.addListener("contextmenu",(a,r)=>this.onContextMenu(a,r)),s.addListener("drag-move",a=>this.onDragMove(a)),s.addListener("click",a=>this.onClick(a,n)),s.addListener("dblclick",a=>this.onClick(a,n)),o.addListener("contextmenu",(a,r)=>this.onContextMenu(a,r)),o.addListener("click",(a,r)=>this.onClick(a,r)),o.addListener("dblclick",(a,r)=>this.onClick(a,r)),t.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),t.ctx.domManager.addListener("resize",()=>this.clearAll()),t.ctx.highlightManager.addListener("highlight-change",a=>this.changeHighlightDatum(a)),t.ctx.layoutManager.addListener("layout:complete",a=>this.layoutComplete(a)),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=Be.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 o=s?.series;this.clearAll();const a=t.currentX+e.cssLeft(),r=t.currentY+e.cssTop();this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{sourceEvent:i,canvasX:a,canvasY:r},{pickedSeries:o,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"||iH(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=FW(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:o}=s??i.matches[0],a=s==null?i.distance:0;if(t.type==="click"){const l=n.fireNodeClickEvent(t.sourceEvent,o)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(l!=null){t.sourceEvent.preventDefault();const{currentX:c,currentY:h}=t,d=c+(this.hoverRect?.x??0),u=h+(this.hoverRect?.y??0);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.current,d,u,{index:l.index,length:l.length})}return!0}return t.type==="dblclick"?(t.preventZoomDblClick=a===0,n.fireNodeDoubleClickEvent(t.sourceEvent,o),!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 o=s.datumIndex-e,a=s.seriesIndex-t;s.seriesIndex=ft(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const r=this.focus.datumIndex,l=this.focus.seriesIndex;this.updatePickedFocus(r,e,o,l,t,a,i)}handleSoloSeriesFocus(t,e,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,n=this.focus.seriesIndex,o=this.focus.datumIndex-e,a=this.focus.seriesIndex-t;this.updatePickedFocus(s,e,o,n,t,a,i)}updatePickedFocus(t,e,i,s,n,o,a){const{focus:r,hoverRect:l,seriesRect:c}=this;if(r.series===void 0||l===void 0)return;const h=r?.series?.pickFocus({datumIndex:t,datumIndexDelta:e,otherIndex:s,otherIndexDelta:n,seriesRect:c});if(!h)return;const{datum:d}=h;if(h.otherIndex!==void 0&&(r.seriesIndex=h.otherIndex),r.datumIndex=h.datumIndex,r.datum=d,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const p=GW(h),{x:g,y:f}=p.computeCenter();if(!l.containsPoint(g,f)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,p))return;const{x1:x,x2:m,y1:b,y2:S}=$u.from(p),M=l.containsPoint(x,b),D=l.containsPoint(m,b),C=l.containsPoint(x,S),k=l.containsPoint(m,S);if(!(M||D||C||k)){const I=$u.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),b<I.y1&&S<I.y1?(h.movedBounds.y=I.y1-2,h.movedBounds.height=4):b>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 u=VW(r.series,l,h);if(u!==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(r.series,d.datumIndex,d),g=sy.makeTooltipMeta(u,r.series,d,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,d),r.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,g,p):this.chart.ctx.tooltipManager.removeTooltip(this.id),a||(e===0&&n===0||i!==h.datumIndex||o!==(h.otherIndex??r.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(d,p))}}getDatumAriaText(t,e){const i=e==null?"":yN(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),o=e.currentY+(this.hoverRect?.y??0);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,o)){this.clearHighlight();return}const{range:a}=this.chart.highlight,r=a==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},r);if(!l||l.matches.length===0){this.chart.ctx.highlightManager.updateHighlight(this.id);return}const{current:c}=this.tooltipCandidates,d=(c==null?void 0:l.matches.find(u=>g0(u,c)))?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,d),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,o=s+(this.hoverRect?.x??0),a=n+(this.hoverRect?.y??0),r=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(o,a)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(r&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(r,"canvas-overlay",_i))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:d}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(c,o,a,{index:h,length:d})}else this.showTooltip(l.matches[0],o,a)}showTooltip({series:t,datum:e,datumIndex:i},s,n,o){const a=this.chart.getTooltipContent(t,i,e);if((t.tooltipEnabled??this.chart.tooltip.enabled)&&a!=null){const c=sy.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},t,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,c,a,o)}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:o}=t.previousHighlight??{};n&&e.add(n),i&&e.add(i),n?.properties.cursor&&o&&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 o of s){if(!o.visible||!o.contentGroup.visible)continue;const a=o.pickNodes(t,e,i);if(a==null||a.datums.length===0)continue;const{datums:r,distance:l}=a;if(a.datums.length!==0){if(l===0){n?.distance!==0&&(n={matches:[],distance:0});for(const c of r){const{datumIndex:h}=c;n.matches.push({series:o,datum:c,datumIndex:h})}}else if(n==null||n.distance>l){const[c]=r,{datumIndex:h}=c;n={matches:[{series:o,datum:c,datumIndex:h}],distance:l}}}}return n}};function iH(t,e){return t.type!==e}var DN=30,sH=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:o=e}=n??{},a=this.series.get(e);if(a!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(a)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=DN?"aggressive-grouping":"normal");let r=this.groups.get(i);r==null&&(r=new Map,this.groups.set(i,r));const l=this.lookupIdx(o);let c=r.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}))},r.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:o}=t,{groupIndex:a=e}=i??{};this.groups.get(s)?.get(a)?.seriesIds.includes(e)||(this.series.has(e)&&this.releaseGroup({internalId:e,seriesGrouping:o,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(o=>o!==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(ft(0,t/this.expectedSeriesCount,1)*DN)}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 o=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||o==null?o:Gk(i,o)<=0?i:o},void 0)??1}},AN=class extends kt{constructor(){super(...arguments),this.dragAction="drag"}};v([A(le(["none","drag","hover"]))],AN.prototype,"dragAction",2);var nH=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),o=new Date(Number(i[0])+s*e.max);return{min:n,max:o}}},oH=/^((?!chrome|android).)*safari/i,aH=/Version\/(\d+(\.\d+)?)/,rH=/Chrome/,lH=/Chrome\/(\d+)/,cH=/Edg/,hH=/OPR/;function dH(){const{userAgent:t}=re("navigator");if(oH.test(t)){const e=aH.exec(t);if(e==null)return!1;const i=parseFloat(e[1]),s=Math.floor(i)>16;return s||$.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!s}else if(rH.test(t)&&!cH.test(t)&&!hH.test(t)){const e=lH.exec(t);if(e==null)return!1;const i=parseInt(e[1],10),s=i>126;return s||$.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!s}return!1}var uH=new Set(["map-shape-background","map-line-background"]),pH=class{constructor(t,e,i,s,n,o,a){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=o,this.domManager=a,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(h0),this.destroyFns.push(this.layoutManager.addListener("layout:complete",r=>this.onLayoutComplete(r)))}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&&!uH.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(nN):this.overlayElem.classList.remove(nN),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,o=!e&&!i,a=i&&!s,r=this.overlays.unsupportedBrowser.enabled&&dH();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||o||a||r;fe(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)}},vo=qt.create(!0,"opts"),f0=class extends kt{constructor(){super(...arguments),this.padding=new Wr(0)}};v([A(xt,{optional:!0})],f0.prototype,"clip",2),v([A(at)],f0.prototype,"padding",2);var ri=class S_ extends Zk{constructor(e,i){var s;super(),this.id=hn(this),this.seriesRoot=new Ns({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new Ns({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new It({name:"titles",zIndex:13}),this.debug=qt.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new Vk,this.padding=new Wr(20),this.seriesArea=new f0,this.keyboard=new Uv,this.touch=new AN,this.mode="standalone",this.chartCaptions=new Xf,this.suppressFieldDotNotation=!1,this.destroyed=!1,this._destroyFns=[],this.skipSync=!1,this.chartAnimationPhase="initial",this.modulesManager=new NW,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new Vk,this.performUpdateType=7,this.runningUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new q4,this.updateRequestors={},this.performUpdateTrigger=eV(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(d){$.error("update error",d)}}).catch(d=>$.errorOnce(d))}),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 d0))return;const{series:d,seriesGrouping:u,oldGrouping:p}=h;d.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:d.internalId,type:d.type,contentGroup:d.contentGroup,renderToOffscreenCanvas:()=>d.renderToOffscreenCanvas(),seriesGrouping:u,oldGrouping:p})},this.chartOptions=e;const n=i?.scene,o=i?.container??e.processedOptions.container??void 0,a=i?.styleContainer??e.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const r=new It({name:"root"});r.visible=!1,r.append(this.seriesRoot),r.append(this.annotationRoot),r.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Gn,this.seriesLayerManager=new sH(this.seriesRoot),this.mode=e.userOptions.mode??this.mode;const l=this.ctx=new N3(this,{chartType:this.getChartType(),scene:n,root:r,container:o,styleContainer:a,domMode:e.optionMetadata.domMode,syncManager:new iW(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,d)=>this.update(h,d),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new td,(s=this.overlays.loading).renderer??(s.renderer=()=>wW(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new nH(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new pH(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new DL,this.container=o;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new eH(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"),ia.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(d=>d.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(3,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(e){return S_.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:o,mode:a}=this,r=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(d,u,p)=>this.getTooltipContent(d,u,p),chartType:r,ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:o,mode:a}}getModuleContext(){return this.ctx}getTooltipContent(e,i,s){const n=e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,s):void 0,o=n==null?[]:[n];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const a=e.getCategoryValue(i);return a==null?o:this.series.flatMap(r=>{if(r===e)return o;if(!r.isEnabled()||r.properties.tooltip.enabled===!1)return[];const l=r.datumIndexForCategoryValue(a),c=l==null?void 0:r.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=>$.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:o=this.series,newAnimationBatch:a}=i??{};this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(r=>r.markNodeDataDirty());for(const r of o)this.seriesToUpdate.add(r);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.skipSync=i?.skipSync??!1,this.debug.check()){let r=new Error().stack??"<unknown>";r=r.replace(/\([^)]*/g,""),this.updateRequestors[r]=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:o}=this,a=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=7,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<6&&(o.animationManager.startBatch(this._performUpdateSkipAnimations),o.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",Xu[i]);let r=performance.now();n.start??(n.start=r);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-r,r=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(a),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 5:if(this.checkUpdateShortcut(5))break;o.updateService.dispatchPreSceneRender(),l("\u2196");case 6:if(this.checkUpdateShortcut(6))break;o.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,o.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,o.animationManager.endBatch()}this.destroyed||(o.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:Xu[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let s=i[0],n=!1,{theme:o}=this.chartOptions.processedOptions;for(;typeof o!="string"&&o!=null;)o=o.baseTheme;typeof o=="string"&&(s=o.replace("ag-",e),n=o.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?($.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 o=this.seriesLayerManager.requestGroup(n);n.attachSeries(o,this.seriesRoot,this.annotationRoot);const a=this;n.chart={get mode(){return a.mode},get isMiniChart(){return!1},get seriesRect(){return a.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=wS(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=e[s];if(!n){$.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const o=i.getKeys(s),a=n.find(r=>!r.keys.length||o.some(l=>r.keys.includes(l)));if(!a){$.warnOnce(`no matching axis for direction [${s}] and keys [${o}]; check series and axes configuration.`);return}i.axes[s]=a}}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[o=0,a=0,r=1]=this._lastAutoSize??[];o===i&&a===s&&r===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:o,inHeight:a,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,o??this.width,a??this.height);const h=o??this.width??this._lastAutoSize?.[0],d=a??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:d,pixelRatio:u,stack:new Error().stack}),!(h==null||d==null||!Pt(h)||!Pt(d))&&s.resize(h,d,u)){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 LL(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(a=>{const r=e.find(l=>l.seriesId===a.id);a.onLegendInitialState("category",r)});const o=this.series.flatMap(a=>{const r=a.getLegendData("category");return s.updateData(a.id,r),r});if(e){n.setStateAndRestore(s,e);return}if(this.mode!=="integrated"){const a={},r=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of o.filter(d=>!d.hideInLegend)){if(c.fill==null)continue;const d=r.get(l),u=a[d]??(a[d]={});u[i=h.text]??(u[i]=c.fill),u[h.text]!==c.fill&&$.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);$.warnOnce(n)}Wk()&&await A4()}}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;vo("Chart.applyOptions() - applying delta",i);const o=this.applyModules(n),a=["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),Bu(this,i,{skip:a});let r=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),r=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,n,s,l,[])&&(r=!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 d=c?.miniChart,u=n.navigator?.miniChart?.series??n.series;d?.enabled===!0&&u!=null?this.applyMiniChartOptions(d,u,n,s):d?.enabled===!1&&(d.series=[],d.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),r||(r=this.shouldForceNodeDataRefresh(i,l));const g=r||o?0:3;this.maybeResetAnimations(l),this.shouldClearLegendData(n,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),vo("Chart.applyOptions() - update type",Xu[g],{seriesStatus:l,forceNodeDataRefresh:r}),this.update(g,{forceNodeDataRefresh:r,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:o,zoomManager:a}=this.ctx,{initialState:r}=e;if("annotations"in e&&e.annotations?.enabled&&r?.annotations!=null){const l=r.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return jt(c,h)});o.setState(i,l)}r?.chartType!=null&&o.setState(s,r.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&r?.zoom!=null&&o.setState(a,r.zoom),r?.legend!=null&&this.updateLegends(r.legend),r!=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=jv.getKeys(),o=Object.values(n).some(r=>e[r]!=null),a=e.title!=null&&e.subtitle!=null;return s||o||a}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated",o=i.legend!=null&&e.legend==null;return n||o}applyMiniChartOptions(e,i,s,n){const o=n?.navigator?.miniChart?.series??n?.series,a=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(o));this.applyAxes(e,s,n,a,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const r=e.series;for(const h of r)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,d=h?.label,u=h?.label?.interval;if(c.line.enabled=!1,c.label.set(zr(d,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(zr(u,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:g}=c;if(g.length===0)g.set([{label:{enabled:!0}}]);else for(let f=1;f<g.length;f++)g[f].label.enabled=!1}const p=u?.step;p!=null&&(c.interval.step=p)}}applyModules(e){const{type:i}=this.constructor;let s=!1;for(const n of Zo.byType("root","legend")){const a=e[n.optionsKey]!=null&&n.chartTypes.includes(i);a!==this.modulesManager.isEnabled(n)&&(a?(this.modulesManager.addModule(n,r=>r.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=CW(e.series,i,s);if(n.status==="no-overlap"){vo(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const h=i.map(d=>this.createSeries(d));return this.initSeriesDeclarationOrder(h),e.series=h,"replaced"}vo("Chart.applySeries() - matchResult",n);const o=[];let a=!1,r=!1,l=!1;const c=n.changes.toSorted((h,d)=>h.targetIdx-d.targetIdx);for(const h of c)switch(r||(r=h.status==="series-grouping"),a||(a=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const d=this.createSeries(h.opts);o.push(d),vo("Chart.applySeries() - created new series",d);break}case"remove":vo(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":o.push(h.series),vo(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:d,diff:u,idx:p}=h;vo(`Chart.applySeries() - applying series diff previous idx ${p}`,u,d),this.applySeriesValues(d,u),d.markNodeDataDirty(),o.push(d)}}return this.initSeriesDeclarationOrder(o),vo("Chart.applySeries() - final series instances",o),e.series=o,r?"series-grouping-change":a?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,o=[]){if(!("axes"in i)||!i.axes)return!1;o=["axes[].type",...o];const{axes:a}=i;return!(n==="replaced")&&e.axes.length===a.length&&e.axes.every((c,h)=>c.type===a[h].type)&&r0(s)?(e.axes.forEach((c,h)=>{const d=s.axes?.[h]??{},u=ea(d,a[h]);vo(`Chart.applyAxes() - applying axis diff idx ${h}`,u);const p=`axes[${h}]`;Bu(c,u,{path:p,skip:o})}),!0):(vo(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(a,o),!0)}createSeries(e){const i=Fn.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 o of Zo.byType("series-option"))o.optionsKey in i&&o.seriesTypes.includes(e.type)&&n.addModule(o,a=>a.moduleFactory(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:o,listeners:a,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const h of Zu)if(h.type==="series-option"&&h.optionsKey in c){const d=s.getModule(h.optionsKey);if(d){const u=c[h.optionsKey];delete c[h.optionsKey],d.properties.set(u)}}e.properties.set(c),"data"in i&&e.setOptionsData(o),a&&this.registerListeners(e,a,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in i&&(r==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...r})}createAxis(e,i){const s=[],n=this.getModuleContext();for(let o=0;o<e.length;o++){const a=e[o],r=lc.create(a.type,n);this.applyAxisModules(r,a),Bu(r,a,{path:`axes[${o}]`,skip:i}),s.push(r)}return TW(s),s}applyAxisModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const o of Zo.byType("axis-option")){const a=i[o.optionsKey]!=null;a!==n.isEnabled(o)&&(a?(n.addModule(o,r=>r.moduleFactory(s)),e[o.optionsKey]=n.getModule(o)):(n.removeModule(o),delete e[o.optionsKey]))}}registerListeners(e,i,s){e.clearEventListeners();for(const[n,o]of ke(i))if(Rr(o)){const a=s?.[n];a==null?e.addEventListener(n,o):e.addEventListener(a,r=>{if(r?.type===a){const l=new Proxy(r,{get(c,h,d){return h==="type"?n:Reflect.get(c,h,d)}});o(l)}else o(r)})}}};ri.chartsInstances=new WeakMap,v([Hs({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),ri.chartsInstances.set(t,this))},oldValue(t){ri.chartsInstances.delete(t)}})],ri.prototype,"container",2),v([Hs({newValue(t){this.resize("width option",{inWidth:t})}})],ri.prototype,"width",2),v([Hs({newValue(t){this.resize("height option",{inHeight:t})}})],ri.prototype,"height",2),v([Hs({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],ri.prototype,"minWidth",2),v([Hs({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],ri.prototype,"minHeight",2),v([Hs({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],ri.prototype,"overrideDevicePixelRatio",2),v([A(at)],ri.prototype,"padding",2),v([A(at)],ri.prototype,"seriesArea",2),v([A(at)],ri.prototype,"keyboard",2),v([A(at)],ri.prototype,"touch",2),v([A(le(["standalone","integrated"],"a chart mode"))],ri.prototype,"mode",2),v([ue("chartCaptions.title")],ri.prototype,"title",2),v([ue("chartCaptions.subtitle")],ri.prototype,"subtitle",2),v([ue("chartCaptions.footnote")],ri.prototype,"footnote",2),v([A(xt)],ri.prototype,"suppressFieldDotNotation",2),v([Hs({changeValue(t,e){this.onAxisChange(t,e)}})],ri.prototype,"axes",2),v([Hs({changeValue(t,e){this.onSeriesChange(t,e)}})],ri.prototype,"series",2);var Sy=ri,IN=qt.create(!0,"opts"),gc="AG Charts - Chart was destroyed, cannot perform request.",sp=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){if(!this.chart)throw new Error(gc);return IN.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(gc);return IN.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(gc);const e=Se(this.chart.getOptions());for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(gc);return this.chart.waitForUpdate()}async download(e){if(!this.chart)throw new Error(gc);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(gc);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(gc);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,o=s.height??i.height??i.ctx.scene.canvas.height,a=e.getState(),r=Zo.hasEnterpriseModules(),l={...i.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:o};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();r&&(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},d={...i.chartOptions.optionMetadata},u=this.factoryApi.create(c,l,h,d);await u.setState(a),u.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),u.chart?.ctx.legendManager.clearData(),u.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((g,f)=>{g.visible||(u.chart.series[f].visible=!1)});const p=[];for(const g of i.modulesManager.legends())p.push(g.legend.pagination?.currentPage??0);for(const g of u.chart.modulesManager.legends()){const f=p.shift()??0;g.legend.pagination&&g.legend.pagination.setPage(f)}return u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:o,legendManager:a}}=this.chart,r=[];return"annotations"in e&&e.annotations?.enabled&&r.push(s),i.presetType==="price-volume"&&r.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&r.push(o),"legend"in this.chart&&r.push(a),r}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};sp.chartInstances=new WeakMap,v([Hs({oldValue(t){t.destroyed||(t.publicApi=void 0),sp.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,sp.chartInstances.set(t,this))}})],sp.prototype,"chart",2);var TN=sp,y0=class extends Sf{constructor(t){super(),this.ctx=t,this.localeText=void 0}};v([Hr(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),A(vk,{optional:!0})],y0.prototype,"localeText",2),v([Hr(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),A(Ls,{optional:!0})],y0.prototype,"getLocaleText",2);var gH={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new y0(t)},np=class extends Hu{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=kN(n):(s&&(s=fH(n,e)),e=kN([...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(ys(i[s]),s);this.index=e}return e.get(ys(t))}};function kN(t){let e;const i=new Set;for(const s of t){const n=ys(s),o=i.size;i.add(n),i.size!==o?e?.push(s):e??(e=t.slice(0,i.size))}return e??t}function fH(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 ed=class v_ extends qu{constructor(e,i=new np){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(e){return e instanceof v_}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!Pt(e)||!Pt(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})}};ed.className="CategoryAxis",ed.type="category",v([A(ae)],ed.prototype,"groupPaddingInner",2),v([A(ae,{optional:!0})],ed.prototype,"paddingInner",2),v([A(ae,{optional:!0})],ed.prototype,"paddingOuter",2);var fc=ed,CN=class extends np{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 Za(t){if(t.length===0)return null;let e=1/0,i=-1/0;for(const n of t){const o=n instanceof Date?n.getTime():n;typeof o=="number"&&(o<e&&(e=o),o>i&&(i=o))}const s=[e,i];return s.every(isFinite)?s:null}function m0(t,e,i){let s=!1;return t.length>2&&(t=Za(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 op=new WeakMap;function vy(t,e){const i=JSON.stringify(t,null,0);return op.has(e)||op.set(e,new Map),op.get(e)?.has(i)||op.get(e)?.set(i,e(t)),op.get(e)?.get(i)}function Rs(t,e){const i=new Map,s=(...a)=>a.map(r=>typeof r=="object"||typeof r=="symbol"?r:(i.has(r)||i.set(r,{v:r}),i.get(r))),n={},o=new WeakMap;return(...a)=>{const r=a.length===0?[n]:s(...a);let l=o;for(const d of r.slice(0,-1))l.has(d)||l.set(d,new WeakMap),l=l.get(d);const c=r.at(-1);let h=l.get(c);return h?e?.("hit",t,a):(h=t(...a),l.set(c,h),e?.("miss",t,a)),h}}function My(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 yH(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>My(s)}}function LN(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:i=>My(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function mH(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>$r.extendDomain(s)}}function x0(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 NN(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:s=>My(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 b0(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,o=[])=>{const a=o[1]-o[0];return e.aggregateFunction(n).map(r=>r/a)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function wN(t){return()=>{let e=0;return i=>Pt(i)?(e+=t?Math.max(0,i):i,e):i}}function ON(){return()=>{let t=0;return e=>{if(!Pt(e))return e;const i=t;return t+=e,i}}}function EN(t){return t!=null&&dy(t)}function xH(t){return t!=null}function RN(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return EN;default:return xH}}function PN(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Mo(t,e,i={}){return{property:t,type:"key",valueType:PN(e),validation:RN(e),...i}}function Wt(t,e,i={}){return{property:t,type:"value",valueType:PN(e),validation:RN(e),...i}}function BN(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...e}}var bH=function(t){return t};function zN(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>bH:e.length===1?e[0]:()=>{const i=e.map(s=>s());return(s,n)=>i.reduce((o,a)=>a(o,n),s)}}function S0(t,e={}){const{min:i=-1/0,max:s=1/0,processor:n,...o}=e;return{type:"value",property:t,valueType:"range",validation:EN,processor:zN(n,()=>a=>Pt(a)?ft(i,a,s):a),...o}}function ap(t,e,i={}){const{onlyPositive:s,processor:n,...o}=i;return{...Wt(t,e,o),processor:zN(n,wN(s))}}function SH(t,e,i={}){return{...Wt(t,e,i),processor:ON()}}function Xr(t,e,i,s,n){return[Wt(t,n,s),WN(s.groupId,e,i,s.separateNegative),...s.rangeId!=null?[mH(s.rangeId,s.groupId)]:[]]}function FN(t,e,i){return[Wt(t,e,i),HN(i.groupId)]}var _N={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}}},GN={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}}},VN={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 vH({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 o=MH(i,s,n);for(const a of s)for(const r of n.datumIndices[a]??[]){const l=i[a],c=l[r];if(c==null){l[r]=void 0;continue}l[r]=typeof c=="number"?e(c,o):c.map(h=>e(h,o))}}}function MH(t,e,i){const s=[0,0];for(const n of e){const o=t[n];for(const a of i.datumIndices[n]??[]){const r=o[a];if(r==null)continue;const l=typeof r=="number"?r:Math.max(...r.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 Dy(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:vy({normaliseTo:e},vH)}}function DH({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],o=(a,r,l)=>{const c=t[0]+(a-r)/l*n;return l===0?e:c>=t[1]?t[1]:c<t[0]?t[0]:c};return()=>(a,r)=>{let[l,c]=a.domain.values[r];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;a.domain.values[r]=[t[0],t[1]];const d=a.columns[r];for(let u=0;u<d.length;u+=1)d[u]=o(d[u],l,h)}}function yc(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:vy({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},DH)}}var rp=1,Ay=2,jN=(t,e,i,s)=>{let n=rp|Ay;if(e.valueType==="category")return i.length!==t&&(n&=~rp),n;let o=s[0]?.valueOf();for(let a=1;n!==0&&a<s.length;a++){const r=s[a]?.valueOf();(!Number.isFinite(r)||o>r)&&(n&=~Ay),Number.isFinite(r)&&o===r&&(n&=~rp),o=r}return n};function id(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:{count:n},domain:{keys:o,values:a},keys:r,columns:l}=e;let c=rp|Ay;if(n!==0){for(let h=0;c!==0&&h<i.length;h++)for(const d of i[h].scopes)c&=jN(n,i[h],o[h],r[h].get(d));for(let h=0;c!==0&&h<s.length;h++){const d=s[h];t?.includes(d.id)&&(c&=jN(n,d,a[h],l[h]))}}return{uniqueKeys:(c&rp)!==0,orderedKeys:(c&Ay)!==0}}}}function AH({mode:t,separateNegative:e}){return()=>()=>(i,s,n)=>{const o=[0,0];for(const a of s)for(const r of n.datumIndices[a]??[]){const l=i[a],c=l[r],h=OS(c)&&e?0:1;Pt(c)&&(t==="normal"&&(o[h]+=c),l[r]=o[h],t==="trailing"&&(o[h]+=c))}}}function IH({mode:t,sum:e}){return()=>{const i=[];let s=!0;return()=>(n,o,a)=>{let r=0;for(const l of o){const c=n[l];for(const h of a.datumIndices[l]??[]){const d=c[h],u=s&&e==="current"?0:i[l];i[l]=d;const p=e==="current"?d:u;if(!Pt(d)||!Pt(u)){c[h]=r;continue}t==="normal"&&(r+=p),c[h]=r,t==="trailing"&&(r+=p)}}s=!1}}}function WN(t,e,i,s=!1){let n;if(e.startsWith("window")){const o=e.endsWith("-trailing")?"trailing":"normal";n=vy({mode:o,sum:i},IH)}else n=vy({mode:e,separateNegative:s},AH);return{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function TH(){return()=>(t,e,i)=>{const s=new Float64Array(e.length);let n=0;for(const o of e){const a=t[o];for(const r of i.datumIndices[o]??[]){const l=a[r];s[n]=Number.isFinite(l)?l:NaN,n+=1,a[r]=s.subarray(0,n)}}}}function HN(t){return{type:"group-value-processor",matchGroupIds:[t],adjust:TH}}function UN(t){return t.id??t.property}function kH(t,e,i){const s=new Map,n=e.defs.values;for(let r=0;r<n.length;r+=1){const l=n[r];if(l.scopes?.includes(t)===!1)continue;const c=UN(l);if(s.has(c))return;s.set(c,r)}const o=[],a=i.defs.values;for(let r=0;r<a.length;r+=1){const l=a[r];if(l.scopes?.includes(t)===!1)continue;const c=UN(l),h=s.get(c);if(h==null)return;s.delete(c),o.push({previousIndex:h,nextIndex:r})}if(s.size===0)return o}function v0(t,e,i,s,n){for(const{previousIndex:o,nextIndex:a}of i){const r=t[o],l=e[a],c=r[s],h=l[n];if(c!==h)return!1}return!0}function sd(t,e,i=!0){return{type:"processor",property:"diff",calculate(s,n){const o=new Map,a=new Map,r=new Map,l=new Map,c=e.keys,h=s.keys,d=e.columns,u=s.columns,p=kH(t,e,s);if(p==null)return n;const g=Math.max(e.input.count,s.input.count);for(let m=0;m<g;m++){const b=m<e.input.count,S=m<s.input.count,M=b?cy(c,t,m):void 0,D=M!=null?Gi(M):"",C=S?cy(h,t,m):void 0,k=C!=null?Gi(C):"";if(S&&b&&D===k){v0(d,u,p,m,m)||r.set(k,m);continue}const I=l.get(k);I!=null?((i||!v0(d,u,p,I,m))&&(r.set(k,m),o.set(k,m)),l.delete(k)):S&&a.set(k,m);const L=a.get(D);L!=null?((i||!v0(d,u,p,L,m))&&(r.set(D,m),o.set(D,m)),a.delete(D)):b&&(r.delete(D),l.set(D,m))}const x={changed:a.size>0||r.size>0||l.size>0,added:new Set(a.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(o.keys())};return{...n,[t]:x}}}}function Gi(t,...e){let i;return wt(t)?i=t.map(n=>Qv(n)).join("___"):i=Qv(t),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var CH=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)}},LH=class M_{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 o=e[n],a=n!==e.length-1,{children:r}=s,l=r.find(c=>c.label===o);if(l&&a)s=l;else{const c=new M_(o,s,i);c.index=r.length,r.push(c),a&&(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 NH(t){const e=t.reduce((s,n)=>s<n.length?n.length:s,0),i=new LH;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 wH(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 OH(t,e,i){return e.getSiblings().indexOf(t.ancestor)>=0?t.ancestor:i}function EH({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 RH(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,o=i,a=n.getLeftmostSibling(),r=n.mod,l=s.mod,c=o.mod,h=a.mod;for(;o.nextRight()&&n.nextLeft();){o=o.nextRight(),n=n.nextLeft(),a=a.nextLeft(),s=s.nextRight(),s.ancestor=t;const d=o.prelim+c-(n.prelim+r)+1;d>0&&(wH(OH(o,t,e),t,d),r+=d,l+=d),c+=o.mod,r+=n.mod,h+=a.mod,l+=s.mod}o.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!a.nextLeft()&&(a.mod+=r-h),e=t)}return e}function YN(t){const{children:e}=t;if(e.length){let[i]=e;for(const o of e)YN(o),i=RH(o,i);EH(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 KN(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.insertNode(t);for(const s of t.children)KN(s,e+t.mod,i)}function $N(t){const{children:e}=t;let i=0;for(const s of e)$N(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 PH(t){const e=new BH,i=NH(t);return YN(i),KN(i,-i.prelim,e),$N(i),e}var BH=class{constructor(){this.dimensions=new CH,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}},Qa=class extends kt{constructor(){super(...arguments),this.enabled=!0}};v([A(xt)],Qa.prototype,"enabled",2),v([A(xt,{optional:!0})],Qa.prototype,"avoidCollisions",2),v([A(zt,{optional:!0})],Qa.prototype,"color",2),v([A(ot,{optional:!0})],Qa.prototype,"spacing",2),v([A(za,{optional:!0})],Qa.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],Qa.prototype,"fontWeight",2),v([A(Et.restrict({min:1}),{optional:!0})],Qa.prototype,"fontSize",2),v([A(et,{optional:!0})],Qa.prototype,"fontFamily",2);var Iy=class extends kt{constructor(){super(...arguments),this.enabled=!0}};v([A(xt)],Iy.prototype,"enabled",2),v([A(ot,{optional:!0})],Iy.prototype,"width",2),v([A(zt,{optional:!0})],Iy.prototype,"stroke",2);var M0=class extends kt{constructor(){super(...arguments),this.label=new Qa,this.tick=new Iy}};v([A(at)],M0.prototype,"label",2),v([A(at)],M0.prototype,"tick",2);var mc=class extends fc{constructor(t){super(t,new CN),this.tickScale=new CN,this.depthOptions=new wu(M0),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,o=Math.abs(e[1]-e[0])-i,a=this.tickTreeLayout.scalingX(o,e[0]>e[1]),r=s+n/2;let l=0;for(const c of t){const h=c.x*a;l>h&&(l=h),c.screenX=h+r}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:De.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:pt.zero,separatorLayout:[],tickLabelLayout:[]};const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n}=this,{depth:o,nodes:a}=this.tickTreeLayout,r=Math.ceil(i.fontSize/t),l=Me(this.rotation),c=this.position==="top"||this.position==="bottom",h=i.getSideFlag(),d=[],u=new Map,p=new _h,{defaultRotation:g,configuredRotation:f}=hy({rotation:i.rotation,parallel:i.parallel,regularFlipRotation:me(l-Math.PI/2),parallelFlipRotation:me(l)}),x=g+f,m=this.getDepthOptionsMap(o),b=(B,P)=>{const V=o-B.depth;if(!m[V]?.enabled||P%r!==0||!SG(B.screenX,s))return!1;const W=this.formatTick(B.label,P-1,this.scale.domain),F=this.getLabelStyles({value:W,depth:V},n[V]?.label);return p.setProperties({...F,text:W,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",rotation:0,translationX:0,translationY:B.screenX}),!0};let S=0;const M={};a.forEach((B,P)=>{const V=o-B.depth,W=X_(B.label);if(M[V]??(M[V]=1),M[V]<W&&(M[V]=W),!(!b(B,P)||!p.getBBox())&&(u.set(P,p.getBBox()),!B.leafCount)){p.rotation=x;const{width:_}=p.getBBox();S<_&&(S=_)}});const D=n0(),C=h*m[0].spacing,k=new Map,I=B=>{let P=S;for(let V=1;V<=B;V++)P+=m[V].spacing,(i.mirrored||V!==B)&&(P+=M[V]*m[V].lineHeight);return P};a.forEach((B,P)=>{if(P===0)return;const V=b(B,P),W=!B.children.length,F=o-B.depth;if(B.parent){const z=W?B.x:B.x-(B.leafCount-1)/2;if(!k.has(z)){const U=this.depthOptions[F]?.tick;let Y=S;for(let Z=0;Z<=F;Z++)Y+=m[Z].spacing,Z!==0&&(Y+=M[Z]*m[Z].lineHeight);k.set(z,{tickSize:Y,tickStroke:U?.stroke,tickWidth:U?.enabled!==!1?U?.width:0})}}if(!V)return;if(p.x=C,p.y=0,W){const{width:z}=u.get(P),U=fk(x);p.rotation=x,p.textAlign="end",p.textBaseline="middle",p.rotationCenterX=C-z/2,p.translationX=(m[F].spacing-z)/2*U*h,i.mirrored&&(p.translationX+=z)}else p.rotation=c?g:-Math.PI/2,p.rotationCenterX=C,p.translationX=h*I(F);if(m[F].avoidCollisions){const z=W?t:B.leafCount*t;if(p.getBBox().height>z){u.delete(P);return}}const{text:_=""}=p;d.push({text:_,visible:!0,range:this.scale.range,tickId:D(_),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}),u.set(P,Be.toCanvas(p))});const{enabled:L,stroke:N,width:O}=this.line;this.lineNode.datum={x:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:N,strokeWidth:L?O:0});const w=[...k.values()];w.push(w[0]);const R=[this.lineNode.getBBox(),new pt(0,0,w[0].tickSize*h,0)];e.enabled&&(this.updateTitle(this.scale.domain,!1,w[0].tickSize),R.push(e.caption.node.getBBox()));const G=pt.merge(Pr(u.values(),R));return{bbox:this.getTransformBox(G),separatorLayout:w,tickLabelLayout:d}}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((o,a)=>({...s[a],tick:o,tickId:Gi(o,a),tickLabel:o.filter(Boolean).join(" - "),translationY:Math.round(t.convert(o))}));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:Za(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>xf(Rt(n)&&"value"in n?n.value:n));this.tickTreeLayout=PH(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=fG(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,o)=>{const{stroke:a,lineDash:r}=e[o%e.length],l=n.translationY;s.visible=this.inRange(l),s.x1=0,s.x2=i,s.y=l,s.stroke=a,s.strokeWidth=t,s.lineDash=r})}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=wt(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}};mc.className="GroupedCategoryAxis",mc.type="grouped-category",v([A(KS)],mc.prototype,"depthOptions",2);var zH={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},FH=(t,e)=>Math.log(e)/Math.log(t);function D0(t,e,i){const s=Math.min(...e),n=zH[t]??FH;return s>=0?n(t,i):-n(t,-i)}var _H={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},GH=(t,e)=>t**e;function A0(t,e,i){const s=Math.min(...e),n=_H[t]??GH;return s>=0?n(t,i):-n(t,-i)}var I0=class extends he{constructor(t=[1,10],e=[0,1]){super(t,e),this.type="log",this.defaultClamp=!0,this.base=10,this.log=i=>D0(this.base,this.domain,i),this.pow=i=>A0(this.base,this.domain,i)}toDomain(t){return t}transform(t){const[e,i]=oi(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[e,i]=oi(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,o=s>n?Math.ceil:Math.floor,a=s>n?Math.floor:Math.ceil,r=A0(i,e,o(D0(i,e,s))),l=A0(i,e,a(D0(i,e,n)));return[r,l]}ticks({interval:t,tickCount:e=he.defaultTickCount},i=this.domain,s){if(!i||i.length<2||e<1)return[];const n=this.base,[o,a]=i,r=Math.min(o,a),l=Math.max(o,a);let c=this.log(r),h=this.log(l);if(t){const f=b=>b>=r&&b<=l,x=Math.min(Math.abs(t),Math.abs(h-c)),m=Ku(c,h,x).map(this.pow).filter(f);if(!Zh(m.length,this.getPixelRange()))return m}if(!QT(n)||h-c>=e)return zv(c,h,Math.min(h-c,e)).map(this.pow);let d=[];const u=r>0;c=Math.floor(c)-1,h=Math.round(h)+1;const p=Uh(this.range)/e;let g=1/0;for(let f=c;f<=h;f++){const x=this.convert(this.pow(f+1));for(let m=1;m<n;m++){const b=u?m:n-m+1,S=this.pow(f)*b,M=this.convert(S),D=Math.abs(g-M),C=Math.abs(M-x),k=D>=p&&C>=p;S>=r&&S<=l&&(m===1||k||d.length===0)&&(d.push(S),g=M)}}return d=aL(d,u,s),d}tickFormatter({specifier:t}){return t!=null?ik(t):String}datumFormatter(t){return this.tickFormatter(t)}},Do=class D_ extends he{constructor(){super([0,1],[0,1]),this.type="number"}static getTickStep(e,i,s){const{interval:n,tickCount:o=he.defaultTickCount,minTickCount:a,maxTickCount:r}=s;return n??Yu(e,i,o,a,r)}toDomain(e){return e}ticks({interval:e,tickCount:i=he.defaultTickCount,minTickCount:s,maxTickCount:n},o=this.domain,a){if(!o||o.length<2||i<1||!o.every(isFinite))return[];const[r,l]=o;if(e){const c=Math.abs(e);if(!Zh((l-r)/c,this.getPixelRange()))return Ku(r,l,c)}return zv(r,l,i,s,n,a)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:s=he.defaultTickCount}=e;let[n,o]=i;if(s===1)[n,o]=i3(n,o);else if(s>1){const a=n>o?Math.ceil:Math.floor,r=n>o?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,d=o,u=D_.getTickStep(n,o,e),[p,g]=i;if(n=a(p/u)*u,o=r(g/u)*u,n===h&&o===d)break}}return[n,o]}tickFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?dL(e,s):n=>Wa(n,i)}datumFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?dL(e,s):n=>Wa(n,i+1)}},qa=class extends qu{constructor(t,e=new Do){super(t,e)}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=m0(t,e,i);return{domain:s,clipped:n}}};qa.className="NumberAxis",qa.type="number",v([A(_r(Of,Rf("max")),{optional:!0})],qa.prototype,"min",2),v([A(_r(Of,Pf("min")),{optional:!0})],qa.prototype,"max",2);var nd=class extends qa{normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=m0(t,e,i);return s[0]<0&&s[1]>0||t[0]<0&&t[1]>0?($.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?($.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 I0)}defaultDatumFormatter(t,e){return String(t)}defaultLabelFormatter(t,e){return String(t)}};nd.className="LogAxis",nd.type="log";var Zr=class extends qu{constructor(t){super(t,new pL),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=Za(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}}};Zr.className="TimeAxis",Zr.type="time",v([A(_r(YS,Rf("max")),{optional:!0})],Zr.prototype,"min",2),v([A(_r(YS,Pf("min")),{optional:!0})],Zr.prototype,"max",2);var lp=(t,{x0:e,y0:i,x1:s,y1:n,cx:o,cy:a},r,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-a,e-o),h=Math.atan2(n-a,s-o);t.arc(o,a,r,c,h)}else t.lineTo(e,i)},XN=1e-6,Ty=(t,e,i,s,n)=>{let o=!1,a=!1,r=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 r>t?(o=!0,r=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):r<XN&&(r=0),h>e?(a=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):h<XN&&(h=0),{leading0:r,leading1:l,trailing0:c,trailing1:h,leadingClipped:o,trailingClipped:a}},ky=(t,e,i,s,n,o,a)=>{let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:h}=o;const d=Math.max(r+h,l+c),u=Math.max(r+l,h+c);if(d<=0&&u<=0){a==null?t.rect(e,i,s,n):t.rect(a.x,a.y,a.width,a.height);return}else if(a==null&&r===l&&r===c&&r===h){t.roundRect(e,i,s,n,r);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(a==null)a=new pt(e,i,s,n);else{const k=Math.max(e,a.x),I=Math.min(e+s,a.x+a.width),L=Math.max(i,a.y),N=Math.min(i+n,a.y+a.height);a=new pt(k,L,I-k,N-L)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,x=!0,m=!0,b,S,M,D;if(g){const k=Ty(a.height,a.width,Math.max(e+r-a.x,0),Math.max(i+r-a.y,0),r);k.leadingClipped&&(m=!1),k.trailingClipped&&(f=!1);const I=Math.max(a.x+k.leading1,a.x),L=Math.max(a.y+k.leading0,a.y),N=Math.max(a.x+k.trailing1,a.x),O=Math.max(a.y+k.trailing0,a.y),w=e+r,R=i+r;b={x0:I,y0:L,x1:N,y1:O,cx:w,cy:R}}if(f){const k=Ty(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(e+s-l),0),l);k.leadingClipped&&(g=!1),k.trailingClipped&&(x=!1);const I=Math.min(a.x+a.width-k.leading0,a.x+a.width),L=Math.max(a.y+k.leading1,a.y),N=Math.min(a.x+a.width-k.trailing0,a.x+a.width),O=Math.max(a.y+k.trailing1,a.y),w=e+s-l,R=i+l;S={x0:I,y0:L,x1:N,y1:O,cx:w,cy:R}}if(x){const k=Ty(a.height,a.width,Math.max(a.x+a.width-(e+s-c),0),Math.max(a.y+a.height-(i+n-c),0),c);k.leadingClipped&&(f=!1),k.trailingClipped&&(m=!1);const I=Math.min(a.x+a.width-k.leading1,a.x+a.width),L=Math.min(a.y+a.height-k.leading0,a.y+a.height),N=Math.min(a.x+a.width-k.trailing1,a.x+a.width),O=Math.min(a.y+a.height-k.trailing0,a.y+a.height),w=e+s-c,R=i+n-c;M={x0:I,y0:L,x1:N,y1:O,cx:w,cy:R}}if(m){const k=Ty(a.width,a.height,Math.max(a.y+a.height-(i+n-h),0),Math.max(e+h-a.x,0),h);k.leadingClipped&&(x=!1),k.trailingClipped&&(g=!1);const I=Math.max(a.x+k.leading0,a.x),L=Math.min(a.y+a.height-k.leading1,a.y+a.height),N=Math.max(a.x+k.trailing0,a.x),O=Math.min(a.y+a.height-k.trailing1,a.y+a.height),w=e+h,R=i+n-h;D={x0:I,y0:L,x1:N,y1:O,cx:w,cy:R}}let C=!1;g&&b!=null&&(lp(t,b,r,!C),C||(C=!0)),f&&S!=null&&(lp(t,S,l,!C),C||(C=!0)),x&&M!=null&&(lp(t,M,c,!C),C||(C=!0)),m&&D!=null&&lp(t,D,h,!C),t.closePath()},ms=class extends Es{constructor(){super(...arguments),this.borderPath=new Bh,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=Bn.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Bn.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:o,bottomLeftCornerRadius:a}=this;let{x:r,y:l,width:c,height:h,strokeWidth:d,clipBBox:u}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(!0),e.clear(!0),i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(r,c),h=this.align(l,h),r=this.align(r),l=this.align(l),u=u!=null?new pt(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height)):void 0),d)if(c<g){const x=r+g/2;e.moveTo(x,l),e.lineTo(x,l+h),d=g,this.borderClipPath=void 0}else if(h<g){const x=l+g/2;e.moveTo(r,x),e.lineTo(r+c,x),d=g,this.borderClipPath=void 0}else if(d<c&&d<h){const x=d/2;r+=x,l+=x,c-=d,h-=d;const m=u?.clone().shrink(x),b={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:o>0?o-d:0,bottomLeft:a>0?a-d:0};this.borderClipPath=void 0,c>0&&h>0&&(m==null||m?.width>0&&m?.height>0)&&(ky(t,r,l,c,h,b,m),ky(e,r,l,c,h,b,m))}else this.borderClipPath=this.borderClipPath??new Bh,this.borderClipPath.clear(!0),this.borderClipPath.rect(r,l,c,h),e.rect(r,l,c,h);else{const x={topLeft:s,topRight:n,bottomRight:o,bottomLeft:a};this.borderClipPath=void 0,ky(t,r,l,c,h,x,u)}if([s,n,o,a].every(x=>x===0)){const x=this.getBBox();this.hittester=x.containsPoint.bind(x),this.distanceSquared=(m,b)=>this.getBBox().distanceSquared(m,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=f}computeBBox(){const{x:t,y:e,width:i,height:s,clipBBox:n}=this;return n?.clone()??new pt(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:o,lineDashOffset:a,lineCap:r,lineJoin:l,borderPath:c,borderClipPath:h,opacity:d,microPixelEffectOpacity:u}=this;h&&t.clip(h.getPath2D()),this.applyStroke(t),t.globalAlpha*=d*n*u,t.lineWidth=i,o&&t.setLineDash(o),a&&(t.lineDashOffset=a),r&&(t.lineCap=r),l&&(t.lineJoin=l),t.stroke(c.getPath2D()),t.globalAlpha=s}}};ms.className="Rect",v([Lt()],ms.prototype,"x",2),v([Lt()],ms.prototype,"y",2),v([Lt()],ms.prototype,"width",2),v([Lt()],ms.prototype,"height",2),v([Lt()],ms.prototype,"topLeftCornerRadius",2),v([Lt()],ms.prototype,"topRightCornerRadius",2),v([Lt()],ms.prototype,"bottomRightCornerRadius",2),v([Lt()],ms.prototype,"bottomLeftCornerRadius",2),v([Lt()],ms.prototype,"clipBBox",2),v([Lt()],ms.prototype,"crisp",2);var od=class extends Sf{constructor(t){super(),this.ctx=t,this.rectNode=new ms,this.textNode=new Li,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}};v([A(xt),zi("node","visible")],od.prototype,"visible",2),v([A(zt,{optional:!0}),zi("rectNode","fill")],od.prototype,"fill",2),v([A(at,{optional:!0})],od.prototype,"image",2),v([A(et,{optional:!0}),zi("textNode")],od.prototype,"text",2);var ZN={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new od(t)};function VH({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:o=0,forceResult:a=!1}){const r=t==="horizontal",l={max:r?s:i,fn:r?u=>u.width:u=>u.height,padding:r?o:n},c={max:r?i:s,fn:r?u=>u.height:u=>u.width,padding:r?n:o};let h=0;const d=[];for(;h<e.length;){const u=e.slice(h),p=jH(u,h,l,c,a);if(!p)return;h+=p.processedBBoxCount,d.push(p.pageIndices)}return HH(d,t,e,n,o)}function jH(t,e,i,s,n){let a=YH(t,i);if(a<1){if(!n)return;a=1}let r=a;for(;r>=1;){const l=WH(t,e,r,i,s,n);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l<r&&l>1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function WH(t,e,i,s,n,o){const a=[];let r=0,l=0,c=[];const h=[];for(let d=0;d<t.length;d++){const u=(d+i)%i;u===0&&(r+=l,l=0,c.length>0&&a.push(c),c=[]);const p=s.fn(t[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(t[d])+n.padding);const g=r+l,f=!o||a.length>0;if(g>n.max&&f){c=[];break}if(h.reduce((m,b)=>m+b,0)>s.max&&!o)return h.length<i?h.length:void 0;c.push(d+e)}return c.length>0&&a.push(c),a.length>0?a:void 0}function HH(t,e,i,s,n){let o=0,a=0;return{pages:t.map(l=>{e==="horizontal"&&(l=UH(l));let c=0;const h=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let f=0,x=0;return g.forEach(m=>{f+=m.height+s,x=Math.max(x,m.width+n)}),{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(x)}});let d=0,u=0;return h.forEach(p=>{d+=p.columnWidth,u=Math.max(u,p.columnHeight)}),o=Math.max(d,o),a=Math.max(u,a),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:o,maxPageHeight:a}}function UH(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((i,s)=>{i.forEach((n,o)=>{e[o][s]=n})}),e}function YH(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 ad=class extends kt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};v([A(zt)],ad.prototype,"color",2),v([A(za,{optional:!0})],ad.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],ad.prototype,"fontWeight",2),v([A(ot)],ad.prototype,"fontSize",2),v([A(et)],ad.prototype,"fontFamily",2);var Ja=class extends kt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};v([A(ot)],Ja.prototype,"size",2),v([A(zt,{optional:!0})],Ja.prototype,"fill",2),v([A(ae,{optional:!0})],Ja.prototype,"fillOpacity",2),v([A(zt,{optional:!0})],Ja.prototype,"stroke",2),v([A(ot)],Ja.prototype,"strokeWidth",2),v([A(ae)],Ja.prototype,"strokeOpacity",2);var Cy=class extends kt{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};v([Hs({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Cy.prototype,"shape",2),v([A(ot)],Cy.prototype,"size",2),v([A(ot)],Cy.prototype,"padding",2);var xc=class extends kt{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=hn(this),this.marker=new Cy(this),this.activeStyle=new Ja,this.inactiveStyle=new Ja,this.highlightStyle=new Ja,this.label=new ad,this.group=new Ns({name:"pagination"}),this.labelNode=new Li,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 Oi,this.previousButton=new Oi,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:o,fontSize:a,fontFamily:r}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=o,i.fontSize=a,i.fontFamily=r}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:o,highlightStyle:a,highlightActive:r}=this,l=(c,h)=>h?o:c===r?a: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=ft(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=Be.toCanvas(this.previousButton),e=Be.toCanvas(this.nextButton);return{prev:t,next:e}}};xc.className="Pagination",v([A(at)],xc.prototype,"marker",2),v([A(at)],xc.prototype,"activeStyle",2),v([A(at)],xc.prototype,"inactiveStyle",2),v([A(at)],xc.prototype,"highlightStyle",2),v([A(at)],xc.prototype,"label",2);var T0=class extends kt{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}},KH=new Set(["circle","cross","diamond","heart","pin","plus","square","star","triangle"]);function $H(t){return typeof t=="string"&&KH.has(t)}var tr=class extends kt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};v([A(zt,{optional:!0})],tr.prototype,"fill",2),v([A(ae,{optional:!0})],tr.prototype,"fillOpacity",2),v([A(zt,{optional:!0})],tr.prototype,"stroke",2),v([A(ot,{optional:!0})],tr.prototype,"strokeWidth",2),v([A(ae,{optional:!0})],tr.prototype,"strokeOpacity",2),v([A(ta,{optional:!0})],tr.prototype,"lineDash",2),v([A(ot,{optional:!0})],tr.prototype,"lineDashOffset",2);var Ly=class extends kt{};v([A(ot,{optional:!0})],Ly.prototype,"strokeWidth",2),v([A(ae,{optional:!0})],Ly.prototype,"dimOpacity",2),v([A(xt,{optional:!0})],Ly.prototype,"enabled",2);var QN=class extends kt{constructor(){super(...arguments),this.color="black"}};v([A(zt,{optional:!0})],QN.prototype,"color",2);var k0=class extends kt{constructor(){super(...arguments),this.enabled=!0}};v([A(xt,{optional:!0})],k0.prototype,"enabled",2);var Vn=class extends kt{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};v([A(et)],Vn.prototype,"type",2),v([A(Jl)],Vn.prototype,"colorStops",2),v([A(et)],Vn.prototype,"bounds",2),v([A(et)],Vn.prototype,"gradient",2),v([A(Et)],Vn.prototype,"rotation",2),v([A(xt)],Vn.prototype,"reverse",2);var _e=class extends kt{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}};v([A(et)],_e.prototype,"type",2),v([A(Jl)],_e.prototype,"colorStops",2),v([A(et)],_e.prototype,"bounds",2),v([A(et)],_e.prototype,"gradient",2),v([A(Et)],_e.prototype,"rotation",2),v([A(xt)],_e.prototype,"reverse",2),v([A(et)],_e.prototype,"pattern",2),v([A(Et)],_e.prototype,"width",2),v([A(Et)],_e.prototype,"height",2),v([A(Et)],_e.prototype,"padding",2),v([A(et)],_e.prototype,"fill",2),v([A(Et)],_e.prototype,"fillOpacity",2),v([A(et)],_e.prototype,"backgroundFill",2),v([A(Et)],_e.prototype,"backgroundFillOpacity",2),v([A(et)],_e.prototype,"stroke",2),v([A(Et)],_e.prototype,"strokeOpacity",2),v([A(Et)],_e.prototype,"strokeWidth",2);var cp=class extends kt{constructor(){super(...arguments),this.item=new tr,this.series=new Ly,this.text=new QN}};v([A(at)],cp.prototype,"item",2),v([A(at)],cp.prototype,"series",2),v([A(at)],cp.prototype,"text",2);var gn=class extends kt{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new k0,this.highlightStyle=new cp}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context"))}};v([A(et,{optional:!0})],gn.prototype,"id",2),v([A(xt)],gn.prototype,"visible",2),v([A(Mk,{optional:!0})],gn.prototype,"focusPriority",2),v([A(xt)],gn.prototype,"showInLegend",2),v([A(et)],gn.prototype,"cursor",2),v([A(zf)],gn.prototype,"nodeClickRange",2),v([A(at)],gn.prototype,"highlight",2),v([A(at)],gn.prototype,"highlightStyle",2);var C0=ce(t=>$H(t)||typeof t=="function","a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Vi=class extends T0{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Vn,this.fillPatternDefaults=new _e,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:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};v([A(xt),gt()],Vi.prototype,"enabled",2),v([A(C0),gt()],Vi.prototype,"shape",2),v([A(ot),gt()],Vi.prototype,"size",2),v([A(Zi(zt,Jo,qo),{optional:!0}),gt()],Vi.prototype,"fill",2),v([A(at)],Vi.prototype,"fillGradientDefaults",2),v([A(at)],Vi.prototype,"fillPatternDefaults",2),v([A(ae),gt()],Vi.prototype,"fillOpacity",2),v([A(zt,{optional:!0}),gt()],Vi.prototype,"stroke",2),v([A(ot),gt()],Vi.prototype,"strokeWidth",2),v([A(ae),gt()],Vi.prototype,"strokeOpacity",2),v([A(ta)],Vi.prototype,"lineDash",2),v([A(ot)],Vi.prototype,"lineDashOffset",2),v([A(Ls,{optional:!0}),gt()],Vi.prototype,"itemStyler",2);var XH=class{constructor(t,e){this.idPrefix=e,this.dirty=!0,this.destroyFns=new sC,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=Mt("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,o=e.localeManager,a=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(o,s.getItemLabel(l),c,a),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=r.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,r.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,r.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,r)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d.sourceEvent,r)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>n.onHover(d.sourceEvent,r)),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=Be.toCanvas(e);this.itemList.setBounds(n);const o=Math.max(...t.nodes().map(a=>a.getBBox().height));t.each((a,r)=>{if(a.proxyButton){const l=a.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=Be.toCanvas(a),p=(o-d)/2,g={x:c-n.x,y:h-p-n.y,height:o,width:u};a.proxyButton.setCursor("pointer"),a.proxyButton.setEnabled(s&&l),a.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{ctx:o,oldPages:a,newPages:r}=t,l=(a?.length??r.length)>1,c=r.length>1;l!==c&&(c?(this.prevButton=o.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=o.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[o,a]=[e[s],t[s]];return o.id!==a.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},o,a)=>{const r=n?.getElement();if(r!=null){const l=i.getItemLabel(o);r.textContent=this.getItemAriaText(t,l,a,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 qN(t,e,i,s){const n={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var jn=class extends ec(It){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new It({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new Li),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Oi({zIndex:1})),this.line=this.symbolsGroup.appendChild(new pn({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,o=0;if(t.visible){const{size:a}=t,r=Oi.anchor(t.shape);n=(r.x-.5)*a+i/2,o=(r.y-.5)*a,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=o):(t.x=n,t.y=o,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()}};jn.className="MarkerLabel",v([zi("label")],jn.prototype,"text",2),v([zi("label")],jn.prototype,"fontStyle",2),v([zi("label")],jn.prototype,"fontWeight",2),v([zi("label")],jn.prototype,"fontSize",2),v([zi("label")],jn.prototype,"fontFamily",2),v([zi("label","fill")],jn.prototype,"color",2),v([Hr(t=>t.layoutLabel())],jn.prototype,"spacing",2),v([Hr(t=>t.layoutLabel())],jn.prototype,"length",2),v([gt()],jn.prototype,"isCustomMarker",2);var Qr=class extends kt{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"}};v([A(ot,{optional:!0})],Qr.prototype,"maxLength",2),v([A(zt)],Qr.prototype,"color",2),v([A(za,{optional:!0})],Qr.prototype,"fontStyle",2),v([A(Fa,{optional:!0})],Qr.prototype,"fontWeight",2),v([A(ot)],Qr.prototype,"fontSize",2),v([A(et)],Qr.prototype,"fontFamily",2),v([A(Ls,{optional:!0})],Qr.prototype,"formatter",2);var rd=class extends kt{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};v([A(C0,{optional:!0})],rd.prototype,"shape",2),v([A(ot)],rd.prototype,"size",2),v([A(ot)],rd.prototype,"padding",2),v([A(ot,{optional:!0})],rd.prototype,"strokeWidth",2),v([A(xt)],rd.prototype,"enabled",2);var L0=class extends kt{};v([A(ot,{optional:!0})],L0.prototype,"strokeWidth",2),v([A(ot,{optional:!0})],L0.prototype,"length",2);var qr=class extends kt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new rd,this.label=new Qr,this.line=new L0}};v([A(ot,{optional:!0})],qr.prototype,"maxWidth",2),v([A(ot)],qr.prototype,"paddingX",2),v([A(ot)],qr.prototype,"paddingY",2),v([A(xt)],qr.prototype,"showSeriesStroke",2),v([A(at)],qr.prototype,"marker",2),v([A(at)],qr.prototype,"label",2),v([A(at)],qr.prototype,"line",2);var N0=class extends kt{};v([A(Ls,{optional:!0})],N0.prototype,"legendItemClick",2),v([A(Ls,{optional:!0})],N0.prototype,"legendItemDoubleClick",2);var hp="legend-visibility",w0="legend-other-series",ZH={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},QH={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},Ys=class extends kt{constructor(t){super(),this.ctx=t,this.id=hn(this),this.group=new Ns({name:"legend",zIndex:14}),this.itemSelection=ai.select(this.group,jn),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 qr,this.listeners=new N0,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new xc(e=>t.updateService.update(e),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group),this.destroyFns.push(t.contextMenuRegistry.registerDefaultAction({id:hp,type:"legend",label:"contextMenuToggleSeriesVisibility",action:e=>this.contextToggleVisibility(e)}),t.contextMenuRegistry.registerDefaultAction({id:w0,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 XH(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){Qo(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:o,label:{maxLength:a=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,d=[...this.data];this.reverseOrder&&d.reverse(),this.itemSelection.update(d);const u=[],p=De.toFontString(n),f=o??t*.8,{markerWidth:x,anyLineEnabled:m}=this.calculateMarkerWidth();if(this.itemSelection.each((N,O)=>{N.fontStyle=r,N.fontWeight=l,N.fontSize=c,N.fontFamily=h;const w=this.updateMarkerLabel(N,O,x,m),R=O.itemId??O.id,B=(this.getItemLabel(O)??"<unknown>").replace(/\r?\n/g," ");N.text=this.truncate(B,a,f,w,p,R),u.push(N.getBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return{};const b=this.size,S=this.oldSize;b[0]=t,b[1]=e,(b[0]!==S[0]||b[1]!==S[1])&&(S[0]=b[0],S[1]=b[1]);const{pages:M,maxPageHeight:D,maxPageWidth:C}=this.updatePagination(u,t,e),k=this.pages;this.pages=M,this.maxPageSize=[C-i,D-s];const I=this.pagination.currentPage,L=this.pages[I];return this.pages.length<1||!L?(this.visible=!1,{oldPages:k}):(this.visible=!0,this.updatePositions(I),this.update(),{oldPages:k})}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),o=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:o}}calcSymbolsLengths(t,e,i){const{marker:s,line:n}=this.item;let o;const{shape:a}=t.marker;if(this.isCustomMarker(e,a)){const c=new Oi;c.shape=a,c.updatePath();const h=c.getBBox();o=Math.max(h.width,h.height)}const r=e?s.size:0,l=i?n.length??25:0;return{markerLength:r,lineLength:l,customMarkerSize:o}}calculateMarkerWidth(){let t=0,e=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:o,markerEnabled:a}=this.calcSymbolsEnabled(n),{markerLength:r,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,a,o);t=Math.max(t,l,c,r),e||(e=o)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,s){const{marker:n,paddingX:o}=this.item,{symbol:a}=e;let r=o;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(a),h=n.padding;(l||s)&&(r+=h+i);const{marker:d,line:u}=t;return d.visible=l,d.visible&&(d.shape=n.shape??a.marker.shape??"square",d.size=n.size,pc(d,this.getMarkerStyles(a))),u.visible=s,u.visible&&pc(u,this.getLineStyles(a)),t.length=i,t.spacing=h,t.isCustomMarker=c,r}truncate(t,e,i,s,n,o){let a=!1;t.length>e&&(t=t.substring(0,e),a=!0);const r=Va.getMeasurer({font:n}),l=gv.truncateLine(t,r,i-s,a);return l.endsWith(De.EllipsisChar)?this.truncatedItems.add(o):this.truncatedItems.delete(o),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:o,maxPageHeight:a,maxPageWidth:r,paginationBBox:l,paginationVertical:c}=this.calculatePagination(t,e,i),h=o.findIndex(S=>S.endIndex>=n);this.pagination.currentPage=ft(0,h,o.length-1);const{paddingX:d,paddingY:u}=this.item,p=8,g=r-d,f=a-u;let x=0,m=-l.y-this.item.marker.size/2;c?m+=f+p:(x+=-l.x+g+p,m+=(f-l.height)/2),this.pagination.translationX=x,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let b=0;return this.itemSelection.each((S,M,D)=>{D>(o[b]?.endIndex??1/0)&&b++,S.pageIndex=b}),{maxPageHeight:a,maxPageWidth:r,pages:o}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,o=this.getOrientation(),a=["left","right"].includes(this.position);let r=this.pagination.getBBox(),l=new pt(0,0,0,0),c=[],h=0,d=0,u=0;const p=f=>f.width===r.width&&f.height===r.height,g=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(u++>10){$.warn("unable to find stable legend layout.");break}r=l;const f=e-(a?0:r.width),x=i-(a?r.height:0),m=VH({orientation:o,bboxes:t,maxHeight:x,maxWidth:f,itemPaddingY:n,itemPaddingX:s,forceResult:g});c=m?.pages??[],h=m?.maxPageWidth??0,d=m?.maxPageHeight??0;const b=c.length;if(this.pagination.visible=b>1,this.pagination.totalPages=b,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:h,maxPageHeight:d,pages:c,paginationBBox:l,paginationVertical:a}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:o,endIndex:a}=s[t];let r=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+e,p=[];i.each((g,f,x)=>{if(x<o||x>a){g.visible=!1;return}const m=x-o;let b,S;d?(b=m%c,S=Math.floor(m/c)):(b=Math.floor(m/h),S=m%h),g.visible=!0;const M=n[b];M&&(l=Math.floor(u*S),r=Math.floor(p[S]??0),p[S]=(p[S]??0)+M.columnWidth,g.translationX=r,g.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n,toggleSeries:o}=this,{startIndex:a,endIndex:r}=n[t];a===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((a+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:o}),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(hp),e.hideAction(w0)):(e.showAction(hp),e.showAction(w0))}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},o=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??o,lineDash:n}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:o,lineDash:a,lineDashOffset:r}=t,l=Math.min(2,o??1);return tc(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),na({fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:r},ZH,QH)}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(hp):this.ctx.contextMenuRegistry.enableAction(hp);const{offsetX:s,offsetY:n}=t,{x:o,y:a}=Be.toCanvasPoint(e,s,n);this.ctx.contextMenuRegistry.dispatchContext("legend",{sourceEvent:t,canvasX:o,canvasY:a},{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:o},preventHidingAll:a,toggleSeries:r}=this;if(!e)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:d}=e,u=n.series.find(f=>f.id===c);if(!u)return!1;let p=d;const g=qN("click",h,u.id,t);return s?.(g.apiEvent),g.defaultPrevented||(r&&(p=!d,a&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,u,h,p,e.legendItemName)),p?o.updateHighlight(this.id,{series:u,itemId:h,datum:void 0,datumIndex:void 0}):o.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:o,id:a,itemId:r,seriesId:l}=e,c=s.series.find(d=>d.id===a);if(!c)return!1;const h=qN("dblclick",r,c.id,t);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(f=>f.getLegendData("category"));let u=0;const p=new Set;for(const f of d)f.enabled&&(u+=1,f.legendItemName!=null&&p.add(f.legendItemName));p.size>0&&(u=p.size);const g=d.find(f=>f.itemId===r&&f.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(o,c,r,g?.enabled??!1,u,g?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Be.toCanvas(e).computeCenter():(t.preventDefault(),i=Be.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:o}=e,[a,r]=this.calculateLegendDimensions(e),{oldPages:l}=this.calcLayout(a,r),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return o-c.height;case"right":default:return n-c.width}};if(this.visible){const d=this.spacing;let u,p;switch(this.position){case"top":case"bottom":u=(n-c.width)/2,p=h(),e.shrink(c.height+d,this.position);break;case"left":case"right":default:u=h(),p=(o-c.height)/2,e.shrink(c.width+d,this.position)}this.group.translationX=Math.floor(i+u-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:o,group:a,listeners:{legendItemClick:r,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=o||l!=null||r!=null;this.domProxy.update({visible:c,interactive:h,ctx:e,itemSelection:i,group:a,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/i,n=.5,o=.2,a=.25;let r,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(n,o*(1/s)):o;r=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,a*s):a;r=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[r,l]}};Ys.className="Legend",v([A(xt)],Ys.prototype,"toggleSeries",2),v([A(at)],Ys.prototype,"pagination",2),v([A(at)],Ys.prototype,"item",2),v([A(at)],Ys.prototype,"listeners",2),v([Hr((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),A(xt)],Ys.prototype,"enabled",2),v([A($S)],Ys.prototype,"position",2),v([A(ot,{optional:!0})],Ys.prototype,"maxWidth",2),v([A(ot,{optional:!0})],Ys.prototype,"maxHeight",2),v([A(xt,{optional:!0})],Ys.prototype,"reverseOrder",2),v([A(le(["horizontal","vertical"],"an orientation"),{optional:!0})],Ys.prototype,"orientation",2),v([A(xt,{optional:!0})],Ys.prototype,"preventHidingAll",2),v([A(ot)],Ys.prototype,"spacing",2);var qH={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Ys(t),packageType:"community",removable:"standalone-only"},JN={};ho(JN,{CARTESIAN_AXIS_TYPE:()=>iw,CARTESIAN_POSITION:()=>ew,FONT_SIZE:()=>tw,FONT_SIZE_RATIO:()=>O0,POLAR_AXIS_SHAPE:()=>nw,POLAR_AXIS_TYPE:()=>sw});var tw=(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))(tw||{}),O0=(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))(O0||{}),ew=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(ew||{}),iw=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(iw||{}),sw=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(sw||{}),nw=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(nw||{}),E0={};ho(E0,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>yp,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>bp,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Sp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>vp,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Mp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>mp,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>xp,DEFAULT_CAPTION_ALIGNMENT:()=>el,DEFAULT_CAPTION_LAYOUT_STYLE:()=>tl,DEFAULT_FIBONACCI_STROKES:()=>gp,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>mi,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ge,DEFAULT_GRIDLINE_ENABLED:()=>oa,DEFAULT_POLAR_SERIES_STROKE:()=>Ry,DEFAULT_SEPARATION_LINES_COLOUR:()=>dp,DEFAULT_SHADOW_COLOUR:()=>Jr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Py,DEFAULT_TEXTBOX_COLOR:()=>Ip,DEFAULT_TEXTBOX_FILL:()=>Dp,DEFAULT_TEXTBOX_STROKE:()=>Ap,DEFAULT_TEXT_ANNOTATION_COLOR:()=>fp,DEFAULT_TOOLBAR_POSITION:()=>Tp,IS_COMMUNITY:()=>R0,IS_DARK_THEME:()=>ld,IS_ENTERPRISE:()=>P0,PALETTE_ALT_DOWN_FILL:()=>_0,PALETTE_ALT_DOWN_STROKE:()=>z0,PALETTE_ALT_NEUTRAL_FILL:()=>G0,PALETTE_ALT_NEUTRAL_STROKE:()=>Ey,PALETTE_ALT_UP_FILL:()=>F0,PALETTE_ALT_UP_STROKE:()=>B0,PALETTE_DOWN_FILL:()=>pp,PALETTE_DOWN_STROKE:()=>wy,PALETTE_NEUTRAL_FILL:()=>Oy,PALETTE_NEUTRAL_STROKE:()=>cd,PALETTE_UP_FILL:()=>up,PALETTE_UP_STROKE:()=>Ny});var ld=Symbol("is-dark-theme"),R0=Symbol("is-community"),P0=Symbol("is-enterprise"),dp=Symbol("default-separation-lines-colour"),Jr=Symbol("default-shadow-colour"),tl=Symbol("default-caption-layout-style"),el=Symbol("default-caption-alignment"),Ny=Symbol("palette-up-stroke"),wy=Symbol("palette-down-stroke"),up=Symbol("palette-up-fill"),pp=Symbol("palette-down-fill"),cd=Symbol("palette-neutral-stroke"),Oy=Symbol("palette-neutral-fill"),B0=Symbol("palette-alt-up-stroke"),z0=Symbol("palette-alt-down-stroke"),F0=Symbol("palette-alt-up-fill"),_0=Symbol("palette-alt-down-fill"),G0=Symbol("palette-gray-fill"),Ey=Symbol("palette-gray-stroke"),Ry=Symbol("default-polar-series-stroke"),Py=Symbol("default-sparkline-crosshair-stroke"),Ge=Symbol("default-financial-charts-annotation-stroke"),gp=Symbol("default-hierarchy-strokes"),fp=Symbol("default-text-annotation-color"),mi=Symbol("default-financial-charts-annotation-background-fill"),yp=Symbol("default-annotation-handle-fill"),mp=Symbol("default-annotation-statistics-fill"),xp=Symbol("default-annotation-statistics-stroke"),bp=Symbol("default-annotation-statistics-color"),Sp=Symbol("default-annotation-statistics-divider-stroke"),vp=Symbol("default-annotation-statistics-fill"),Mp=Symbol("default-annotation-statistics-stroke"),Dp=Symbol("default-textbox-fill"),Ap=Symbol("default-textbox-stroke"),Ip=Symbol("default-textbox-color"),Tp=Symbol("default-toolbar-position"),oa=Symbol("default-gridline-enabled"),ow=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],JH={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},V0={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},By={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},tU={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},il={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:By,strokeOpacity:1,strokeWidth:4,backgroundFill:"transparent",backgroundFillOpacity:1,rotation:0};function fn(t){return gk(t,e=>{const i=oe.fromString(e);return[oe.darken(i,.15).toString(),e,oe.lighten(i,.15).toString()]})}function zy(t,e,i,s,n){const{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:r}=n,l=(c,h,d)=>{i.animate({id:`${t}_${e}_${h.id}_${c}`,groupId:t,from:0,to:1,ease:_u,collapsable:!1,onUpdate(u,p){p&&c!=="removed"||(h.path.clear(!0),d(u,h),h.checkPathDirty())},onStop(){c==="added"&&(h.path.clear(!0),d(1,h),h.checkPathDirty())},phase:xo[c]})};for(const c of s)i.isSkipped()||(l("removed",c,r),l("updated",c,a)),l("added",c,o)}function ee({id:t},e,i,...s){Ya(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function sl({id:t},e,i,...s){Ya(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function er(t){return{opacity:1}}var Ao=class extends T0{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};v([A(xt),gt()],Ao.prototype,"enabled",2),v([A(zt),gt()],Ao.prototype,"color",2),v([A(Et),gt()],Ao.prototype,"xOffset",2),v([A(Et),gt()],Ao.prototype,"yOffset",2),v([A(ot),gt()],Ao.prototype,"blur",2);var aw=class extends kt{constructor(){super(...arguments),this.enabled=!1}};v([A(xt)],aw.prototype,"enabled",2);var xs=class extends kt{constructor(){super(...arguments),this.interaction=new aw,this.position=new Xa,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const s=this.renderer==null?void 0:Tv(t,this.renderer,[i]);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...e,...s}:{type:"structured",...e}}};v([A(xt,{optional:!0})],xs.prototype,"enabled",2),v([A(xt,{optional:!0})],xs.prototype,"showArrow",2),v([A(Ls,{optional:!0})],xs.prototype,"renderer",2),v([A(at)],xs.prototype,"interaction",2),v([A(at)],xs.prototype,"position",2),v([A(zf,{optional:!0})],xs.prototype,"range",2),v([A(et,{optional:!0})],xs.prototype,"class",2);var eU=class{constructor(t,e,i){this.root=new nU(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}},iU=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)}},sU=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??pt.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,o=this.maxdepth-1,a=i/2,r=s/2,l=new pt(t,e,a,r),c=new pt(t+a,e,a,r),h=new pt(t,e+r,a,r),d=new pt(t+a,e+r,a,r);return new iU(this.child(n,o,l),this.child(n,o,c),this.child(n,o,h),this.child(n,o,d))}},nU=class A_ extends sU{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=Af(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 A_(e,i,s)}},j0=class extends xy{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}getScaleInformation({xScale:t,yScale:e}){const i=he.is(t),s=he.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],o={...t,datumIndex:i},a=this.computeFocusBounds(o);if(a!==void 0)return{bounds:a,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=(a,r)=>{for(;a>=0&&!this.isDatumEnabled(e,a);)a+=r;return a===-1?void 0:a},s=(a,r)=>{for(;a<e.length&&!this.isDatumEnabled(e,a);)a+=r;return a===e.length?void 0:a};let n;const o=ft(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?n=i(o,t.datumIndexDelta):t.datumIndexDelta>0?n=s(o,t.datumIndexDelta):n=s(o,1)??i(o,-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),o=this.keysOrValues(s);for(let a=0;a<o.length;a+=1){if(n?.[a]===!0)continue;const r=o[a]?.valueOf();if(Qo(t,r))return a}}},bc={x:["xKey"],y:["yKey"]},Sc={x:["xName"],y:["yName"]},W0=class extends Ju{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},ir=class extends gn{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};v([A(et,{optional:!0})],ir.prototype,"legendItemName",2),v([A(xt,{optional:!0})],ir.prototype,"pickOutsideVisibleMinorAxis",2);var Fy=100,nl=class extends j0{constructor({pathsPerSeries:t=["path"],hasMarkers:e=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:o=!0,animationAlwaysUpdateSelections:a=!1,animationResetFns:r,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=W0,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 Ns({name:`${this.id}-series-labels`})),this.labelSelection=ai.select(this.labelGroup,Li),this.highlightSelection=ai.select(this.highlightNode,()=>this.opts.hasMarkers?new Oi:this.nodeFactory()),this.highlightLabelSelection=ai.select(this.highlightLabel,Li),this.annotationSelections=new Set,this.debug=qt.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:r,animationAlwaysUpdateSelections:a,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:o},this.paths=t.map(d=>new Es({name:`${this.id}-${d}`})),this.datumSelection=ai.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=ai.select(this.markerGroup,Oi,o),this.animationState=new Qu("empty",{empty:{update:{target:"ready",action:d=>this.animateEmptyUpdateReady(d)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:d=>this.animateReadyHighlight(d),highlightMarkers:d=>this.animateReadyHighlightMarkers(d),resize:d=>this.animateReadyResize(d),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:d=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(d):this.animateWaitingUpdateReady(d)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:d=>this.resetAllAnimation(d),reset:"empty"},clearing:{update:{target:"empty",action:d=>this.animateClearingUpdateEmpty(d)},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>Fy}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,o=this.checkResize(t),a=this.updateHighlightSelection(n);this.updateSelections(e),this.updateNodes(a,n,e);const r=this.getAnimationData(t,i);r&&(o&&this.animationState.transition("resize",r),this.animationState.transition("update",r))}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:o}=this;n!==void 0&&o!==void 0&&this.dispatch("data-update",{dataModel:n,processedData:o})}this.updateSeriesSelections()}}updateSeriesSelections(t){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,o=this._contextNodeData;if(!o)return;const{nodeData:a,labelData:r,itemId:l}=o;this.updatePaths({seriesHighlighted:t,itemId:l,contextData:o,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:a,markerSelection:s}))}getShapeFillBBox(){const{axes:t}=this,e=t.x,i=t.y,[s,n]=oi(e?.range??[0,1]),[o,a]=oi(i?.range??[0,1]),r=this.getSeriesDomain("x"),l=[e?.scale.convert(r.at(0)),e?.scale.convert(r.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=oi(l),[p,g]=oi(h);return{axis:new pt(s,o,n-s,a-o),series:new pt(d,p,u-d,g-p)}}updateNodes(t,e,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:o,hasHighlightedLabels:a}}=this,r=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=r||l,this.highlightGroup.visible=(r||l)&&e;const c=this.getOpacity();o?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),a&&this.updateLabelNodes({labelSelection:n});const{dataNodeGroup:h,markerGroup:d,datumSelection:u,labelSelection:p,markerSelection:g,paths:f,labelGroup:x}=this,{itemId:m}=this.contextNodeData??{};h.opacity=c,h.visible=r||l,x.visible=l,o&&(d.opacity=c,d.visible=l),x&&(x.opacity=c),this.updatePathNodes({seriesHighlighted:e,itemId:m,paths:f,opacity:c,visible:l,animationEnabled:r}),h.visible&&(this.updateDatumNodes({datumSelection:u,highlightedItems:t,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),o&&this.updateMarkerNodes({markerSelection:g,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(),o=t&&n?.datum?n:void 0;let a,r;if(o!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:h}=s;r=this.getHighlightData(h,o),a=l?this.getHighlightLabelData(c,o):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:r,highlightSelection:e}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:a,highlightLabelSelection:i}),r}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 pt(0,0,t,e);this.quadtree=new eU(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:o,markerGroup:a}=this;let r=o.pickNodes(i,s).filter(l=>l.datum.missing!==!0);if(r.length===0&&n&&(r=a?.pickNodes(i,s).filter(l=>l.datum.missing!==!0)),r.length!==0)return r.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 o=s.x,a=s.y,r={x:e,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:d=NaN,y:u=NaN}={}}=h;if(isNaN(d)||isNaN(u)||!(o?.inRange(d)&&a?.inRange(u)))continue;const g=Math.max((r.x-d)**2+(r.y-u)**2,0);g<l&&(l=g,c=h)}for(const h of this.moduleMap.modules()){const d=h.pickNodeNearest(t);if(d!==void 0&&d.distanceSquared<l){l=d.distanceSquared,c=d.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:o}=this,{pickOutsideVisibleMinorAxis:a}=this.properties;if(!o)return;const r=n.x,l=n.y,c=[r,l].filter(fc.is).map(g=>g.direction);if(e&&c.length===0)return;const[h="x"]=c,d=[i,s];h!=="x"&&d.reverse();const u=[1/0,1/0];let p;for(const g of o.nodeData){const{x:f=NaN,y:x=NaN}=g.point??g.midPoint??{};if(isNaN(f)||isNaN(x)||g.missing===!0)continue;const m=[r?.inRange(f),l?.inRange(x)];if(h!=="x"&&m.reverse(),!m[0]||!a&&!m[1])continue;const b=[f,x];h!=="x"&&b.reverse();let S=!0;for(let M=0;M<b.length;M++){const D=Math.abs(b[M]-d[M]);if(D>u[M]){S=!1;break}else D<u[M]&&(u[M]=D,u.fill(1/0,M+1,u.length))}S&&(p=g)}if(p){let g=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const f of this.moduleMap.modules()){const x=f.pickNodeMainAxisFirst(t);if(x!==void 0&&x.distanceSquared<g){p=x.datum,g=x.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(t,e,i){const s=this.keysOrValues(t),n=0;return jC(i?.length??s.length,e,o=>{const a=i?.[o]??o;return this.xCoordinateRange(s[a],n,a)})}domainForVisibleRange(t,e,i,s,n,o){const{processedData:a,dataModel:r}=this,[l,c]=s,h=this.keysOrValues(i);if(n){const g=this.visibleRange(i,s,o);return r.getDomainBetweenRange(this,e,g,a)}const d=e.map(g=>this.keysOrValues(g));let u=1/0,p=-1/0;return h.forEach((g,f)=>{const[x,m]=this.xCoordinateRange(g,0,f);if(!(m<l||x>c))for(let b=0;b<e.length;b++){const S=d[b][f];u=Math.min(u,S),p=Math.max(p,S)}}),u>p?[NaN,NaN]:[u,p]}domainForClippedRange(t,e,i,s){const{processedData:n,dataModel:o,axes:a}=this,l=oU(a[t==="x"?"y":"x"]);if(!l)return e.flatMap(g=>o.getDomain(this,g,"value",n));const c=this.keysOrValues(i);if(s){const g=aU(c.length,l,f=>c[f]);return o.getDomainBetweenRange(this,e,g,n)}const h=e.map(g=>this.keysOrValues(g)),d=l[0].valueOf(),u=l[1].valueOf(),p=[];return c.forEach((g,f)=>{const x=g.valueOf();if(x<d||x>u)return;const m=h.map(b=>b[f]);x>=d&&p.push(...m),x<=u&&p.push(...m)}),p}countVisibleItems(t,e,i,s,n){const{dataModel:o,processedData:a}=this;if(!o||!a)return 1/0;const r=this.keysOrValues(t),l=e.map(D=>o.resolveColumnById(this,D,a)),c=this.axes.x,h=this.axes.y,d=this.shouldFlipXY(),u=c.range,p=h.range,g=(D,C,k)=>D[0]+(k-C[0])/(C[1]-C[0])*(D[1]-D[0]),f=g(u,c.visibleRange,i[0]),x=g(u,c.visibleRange,i[1]),m=g(p,h.visibleRange,d?s[0]:s[1]),b=g(p,h.visibleRange,d?s[1]:s[0]),S=Math.round((i[0]+(i[1]-i[0])/2)*r.length),M=0;return WC(0,r.length-1,S,n,D=>{let[C,k]=this.xCoordinateRange(r[D],M,D),[I,L]=this.yCoordinateRange(l.map(N=>N[D]),M,D);return!Pt(C)||!Pt(k)||!Pt(I)||!Pt(L)?!1:(d&&([C,k,I,L]=[I,L,C,k]),C>=f&&k<=x&&I>=m&&L<=b)})}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=i??[];if(e){const o=s;return this.updateMarkerSelection({nodeData:n,markerSelection:o})}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=>{Fi([i],e)})}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Fi([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&Fi([t.labelSelection],e)}resetMarkerAnimation(t){const{marker:e}=this.opts?.animationResetFns??{};e&&this.opts.hasMarkers&&Fi([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&&Fi([t],e)}animateReadyHighlightMarkers(t){const{marker:e}=this.opts?.animationResetFns??{};e&&Fi([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 I0){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 he){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Hu){const{domain:e}=t;return{type:"category",domain:e,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(fv)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}};function oU(t){let e,i;if((t instanceof qa||t instanceof Zr)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function aU(t,e,i){const s=e[0].valueOf(),n=e[1].valueOf(),o=$T(0,t-1,r=>{const l=i(r)?.valueOf();return!Number.isFinite(l)||l>=s});let a=KT(0,t-1,r=>{const l=i(r)?.valueOf();return!Number.isFinite(l)||l<=n});return o==null||a==null?[0,0]:(a=Math.min(a+1,t),[o,a])}var rw=le(["linear","smooth","step"],"a line style"),lw=le(["start","middle","end"]),hd=class extends kt{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};v([A(rw)],hd.prototype,"type",2),v([A(ae)],hd.prototype,"tension",2),v([A(lw)],hd.prototype,"position",2);var Qe=class extends ir{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Vn,this.fillPatternDefaults=new _e,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new hd,this.shadow=new Ao,this.marker=new Vi,this.label=new Ni,this.tooltip=new xs,this.connectMissingData=!1}};v([A(et)],Qe.prototype,"xKey",2),v([A(et,{optional:!0})],Qe.prototype,"xName",2),v([A(et)],Qe.prototype,"yKey",2),v([A(et,{optional:!0})],Qe.prototype,"yName",2),v([A(et,{optional:!0})],Qe.prototype,"yFilterKey",2),v([A(ot,{optional:!0})],Qe.prototype,"normalizedTo",2),v([A(Zi(qo,Jo,zt))],Qe.prototype,"fill",2),v([A(at)],Qe.prototype,"fillGradientDefaults",2),v([A(at)],Qe.prototype,"fillPatternDefaults",2),v([A(ae)],Qe.prototype,"fillOpacity",2),v([A(zt)],Qe.prototype,"stroke",2),v([A(ot)],Qe.prototype,"strokeWidth",2),v([A(ae)],Qe.prototype,"strokeOpacity",2),v([A(ta)],Qe.prototype,"lineDash",2),v([A(ot)],Qe.prototype,"lineDashOffset",2),v([A(at)],Qe.prototype,"interpolation",2),v([A(at)],Qe.prototype,"shadow",2),v([A(at)],Qe.prototype,"marker",2),v([A(at)],Qe.prototype,"label",2),v([A(at)],Qe.prototype,"tooltip",2),v([A(xt)],Qe.prototype,"connectMissingData",2);function aa(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 rU(t){const e=aa(t);return e[0].x>e[1].x&&e.reverse(),e}function lU(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 kp(t,e,i){const[s,n]=aa(t),o=n.x!==s.x?(i.x-e.x)/(n.x-s.x):0,a=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)*o,cp1y:i.y-(t.cp2y-s.y)*a,cp2x:i.x-(t.cp1x-s.x)*o,cp2y:i.y-(t.cp1y-s.y)*a,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)*o}}}function cw(t,e,i){const{moveTo:s}=t,[n,o]=rU(t),{x:a,y:r}=n,{x:l,y:c}=o;if(i<a)return kp(t,n,n);if(e>l)return kp(t,o,o);switch(t.type){case"linear":{const h=r===c?void 0:(c-r)/(l-a),d=h==null?r:h*(e-a)+r,u=h==null?r:h*(i-a)+r;return{type:"linear",moveTo:s,x0:e,y0:d,x1:i,y1:u}}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:d,stepX:u}=t;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:d,stepX:u}}case"cubic":{const h=Gf(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[d,u]=Vf(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const p=Gf(u[0].x,u[1].x,u[2].x,u[3].x,i);return[u,d]=Vf(u[0].x,u[0].y,u[1].x,u[1].y,u[2].x,u[2].y,u[3].x,u[3].y,p),{type:"cubic",moveTo:s,cp0x:u[0].x,cp0y:u[0].y,cp1x:u[1].x,cp1y:u[1].y,cp2x:u[2].x,cp2y:u[2].y,cp3x:u[3].x,cp3y:u[3].y}}}}function cU(t){const e=[];let i=0,s=NaN,n=NaN;for(const{x:o,y:a}of t){if(i>0){const r=i===1;e.push({type:"linear",moveTo:r,x0:s,y0:n,x1:o,y1:a})}i+=1,s=o,n=a}return e}var hU={start:0,middle:.5,end:1};function dU(t,e){const i=[];let s=0,n=NaN,o=NaN;const a=typeof e=="number"?e:hU[e];for(const{x:r,y:l}of t){if(s>0){const c=s===1,h=n+(r-n)*a;i.push({type:"step",moveTo:c,x0:n,y0:o,x1:r,y1:l,stepX:h})}s+=1,n=r,o=l}return i}var _y=.05;function uU(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const s=i.map((o,a)=>{const r=a===0?o:i[a-1],l=a===i.length-1?o:i[a+1],c=a===0||a===i.length-1;if(Math.sign(r.y-o.y)===Math.sign(l.y-o.y))return 0;if(!c){const h=Math.abs(r.y-l.y),d=Math.abs(o.y-r.y)/h,u=Math.abs(o.y-l.y)/h;if(d<=_y||1-d<=_y||u<=_y||1-u<=_y)return 0}return(l.y-r.y)/(l.x-r.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let o=1;o<i.length;o+=1){const a=i[o-1],r=s[o-1],l=i[o],c=s[o],h=l.x-a.x,d=l.y-a.y;let u=h*e/3,p=h*r*e/3,g=h*e/3,f=h*c*e/3;c===0&&Math.abs(p)>Math.abs(d)&&(u*=Math.abs(d/p),p=Math.sign(p)*Math.abs(d)),r===0&&Math.abs(f)>Math.abs(d)&&(g*=Math.abs(d/f),f=Math.sign(f)*Math.abs(d)),n.push({type:"cubic",moveTo:o===1,cp0x:a.x,cp0y:a.y,cp1x:a.x+u,cp1y:a.y+p,cp2x:l.x-g,cp2y:l.y-f,cp3x:l.x,cp3y:l.y})}return n}function xi(t,e,i){return(e-t)*i+t}function pU(t,e){const{x0:i,y0:s,x1:n,y1:o}=t,r=(o-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:r,stepX:e,stepY0:r,stepY1:r,rightCp1x:e,rightCp1y:r,rightCp2x:n,rightCp2y:o}}function gU(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:o,cp2x:a,cp2y:r,cp3x:l,cp3y:c}=t,h=Gf(i,n,a,l,e),[d,u]=Vf(i,s,n,o,a,r,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:e,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function fU(t){const{x0:e,y0:i,x1:s,y1:n,stepX:o}=t;return{leftCp1x:(e+o)/2,leftCp1y:i,leftCp2x:(e+o)/2,leftCp2y:i,stepX:o,stepY0:i,stepY1:n,rightCp1x:(o+s)/2,rightCp1y:n,rightCp2x:(o+s)/2,rightCp2y:n}}function hw(t,e){return t.type==="linear"?pU(t,e):t.type==="cubic"?gU(t,e):fU(t)}function dw(t,e,i,s,n,o,a){switch(e){case 0:a?t.moveTo(n,o):t.moveTo(i,s);break;case 1:a?t.lineTo(n,o):t.lineTo(i,s);break}}function uw(t,e,i,s,n,o){o?t.lineTo(e,i):t.lineTo(s,n)}function pw(t,e,i,s,n,o,a,r,l,c){c?t.cubicCurveTo(o,a,s,n,e,i):t.cubicCurveTo(s,n,o,a,r,l)}function gw(t,e,i,s,n,o,a){a?(t.lineTo(o,n),t.lineTo(o,i),t.lineTo(e,i)):(t.lineTo(o,i),t.lineTo(o,n),t.lineTo(s,n))}function H0(t,e,i,s){const[n,o]=aa(e);switch(dw(t,i,n.x,n.y,o.x,o.y,s),e.type){case"linear":uw(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":pw(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":gw(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break}}function fw(t,e,i){const[s,n]=aa(t),[o,a]=aa(e),r=xi(s.x,o.x,i),l=xi(s.y,o.y,i),c=xi(n.x,a.x,i),h=xi(n.y,a.y,i);return[{x:r,y:l},{x:c,y:h}]}function U0(t,e,i,s,n,o){const[{x:a,y:r},{x:l,y:c}]=fw(e,i,s);if(dw(t,n,a,r,l,c,o),e.type==="cubic"&&i.type==="cubic"){const h=xi(e.cp1x,i.cp1x,s),d=xi(e.cp1y,i.cp1y,s),u=xi(e.cp2x,i.cp2x,s),p=xi(e.cp2y,i.cp2y,s);pw(t,a,r,h,d,u,p,l,c,o)}else if(e.type==="step"&&i.type==="step"){const h=xi(e.stepX,i.stepX,s);gw(t,a,r,l,c,h,o)}else if(e.type==="linear"&&i.type==="linear")uw(t,a,r,l,c,o);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(a+l)/2;const d=hw(e,h),u=hw(i,h),p=xi(d.leftCp1x,u.leftCp1x,s),g=xi(d.leftCp1y,u.leftCp1y,s),f=xi(d.leftCp2x,u.leftCp2x,s),x=xi(d.leftCp2y,u.leftCp2y,s),m=xi(d.stepX,u.stepX,s),b=xi(d.stepY0,u.stepY0,s),S=xi(d.stepY1,u.stepY1,s),M=xi(d.rightCp1x,u.rightCp1x,s),D=xi(d.rightCp1y,u.rightCp1y,s),C=xi(d.rightCp2x,u.rightCp2x,s),k=xi(d.rightCp2y,u.rightCp2y,s);o?(t.cubicCurveTo(C,k,M,D,m,S),t.lineTo(m,b),t.cubicCurveTo(f,x,p,g,a,r)):(t.cubicCurveTo(p,g,f,x,m,b),t.lineTo(m,S),t.cubicCurveTo(M,D,C,k,l,c))}}var yw=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(yw||{});function yU(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 bs(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=>yU(t,n))>=0?e.inset+e.step*i:NaN}function Wn(t){return Qv(t).valueOf()}function mw({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(Wn(i.xValue0)),xValue1Index:e.indexOf(Wn(i.xValue1)),datumIndex:s}))}function mU(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 o of i.domain){const a=bs(o,s);if(Number.isFinite(a)){if(a<n)return!1;n=a}}return!0}function xU(t,e){let i=-1/0;for(const s of t){const n=bs(s.value,e.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function bU(t,e){const i=new Map;for(const{xValue0:h,xValue1:d}of t.data){const u=Wn(h),p=Wn(d);i.set(u,h).set(p,d)}const s=Array.from(i,([h,d])=>({axisValue:h,value:d}));s.sort((h,d)=>bs(h.value,t.scales.x)-bs(d.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of e.data){const u=Wn(h),p=Wn(d);i.has(u)||(i.set(u,h),n.push({axisValue:u,value:h})),i.has(p)||(i.set(p,d),n.push({axisValue:p,value:d}))}n.sort((h,d)=>bs(h.value,e.scales.x)-bs(d.value,e.scales.x));const o=s;let a=0;for(const h of n){for(let d=o.length-1;d>a;d-=1){const u=bs(h.value,e.scales.x),p=bs(o[d].value,e.scales.x);if(u>p){a=d+1;break}}o.splice(a,0,h),a+=1}if(!xU(o,e))return;const r=o.map(h=>h.axisValue),l=mw(e,r),c=mw(t,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function xw(t,e,i){if(i.xValue1Index===i.xValue0Index+1)return t;const s=aa(t),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),o=s[0].x+(e-i.xValue0Index)*n,a=o+n;return cw(t,o,a)}function bw(t,e){const[i,s]=aa(t),n=bs(0,e.scales.y);return kp(t,{x:i.x,y:n},{x:s.x,y:n})}function Sw(t){const[e,i]=aa(t);return lU(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function vw(t,e,i,s,n,o){let a,r;if(n.xValue0Index>=o.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=o.xValue1Index)?.datumIndex,u=d!=null?i.data[d]:void 0;a=u?.xValue1,r=u?.yValue1}else if(n.xValue0Index<=o.xValue0Index){const d=s.find(p=>p.xValue0Index>=o.xValue0Index)?.datumIndex,u=d!=null?i.data[d]:void 0;a=u?.xValue0,r=u?.yValue0}if(a==null||r==null)switch(e){case 0:return bw(t,i);case 1:return Sw(t)}const l=bs(a,i.scales.x),c=bs(r,i.scales.y),h={x:l,y:c};return kp(t,h,h)}function Y0(t,e){if(e==null)return;const i=Wn(t.xValue0),s=Wn(t.xValue1);return e.find(n=>Wn(n.xValue0)===i&&Wn(n.xValue1)===s)?.span}function Mw(t,e,i,s,n,o,a){const r=t.data[s.datumIndex],l=r.span,c=Y0(r,n);if(c!=null)a.removed.push({from:c,to:c}),a.moved.push({from:c,to:l}),a.added.push({from:l,to:l});else{const h=vw(l,e,t,i,s,o);a.added.push({from:h,to:l})}}function Dw(t,e,i,s,n,o,a){const r=t.data[s.datumIndex],l=r.span,c=Y0(r,n);if(c!=null)a.removed.push({from:l,to:l}),a.moved.push({from:l,to:c}),a.added.push({from:c,to:c});else{const h=vw(l,e,t,i,s,o);a.removed.push({from:l,to:h})}}function Aw(t,e,i,s,n){const o=e[n.xValue0Index],a=i.data.find(x=>Wn(x.xValue0)===o),r=e[n.xValue1Index],l=i.data.find(x=>Wn(x.xValue1)===r);if(a==null||l==null)return;const[{x:c},{x:h}]=aa(t),d=bs(a.xValue0,i.scales.x),u=bs(a.yValue0,i.scales.y),p=bs(l.xValue1,i.scales.x),g=bs(l.yValue1,i.scales.y);let f=s.data[n.datumIndex].span;return f=kp(f,{x:d,y:u},{x:p,y:g}),f=cw(f,c,h),f}function SU(t,e,i,s,n,o,a,r,l){const c=n+1,h=a.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),d=o.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),u=e.zeroData,p=t.zeroData;if(h==null&&d!=null){Mw(t,i,o,d,u,r,l);return}else if(h!=null&&d==null){Dw(e,i,a,h,p,r,l);return}else if(h==null||d==null)return;let g;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?g=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?g=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?g=1:g=0;const f=e.data[h.datumIndex],x=xw(f.span,n,h),m=t.data[d.datumIndex],b=xw(m.span,n,d);if(g===1){const S=Aw(x,s,e,t,d);S!=null?(l.removed.push({from:x,to:S}),l.moved.push({from:S,to:b}),l.added.push({from:b,to:b})):Dw(e,i,a,h,p,r,l)}else if(g===-1){const S=Aw(b,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:b})):Mw(t,i,o,d,u,r,l)}else l.removed.push({from:x,to:x}),l.moved.push({from:x,to:b}),l.added.push({from:b,to:b})}function vU(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:o,oldDataAxisIndices:a,newDataAxisIndices:r}=t,l={xValue0Index:Math.max(a.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(a.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;c<o.length-1;c+=1)SU(e,i,s,o,c,r,a,l,n);return n}function Iw(t,e,i){const{span:s}=e;switch(i){case 0:return Y0(e,t.zeroData)??bw(s,t);case 1:return Sw(s)}}function MU(t,e,i){const s=[],n=[];for(const o of e.data){const a=o.span,r=Iw(e,o,i);n.push({from:a,to:r})}for(const o of t.data){const a=o.span,r=Iw(t,o,i);s.push({from:r,to:a})}return{removed:n,moved:[],added:s}}function Cp(t,e,i){if(!mU(t,e))return;const s=bU(t,e);return s==null?MU(t,e,i):vU(s,t,e,i)}function Tw(t){return t.type==="continuous"||t.type==="log"}function kw(t){return t.type==="category"}function dd(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:Tw(t)&&Tw(e)?t.type===e.type&&Xo(t.domain,e.domain)&&Xo(t.range,e.range):kw(t)&&kw(e)?t.inset===e.inset&&t.step===e.step&&Xo(t.domain,e.domain):!1}function Lp(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 Gy(t,e){let i;const s=t.map(n=>n.point);switch(e.type){case"linear":i=cU(s);break;case"smooth":i=uU(s,e.tension);break;case"step":i=dU(s,e.position);break}return i.map((n,o)=>({span:n,xValue0:t[o].xDatum,yValue0:t[o].yDatum,xValue1:t[o+1].xDatum,yValue1:t[o+1].yDatum}))}function Cw(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function K0({path:t},e){let i;for(const{span:s}of e){const[n,o]=aa(s),a=i!=null&&Cw(i,n)?1:0;H0(t,s,a,!1),i=o}}function Vy(t,e,i){let s;for(const n of i){const[o,a]=fw(n.from,n.to,t),r=s!=null&&Cw(s,o)?1:0;U0(e.path,n.from,n.to,t,r,!1),s=a}}function $0(t,e,i){const s=(r,l)=>Vy(r,l,e.removed),n=(r,l)=>Vy(r,l,e.moved),o=(r,l)=>Vy(r,l,e.added),a=X0(t,i);return{status:t,path:{addPhaseFn:o,updatePhaseFn:n,removePhaseFn:s},pathProperties:a}}function X0(t,e){const i=e==="none"?"updated":t,s={fromFn:n=>{let o;return t==="removed"?o={finish:{visible:!1}}:t==="added"?o={start:{visible:!0}}:o={},{phase:xo[i],...o}},toFn:n=>({phase:xo[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 Lw(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!Lp(t.scales.x)||!Lp(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const a=Cp({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(a==null)return;const r=$0(o,a,"fade"),l=(i?.changed??!0)||!dd(t.scales.x,e.scales.x)||!dd(t.scales.y,e.scales.y)||o!=="updated";return{status:o,stroke:r,hasMotion:l}}function Nw({path:t},{spans:e,phantomSpans:i}){for(let s=0;s<e.length;s+=1){const{span:n}=e[s],o=i[s].span;H0(t,n,0,!1),H0(t,o,1,!0),t.closePath()}}function jy(t,{path:e},i,s){for(let n=0;n<i.length;n+=1){const o=i[n],a=s[n];U0(e,o.from,o.to,t,0,!1),U0(e,a.from,a.to,t,1,!0),e.closePath()}}function ww(t,e,i,s){const n=(l,c)=>jy(l,c,e.removed,i.removed),o=(l,c)=>jy(l,c,e.moved,i.moved),a=(l,c)=>jy(l,c,e.added,i.added),r=X0(t,s);return{status:t,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function Ow(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!Lp(t.scales.x)||!Lp(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const o=Cp({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(o==null)return;const a=Cp({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(a==null)return;const r=Cp({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(r==null)return;const l="none",c=ww(n,o,a,l),h=$0(n,r,l);return{status:n,fill:c,stroke:h}}function Np({id:t},e,i,...s){const n={phase:i?xo[i]:"trailing"};Ya(t,"markers",e,s,{opacity:0},{opacity:1},n),s.forEach(o=>o.cleanup())}function Z0({id:t},e,...i){Ya(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function Q0({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;Fe(t,"markers",i,s,{fromFn:(r,l)=>{const c=l.midPoint?.x??n;let h=ft(0,NC(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:ey,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function wp(t){return{opacity:1,scalingX:1,scalingY:1}}function Op(t,e){return{x:e.point?.x??NaN,y:e.point?.y??NaN,scalingCenterX:e.point?.x??NaN,scalingCenterY:e.point?.y??NaN}}function Ep(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 o=4+(n.focusSize??t.getFormattedMarkerStyle(s).size),a=o/2,r=s.point.x-a,l=s.point.y-a;return Be.toCanvas(t.contentGroup,new pt(r,l,o,o))}function q0({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:o,seriesRectHeight:a}=i;Ya(t,"path_properties",s,n,{clipX:0},{clipX:o},{phase:"initial",start:{clip:!0,clipY:a,visible:e},finish:{clip:!1,visible:e}})}function Wy({id:t},e,i,s="add",...n){Ya(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function J0(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function Hy({nodeDataDependencies:t},e){const i=s=>isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var DU=.125,AU=.25,Uy=class extends nl{constructor(t){super({moduleCtx:t,directionKeys:bc,directionNames:Sc,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:J0({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:er,marker:(e,i)=>({...wp(e),...Op(e,i)})},clipFocusBox:!1}),this.properties=new Qe,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>Fy||this.contextNodeData.strokeData.spans.length>Fy)}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:o,yKey:a,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:d,yScale:u}),f={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},x=[];$e(c)&&x.push(Dy(Object.values(f),c)),h&&x.push(id());const m={invalidValue:null};($e(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(t,e,{props:[Mo(o,p,{id:"xValue"}),Wt(a,g,{id:"yValueRaw",...m}),...r!=null?[Wt(r,g,{id:"yFilterRaw"})]:[],...FN(a,g,{id:"yValueStack",...m,groupId:f.stack}),Wt(a,g,{id:"yValue",...m,groupId:f.value}),...Xr(a,"window","current",{id:"yValueEnd",...m,groupId:f.values},g),...Xr(a,"normal","current",{id:"yValueCumulative",...m,groupId:f.marker},g),...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 a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return a?.def.type==="key"&&a.def.valueType==="category"?r:Us(Za(r))}const o=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);if(n instanceof nd||n instanceof Zr)return Us(o);{const a=Number.isFinite(o[1]-o[0])?[o[0]>0?0:o[0],o[1]<0?0:o[1]]:[];return Us(a)}}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,o=t.y;if(!n||!o||!e||!s||i?.type!=="grouped"||!this.properties.isValid())return;const{yKey:a,xKey:r,yFilterKey:l,marker:c,label:h,fill:d,stroke:u,connectMissingData:p,interpolation:g}=this.properties,{scale:f}=n,{scale:x}=o,{isContinuousY:m}=this.getScaleInformation({xScale:f,yScale:x}),b=(f.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),k=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,I=s.resolveColumnById(this,"yValueStack",i),L=(Q,tt,X)=>{let it;return($e(this.properties.normalizedTo)?m&&dy(X):!isNaN(X))&&(it=tt),{x:f.convert(Q)+b,y:x.convert(it),size:c.size}},N=[],O=[],{visibleSameStackCount:w}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let R=!1;const{dataSources:G}=i,B=G.get(this.id)??[];for(const{datumIndex:Q}of s.forEachGroupDatum(this,i)){const tt=S[Q];if(tt==null)return;const X=B[Q],it=D[Q],nt=C[Q],ht=M[Q],lt=Number.isFinite(it),vt=L(tt,+nt,it),At=k!=null?k[Q]===it:void 0;if(At===!1&&(R=!0),lt&&c&&O.push({series:this,itemId:a,datum:X,datumIndex:Q,midPoint:{x:vt.x,y:vt.y},cumulativeValue:ht,yValue:it,xValue:tt,yKey:a,xKey:r,point:vt,fill:c.fill??d,stroke:c.stroke??u,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:At}),lt&&h){const ut=this.getLabelText(h,{value:it,datum:X,xKey:r,yKey:a,xName:this.properties.xName,yName:this.properties.yName});N.push({series:this,itemId:a,datum:X,datumIndex:Q,x:vt.x,y:vt.y,labelText:ut})}}const P=Q=>Q.flatMap(tt=>Array.isArray(tt)?Gy(tt,g):new Array(tt.skip).fill(null)),V=(Q,tt)=>({point:{x:f.convert(Q)+b,y:x.convert(tt)},xDatum:Q,yDatum:tt}),W=Q=>{const tt=[];for(const{datumIndexes:[X,it,nt]}of s.forEachGroupDatumTuple(this,i)){const ht=S[it],lt=I[it],vt=lt[Q],At=Number.isFinite(vt);if(p&&!At)continue;const ut=X!=null?I[X]:void 0,Kt=nt!=null?I[nt]:void 0;let Xt=0,Gt=0;for(let Dt=0;Dt<=Q;Dt+=1){const Bt=lt[Dt];if(Number.isFinite(Bt)){const $t=ut==null||Number.isFinite(ut[Dt]),Xi=Kt==null||Number.isFinite(Kt[Dt]);$t&&(Xt+=Bt),Xi&&(Gt+=Bt)}}const Vt=tt[tt.length-1];if(!p&&(Xt!==Gt||!At))if(!At&&Array.isArray(Vt)&&Vt.length===1)tt[tt.length-1]={skip:1};else{const Dt=V(ht,Xt),Bt=V(ht,Gt);Array.isArray(Vt)?Vt.push(Dt):Vt!=null&&(Vt.skip+=1),tt.push(At?[Bt]:{skip:0})}else{const Dt=p?vt:Math.max(Xt,Gt),Bt=V(ht,Dt);Array.isArray(Vt)?Vt.push(Bt):Vt!=null?(Vt.skip+=1,tt.push([Bt])):tt.push([Bt])}}return P(tt)},F=this.seriesGrouping?.stackIndex??0,_=()=>{const Q=Array.from(s.forEachGroupDatum(this,i),({datumIndex:tt})=>{const X=S[tt],nt=I[tt][F];if(!(p&&!Number.isFinite(nt)))return V(X,0)}).filter(tt=>tt!=null);return Gy(Q,g)},z=W(F),U=z.map(()=>null);for(let Q=F-1;Q>=-1;Q-=1){let tt;for(let X=0;X<U.length;X+=1)U[X]==null&&(tt??(tt=Q!==-1?W(Q):_()),U[X]=tt[X])}const Y=z.map((Q,tt)=>Q??U[tt]),Z=z.filter(Q=>Q!=null);return{itemId:a,fillData:{itemId:a,spans:Y,phantomSpans:U},strokeData:{itemId:a,spans:Z},labelData:N,nodeData:O,scales:this.calculateScaling(),visible:this.visible,stackVisible:w>0,crossFiltering:R}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,o]=t.paths,a=this.contextNodeData?.crossFiltering===!0,r=this.getStrokeWidth(this.properties.strokeWidth);o.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:r,strokeOpacity:this.properties.strokeOpacity*(a?AU:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const l=uc(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);pc(n,{fill:l,stroke:void 0,fillOpacity:this.properties.fillOpacity*(a?DU:1)},void 0,this.getShapeFillBBox()),n.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:e,visible:i||s}),Hy(this,o),Hy(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(),Nw(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),K0(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:o,fill:a,stroke:r,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:d}=this.properties,u=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=jt(i&&d.item,o.getStyle(),{fill:a,stroke:r,strokeWidth:l,fillOpacity:c,strokeOpacity:h}),f=this.getShapeFillBBox();e.each((x,m)=>{this.updateMarkerStyle(o,x,m.datum,m.point,Yr(m,s,n,u,p),i,g,f,{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:o,fontFamily:a,color:r}=this.properties.label;e.each((l,c)=>{const{x:h,y:d,labelText:u}=c;u&&i&&this.visible?(l.fontStyle=s,l.fontWeight=n,l.fontSize=o,l.fontFamily=a,l.textAlign="center",l.textBaseline="bottom",l.text=u,l.x=h,l.y=d-10,l.fill=r,l.visible=!0):l.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h,marker:d}=o,u=n.x,p=n.y;if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveKeysById(this,"xValue",s)[t],x=i.resolveColumnById(this,"yValueRaw",s)[t],{xDomain:m,yDomain:b}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(f==null)return;const S=d.getStyle(),M={datum:g,xValue:f,yValue:x},D=this.getMarkerStyle(d,g,Yr(M,a,l,m,b),!1,void 0,S);return h.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(x)}]},{seriesId:e,datum:g,title:c,xKey:a,xName:r,yKey:l,yName:c,...D,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,marker:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties,c=!a.enabled||a.fill===void 0,h=c?uc(t,r,l):uc(a.fill,a.fillGradientDefaults,a.fillPatternDefaults);return{marker:{...this.getMarkerStyle(a,void 0,void 0,!1,void 0,{fill:h,fillOpacity:c?i:a.fillOpacity}),enabled:a.enabled||n<=0},line:{stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:o}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:t,id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??o??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),q0(this,o,...n),Fi([e],Op),Q0(this,o,e),ee(this,"labels",o,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:o,previousContextData:a}=t,[r,l]=o;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(o,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||a==null){c(),Np(this,e,"added",i),Wy(this,"fill_path_properties",e,"add",r),Wy(this,"stroke_path_properties",e,"add",l),ee(this,"labels",e,s);return}if(n.crossFiltering!==a.crossFiltering){h();return}const d=Ow(n,a);if(d===void 0){h();return}else if(d.status==="no-op")return;Np(this,e,void 0,i),Fe(this.id,"fill_path_properties",e,[r],d.fill.pathProperties),zy(this.id,"fill_path_update",e,[r],d.fill.path),Fe(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),zy(this.id,"stroke_path_update",e,[l],d.stroke.path),ee(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,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,Yr(t,e,i,s,n),!0)}computeFocusBounds(t){return Ep(this,t)}};Uy.className="AreaSeries",Uy.type="area";var Yy=ne(vG,"a valid number format string"),tM={enabled:j,text:E,padding:J,...ge},Ew=ne({enabled:j,type:K(st("line","range")),range:Ze(ne((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),mt(cn),bu(2,2)),value:Ze(ne((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),cn),label:tM,fill:E,fillOpacity:Tt,...rt,...Ot},"cross-line options"),Rw={...Ew,label:{...tM,position:st("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:J}},eM={enabled:j,rotation:J,avoidCollisions:j,minSpacing:H,spacing:H,formatter:bt,itemStyler:bt,...ge},ud={autoRotate:j,autoRotateAngle:J,...eM},Ky={reverse:j,gridLine:{enabled:j,width:H,style:gs({stroke:dt,lineDash:mt(H)},"a grid-line style object array")},interval:{values:mt(cn),minSpacing:H},label:eM,line:{enabled:j,width:H,stroke:dt},tick:{enabled:j,width:H,size:H,stroke:dt}};Ky.context=cn,Ky.layoutConstraints={stacked:K(j),align:K(st("start","end")),unit:K(st("percent","px")),width:K(H)};var pd={...Ky,keys:mt(E),crossLines:gs(Rw,"a cross-line options array"),position:st("top","right","bottom","left"),thickness:H,title:{enabled:j,text:E,spacing:H,formatter:bt,...ge}};function gd(t){const e={enabled:j,xOffset:J,yOffset:J,renderer:bt};return t&&(e.format=E),{enabled:j,snap:j,label:e,...rt,...Ot}}function $y(t,e){return{min:Ze(t,Zl("max")),max:Ze(t,Su("min")),nice:j,interval:{step:e?Qt(gf,Qt(gf,cG(oc))):gf,values:mt(t),minSpacing:Ze(H,Zl("maxSpacing")),maxSpacing:Ze(H,Su("minSpacing"))}}}var iM=Qt(st("circle","cross","diamond","heart","plus","pin","square","star","triangle"),bt),Pw=st("never","always","hyphenate","on-space"),Xy=st("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),sM=st("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),nM=Qt(H,st("exact","nearest")),Bw=st("pointer","start","middle","end"),oM={enabled:j,text:E,textAlign:st("left","center","right"),wrapping:st("never","always","hyphenate","on-space"),spacing:H,maxWidth:H,maxHeight:H,...ge},Zy={enabled:j,text:E,renderer:bt},Qy=gs({label:E,action:bt},"a context menu actions array"),aM={label:E,ariaLabel:E,tooltip:E,icon:st("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")},Ps={width:H,height:H,minWidth:H,minHeight:H,suppressFieldDotNotation:j,title:oM,subtitle:oM,footnote:oM,padding:{top:H,right:H,bottom:H,left:H},seriesArea:{clip:j,padding:{top:H,right:H,bottom:H,left:H}},legend:{enabled:j,position:st("top","right","bottom","left"),orientation:st("horizontal","vertical"),maxWidth:H,maxHeight:H,spacing:H,preventHidingAll:j,reverseOrder:j,toggleSeries:j,item:{marker:{size:H,shape:iM,padding:H,strokeWidth:H},line:{length:H,strokeWidth:H},label:{maxLength:H,formatter:bt,...ge},maxWidth:H,paddingX:H,paddingY:H,showSeriesStroke:j},pagination:{marker:{size:H,shape:iM,padding:H},activeStyle:{...St,...rt},inactiveStyle:{...St,...rt},highlightStyle:{...St,...rt},label:ge},listeners:{legendItemClick:bt,legendItemDoubleClick:bt}},gradientLegend:{enabled:j,position:st("top","right","bottom","left"),spacing:H,reverseOrder:j,gradient:{preferredLength:H,thickness:H},scale:{label:{...ge,format:Yy,formatter:bt},padding:H,interval:{step:J,values:On,minSpacing:Ze(H,Zl("maxSpacing")),maxSpacing:Ze(H,Su("minSpacing"))}}},listeners:{seriesNodeClick:bt,seriesNodeDoubleClick:bt,seriesVisibilityChange:bt,click:bt,doubleClick:bt,annotations:bt,zoom:bt},highlight:{range:st("tooltip","node")},overlays:{loading:Zy,noData:Zy,noVisibleSeries:Zy,unsupportedBrowser:Zy},tooltip:{enabled:j,showArrow:j,pagination:j,delay:H,range:nM,wrapping:Pw,mode:st("single","shared","compact"),position:{type:sM,anchorTo:st("pointer","node","chart"),placement:Qt(Xy,mt(Xy)),xOffset:J,yOffset:J}},animation:{enabled:j,duration:H},contextMenu:{enabled:j,extraActions:Qy,extraSeriesAreaActions:Qy,extraNodeActions:Qy,extraLegendItemActions:Qy},dataSource:{getData:bt},keyboard:{enabled:j,tabIndex:J},touch:{dragAction:st("none","drag","hover")},ranges:{enabled:j,buttons:gs({...aM,value:Qt(J,Ze(mt(Qt(J,Xl)),bu(2,2)),bt)},"range button options array")},locale:{localeText:Ko,getLocaleText:bt},background:{visible:j,fill:dt,image:{url:E,top:J,right:J,bottom:J,left:J,width:H,height:H,opacity:Tt}},sync:{enabled:j,groupId:E,axes:st("x","y","xy"),nodeInteraction:j,zoom:j},zoom:{enabled:j,enableAxisDragging:j,enableDoubleClickToReset:j,enablePanning:j,enableScrolling:j,enableSelecting:j,enableTwoFingerZoom:j,keepAspectRatio:j,anchorPointX:Bw,anchorPointY:Bw,axes:st("x","y","xy"),deceleration:Qt(st("off","short","long"),Tt),minVisibleItems:H,minVisibleItemsX:H,minVisibleItemsY:H,panKey:st("alt","ctrl","meta","shift"),scrollingStep:Tt,autoScaling:{enabled:j,padding:Tt},buttons:{enabled:j,buttons:gs({...aM,value:st("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:E},"zoom button options array"),visible:st("always","zoomed","hover")}}};Ps.dataSource.requestThrottle=H,Ps.dataSource.updateThrottle=H,Ps.dataSource.updateDuringInteraction=j,Ps.zoom.enableIndependentAxes=j,Ps.statusBar=cn,Ps.foreground={visible:j,text:E,image:{url:E,top:J,right:J,bottom:J,left:J,width:H,height:H,opacity:Tt},...St},Ps.overrideDevicePixelRatio=J;var Io={id:E,cursor:E,visible:j,data:mt(Ko),showInLegend:j,nodeClickRange:nM,listeners:{nodeClick:bt,nodeDoubleClick:bt},highlightStyle:{item:{...St,...rt},series:{enabled:j,dimOpacity:Tt,strokeWidth:H}}};Io.context=cn,Io.seriesGrouping=cn,Io.highlight={enabled:j};var Rp={enabled:j,shape:iM,size:H,itemStyler:bt,...St,...rt,...Ot},ol={enabled:j,formatter:bt,...ge},IU={...ol,lineHeight:H,minimumFontSize:H,wrapping:Pw,overflowStrategy:st("ellipsis","hide")},qy={visible:j,xLowerKey:E,xUpperKey:E,yLowerKey:E,yUpperKey:E,xLowerName:E,xUpperName:E,yLowerName:E,yUpperName:E,itemStyler:bt,cap:{visible:j,length:H,lengthRatio:Tt,...rt,...Ot},...rt,...Ot},sr={enabled:j,showArrow:j,range:nM,renderer:bt,position:{type:sM,anchorTo:st("node","pointer","chart"),placement:Qt(Xy,mt(Xy)),xOffset:J,yOffset:J},interaction:{enabled:j}};sr.position._seriesOverrideType=sM;var Pp={enabled:j,xOffset:J,yOffset:J,blur:H,color:dt},rM=vu({linear:{},smooth:{tension:Tt},step:{position:st("start","middle","end")}},"interpolation line options"),TU={type:K(Ct("area")),xKey:K(E),yKey:K(E),xName:E,yName:E,stacked:j,stackGroup:E,normalizedTo:J,showInMiniChart:j,connectMissingData:j,interpolation:rM,label:ol,marker:Rp,tooltip:sr,shadow:Pp,...Io,...St,...rt,...Ot},kU={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:t=>new Uy(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:il,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Jr,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:il},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},zw={type:"series",name:"area",chartType:"cartesian",options:TU,create:t=>new Uy(t)};function lM(t,e){for(const i of e){const s=i.datum;s===void 0?$.error("undefined datum"):t.addValue(i,s)}}function cM(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:o}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(o)}}var hM=class extends ir{constructor(){super(...arguments),this.direction="vertical"}};v([A(kk)],hM.prototype,"direction",2);var Fw=class extends nl{constructor(){super(...arguments),this.groupScale=new np,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=Pt(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=Za(t)??[NaN,NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),Us(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 he.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=he.is(i)?s*-.5:0,o=i.convert(t)+n;return[o,o+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:o}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let r=0;r<o;r++)e.push(String(r));return i.domain=e,i.range=[0,s??0],t instanceof mc?i.paddingInner=t.groupPaddingInner:t instanceof fc?(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){lM(t,this.datumNodesIter())}pickNodeClosestDatum(t){return cM(this,t)}},dM=class extends Ni{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};v([A(le(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],dM.prototype,"placement",2),v([A(Et)],dM.prototype,"padding",2);var Ie=class extends hM{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Vn,this.fillPatternDefaults=new _e,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 Ao,this.label=new dM,this.tooltip=new xs,this.sparklineMode=!1,this.fastDataProcessing=!1}};v([A(et)],Ie.prototype,"xKey",2),v([A(et,{optional:!0})],Ie.prototype,"xName",2),v([A(et)],Ie.prototype,"yKey",2),v([A(et,{optional:!0})],Ie.prototype,"yName",2),v([A(et,{optional:!0})],Ie.prototype,"yFilterKey",2),v([A(et,{optional:!0})],Ie.prototype,"stackGroup",2),v([A(Et,{optional:!0})],Ie.prototype,"normalizedTo",2),v([A(Zi(qo,Jo,zt))],Ie.prototype,"fill",2),v([A(at)],Ie.prototype,"fillGradientDefaults",2),v([A(at)],Ie.prototype,"fillPatternDefaults",2),v([A(ae)],Ie.prototype,"fillOpacity",2),v([A(zt)],Ie.prototype,"stroke",2),v([A(ot)],Ie.prototype,"strokeWidth",2),v([A(ae)],Ie.prototype,"strokeOpacity",2),v([A(ta)],Ie.prototype,"lineDash",2),v([A(ot)],Ie.prototype,"lineDashOffset",2),v([A(ot)],Ie.prototype,"cornerRadius",2),v([A(xt,{optional:!0})],Ie.prototype,"crisp",2),v([A(Ls,{optional:!0})],Ie.prototype,"itemStyler",2),v([A(at,{optional:!0})],Ie.prototype,"shadow",2),v([A(at)],Ie.prototype,"label",2),v([A(at)],Ie.prototype,"tooltip",2),v([A(xt)],Ie.prototype,"sparklineMode",2),v([A(xt)],Ie.prototype,"fastDataProcessing",2);function _w(t,e,i,s){if(e!=null){const[n,o]=e;if(n!==0||o!==1)return!1}if(he.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}var uM=t=>OS(t.yValue??0);function Bp(t,e,i){const{startingX:s,startingY:n}=LU(t,e);return{isVertical:t,calculate:(a,r)=>{let l=t?a.x:s,c=t?n:a.y,h=t?a.width:0,d=t?0:a.height;const{opacity:u=1}=a;r&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=r,h=t?r.width:0,d=t?0:r.height,t&&!uM(r)?c+=r.height:!t&&uM(r)&&(l+=r.width));let p;return a.clipBBox==null?p=void 0:uM(a)?p=t?new pt(l,c-d,h,d):new pt(l-h,c,h,d):p=new pt(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function CU(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 zp(t){const e=o=>o==null||isNaN(o.x)||isNaN(o.y);return{toFn:(o,a,r)=>r==="removed"&&o.datum==null&&t.mode==="fade"?{...Fp(o,a),opacity:0}:r==="removed"||e(a)?t.calculate(a,o.previousDatum):{x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1},fromFn:(o,a,r)=>{r==="updated"&&e(a)?r="removed":r==="updated"&&e(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&t.mode==="fade"?l={...Fp(o,a),opacity:0}:r==="unknown"||r==="added"?l=t.calculate(a,o.previousDatum):l={x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1};const c=xo[r];return{...l,phase:c}},applyFn:(o,a,r)=>{o.setProperties(a),o.crisp=r==="end"&&(o.datum?.crisp??!1)}}}function LU(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(he.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(he.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function Fp(t,{x:e,y:i,width:s,height:n,clipBBox:o,opacity:a=1}){return{x:e,y:i,width:s,height:n,clipBBox:o,opacity:a,crisp:t.datum?.crisp??!1}}function pM(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:o}=e;return Be.toCanvas(t.contentGroup,new pt(i,s,n,o))}function Gw(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:o,textAlign:a,textBaseline:r}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u}=e;t.setProperties({visible:!0,x:s,y:n,text:o,fill:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:a,textBaseline:r})}else t.visible=!1}var NU={"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 Vw({isUpward:t,isVertical:e,placement:i,padding:s=0,rect:n}){let o=n.x+n.width/2,a=n.y+n.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:d}=NU[i],u=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,g=n.height*c;a=p+g*u+s*d*c,l=d===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,g=n.width*c;o=p+g*u+s*d*c,r=d===c?"left":"right"}}return{x:o,y:a,textAlign:r,textBaseline:l}}var wU=0,OU=1,EU=2,RU=3,PU=4,_p=class extends Fw{constructor(t){super({moduleCtx:t,directionKeys:bc,directionNames:Sc,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Fp,label:er}}),this.properties=new Ie,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:o}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:r}=this,l=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,d=!o||l>1||h,u=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:x,yScaleType:m}=this.getScaleInformation({xScale:p,yScale:g}),b=`bar-stack-${a}-yValues`,S=`${b}-trailing`,M=this.visible?{}:{forceValue:0},D=[Mo(e,x,{id:"xValue"}),Wt(i,m,{id:"yValue-raw",invalidValue:null,...M})];this.crossFilteringEnabled()&&D.push(Wt(s,m,{id:"yFilterValue",invalidValue:null,...M})),h&&D.push(...Xr(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...M},m),...Xr(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:S,separateNegative:!0,...M},m)),f&&D.push(_N,GN),Pt(n)&&D.push(Dy([b,S],Math.abs(n))),u&&this.processedData&&D.push(sd(this.id,this.processedData)),(u||!d)&&D.push(id());const{dataModel:C,processedData:k}=await this.requestDataModel(t,r,{props:D,groupByKeys:d,groupByData:!d});this.dataAggregationFilters=this.aggregateData(C,k),this.smallestDataInterval=k.reduced?.smallestKeyInterval,this.largestDataInterval=k.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 a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return a?.def.type==="key"&&a.def.valueType==="category"?r:this.padBandExtent(r)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange("y",[s],"xValue",!0);const o=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e):void 0;if(o!=null&&(n=[Math.min(n[0],o[0]),Math.max(n[1],o[1])]),this.getValueAxis()instanceof nd)return Us(n);{const a=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return Us(a)}}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(),o=this.getValueAxis();if(!t||!e||!n||!o||!this.properties.isValid())return;const a=e.dataSources?.get(this.id);if(a==null)return;const r=n.scale,l=o.scale,{xKey:c,yKey:h,xName:d,yName:u,legendItemName:p,label:g}=this.properties,f=o.isReversed(),{barWidth:x,groupIndex:m}=this.updateGroupScale(n),b=i.convert(String(m)),S=he.is(r)?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,k=!this.ctx.animationManager.isSkipped(),I=_=>r.convert(M[_])+b+S,L=this.properties.crisp??_w(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),N=l.convert(0),O=({datum:_,datumIndex:z,valueIndex:U,xValue:Y,yValue:Z,cumulativeValue:q,phantom:Q,currY:tt,prevY:X,x:it,width:nt,isPositive:ht,yRange:lt,labelText:vt,opacity:At,crossScale:ut=1})=>{const Kt=ht!==f,Xt=l.convert(tt),Gt=l.convert(X),Vt=l.convert(lt),Dt=this.getBarDirection()==="x",Bt=nt*.5*(1-ut),$t={x:Dt?Math.min(Xt,Gt):it+Bt,y:Dt?it+Bt:Math.min(Xt,Gt),width:Dt?Math.abs(Gt-Xt):nt*ut,height:Dt?nt*ut:Math.abs(Gt-Xt)},Xi=new pt($t.x,$t.y,$t.width,$t.height),ps={x:Dt?Math.min(N,Vt):it+Bt,y:Dt?it+Bt:Math.min(N,Vt),width:Dt?Math.abs(N-Vt):nt*ut,height:Dt?nt*ut:Math.abs(N-Vt)},Nn=this.shouldFlipXY()?$t.height:$t.width;return{series:this,itemId:Q?Gi(h,Q):h,datum:_,datumIndex:z,valueIndex:U,cumulativeValue:q,phantom:Q,xValue:Y,yValue:Z,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:Nn,lengthMax:Nn},x:ps.x,y:ps.y,width:ps.width,height:ps.height,midPoint:{x:$t.x+$t.width/2,y:$t.y+$t.height/2},opacity:At,topLeftCornerRadius:Dt!==Kt,topRightCornerRadius:Kt,bottomRightCornerRadius:Dt===Kt,bottomLeftCornerRadius:!Kt,clipBBox:Xi,crisp:L,label:vt!=null?{text:vt,...Vw({isUpward:Kt,isVertical:!Dt,placement:g.placement,padding:g.padding,rect:$t})}:void 0,missing:Z==null,focusable:!Q}},w=[],R=[],G=[],B=(_,z,U,Y,Z,q,Q,tt)=>{const X=M[_];if(X==null)return;const it=D[_],nt=C!=null?Number(C[_]):void 0,ht=it>=0&&!Object.is(it,-0);if(!Number.isFinite(q)||nt!=null&&!Number.isFinite(nt))return;const lt=it!=null?this.getLabelText(this.properties.label,{datum:a[_],value:nt??it,xKey:c,yKey:h,xName:d,yName:u,legendItemName:p}):void 0,vt=nt!=null&&nt>it,At=O({datum:a[_],datumIndex:_,valueIndex:z,xValue:X,yValue:nt??it,cumulativeValue:nt??q,phantom:!1,currY:nt!=null?Z+nt:q,prevY:Z,x:U,width:Y,isPositive:ht,yRange:Math.max(Z+(nt??-1/0),Q),labelText:lt,opacity:tt,crossScale:vt?.6:void 0});if(R.push(At),G.push(At),nt!=null){const ut=O({datum:a[_],datumIndex:_,valueIndex:z,xValue:X,yValue:nt,cumulativeValue:nt,phantom:!0,currY:q,prevY:Z,x:U,width:Y,isPositive:ht,yRange:Q,labelText:void 0,opacity:tt,crossScale:void 0});w.push(ut)}},[P,V]=r.range,W=V-P,F=s?.find(_=>_.maxRange>W);if(e.type==="grouped"){const _=x,z=t.hasColumnById(this,"yValue-start"),U=z?t.resolveColumnById(this,"yValue-start",e):void 0,Y=z?t.resolveColumnById(this,"yValue-end",e):void 0,Z=z?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:q,valueIndex:Q,group:{aggregation:tt}}of t.forEachGroupDatum(this,e)){const X=I(q),it=D[q],nt=it>=0&&!Object.is(it,-0),ht=z?Number(U?.[q]):0,lt=z?Number(Y?.[q]):it;let vt=lt;z&&(vt=tt[Z][nt?1:0]),B(q,Q,X,_,ht,lt,vt,1)}}else if(F==null){const _=x;let[z,U]=this.visibleRange("xValue",n.range);e.input.count<1e3&&(z=0,U=e.input.count);for(let Y=z;Y<U;Y+=1){const Z=I(Y),q=Number(D[Y]);B(Y,0,Z,_,0,q,q,1)}}else{const{indexData:_,indices:z}=F,[U,Y]=this.visibleRange("xValue",n.range,z);for(let Z=U;Z<Y;Z+=1){const q=Z*PU,Q=_[q+wU],tt=_[q+OU],X=_[q+EU],it=_[q+RU];if(Q===-1)continue;const nt=I((Q+tt)/2|0),ht=Math.abs(I(tt)-I(Q))+x,lt=M[it]!=null?Number(D[it]):NaN,vt=M[X]!=null?Number(D[X]):NaN;if(lt>0){const At=vt>=0?vt/lt:1;B(it,0,nt,ht,0,lt,lt,At)}if(vt<0){const At=lt<=0?lt/vt:1;B(X,1,nt,ht,0,vt,vt,At)}}}return{itemId:h,nodeData:w.length>0?[...w,...R]:R,labelData:G,scales:this.calculateScaling(),visible:this.visible||k,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new ms}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,o=t?e.highlightStyle.item:void 0;return na({fill:o?.fill??e.fill,fillOpacity:o?.fillOpacity??e.fillOpacity,stroke:o?.stroke??e.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:o?.strokeOpacity??e.strokeOpacity,lineDash:o?.lineDash??e.lineDash??[],lineDashOffset:o?.lineDashOffset??e.lineDashOffset,cornerRadius:i},s,n)}getItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:d,fillPatternDefaults:u}=r;if(h==null)return;const{xDomain:p,yDomain:g}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),f=this.cachedDatumCallback(Gi(t,o?"highlight":"node"),()=>this.callWithContext(h,{seriesId:a,...Yr(e,l,c,p,g),datum:e,xValue:i,yValue:s,highlighted:o,...n}));return na(f,d,u)}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((o,a)=>{const r=this.getItemStyleOverrides(String(a.datumIndex),a.datum,a.xValue,a.yValue,s,t.isHighlight);o.opacity=a.opacity??0,pc(o,s,r,n);const l=r?.cornerRadius??s.cornerRadius;o.topLeftCornerRadius=a.topLeftCornerRadius?l:0,o.topRightCornerRadius=a.topRightCornerRadius?l:0,o.bottomRightCornerRadius=a.bottomRightCornerRadius?l:0,o.bottomLeftCornerRadius=a.bottomLeftCornerRadius?l:0,o.visible=i?(a.clipBBox?.width??a.width)>0:(a.clipBBox?.height??a.height)>0,o.crisp=a.crisp,o.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)=>{Gw(e,this.properties.label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveKeysById(this,"xValue",s)[t],x=i.resolveColumnById(this,"yValue-raw",s)[t];if(f==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(t),g,f,x,m,!1)),d.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:p.formatDatum(x)}]},{seriesId:e,datum:g,title:l,xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:na({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a},r,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:o,yName:a,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:o,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:o}),label:{text:r??a??o},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!e}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=zp(Bp(this.isVertical(),this.axes,"normal"));Fe(this.id,"nodes",this.ctx.animationManager,[t],s),ee(this,"labels",this.ctx.animationManager,e),ee(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 o=this.processedData?.reduced?.diff?.[this.id];o==null&&this.processedData?.reduced?.diff!=null&&(o={changed:!0,added:new Set(Array.from(e,({datum:h})=>this.getDatumId(h))),updated:new Set,removed:new Set,moved:new Set});const a=n==null?"fade":"normal",r=zp(Bp(this.isVertical(),this.axes,a));Fe(this.id,"nodes",this.ctx.animationManager,[e],r,(h,d)=>this.getDatumId(d),o);const l=n!=null&&(!dd(t.contextData.scales.x,n.scales.x)||!dd(t.contextData.scales.y,n.scales.y)||!dd(t.contextData.groupScale,t.previousContextData.groupScale));((o?.changed??!1)||l)&&(ee(this,"labels",this.ctx.animationManager,i),ee(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return Gi(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return pM(this,e)}};_p.className="BarSeries",_p.type="bar";var Gp={type:K(Ct("bar")),xKey:K(E),yKey:K(E),xName:E,yName:E,direction:st("horizontal","vertical"),grouped:j,stacked:j,stackGroup:E,normalizedTo:J,legendItemName:E,showInMiniChart:j,cornerRadius:H,itemStyler:bt,crisp:j,label:{...ol,placement:st("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:H},errorBar:qy,shadow:Pp,tooltip:sr,...Io,...St,...rt,...Ot};Gp.pickOutsideVisibleMinorAxis=j,Gp.fastDataProcessing=j,Gp.focusPriority=J,Gp.sparklineMode=j;var jw={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new _p(t),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:ow,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:il,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:Jr,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},Ww={type:"series",name:"bar",chartType:"cartesian",options:Gp,create:t=>new _p(t)},gM=class extends Vi{constructor(){super(...arguments),this.maxSize=30}};v([A(ot),gt()],gM.prototype,"maxSize",2),v([A(Ak,{optional:!0}),gt()],gM.prototype,"domain",2);var Hw=class extends Ni{constructor(){super(...arguments),this.placement="top"}};v([A(XS)],Hw.prototype,"placement",2);var ye=class extends ir{constructor(){super(...arguments),this.label=new Hw,this.tooltip=new xs,this.marker=new gM}};v([A(et)],ye.prototype,"xKey",2),v([A(et)],ye.prototype,"yKey",2),v([A(et)],ye.prototype,"sizeKey",2),v([A(et,{optional:!0})],ye.prototype,"labelKey",2),v([A(et,{optional:!0})],ye.prototype,"xFilterKey",2),v([A(et,{optional:!0})],ye.prototype,"yFilterKey",2),v([A(et,{optional:!0})],ye.prototype,"sizeFilterKey",2),v([A(et,{optional:!0})],ye.prototype,"xName",2),v([A(et,{optional:!0})],ye.prototype,"yName",2),v([A(et,{optional:!0})],ye.prototype,"sizeName",2),v([A(et,{optional:!0})],ye.prototype,"labelName",2),v([A(et,{optional:!0})],ye.prototype,"title",2),v([ue("marker.shape")],ye.prototype,"shape",2),v([ue("marker.size")],ye.prototype,"size",2),v([ue("marker.maxSize")],ye.prototype,"maxSize",2),v([ue("marker.domain",{optional:!0})],ye.prototype,"domain",2),v([ue("marker.fillGradientDefaults")],ye.prototype,"fillGradientDefaults",2),v([ue("marker.fillPatternDefaults")],ye.prototype,"fillPatternDefaults",2),v([ue("marker.fill",{optional:!0})],ye.prototype,"fill",2),v([ue("marker.fillOpacity")],ye.prototype,"fillOpacity",2),v([ue("marker.stroke",{optional:!0})],ye.prototype,"stroke",2),v([ue("marker.strokeWidth")],ye.prototype,"strokeWidth",2),v([ue("marker.strokeOpacity")],ye.prototype,"strokeOpacity",2),v([ue("marker.lineDash")],ye.prototype,"lineDash",2),v([ue("marker.lineDashOffset")],ye.prototype,"lineDashOffset",2),v([ue("marker.itemStyler",{optional:!0})],ye.prototype,"itemStyler",2),v([A(at)],ye.prototype,"label",2),v([A(at)],ye.prototype,"tooltip",2);var BU=class extends W0{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},Jy=class extends nl{constructor(t){super({moduleCtx:t,directionKeys:bc,directionNames:Sc,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:er,marker:wp},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=BU,this.properties=new ye,this.sizeScale=new Do}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}),o=this.sizeScale.type,{xKey:a,yKey:r,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,{dataModel:g,processedData:f}=await this.requestDataModel(t,this.data,{props:[Wt(a,s,{id:"xValue"}),Wt(r,n,{id:"yValue"}),...c!=null?[Wt(c,s,{id:"xFilterValue"})]:[],...h!=null?[Wt(h,n,{id:"yFilterValue"})]:[],...d!=null?[Wt(d,o,{id:"sizeFilterValue"})]:[],Wt(l,o,{id:"sizeValue"}),...u?[Wt(u,"band",{id:"labelValue"})]:[]]}),x=g.resolveProcessedDataIndexById(this,"sizeValue");this.sizeScale.domain=p.domain??f.domain.values[x]??[],this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.x.scale.convert(t),l=a!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):o)*e;return[r-h,r+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.y.scale.convert(t[0]),l=a!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):o)*e;return[r-h,r+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],o=e.resolveProcessedDataDefById(this,n),a=e.getDomain(this,n,"value",i);if(o?.def.type==="value"&&o?.def.valueType==="category")return a;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return Us(Za(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:o,yKey:a,sizeKey:r,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f,label:x,marker:m}=this.properties,{placement:b}=x,S=Oi.anchor(m.shape),M=t.x,D=t.y;if(!(e&&i&&n&&M&&D))return;const C=e.resolveColumnById(this,"xValue",i),k=e.resolveColumnById(this,"yValue",i),I=r!=null?e.resolveColumnById(this,"sizeValue",i):void 0,L=d!=null?e.resolveColumnById(this,"labelValue",i):void 0,N=l!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,O=c!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,w=h!=null?e.resolveColumnById(this,"sizeFilterValue",i):void 0,R=M.scale,G=D.scale,B=(R.bandwidth??0)/2,P=(G.bandwidth??0)/2,V=[];s.range=[m.size,m.maxSize];const W=x.getFont(),F=Va.getMeasurer({font:W});return i.dataSources.get(this.id)?.forEach((_,z)=>{const U=C[z],Y=k[z],Z=I?.[z],q=R.convert(U)+B,Q=G.convert(Y)+P;let tt;N!=null&&O!=null&&(tt=N[z]===U&&O[z]===Y,w!=null&&tt&&(tt=w[z]===Z));const X=this.getLabelText(x,{value:L!=null?L[z]:Y,datum:_,xKey:o,yKey:a,sizeKey:r,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f}),it=F.measureText(String(X)),nt=Z!=null?s.convert(Z):m.size;V.push({series:this,itemId:a,yKey:a,xKey:o,datum:_,datumIndex:z,xValue:U,yValue:Y,sizeValue:Z,point:{x:q,y:Q,size:nt},midPoint:{x:q,y:Q},label:{text:X,...it},anchor:S,placement:b,selected:tt})}),{itemId:a,nodeData:V,labelData:V,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=>Gi([n.xValue,n.yValue,n.sizeValue,n.label.text]))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:o,labelKey:a,marker:r}=this.properties,l=jt(i&&this.properties.highlightStyle.item,r.getStyle());this.sizeScale.range=[r.size,r.maxSize];const c=this.getShapeFillBBox();e.each((h,d)=>{this.updateMarkerStyle(r,h,d.datum,d.point,{xKey:s,yKey:n,sizeKey:o,labelKey:a},i,l,c,{selected:d.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:o}=this,{xKey:a,xName:r,yKey:l,yName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,title:g,tooltip:f,marker:x}=o,m=n.x,b=n.y;if(!i||!s||!m||!b)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 k=[{label:r,fallbackLabel:a,value:m.formatDatum(M)},{label:c,fallbackLabel:l,value:b.formatDatum(D)}];if(h!=null){const N=i.resolveColumnById(this,"sizeValue",s)[t];k.push({label:d,fallbackLabel:h,value:String(N)})}const I=x.getStyle(),L=this.getMarkerStyle(x,S,{xKey:a,yKey:l,sizeKey:h,labelKey:u,highlighted:!0},!1,void 0,I);return f.formatTooltip(this.properties,{title:g,symbol:this.legendItemSymbol(),data:k},{seriesId:e,datum:S,title:l,xKey:a,xName:r,yKey:l,yName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,...L,...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:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:o??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){Z0(this,this.ctx.animationManager,t),ee(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:o}=this.properties;return this.getMarkerStyle(o,t,{xKey:e,yKey:i,sizeKey:s,labelKey:n},!1,t.point.size)}computeFocusBounds(t){return Ep(this,t)}};Jy.className="BubbleSeries",Jy.type="bubble";var zU={type:K(Ct("bubble")),xKey:K(E),yKey:K(E),sizeKey:K(E),labelKey:E,xName:E,yName:E,sizeName:E,labelName:E,title:E,domain:mt(J),maxSize:H,showInMiniChart:j,label:{placement:st("top","right","bottom","left"),...ol},tooltip:sr,...Io,...zr(Rp,["enabled"])},FU={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:t=>new Jy(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:il,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},Uw={type:"series",name:"bubble",chartType:"cartesian",options:zU,create:t=>new Jy(t)},qe=class extends ir{constructor(){super(...arguments),this.fillGradientDefaults=new Vn,this.fillPatternDefaults=new _e,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 Ao,this.label=new Ni,this.tooltip=new xs}};v([A(et)],qe.prototype,"xKey",2),v([A(et,{optional:!0})],qe.prototype,"yKey",2),v([A(et,{optional:!0})],qe.prototype,"xName",2),v([A(et,{optional:!0})],qe.prototype,"yName",2),v([A(Zi(qo,Jo,zt))],qe.prototype,"fill",2),v([A(at)],qe.prototype,"fillGradientDefaults",2),v([A(at)],qe.prototype,"fillPatternDefaults",2),v([A(ae)],qe.prototype,"fillOpacity",2),v([A(zt,{optional:!0})],qe.prototype,"stroke",2),v([A(ot)],qe.prototype,"strokeWidth",2),v([A(ae)],qe.prototype,"strokeOpacity",2),v([A(ta)],qe.prototype,"lineDash",2),v([A(ot)],qe.prototype,"lineDashOffset",2),v([A(ot)],qe.prototype,"cornerRadius",2),v([A(xt)],qe.prototype,"areaPlot",2),v([A(Jl,{optional:!0})],qe.prototype,"bins",2),v([A(le(["count","sum","mean"],"a histogram aggregation"))],qe.prototype,"aggregation",2),v([A(ot,{optional:!0})],qe.prototype,"binCount",2),v([A(at)],qe.prototype,"shadow",2),v([A(at)],qe.prototype,"label",2),v([A(at)],qe.prototype,"tooltip",2);var Yw=10,tm=class extends nl{constructor(t){super({moduleCtx:t,directionKeys:bc,directionNames:Sc,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Fp,label:er}}),this.properties=new qe,this.calculatedBins=[]}deriveBins(t){const e=zv(t[0],t[1],Yw),i=Yu(t[0],t[1],Yw),[s]=e,n=o=>[o,o+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:o,binSize:a}=this.calculateNiceStart(i,s,n);return this.getBins(o,s,a,n)}getBins(t,e,i,s){const n=[],o=this.calculatePrecision(i);for(let a=0;a<s;a++){const r=Math.round((t+a*i)*o)/o;let l=Math.round((t+(a+1)*i)*o)/o;a===s-1&&(l=Math.max(l,e)),n[a]=[r,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)),o=Math.pow(10,n);return{start:Math.floor(t/o)*o,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,o=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({yScale:a,xScale:o}),c=[Mo(e,r),VN];if(i){let d=x0("groupAgg");n==="count"||(n==="sum"?d=LN("groupAgg"):n==="mean"&&(d=NN("groupAgg"))),s&&(d=b0("groupAgg",d)),c.push(Wt(i,l,{invalidValue:void 0}),d)}else{c.push(BN("count"));let d=x0("groupAgg");s&&(d=b0("groupAgg",d)),c.push(d)}const h=d=>{const u=Us(d.domain.keys[0]);if(u.length===0)return d.domain.groups=[],()=>[];const p=pe(this.properties.binCount)?this.calculateNiceBins(u,this.properties.binCount):this.properties.bins??this.deriveBins(u),g=p.length;return this.calculatedBins=[...p],f=>{let x=f[0];if(Yo(x)&&(x=x.getTime()),!pe(x))return[];for(let m=0;m<g;m++){const b=p[m];if(x>=b[0]&&x<b[1]||m===g-1&&x<=b[1])return b}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(sd(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],o=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return Us(t==="x"?[n,o]:s)}getSeriesRange(t,[e,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[NaN,NaN];const o=this.axes.x.scale,a=0;let r=-1/0;return n.groups.forEach(({keys:l,aggregation:c})=>{const[[h,d]=[0,0]]=c,[u,p]=l,[g,f]=oi([o.convert(u),o.convert(p)]);if(f>=e&&g<=i){const x=h+d;r=Math.max(r,x)}}),a>r?[NaN,NaN]:[a,r]}createNodeData(){const{id:t,axes:e,processedData:i,dataModel:s}=this,n=e.x,o=e.y;if(!n||!o||!s)return;const{scale:a}=n,{scale:r}=o,{xKey:l,yKey:c,xName:h,yName:d}=this.properties,u=this.properties.label.formatter,p=[],g={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((f,x)=>{const{keys:m,datumIndices:b,aggregation:S}=f,[[M,D]=[0,0]]=S,C=b.length,k=m,[I,L]=k,N=[...s.forEachDatum(this,i,f)],O=a.convert(I),w=a.convert(L),R=M+D,G=r.convert(0),B=r.convert(R),P=Math.abs(w-O),V=Math.abs(B-G),W=Math.min(O,w),F=Math.min(G,B);let _;R!==0&&(_={x:W+P/2,y:F+V/2,text:this.cachedDatumCallback(Gi(x,"label"),()=>u?.({value:R,datum:N,seriesId:t,xKey:l,yKey:c,xName:h,yName:d}))??o.formatDatum(R)});const z={x:W+P/2,y:F+V/2},U=o.isReversed();p.push({series:this,datumIndex:x,datum:N,aggregatedValue:R,frequency:C,domain:k,yKey:c,xKey:l,x:W,y:F,xValue:O,yValue:B,width:P,height:V,midPoint:z,topLeftCornerRadius:!U,topRightCornerRadius:!U,bottomRightCornerRadius:U,bottomLeftCornerRadius:U,label:_,crisp:!0})}),p.sort((f,x)=>f.x-x.x)),g}nodeFactory(){return new ms}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 na({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((o,a)=>{const{cornerRadius:r}=s,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=a;pc(o,s,void 0,n),o.topLeftCornerRadius=l?r:0,o.topRightCornerRadius=c?r:0,o.bottomRightCornerRadius=h?r:0,o.bottomLeftCornerRadius=d?r:0,o.crisp=a.crisp,o.fillShadow=i,o.visible=a.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:o}=this.properties.label,a=this.isLabelEnabled();t.labelSelection.each((r,l)=>{a&&l?.label?(r.text=l.label.text,r.x=l.label.x,r.y=l.label.y,r.fontStyle=e,r.fontWeight=i,r.fontFamily=s,r.fontSize=n,r.fill=o,r.visible=!0):r.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e&&lM(t,e.children())}pickNodeClosestDatum(t){return cM(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o,ctx:{localeManager:a}}=this,{xKey:r,xName:l,yKey:c,yName:h,tooltip:d}=o,u=n.x,p=n.y;if(!i||s?.type!=="grouped"||!u||!p)return;const g=s.groups[t],{aggregation:f,datumIndices:x,keys:m}=g,[[b,S]=[0,0]]=f,M=x.length,D=m,[C,k]=D,I=b+S,L={data:[...i.forEachDatum(this,s,g)],aggregatedValue:I,frequency:M,domain:D},N=[{label:l,fallbackLabel:r,value:`${u.formatDatum(C)} - ${u.formatDatum(k)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(M)}];if(c!=null){let O;switch(o.aggregation){case"sum":O=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":O=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":O=a.t("seriesHistogramTooltipCount",{yName:h??c});break}N.push({label:O,value:p.formatDatum(I)})}return d.formatTooltip(this.properties,{symbol:this.legendItemSymbol(),data:N},{seriesId:e,datum:L,title:h,xKey:r,xName:l,yKey:c,yName:h,xRange:[C,k],frequency:M,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:na({fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!a}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=zp(Bp(!0,this.axes,"normal"));Fe(this.id,"datums",this.ctx.animationManager,[t],i),ee(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=this.processedData?.reduced?.diff?.[this.id],i=zp(Bp(!0,this.axes,"normal"));Fe(this.id,"datums",this.ctx.animationManager,[t.datumSelection],i,(s,n)=>Gi(n.domain),e),ee(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return pM(this,this.contextNodeData?.nodeData[t])}};tm.className="HistogramSeries",tm.type="histogram";var _U={type:K(Ct("histogram")),xKey:K(E),yKey:E,xName:E,yName:E,areaPlot:j,aggregation:st("count","sum","mean"),bins:mt(mt(J)),binCount:H,showInMiniChart:j,cornerRadius:H,label:ol,tooltip:sr,shadow:Pp,...Io,...St,...rt,...Ot},GU={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:t=>new tm(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:il,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:Jr,xOffset:3,yOffset:3,blur:5}}}},Kw={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:_U,create:t=>new tm(t)},bi=class extends ir{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new hd,this.marker=new Vi,this.label=new Ni,this.tooltip=new xs,this.connectMissingData=!1,this.sparklineMode=!1}};v([A(et)],bi.prototype,"xKey",2),v([A(et)],bi.prototype,"yKey",2),v([A(et,{optional:!0})],bi.prototype,"xName",2),v([A(et,{optional:!0})],bi.prototype,"yName",2),v([A(et,{optional:!0})],bi.prototype,"yFilterKey",2),v([A(et,{optional:!0})],bi.prototype,"stackGroup",2),v([A(ot,{optional:!0})],bi.prototype,"normalizedTo",2),v([A(et,{optional:!0})],bi.prototype,"title",2),v([A(zt)],bi.prototype,"stroke",2),v([A(ot)],bi.prototype,"strokeWidth",2),v([A(ae)],bi.prototype,"strokeOpacity",2),v([A(ta)],bi.prototype,"lineDash",2),v([A(ot)],bi.prototype,"lineDashOffset",2),v([A(at)],bi.prototype,"interpolation",2),v([A(at)],bi.prototype,"marker",2),v([A(at)],bi.prototype,"label",2),v([A(at)],bi.prototype,"tooltip",2),v([A(xt)],bi.prototype,"connectMissingData",2),v([A(xt)],bi.prototype,"sparklineMode",2);var VU=.25,Vp=class extends nl{constructor(t){super({moduleCtx:t,directionKeys:bc,directionNames:Sc,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:J0({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:er,marker:(e,i)=>({...wp(e),...Op(e,i)})},clipFocusBox:!1}),this.properties=new bi,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:o,yKey:a,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),x=n>=1||c!=null,m={invalidValue:null};l&&x&&(m.invalidValue=0),x&&!i&&(m.forceValue=0);const b=[];if((!p||x)&&b.push(Mo(o,g,{id:"xKey"})),b.push(Wt(o,g,{id:"xValue"}),Wt(a,f,{id:"yValueRaw",...m,invalidValue:void 0})),r!=null&&b.push(Wt(r,f,{id:"yFilterRaw"})),x){const D=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];b.push(...Xr(a,"window","current",{id:"yValueEnd",...m,groupId:D[0]},f),...Xr(a,"window-trailing","current",{id:"yValueStart",...m,groupId:D[1]},f),...Xr(a,"normal","current",{id:"yValueCumulative",...m,groupId:D[2]},f)),$e(c)&&b.push(Dy([D[0],D[1],D[2]],c))}h&&(b.push(id(p?["xValue"]:void 0)),this.processedData&&b.push(sd(this.id,this.processedData)));const{dataModel:S,processedData:M}=await this.requestDataModel(t,e,{props:b,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 o=e.resolveProcessedDataDefById(this,"xValue"),a=e.getDomain(this,"xValue","value",i);return o?.def.type==="value"&&o.def.valueType==="category"?a:Us(Za(a))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue",!0);return Us(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,o=i.y;if(!t||!e||!n||!o)return;const{xKey:a,yKey:r,yFilterKey:l,xName:c,yName:h,marker:d,label:u,connectMissingData:p,interpolation:g,legendItemName:f}=this.properties,x=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,b=o.scale,S=(m.bandwidth??0)/2,M=(b.bandwidth??0)/2,D=d.enabled?d.size:0,C=e.dataSources.get(this.id)??[],k=t.resolveColumnById(this,"xValue",e),I=t.resolveColumnById(this,"yValueRaw",e),L=x?t.resolveColumnById(this,"yValueEnd",e):void 0,N=x?t.resolveColumnById(this,"yValueCumulative",e):I,O=l!=null?t.resolveColumnById(this,"yFilterRaw",e):void 0,w=X=>m.convert(k[X])+S,R=X=>b.convert(N[X])+M,G={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},B=[];let P;const V=X=>{const it=C[X],nt=k[X],ht=I[X],lt=L?.[X],vt=O?.[X],At=w(X),ut=R(X);if(!Number.isFinite(At))return;if(ht!=null){const Xt=u.enabled?this.getLabelText(u,{value:ht,datum:it,xKey:a,yKey:r,xName:c,yName:h,legendItemName:f}):void 0;B.push({series:this,datum:it,datumIndex:X,yKey:r,xKey:a,point:{x:At,y:ut,size:D},midPoint:{x:At,y:ut},cumulativeValue:lt,yValue:ht,xValue:nt,capDefaults:G,labelText:Xt,selected:vt})}if(P==null)return;const Kt=P[P.length-1];if(ht!=null){const Xt={point:{x:At,y:ut},xDatum:nt,yDatum:ht};Array.isArray(Kt)?Kt.push(Xt):Kt!=null?(Kt.skip+=1,P.push([Xt])):P.push([Xt])}else p||(Array.isArray(Kt)||Kt==null?P.push({skip:0}):Kt.skip+=1)},[W,F]=m.range,_=F-W,U=s?.find(X=>X.maxRange>_)?.indices;let[Y,Z]=this.visibleRange("xValue",n.range,U);Y=Math.max(Y-1,0),Z=Math.min(Z+1,U?.length??k.length),e.input.count<1e3&&(Y=0,Z=e.input.count),U==null&&(P=[]);for(let X=Y;X<Z;X+=1)V(U?.[X]??X);const q=P?.flatMap(X=>Array.isArray(X)?Gy(X,g):[]),Q=q!=null?{itemId:r,spans:q}:void 0,tt=O?.some((X,it)=>X===I[it])??!1;return{itemId:r,nodeData:B,labelData:B,strokeData:Q,scales:this.calculateScaling(),visible:this.visible,crossFiltering:tt}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t,o=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*(o?VU:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),Hy(this,e)}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return na({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:o}=this,{xKey:a,yKey:r,marker:l}=o,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Gi(t,s?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),d=this.getSeriesDomain("y");return this.callWithContext(c,{seriesId:n,...Yr(e,a,r,h,d),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=>Gi(n.xValue))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:o,strokeWidth:a,strokeOpacity:r,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),d=this.getSeriesDomain("y"),u=jt(i&&c.item,l.getStyle(),{stroke:o,strokeWidth:a,strokeOpacity:r}),p=this.ctx.animationManager.isSkipped(),g=this.getShapeFillBBox();e.each((f,x)=>{this.updateMarkerStyle(l,f,x.datum,x.point,Yr(x,s,n,h,d),i,u,g,{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:o,color:a}=this.properties.label;t.labelSelection.each((r,l)=>{e&&l?.labelText?(r.fontStyle=i,r.fontWeight=s,r.fontSize=n,r.fontFamily=o,r.textAlign="center",r.textBaseline="bottom",r.text=l.labelText,r.x=l.point.x,r.y=l.point.y-10,r.fill=a,r.visible=!0):r.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h}=o,d=n.x,u=n.y;if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveColumnById(this,"xValue",s)[t],f=i.resolveColumnById(this,"yValueRaw",s)[t];if(g==null)return;const x=this.getMarkerItemBaseStyle(!1);return Object.assign(x,this.getMarkerItemStyleOverrides(String(t),p,x,!1)),h.formatTooltip(this.properties,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(f)}]},{seriesId:e,datum:p,title:c,xKey:a,xName:r,yKey:l,yName:c,...x,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:o}=this.properties;return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:o.fill??t,stroke:o.stroke??e??t}),enabled:o.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:o,title:a,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:n,legendItemName:r,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??a??o??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:o}=e[s].point;t.lineTo(n,o)}}updateLinePaths(t,e){const i=e.strokeData?.spans,[s]=t;s.path.clear(),i!=null?K0(s,i):this.plotNodeDataPoints(s.path,e.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:o}=t,{animationManager:a}=this.ctx;this.updateLinePaths(o,n),q0(this,a,...o),Fi([e],Op),Q0(this,a,e),ee(this,"labels",a,i),ee(this,"annotations",a,...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:o,paths:a,previousContextData:r}=t,[l]=a;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateLinePaths(a,o)},h=()=>{e.skipCurrentBatch(),c()};if(o==null||r==null){c(),Np(this,e,"added",i),Wy(this,"path_properties",e,"add",l),ee(this,"labels",e,s),ee(this,"annotations",e,...n);return}if(o.crossFiltering!==r.crossFiltering){h();return}const d=Lw(o,r,this.processedData?.reduced?.diff?.[this.id]);if(d===void 0){h();return}else if(d.status==="no-op")return;Fe(this.id,"path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(a,o):d.status==="removed"?this.updateLinePaths(a,r):zy(this.id,"path_update",e,[l],d.stroke.path),d.hasMotion&&(Np(this,e,void 0,i),ee(this,"labels",e,s),ee(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,Yr(t,e,i,s,n),!0)}computeFocusBounds(t){return Ep(this,t)}};Vp.className="LineSeries",Vp.type="line";var em={type:Ct("line"),xKey:K(E),yKey:K(E),xName:E,yName:E,title:E,stacked:j,stackGroup:E,normalizedTo:J,legendItemName:E,showInMiniChart:j,connectMissingData:j,interpolation:rM,label:ol,marker:Rp,tooltip:sr,errorBar:qy,...Io,...rt,...Ot};em.pickOutsideVisibleMinorAxis=j,em.focusPriority=J,em.sparklineMode=j;var $w={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new Vp(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:By,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:il},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Xw={type:"series",name:"line",chartType:"cartesian",options:em,create:t=>new Vp(t)},Zw=class extends Ni{constructor(){super(...arguments),this.placement="top"}};v([A(XS)],Zw.prototype,"placement",2);var Le=class extends ir{constructor(){super(...arguments),this.label=new Zw,this.tooltip=new xs,this.marker=new Vi}};v([A(et)],Le.prototype,"xKey",2),v([A(et)],Le.prototype,"yKey",2),v([A(et,{optional:!0})],Le.prototype,"labelKey",2),v([A(et,{optional:!0})],Le.prototype,"xFilterKey",2),v([A(et,{optional:!0})],Le.prototype,"yFilterKey",2),v([A(et,{optional:!0})],Le.prototype,"xName",2),v([A(et,{optional:!0})],Le.prototype,"yName",2),v([A(et,{optional:!0})],Le.prototype,"labelName",2),v([A(et,{optional:!0})],Le.prototype,"title",2),v([ue("marker.shape")],Le.prototype,"shape",2),v([ue("marker.size")],Le.prototype,"size",2),v([ue("marker.fill",{optional:!0})],Le.prototype,"fill",2),v([ue("marker.fillGradientDefaults")],Le.prototype,"fillGradientDefaults",2),v([ue("marker.fillPatternDefaults")],Le.prototype,"fillPatternDefaults",2),v([ue("marker.fillOpacity")],Le.prototype,"fillOpacity",2),v([ue("marker.stroke")],Le.prototype,"stroke",2),v([ue("marker.strokeWidth")],Le.prototype,"strokeWidth",2),v([ue("marker.strokeOpacity")],Le.prototype,"strokeOpacity",2),v([ue("marker.lineDash")],Le.prototype,"lineDash",2),v([ue("marker.lineDashOffset")],Le.prototype,"lineDashOffset",2),v([ue("marker.itemStyler",{optional:!0})],Le.prototype,"itemStyler",2),v([A(at)],Le.prototype,"label",2),v([A(at)],Le.prototype,"tooltip",2);var im=class extends nl{constructor(t){super({moduleCtx:t,directionKeys:bc,directionNames:Sc,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:wp,label:er},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new Le}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:o,yKey:a,xFilterKey:r,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(t,this.data,{props:[Wt(o,s,{id:"xValue"}),Wt(a,n,{id:"yValue"}),...r!=null?[Wt(r,s,{id:"xFilterValue"})]:[],...l!=null?[Wt(l,n,{id:"yFilterValue"})]:[],...c?[Wt(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],o=e.resolveProcessedDataDefById(this,n),a=e.getDomain(this,n,"value",i);if(o?.def.type==="value"&&o?.def.valueType==="category")return a;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return Us(Za(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:o,xFilterKey:a,yFilterKey:r,labelKey:l,xName:c,yName:h,labelName:d,marker:u,label:p}=this.properties,{placement:g}=p,f=Oi.anchor(u.shape),x=t.x,m=t.y;if(!(e&&i&&s&&x&&m))return;const b=e.resolveColumnById(this,"xValue",i),S=e.resolveColumnById(this,"yValue",i),M=l!=null?e.resolveColumnById(this,"labelValue",i):void 0,D=a!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,C=r!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,k=x.scale,I=m.scale,L=(k.bandwidth??0)/2,N=(I.bandwidth??0)/2,O=[],w=p.getFont(),R=Va.getMeasurer({font:w});return(i.dataSources.get(this.id)??[]).forEach((B,P)=>{const V=b[P],W=S[P],F=k.convert(V)+L,_=I.convert(W)+N,z=D!=null&&C!=null?D[P]===V&&C[P]===W:void 0,U=this.getLabelText(p,{value:M!=null?M?.[P]:W,datum:B,xKey:n,yKey:o,labelKey:l,xName:c,yName:h,labelName:d}),Y=R.measureText(U);O.push({series:this,itemId:o,yKey:o,xKey:n,datum:B,datumIndex:P,xValue:V,yValue:W,capDefaults:{lengthRatioMultiplier:u.getDiameter(),lengthMax:1/0},point:{x:F,y:_,size:u.size},midPoint:{x:F,y:_},label:{text:U,...Y},anchor:f,placement:g,selected:z})}),{itemId:o,nodeData:O,labelData:O,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:o,marker:a,highlightStyle:r}=this.properties,l=jt(i&&r.item,a.getStyle()),c=this.getShapeFillBBox();e.each((h,d)=>{this.updateMarkerStyle(a,h,d.datum,d.point,{xKey:s,yKey:n,labelKey:o},i,l,c,{selected:d.selected})}),i||a.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:o}=this,{xKey:a,xName:r,yKey:l,yName:c,labelKey:h,labelName:d,title:u,tooltip:p,marker:g}=o,f=n.x,x=n.y;if(!i||!s||!f||!x)return;const m=s.dataSources.get(this.id)?.[t],b=i.resolveColumnById(this,"xValue",s)[t],S=i.resolveColumnById(this,"yValue",s)[t],M=this.contextNodeData?.nodeData[t];if(b==null||M==null)return;const D=this.getMarkerStyle(g,M.datum,{xKey:a,yKey:l,labelKey:h,highlighted:!0});return p.formatTooltip(this.properties,{symbol:this.legendItemSymbol(),title:u,data:[{label:r,fallbackLabel:a,value:f.formatDatum(b)},{label:c,fallbackLabel:l,value:x.formatDatum(S)}]},{seriesId:e,datum:m,title:c,xKey:a,xName:r,yKey:l,yName:c,labelKey:h,labelName:d,...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:o,ctx:{legendManager:a},visible:r}=this;return[{legendType:"category",id:o,itemId:e,seriesId:o,enabled:r&&a.getItemEnabled({seriesId:o,itemId:e}),label:{text:s??i??e},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;Z0(this,this.ctx.animationManager,e),ee(this,"labels",this.ctx.animationManager,i),ee(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 Ep(this,t)}};im.className="ScatterSeries",im.type="scatter";var jU={type:K(Ct("scatter")),xKey:K(E),yKey:K(E),labelKey:E,xName:E,yName:E,labelName:E,title:E,showInMiniChart:j,label:{placement:st("top","right","bottom","left"),...ol},tooltip:sr,errorBar:qy,...Io,...zr(Rp,["enabled"])},WU={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:t=>new im(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:il,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}}}}},Qw={type:"series",name:"scatter",chartType:"cartesian",options:jU,create:t=>new im(t)},qw=class OT{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 OT(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[Mf](e,i){return new OT(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 Jw({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,o=1/0,a=-1/0,r=-1/0;const l=(c,h)=>{n=Math.min(c,n),o=Math.min(h,o),a=Math.max(c,a),r=Math.max(h,r)};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)),Fr(0,t,e)&&l(s,0),Fr(Math.PI*.5,t,e)&&l(0,s),Fr(Math.PI,t,e)&&l(-s,0),Fr(Math.PI*1.5,t,e)&&l(0,-s),new pt(n,o,a-n,r-o)}function sm(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:o}=i;if(i.startAngle===i.endAngle||s<Math.min(n,o)||s>Math.max(n,o))return!1;const a=Nu(i.startAngle),r=Nu(i.endAngle),l=Math.atan2(e,t);return a<r?l<=r&&l>=a:l<=r&&l>=-Math.PI||l>=a&&l<=Math.PI}function tO(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=e,a={x:o*Math.cos(i),y:o*Math.sin(i)},r={x:o*Math.cos(s),y:o*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 Ph(t.start.x,t.start.y,t.end.x,t.end.y,a.x,a.y,l.x,l.y)||Ph(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,c.x,c.y)||Ek(0,0,o,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function eO(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},o={x:t.x+t.width,y:t.y+t.height};return tO({start:i,end:s},e)||tO({start:n,end:o},e)}function iO(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 o=0,a=1;for(let r=0;r<8;r+=1){const l=(o+a)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?o=l:a=l}return o}var HU=1e-6;function al(t,e){return Cf(t,e)<HU?e:me(t-e)+e}function nm(t,e,i=0){const n=Math.abs(e-t)>=2*Math.PI?2*Math.PI:me(e-t);return t=al(t,i),e=t+n,{startAngle:t,endAngle:e}}function om(t,e,i,s,n,o){const a=Math.sin(o),r=Math.cos(o),l=t**2+e**2-i**2;let c,h,d,u;if(r>.5){const S=a/r,M=1+S**2,D=-2*(t+e*S),C=D**2-4*M*l;if(C<0)return;const k=(-D+Math.sqrt(C))/(2*M),I=(-D-Math.sqrt(C))/(2*M);c=k,h=k*S,d=I,u=I*S}else{const S=r/a,M=1+S**2,D=-2*(e+t*S),C=D**2-4*M*l;if(C<0)return;const k=(-D+Math.sqrt(C))/(2*M),I=(-D-Math.sqrt(C))/(2*M);c=k*S,h=k,d=I*S,u=I}const p=r,g=a,f=c*p+h*g,x=d*p+u*g,m=f>0?al(Math.atan2(h-e,c-t),s):NaN,b=x>0?al(Math.atan2(u-e,d-t),s):NaN;if(m>=s&&m<=n)return m;if(b>=s&&b<=n)return b}function am(t,e,i,s,n,o){const a=Math.hypot(t,e),r=(a**2-i**2+o**2)/(2*a),l=a-r,c=Math.atan2(e,t),h=Math.acos(-l/i),d=al(c+h,s),u=al(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var fM=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))}},ji=class extends Es{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 Jw(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}=nm(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),o=nm(t.startAngle,t.endAngle,e);return new qw(Math.max(e,o.startAngle),Math.min(i,o.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,o,a,r){if(t<=0)return;const{startAngle:l,endAngle:c}=nm(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&h<=0)return;const p=r?this.getAngleOffset(h+t):this.getAngleOffset(d-t),g=a?l+p+e:c-p-e,f=r?h+t:d-t,x=f*Math.cos(g),m=f*Math.sin(g);if(u!=null&&(!a&&!(g>=l-1e-6&&g<=u.endAngle-1e-6)||a&&!(g>=u.startAngle+1e-6&&g<=c-1e-6)||r&&f<u.innerRadius-1e-6||!r&&f>u.outerRadius+1e-6))return;const b=new fM(x,m,t,i,s);if(u!=null){r?(b.clipStart(om(x,m,t,i,s,u.endAngle)),b.clipEnd(om(x,m,t,i,s,u.startAngle))):(b.clipStart(om(x,m,t,i,s,u.startAngle)),b.clipEnd(om(x,m,t,i,s,u.endAngle)));let k,I;if(a?(k=am(x,m,t,i,s,u.innerRadius),I=am(x,m,t,i,s,u.outerRadius)):(k=am(x,m,t,i,s,u.outerRadius),I=am(x,m,t,i,s,u.innerRadius)),b.clipStart(k),b.clipEnd(I),k!=null){const{x:L,y:N}=b.pointAt(k),O=al(Math.atan2(N,L),l);a?o?.clipStart(O):n.clipEnd(O)}if(I!=null){const{x:L,y:N}=b.pointAt(I),O=al(Math.atan2(N,L),l);a?n.clipStart(O):o?.clipEnd(O)}}if(u!=null){const{x:k,y:I}=b.pointAt((b.a0+b.a1)/2);if(!sm(k,I,u))return}const{x:S,y:M}=b.pointAt(a===r?b.a0:b.a1),D=al(Math.atan2(M,S),l),C=r?o:n;return a?C?.clipStart(D):C?.clipEnd(D),b}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:o}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=nm(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=d-h,x=f>=2*Math.PI-1e-6;if(e.clear(),u===0&&p===0||u>p)return;if((g?.startAngle??h)===(g?.endAngle??d))return;if(x&&this.clipSector==null&&a===0&&r===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,d),u>n&&(e.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),e.arc(i,s,u,d,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){e.arc(i,s,p,h,d,!1),e.arc(i,s,p,d,h,!0),e.closePath();return}const m=this.getAngleOffset(u),b=this.getAngleOffset(p);if(f<2*b)return;const M=(g?.innerRadius??u)>n,D=u<n||f<2*m,C=p-u,k=Math.max(a,l,r,c),I=k>0?Math.min(C/k,1):1;a*=I,r*=I,l*=I,c*=I;const L=iO(p,f-2*b,-a,-r);if(a*=L,r*=L,!D&&M){const X=iO(u,f-2*m,l,c);l*=X,c*=X}else l=0,c=0;const N=Math.max(a+l,r+c),O=N>0?Math.min(C/N,1):1;a*=O,r*=O,l*=O,c*=O;let w=0,R=0;const G=a/(p-a),B=r/(p-r);if(G>=0&&G<1-1e-6)w=Math.asin(G);else{w=f/2;const X=p/(1/Math.sin(w)+1);a=Math.min(X,a)}if(B>=0&&B<1-1e-6)R=Math.asin(B);else{R=f/2;const X=p/(1/Math.sin(R)+1);r=Math.min(X,r)}const P=Math.asin(l/(u+l)),V=Math.asin(c/(u+c)),W=g?.outerRadius??p,F=this.getAngleOffset(W),_=new fM(0,0,W,h+F,d-F),z=g?.innerRadius??u,U=this.getAngleOffset(z),Y=M?new fM(0,0,z,h+U,d-U):void 0;g!=null&&(_.clipStart(g.startAngle),_.clipEnd(g.endAngle),Y?.clipStart(g.startAngle),Y?.clipEnd(g.endAngle));const Z=this.arc(a,w,h-Math.PI*.5,h+w,_,Y,!0,!1),q=this.arc(r,R,d-R,d+Math.PI*.5,_,Y,!1,!1),Q=this.arc(c,V,d+Math.PI*.5,d+Math.PI-V,_,Y,!1,!0),tt=this.arc(l,P,h+Math.PI+P,h+Math.PI*1.5,_,Y,!0,!0);if(D){const X=f<Math.PI*.5?o*(1+Math.cos(f))/Math.sin(f):NaN;let it;X>0&&X<p?it=Math.max(Math.hypot(o,X),u):it=o,it=Math.max(it,u);const nt=h+f*.5;e.moveTo(i+it*Math.cos(nt),s+it*Math.sin(nt))}else if(!(tt?.isValid()===!0||Y?.isValid()===!0)){const X=h+f/2,it=u*Math.cos(X),nt=u*Math.sin(X);e.moveTo(i+it,s+nt)}if(Z?.isValid()===!0){const{cx:X,cy:it,r:nt,a0:ht,a1:lt}=Z;e.arc(i+X,s+it,nt,ht,lt)}if(_.isValid()){const{r:X,a0:it,a1:nt}=_;e.arc(i,s,X,it,nt)}if(q?.isValid()===!0){const{cx:X,cy:it,r:nt,a0:ht,a1:lt}=q;e.arc(i+X,s+it,nt,ht,lt)}if(!D){if(Q?.isValid()===!0){const{cx:X,cy:it,r:nt,a0:ht,a1:lt}=Q;e.arc(i+X,s+it,nt,ht,lt)}if(Y?.isValid()===!0){const{r:X,a0:it,a1:nt}=Y;e.arc(i,s,X,nt,it,!0)}if(tt?.isValid()===!0){const{cx:X,cy:it,r:nt,a0:ht,a1:lt}=tt;e.arc(i+X,s+it,nt,ht,lt)}}e.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=this.clipSector??this;return sm(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,o),outerRadius:Math.max(n,o)})}};ji.className="Sector",v([Lt()],ji.prototype,"centerX",2),v([Lt()],ji.prototype,"centerY",2),v([Lt()],ji.prototype,"innerRadius",2),v([Lt()],ji.prototype,"outerRadius",2),v([Lt()],ji.prototype,"startAngle",2),v([Lt()],ji.prototype,"endAngle",2),v([Lt()],ji.prototype,"clipSector",2),v([Lt()],ji.prototype,"concentricEdgeInset",2),v([Lt()],ji.prototype,"radialEdgeInset",2),v([Lt()],ji.prototype,"startOuterCornerRadius",2),v([Lt()],ji.prototype,"endOuterCornerRadius",2),v([Lt()],ji.prototype,"startInnerCornerRadius",2),v([Lt()],ji.prototype,"endInnerCornerRadius",2);var Je={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ra={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},sO=class extends Ae{constructor(){super(...arguments),this.showInLegend=!1}};v([A(xt)],sO.prototype,"showInLegend",2);var yM=class extends Ni{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};v([A(et)],yM.prototype,"text",2),v([A(Et)],yM.prototype,"spacing",2);var mM=class extends kt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};v([A(zt)],mM.prototype,"fill",2),v([A(ae)],mM.prototype,"fillOpacity",2);var fd=class extends Ni{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};v([A(ot)],fd.prototype,"offset",2),v([A(Et.restrict({min:0,max:360}))],fd.prototype,"minAngle",2),v([A(ot)],fd.prototype,"minSpacing",2),v([A(ot)],fd.prototype,"maxCollisionOffset",2),v([A(xt)],fd.prototype,"avoidCollisions",2);var xM=class extends Ni{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};v([A(Et)],xM.prototype,"positionOffset",2),v([A(ae)],xM.prototype,"positionRatio",2);var rm=class extends kt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};v([A(ki(Zi(qo,zt,Jo)),{optional:!0})],rm.prototype,"colors",2),v([A(ot)],rm.prototype,"length",2),v([A(ot)],rm.prototype,"strokeWidth",2);var Ft=class extends gn{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Je),this.strokes=Object.values(ra),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 wu(yM),this.title=new sO,this.innerCircle=new mM,this.shadow=new Ao,this.calloutLabel=new fd,this.sectorLabel=new xM,this.calloutLine=new rm,this.tooltip=new xs}};v([A(et)],Ft.prototype,"angleKey",2),v([A(et,{optional:!0})],Ft.prototype,"angleName",2),v([A(et,{optional:!0})],Ft.prototype,"angleFilterKey",2),v([A(et,{optional:!0})],Ft.prototype,"radiusKey",2),v([A(et,{optional:!0})],Ft.prototype,"radiusName",2),v([A(ot,{optional:!0})],Ft.prototype,"radiusMin",2),v([A(ot,{optional:!0})],Ft.prototype,"radiusMax",2),v([A(et,{optional:!0})],Ft.prototype,"calloutLabelKey",2),v([A(et,{optional:!0})],Ft.prototype,"calloutLabelName",2),v([A(et,{optional:!0})],Ft.prototype,"sectorLabelKey",2),v([A(et,{optional:!0})],Ft.prototype,"sectorLabelName",2),v([A(et,{optional:!0})],Ft.prototype,"legendItemKey",2),v([A(ki(Gr))],Ft.prototype,"defaultColorRange",2),v([A(ki(zt))],Ft.prototype,"defaultPatternFills",2),v([A(ki(Zi(qo,zt,Jo)))],Ft.prototype,"fills",2),v([A(Gr)],Ft.prototype,"strokes",2),v([A(ae)],Ft.prototype,"fillOpacity",2),v([A(ae)],Ft.prototype,"strokeOpacity",2),v([A(ta)],Ft.prototype,"lineDash",2),v([A(ot)],Ft.prototype,"lineDashOffset",2),v([A(ot)],Ft.prototype,"cornerRadius",2),v([A(Ls,{optional:!0})],Ft.prototype,"itemStyler",2),v([A(Et)],Ft.prototype,"rotation",2),v([A(Et)],Ft.prototype,"outerRadiusOffset",2),v([A(ae)],Ft.prototype,"outerRadiusRatio",2),v([A(Et,{optional:!0})],Ft.prototype,"innerRadiusOffset",2),v([A(ae,{optional:!0})],Ft.prototype,"innerRadiusRatio",2),v([A(ot)],Ft.prototype,"strokeWidth",2),v([A(Et)],Ft.prototype,"sectorSpacing",2),v([A(xt)],Ft.prototype,"hideZeroValueSectorsInLegend",2),v([A(KS)],Ft.prototype,"innerLabels",2),v([A(at)],Ft.prototype,"title",2),v([A(at)],Ft.prototype,"innerCircle",2),v([A(at)],Ft.prototype,"shadow",2),v([A(at)],Ft.prototype,"calloutLabel",2),v([A(at)],Ft.prototype,"sectorLabel",2),v([A(at)],Ft.prototype,"calloutLine",2),v([A(at)],Ft.prototype,"tooltip",2);function vc(t,e,i,s){const n=[i.convert(0),i.convert(1)],o=[s.convert(0),s.convert(1)],a=Math.PI/-2+Me(e),r=t?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:o[0],outerRadius:o[0]+(o[1]-o[0])*g});return{nodes:{toFn:(g,f,x,{prevLive:m})=>{let{startAngle:b,endAngle:S,innerRadius:M,outerRadius:D}=f;const{stroke:C,fill:k}=f.sectorFormat;if(x==="removed"&&m?(b=m.datum?.endAngle,S=m.datum?.endAngle):x==="removed"&&!m&&(b=a,S=a),x==="removed"){const I=l(f);M=I.innerRadius,D=I.outerRadius}return{startAngle:b,endAngle:S,outerRadius:D,innerRadius:M,stroke:C,fill:k}},fromFn:(g,f,x,{prevFromProps:m})=>{let{startAngle:b,endAngle:S,innerRadius:M,outerRadius:D}=g,{fill:C,stroke:k}=f.sectorFormat;if(x==="updated"&&g.previousDatum==null&&(x="added"),x==="unknown"||x==="added"&&!m?(b=a,S=a,M=f.innerRadius,D=f.outerRadius):x==="added"&&m&&(b=m.endAngle??a,S=m.endAngle??a,M=m.innerRadius??f.innerRadius,D=m.outerRadius??f.outerRadius),x==="added"&&!t){const I=c(f);M=I.innerRadius,D=I.outerRadius}return x==="updated"&&(C=g.fill??C,k=(typeof g.stroke=="string"?g.stroke:void 0)??k),{startAngle:b,endAngle:S,innerRadius:M,outerRadius:D,fill:C,stroke:k,phase:r}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:r}),toFn:(g,f)=>({size:f.radius??0})}}}function bM(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function SM(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),o=t.getItemNodes();for(const a of o)if(a.datum.missing!==!0&&Fr(n,a.startAngle,a.endAngle)){const r=Math.sqrt(s*s+i*i);let l=0;return r<a.innerRadius?l=a.innerRadius-r:r>a.outerRadius&&(l=r-a.outerRadius),{datum:a.datum,distance:l}}}var nO=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(nO||{}),lm=class extends j0{constructor({categoryKey:t,useLabelLayer:e=!1,pickModes:i=[1,0],canHaveAxes:s=!1,animationResetFns:n,...o}){super({...o,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=ai.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=ai.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=ai.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=ai.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=n,this.animationState=new Qu("empty",{empty:{update:{target:"ready",action:a=>this.animateEmptyUpdateReady(a)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:a=>this.animateReadyHighlight(a),highlightMarkers:a=>this.animateReadyHighlightMarkers(a),resize:a=>this.animateReadyResize(a),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:a=>this.animateWaitingUpdateReady(a)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:a=>this.animateClearingUpdateEmpty(a)},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 Li;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 pt(-t,-t,t*2,t*2),axis:new pt(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&Fi([this.itemSelection,this.highlightSelection],t),e&&Fi([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&&Fi([this.highlightSelection],e),i&&Fi([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 Es&&i.datum===e)[0]}getSeriesRange(t,e){return[NaN,NaN]}},UU=class extends Ju{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}},cm=class extends lm{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:bM,label:er}}),this.properties=new Ft,this.phantomNodeData=void 0,this.backgroundGroup=new Ns({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Do,this.radiusScale=new Do,this.phantomGroup=this.backgroundGroup.appendChild(new It({name:"phantom"})),this.phantomSelection=ai.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new It({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ai(this.calloutLabelGroup,It),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new It({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Oi({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Oi({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new It({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new It({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=ai.select(this.innerLabelsGroup,Li),this.innerCircleSelection=ai.select(this.innerCircleGroup,()=>new Oi({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=UU,this.angleScale=new Do,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 ji}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:o,radiusKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(x,m)=>e&&s.getItemEnabled({seriesId:i,itemId:m})?x:0,d=!this.ctx.animationManager.isSkipped(),u=[],p=[];c?u.push(Mo(c,"band",{id:"legendItemKey"})):r?u.push(Mo(r,"band",{id:"calloutLabelKey"})):l&&u.push(Mo(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;a&&p.push(S0(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,processor:h}),Wt(a,g,{id:"radiusRaw",processor:h}),yc("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&p.push(Wt(r,"band",{id:"calloutLabelValue"})),l&&p.push(Wt(l,"band",{id:"sectorLabelValue"})),c&&p.push(Wt(c,"band",{id:"legendItemValue"})),o&&p.push(ap(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Wt(o,f,{id:"angleFilterRaw"}),yc("angleFilterValue",[0,1],0,0)),d&&this.processedData&&u.length>0&&p.push(sd(this.id,this.processedData)),p.push(id()),await this.requestDataModel(t,this.data,{props:[...u,ap(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Wt(n,f,{id:"angleRaw"}),yc("angleValue",[0,1],0,0),...p]});for(const x of this.processedData?.defs?.values??[]){const{id:m,missing:b,property:S}=x,M=Gv(this,b);m!=="angleRaw"&&M>0&&$.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,o=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=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:o,radiusValues:a,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:o}=this,{rotation:a,innerRadiusRatio:r}=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:d,radiusValues:u,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:f,legendItemValues:x}=this.getProcessedDataValues(i,e),m=d?.some((I,L)=>I>c[L])??!1;let b=0,S=0;const M=[],D=d!=null?[]:void 0,C=e.dataSources.get(this.id)??[],k=e.invalidData?.get(this.id);return C.forEach((I,L)=>{if(k?.[L]===!0)return;const N=m?h[L]:l[L],O=d!=null&&!m?Math.sqrt(d[L]/c[L]):1,w=s.convert(b)+Me(a);b=N,S+=N;const R=s.convert(b)+Me(a),G=Math.abs(R-w),B=w+G/2,P=c[L],W=(u?.[L]??1)*O,F=p?.[L],_=x?.[L],z=this.getLabels(I,B,G,!0,g?.[L],f?.[L],_),U=this.getSectorFormat(I,L,!1),Y={itemId:L,series:this,datum:I,datumIndex:L,angleValue:P,midAngle:B,midCos:Math.cos(B),midSin:Math.sin(B),startAngle:w,endAngle:R,radius:W,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(W),0),sectorFormat:U,radiusValue:F,legendItemValue:_,enabled:o&&n.getItemEnabled({seriesId:t,itemId:L}),focusable:!0,...z};M.push(Y),D?.push({...Y,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&&r!=null&&r!==1&&r>0,{itemId:t,nodeData:M,labelData:M,phantomNodeData:D}}getLabels(t,e,i,s,n,o,a){const{calloutLabel:r,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={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>=Me(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...u,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:o})}),c!=null&&a!=null&&(p.legendItem={key:c,text:a}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Nu(t),s=-.75*Math.PI,n=i-s,o=Math.floor(n/(Math.PI/2)),a=qT(o,e.length);return e[a]}getNodeFill(t,e,i){return uc(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(!(!uo(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,itemStyler:u}=this.properties,p=c[e%c.length],{fill:g,fillOpacity:f,stroke:x,strokeWidth:m,strokeOpacity:b,lineDash:S,lineDashOffset:M,cornerRadius:D}=jt(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],k=d[e%d.length],I=g??"black";let L;return u&&(L=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fill:this.getNodeFill(I,C,k),fillOpacity:f,stroke:x,strokeWidth:m,strokeOpacity:b,lineDash:S,lineDashOffset:M,cornerRadius:D,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(L?.fill??I,C,k),fillOpacity:L?.fillOpacity??f,stroke:L?.stroke??x,strokeWidth:L?.strokeWidth??m,strokeOpacity:L?.strokeOpacity??b,lineDash:L?.lineDash??S,lineDashOffset:L?.lineDashOffset??M,cornerRadius:L?.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=ea(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 o=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(o)}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:o,innerLabelsSelection:a}=this,r=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,h)=>{c.update(h,void 0,d=>this.getDatumId(d.datum,d.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(t,this.nodeData),l(e,r),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new pn;h.tag=0,h.pointerEvents=1,c.appendChild(h);const d=new Li;d.tag=1,d.pointerEvents=1,c.appendChild(d)}),o.update(this.nodeData),s.update(r),a.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());e=Math.ceil(n*2+1)}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],o=this.getShapeFillBBox(),a=this.ctx.animationManager.isSkipped(),r=(l,c,h,d)=>{const u=this.getSectorFormat(c.datum,c.itemId,d);c.sectorFormat.fill=u.fill,c.sectorFormat.stroke=u.stroke,a&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(d||a)&&(l.fill=u.fill,l.stroke=u.stroke);const p=this.getFillParams(u.fill,s,n);my(l,u.fill,o,p),l.strokeWidth=u.strokeWidth,l.fillOpacity=u.fillOpacity,l.strokeOpacity=u.strokeOpacity,l.lineDash=u.lineDash,l.lineDashOffset=u.lineDashOffset,l.cornerRadius=u.cornerRadius,l.fillShadow=this.properties.shadow;const g=Math.max((this.properties.sectorSpacing+(u.stroke!=null?u.strokeWidth:0))/2,0);l.inset=g,l.lineJoin=this.properties.sectorSpacing>=0||g>0?"miter":"round"};this.itemSelection.each((l,c,h)=>r(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{r(l,c,h,!0),l.visible=c.itemId===e?.itemId}),this.phantomSelection.each((l,c,h)=>r(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,o=Bk(i)?i??this.properties.strokes:s,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((r,l)=>{const c=r.closestDatum(),{calloutLabel:h,outerRadius:d}=c;if(h?.text&&!h.hidden&&d!==0){r.visible=!0,r.strokeWidth=n,r.stroke=o[l%o.length],r.fill=void 0;const u=c.midCos*d,p=c.midSin*d;let g=c.midCos*(d+t),f=c.midSin*(d+t);if((h.collisionTextAlign??h.collisionOffsetY!==0)&&h.box!=null){const m=h.box;let b=g,S=f;g<m.x?b=m.x:g>m.x+m.width&&(b=m.x+m.width),f<m.y?S=m.y:f>m.y+m.height&&(S=m.y+m.height);const M=b-g,D=S-f,C=Math.sqrt(Math.pow(M,2)+Math.pow(D,2)),k=C-a;k>0&&(g=g+M*k/C,f=f+D*k/C)}r.x1=u,r.y1=p,r.x2=g,r.y2=f}else r.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,o=-this.centerY,a=o+i.height,r=1;let l=1;e.x+r<s?l=(e.x+e.width-s)/e.width:e.x+e.width-r>n&&(l=(n-e.x)/e.width);const c=e.y+r<o||e.y+e.height-r>a,h=l===1?t.length:Math.floor(t.length*l)-1,d=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:d}}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,o=t.convert(0),a=m=>!m.calloutLabel||m.outerRadius===0,r=this.calloutNodeData,l=r.filter(m=>!a(m));if(l.forEach(m=>{const b=m.calloutLabel;b!=null&&(b.hidden=!1,b.collisionTextAlign=void 0,b.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,b)=>m.midSin-b.midSin),h=l.filter(m=>m.midCos>=0).sort((m,b)=>m.midSin-b.midSin),d=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),u=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),p=m=>{const b=m.calloutLabel;if(b==null)return pt.zero.clone();const S=m.outerRadius+i.length+s,M=m.midCos*S,D=m.midSin*S+b.collisionOffsetY,C=b.collisionTextAlign??b.textAlign,k=b.textBaseline;return Li.computeBBox(b.text,M,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:k})},g=(m,b,S)=>{const M=p(m).grow(n/2),D=p(b).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)&&(b.calloutLabel.collisionOffsetY=S==="to-top"?M.y-D.y-D.height:M.y+M.height-D.y)},f=m=>{const b=m.slice().sort((M,D)=>Math.abs(M.midSin)-Math.abs(D.midSin))[0],S=m.indexOf(b);for(let M=S-1;M>=0;M--){const D=m[M+1],C=m[M];g(D,C,"to-top")}for(let M=S+1;M<m.length;M++){const D=m[M-1],C=m[M];g(D,C,"to-bottom")}},x=m=>{const b=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 L=M[I];for(let N=I+1;N<m.length;N++){const O=M[N];if(L.collidesBBox(O)){D=!0;break}}}const C=r.map(I=>{const{startAngle:L,endAngle:N,outerRadius:O}=I;return{startAngle:L,endAngle:N,innerRadius:o,outerRadius:O}}),k=S.some(I=>C.some(L=>eO(I,L)));!D&&!b&&!k||m.filter(I=>I.calloutLabel.textAlign==="center").forEach(I=>{const L=I.calloutLabel;I.midCos<0?L.collisionTextAlign="right":I.midCos>0?L.collisionTextAlign="left":L.collisionTextAlign="center"})};f(c),f(h),x(d),x(u)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,color:a}=i,r=new Li;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,d=e.convert(c.radius),u=Math.max(0,d);if(!h?.text||u===0||h.hidden){l.visible=!1;return}const p=u+n+o,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,x={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=g,r.y=f,r.setFont(this.properties.calloutLabel),r.setAlign(x);const m=r.getBBox();let b=h.text,S=!0;if(i.avoidCollisions){const{textLength:M,hasVerticalOverflow:D}=this.getLabelOverflow(h.text,m,t);b=h.text.length===M?h.text:`${h.text.substring(0,M)}\u2026`,S=!D}l.text=b,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(x),l.fill=a,l.visible=S})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,maxCollisionOffset:a,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Li;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const u=this.getTitleTranslationY();isFinite(u)&&(c.text=d.text,c.x=0,c.y=u,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(u=>{const p=u.calloutLabel;if(!p||u.outerRadius===0)return null;const g=u.outerRadius+n+o,f=u.midCos*g,x=u.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,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)>a){p.hidden=!0;return}if(h){const b=-this.centerY,S=new pt(h.x-r,b,h.width+2*r,h.y+h.height+r-b);if(m.collidesBBox(S)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:b,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(p.text,m,e),D=p.text.length>2&&b<2;if(S||D||M){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:pt.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:o,positionOffset:a,positionRatio:r,color:l}=this.properties.sectorLabel,c=(h,d)=>{const{sectorLabel:u,outerRadius:p}=d;let g=!1;if(u&&p!==0){const f=e*(1-r)+p*r+a;h.fill=l,h.fontStyle=s,h.fontWeight=n,h.fontSize=i,h.fontFamily=o,h.text=u.text,h.x=d.midCos*f,h.y=d.midSin*f,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:b,endAngle:S}=d,M={startAngle:b,endAngle:S,innerRadius:e,outerRadius:p};m.every(([D,C])=>sm(D,C,M))&&(g=!0)}h.visible=g};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:x}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=d.text,h.x=0,h.y=0,h.fill=x,h.textAlign="center",h.textBaseline="alphabetic",t.push(h.getBBox()),e.push(d.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),o=Math.max(...t.map(h=>h.width)),a=this.getInnerRadius(),l=Math.sqrt(Math.pow(o/2,2)+Math.pow(n/2,2))<=(a>0?a:this.getOuterRadius()),c=[];for(let h=0,d=-n/2;h<t.length;h++){const p=t[h].height+d+i(h);c.push(p),d=p+s(h)}this.innerLabelsSelection.each((h,d,u)=>{h.y=c[u],h.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return SM(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=n,f=this.properties.title.text;if(!i||!s)return;const x=s.dataSources.get(this.id)?.[t],{angleRawValues:m,legendItemValues:b,calloutLabelValues:S,sectorLabelValues:M}=this.getProcessedDataValues(i,s),D=m[t],C=b?.[t]??(a===h?void 0:S?.[t])??(l===h?void 0:M?.[t])??d;return g.formatTooltip(this.properties,{title:f,symbol:this.legendItemSymbol(t),data:[{label:C,fallbackLabel:h,value:Wa(D,3)}]},{seriesId:e,datum:x,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,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:o,lineDash:a,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return uo(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:o}}=this;if(!s||!i||!this.properties.isValid()||t!=="category")return[];const{angleKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===a)&&(!l||l===a))return[];const{angleRawValues:d,calloutLabelValues:u,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(s,i),f=this.properties.title?.showInLegend&&this.properties.title.text,x=[],m=this.properties.hideZeroValueSectorsInLegend,b=i.dataSources.get(this.id),S=i.invalidData?.get(this.id);for(let M=0;M<i.input.count;M++){const D=b?.[M],C=d[M];if(S?.[M]===!0||m&&C===0)continue;const k=[];f&&k.push(f);const I=this.getLabels(D,2*Math.PI,2*Math.PI,!1,u?.[M],p?.[M],g?.[M]);c&&I.legendItem!==void 0?k.push(I.legendItem.text):r&&r!==a&&I.calloutLabel?.text!==void 0?k.push(I.calloutLabel?.text):l&&l!==a&&I.sectorLabel?.text!==void 0&&k.push(I.sectorLabel?.text),k.length!==0&&x.push({legendType:"category",id:n,datum:D,itemId:M,seriesId:n,enabled:e&&o.getItemEnabled({seriesId:n,itemId:M}),label:{text:k.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,o)=>i.toggleItem(n,e,o)),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=vc(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Fe(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),Fe(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),ee(this,"callout",e,this.calloutLabelSelection),ee(this,"sector",e,this.labelSelection),ee(this,"highlight",e,this.highlightLabelSelection),ee(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.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 d=!this.nodeData.some(p=>p.enabled),u=vc(!1,this.properties.rotation,n,o);Fe(this.id,"nodes",a,[t,e,i],u.nodes,(p,g)=>this.getDatumId(g.datum,g.datumIndex),r),Fe(this.id,"innerCircle",a,[this.innerCircleSelection],u.innerCircle),ee(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ee(this,"sector",this.ctx.animationManager,this.labelSelection),ee(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,ee(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:o}=this.ctx,a=vc(!1,this.properties.rotation,s,n);Fe(this.id,"nodes",o,[t,e,i],a.nodes,(r,l)=>this.getDatumId(l.datum,l.datumIndex)),Fe(this.id,"innerCircle",o,[this.innerCircleSelection],a.innerCircle),sl(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),sl(this,"sector",this.ctx.animationManager,this.labelSelection),sl(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),sl(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?Gi(t[n]):i?Gi(t[i]):s?Gi(t[s]):`${e}`:`${e}`}};cm.className="DonutSeries",cm.type="donut";var hm={type:K(Ct("pie")),angleKey:K(E),radiusKey:E,calloutLabelKey:E,sectorLabelKey:E,legendItemKey:E,angleName:E,radiusName:E,calloutLabelName:E,sectorLabelName:E,radiusMin:H,radiusMax:H,rotation:J,outerRadiusOffset:J,outerRadiusRatio:Tt,hideZeroValueSectorsInLegend:j,sectorSpacing:H,cornerRadius:H,itemStyler:bt,title:{enabled:j,text:E,showInLegend:j,spacing:H,...ge},calloutLabel:{enabled:j,offset:J,minAngle:H,avoidCollisions:j,formatter:bt,...ge},sectorLabel:{enabled:j,positionOffset:J,positionRatio:Tt,formatter:bt,...ge},calloutLine:{colors:mt(dt),length:H,strokeWidth:H},fills:mt($o),strokes:mt(dt),tooltip:sr,shadow:Pp,...Io,...Ot,...zr(St,["fill"]),...zr(rt,["stroke"])};hm.defaultColorRange=mt(mt(dt)),hm.defaultPatternFills=mt(dt);var YU={...hm,type:K(Ct("donut")),innerRadiusOffset:J,innerRadiusRatio:Tt,innerCircle:{fill:E,fillOpacity:Tt},innerLabels:gs({text:K(E),spacing:H,...ge},"inner label options array")},KU={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:V0,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:Jr,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}},$U={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:t=>new cm(t),tooltipDefaults:{range:"exact"},themeTemplate:KU},XU={type:"series",name:"donut",chartType:"polar",options:YU,create:t=>new cm(t)},oO=class extends Ae{constructor(){super(...arguments),this.showInLegend=!1}};v([A(xt)],oO.prototype,"showInLegend",2);var yd=class extends Ni{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};v([A(ot)],yd.prototype,"offset",2),v([A(Et.restrict({min:0,max:360}))],yd.prototype,"minAngle",2),v([A(ot)],yd.prototype,"minSpacing",2),v([A(ot)],yd.prototype,"maxCollisionOffset",2),v([A(xt)],yd.prototype,"avoidCollisions",2);var vM=class extends Ni{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};v([A(Et)],vM.prototype,"positionOffset",2),v([A(ae)],vM.prototype,"positionRatio",2);var dm=class extends kt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};v([A(ki(Zi(qo,zt,Jo)),{optional:!0})],dm.prototype,"colors",2),v([A(ot)],dm.prototype,"length",2),v([A(ot)],dm.prototype,"strokeWidth",2);var Zt=class extends gn{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Je),this.strokes=Object.values(ra),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 oO,this.shadow=new Ao,this.calloutLabel=new yd,this.sectorLabel=new vM,this.calloutLine=new dm,this.tooltip=new xs}};v([A(et)],Zt.prototype,"angleKey",2),v([A(et,{optional:!0})],Zt.prototype,"angleName",2),v([A(et,{optional:!0})],Zt.prototype,"angleFilterKey",2),v([A(et,{optional:!0})],Zt.prototype,"radiusKey",2),v([A(et,{optional:!0})],Zt.prototype,"radiusName",2),v([A(ot,{optional:!0})],Zt.prototype,"radiusMin",2),v([A(ot,{optional:!0})],Zt.prototype,"radiusMax",2),v([A(et,{optional:!0})],Zt.prototype,"calloutLabelKey",2),v([A(et,{optional:!0})],Zt.prototype,"calloutLabelName",2),v([A(et,{optional:!0})],Zt.prototype,"sectorLabelKey",2),v([A(et,{optional:!0})],Zt.prototype,"sectorLabelName",2),v([A(et,{optional:!0})],Zt.prototype,"legendItemKey",2),v([A(ki(Gr))],Zt.prototype,"defaultColorRange",2),v([A(ki(zt))],Zt.prototype,"defaultPatternFills",2),v([A(ki(Zi(qo,zt,Jo)))],Zt.prototype,"fills",2),v([A(Gr)],Zt.prototype,"strokes",2),v([A(ae)],Zt.prototype,"fillOpacity",2),v([A(ae)],Zt.prototype,"strokeOpacity",2),v([A(ta)],Zt.prototype,"lineDash",2),v([A(ot)],Zt.prototype,"lineDashOffset",2),v([A(ot)],Zt.prototype,"cornerRadius",2),v([A(Ls,{optional:!0})],Zt.prototype,"itemStyler",2),v([A(Et)],Zt.prototype,"rotation",2),v([A(Et)],Zt.prototype,"outerRadiusOffset",2),v([A(ae)],Zt.prototype,"outerRadiusRatio",2),v([A(ot)],Zt.prototype,"strokeWidth",2),v([A(Et)],Zt.prototype,"sectorSpacing",2),v([A(xt)],Zt.prototype,"hideZeroValueSectorsInLegend",2),v([A(at)],Zt.prototype,"title",2),v([A(at)],Zt.prototype,"shadow",2),v([A(at)],Zt.prototype,"calloutLabel",2),v([A(at)],Zt.prototype,"sectorLabel",2),v([A(at)],Zt.prototype,"calloutLine",2),v([A(at)],Zt.prototype,"tooltip",2);var ZU=class extends Ju{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}},um=class extends lm{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:bM,label:er}}),this.properties=new Zt,this.phantomNodeData=void 0,this.backgroundGroup=new Ns({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new Do,this.radiusScale=new Do,this.phantomGroup=this.backgroundGroup.appendChild(new It({name:"phantom"})),this.phantomSelection=ai.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new It({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ai(this.calloutLabelGroup,It),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new It({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Oi({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=ZU,this.angleScale=new Do,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 ji;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:o,radiusKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(x,m)=>e&&s.getItemEnabled({seriesId:i,itemId:m})?x:0,d=!this.ctx.animationManager.isSkipped(),u=[],p=[];c?u.push(Mo(c,"band",{id:"legendItemKey"})):r?u.push(Mo(r,"band",{id:"calloutLabelKey"})):l&&u.push(Mo(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;a&&p.push(S0(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,processor:h}),Wt(a,g,{id:"radiusRaw",processor:h}),yc("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&p.push(Wt(r,"band",{id:"calloutLabelValue"})),l&&p.push(Wt(l,"band",{id:"sectorLabelValue"})),c&&p.push(Wt(c,"band",{id:"legendItemValue"})),o&&p.push(ap(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Wt(o,f,{id:"angleFilterRaw"}),yc("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&u.length>0&&p.push(sd(this.id,this.processedData)),p.push(id()),await this.requestDataModel(t,this.data,{props:[...u,ap(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Wt(n,f,{id:"angleRaw"}),yc("angleValue",[0,1],0,0),...p]});for(const x of this.processedData?.defs?.values??[]){const{id:m,missing:b,property:S}=x,M=Gv(this,b);m!=="angleRaw"&&M>0&&$.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,o=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=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:o,radiusValues:a,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:o}=this,{rotation:a}=this.properties;if(!i||e?.type!=="ungrouped")return;const{angleValues:r,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:d,radiusRawValues:u,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:f}=this.getProcessedDataValues(i,e),x=h?.some((k,I)=>k>l[I])??!1;let m=0,b=0;const S=[],M=h!=null?[]:void 0,D=e.dataSources.get(this.id)??[],C=e.invalidData?.get(this.id);return D.forEach((k,I)=>{if(C?.[I]===!0)return;const L=x?c[I]:r[I],N=h!=null&&!x?Math.sqrt(h[I]/l[I]):1,O=s.convert(m)+Me(a);m=L,b+=L;const w=s.convert(m)+Me(a),R=Math.abs(w-O),G=O+R/2,B=l[I],V=(d?.[I]??1)*N,W=u?.[I],F=f?.[I],_=this.getLabels(k,G,R,!0,p?.[I],g?.[I],F),z=this.getSectorFormat(k,I,!1),U={itemId:I,series:this,datum:k,datumIndex:I,angleValue:B,midAngle:G,midCos:Math.cos(G),midSin:Math.sin(G),startAngle:O,endAngle:w,radius:V,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(V),0),sectorFormat:z,radiusValue:W,legendItemValue:F,enabled:o&&n.getItemEnabled({seriesId:t,itemId:I}),..._};S.push(U),M?.push({...U,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=b===0,{itemId:t,nodeData:S,labelData:S,phantomNodeData:M}}getLabels(t,e,i,s,n,o,a){const{calloutLabel:r,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={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>=Me(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...u,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:o})}),c!=null&&a!=null&&(p.legendItem={key:c,text:a}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Nu(t),s=-.75*Math.PI,n=i-s,o=Math.floor(n/(Math.PI/2)),a=qT(o,e.length);return e[a]}getNodeFill(t,e,i){return uc(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(!(!uo(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,itemStyler:u}=this.properties,p=c[e%c.length],{fill:g,fillOpacity:f,stroke:x,strokeWidth:m,strokeOpacity:b,lineDash:S,lineDashOffset:M,cornerRadius:D}=jt(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],k=d[e%d.length],I=g??"black";let L;return u&&(L=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fill:this.getNodeFill(I,C,k),strokeOpacity:b,stroke:x,strokeWidth:m,fillOpacity:f,lineDash:S,lineDashOffset:M,cornerRadius:D,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(L?.fill??I,C,k),fillOpacity:L?.fillOpacity??f,stroke:L?.stroke??x,strokeWidth:L?.strokeWidth??m,strokeOpacity:L?.strokeOpacity??b,lineDash:L?.lineDash??S,lineDashOffset:L?.lineDashOffset??M,cornerRadius:L?.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=ea(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 o=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(o)}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:o}=this,a=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),r=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datum,h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};r(t,this.nodeData),r(e,a),r(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new pn;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new Li;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),o.update(this.nodeData),s.update(a)}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],o=this.getShapeFillBBox(),a=this.ctx.animationManager.isSkipped(),r=(l,c,h,d)=>{const u=this.getSectorFormat(c.datum,c.itemId,d);c.sectorFormat.fill=u.fill,c.sectorFormat.stroke=u.stroke,a&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(d||a)&&(l.fill=u.fill,l.stroke=u.stroke);const p=this.getFillParams(u.fill,s,n);my(l,u.fill,o,p),l.strokeWidth=u.strokeWidth,l.fillOpacity=u.fillOpacity,l.strokeOpacity=u.strokeOpacity,l.lineDash=u.lineDash,l.lineDashOffset=u.lineDashOffset,l.cornerRadius=u.cornerRadius,l.fillShadow=this.properties.shadow;const g=Math.max((this.properties.sectorSpacing+(u.stroke!=null?u.strokeWidth:0))/2,0);l.inset=g,l.lineJoin=this.properties.sectorSpacing>=0||g>0?"miter":"round"};this.itemSelection.each((l,c,h)=>r(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{r(l,c,h,!0),l.visible=c.itemId===e?.itemId}),this.phantomSelection.each((l,c,h)=>r(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,o=Bk(i)?i:s,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((r,l)=>{const c=r.closestDatum(),{calloutLabel:h,outerRadius:d}=c;if(h?.text&&!h.hidden&&d!==0){r.visible=!0,r.strokeWidth=n,r.stroke=o[l%o.length],r.fill=void 0;const u=c.midCos*d,p=c.midSin*d;let g=c.midCos*(d+t),f=c.midSin*(d+t);if((h.collisionTextAlign??h.collisionOffsetY!==0)&&h.box!=null){const m=h.box;let b=g,S=f;g<m.x?b=m.x:g>m.x+m.width&&(b=m.x+m.width),f<m.y?S=m.y:f>m.y+m.height&&(S=m.y+m.height);const M=b-g,D=S-f,C=Math.sqrt(Math.pow(M,2)+Math.pow(D,2)),k=C-a;k>0&&(g=g+M*k/C,f=f+D*k/C)}r.x1=u,r.y1=p,r.x2=g,r.y2=f}else r.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,o=-this.centerY,a=o+i.height,r=1;let l=1;e.x+r<s?l=(e.x+e.width-s)/e.width:e.x+e.width-r>n&&(l=(n-e.x)/e.width);const c=e.y+r<o||e.y+e.height-r>a,h=l===1?t.length:Math.floor(t.length*l)-1,d=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:d}}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,o=t.convert(0),a=m=>!m.calloutLabel||m.outerRadius===0,r=this.calloutNodeData,l=r.filter(m=>!a(m));if(l.forEach(m=>{const b=m.calloutLabel;b!=null&&(b.hidden=!1,b.collisionTextAlign=void 0,b.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,b)=>m.midSin-b.midSin),h=l.filter(m=>m.midCos>=0).sort((m,b)=>m.midSin-b.midSin),d=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),u=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),p=m=>{const b=m.calloutLabel;if(b==null)return pt.zero.clone();const S=m.outerRadius+i.length+s,M=m.midCos*S,D=m.midSin*S+b.collisionOffsetY,C=b.collisionTextAlign??b.textAlign,k=b.textBaseline;return Li.computeBBox(b.text,M,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:k})},g=(m,b,S)=>{const M=p(m).grow(n/2),D=p(b).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)&&(b.calloutLabel.collisionOffsetY=S==="to-top"?M.y-D.y-D.height:M.y+M.height-D.y)},f=m=>{const b=m.slice().sort((M,D)=>Math.abs(M.midSin)-Math.abs(D.midSin))[0],S=m.indexOf(b);for(let M=S-1;M>=0;M--){const D=m[M+1],C=m[M];g(D,C,"to-top")}for(let M=S+1;M<m.length;M++){const D=m[M-1],C=m[M];g(D,C,"to-bottom")}},x=m=>{const b=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 L=M[I];for(let N=I+1;N<m.length;N++){const O=M[N];if(L.collidesBBox(O)){D=!0;break}}}const C=r.map(I=>{const{startAngle:L,endAngle:N,outerRadius:O}=I;return{startAngle:L,endAngle:N,innerRadius:o,outerRadius:O}}),k=S.some(I=>C.some(L=>eO(I,L)));!D&&!b&&!k||m.filter(I=>I.calloutLabel.textAlign==="center").forEach(I=>{const L=I.calloutLabel;I.midCos<0?L.collisionTextAlign="right":I.midCos>0?L.collisionTextAlign="left":L.collisionTextAlign="center"})};f(c),f(h),x(d),x(u)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,color:a}=i,r=new Li;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,d=e.convert(c.radius),u=Math.max(0,d);if(!h?.text||u===0||h.hidden){l.visible=!1;return}const p=u+n+o,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,x={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=g,r.y=f,r.setFont(this.properties.calloutLabel),r.setAlign(x);const m=r.getBBox();let b=h.text,S=!0;if(i.avoidCollisions){const{textLength:M,hasVerticalOverflow:D}=this.getLabelOverflow(h.text,m,t);b=h.text.length===M?h.text:`${h.text.substring(0,M)}\u2026`,S=!D}l.text=b,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(x),l.fill=a,l.visible=S})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,maxCollisionOffset:a,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Li;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const u=this.getTitleTranslationY();isFinite(u)&&(c.text=d.text,c.x=0,c.y=u,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(u=>{const p=u.calloutLabel;if(!p||u.outerRadius===0)return null;const g=u.outerRadius+n+o,f=u.midCos*g,x=u.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,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)>a){p.hidden=!0;return}if(h){const b=-this.centerY,S=new pt(h.x-r,b,h.width+2*r,h.y+h.height+r-b);if(m.collidesBBox(S)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:b,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(p.text,m,e),D=p.text.length>2&&b<2;if(S||D||M){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:pt.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:o,positionOffset:a,positionRatio:r,color:l}=this.properties.sectorLabel,c=e>0,h=this.ctx.legendManager.getData(this.id)?.filter(u=>u.enabled).length===1,d=(u,p)=>{const{sectorLabel:g,outerRadius:f,startAngle:x,endAngle:m}=p;let b=!1;if(g&&f!==0){const S=e*(1-r)+f*r+a;u.fill=l,u.fontStyle=s,u.fontWeight=n,u.fontSize=i,u.fontFamily=o,u.text=g.text,!c&&h?(u.x=0,u.y=0):(u.x=p.midCos*S,u.y=p.midSin*S),u.textAlign="center",u.textBaseline="middle";const D=u.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]],k={startAngle:x,endAngle:m,innerRadius:e,outerRadius:f};C.every(([I,L])=>sm(I,L,k))&&(b=!0)}u.visible=b};this.labelSelection.each(d),this.highlightLabelSelection.each(d)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(t){return SM(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=n,f=this.properties.title.text;if(!i||!s)return;const x=s.dataSources.get(this.id)?.[t],{angleRawValues:m,legendItemValues:b,calloutLabelValues:S,sectorLabelValues:M}=this.getProcessedDataValues(i,s),D=m[t],C=b?.[t]??(a===h?void 0:S?.[t])??(l===h?void 0:M?.[t])??d;return g.formatTooltip(this.properties,{title:f,symbol:this.legendItemSymbol(t),data:[{label:C,fallbackLabel:h,value:Wa(D,3)}]},{seriesId:e,datum:x,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,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:o,lineDash:a,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return uo(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{id:e,visible:i,processedData:s,dataModel:n,ctx:{legendManager:o}}=this;if(!n||!s||t!=="category")return[];const{angleKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===a)&&(!l||l===a))return[];const{calloutLabelValues:d,sectorLabelValues:u,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(n,s),f=this.properties.title?.showInLegend&&this.properties.title.text,x=[],m=this.properties.hideZeroValueSectorsInLegend,b=s.dataSources.get(this.id),S=s.invalidData?.get(this.id);for(let M=0;M<s.input.count;M++){const D=b?.[M],C=g[M];if(S?.[M]===!0||m&&C===0)continue;const k=[];f&&k.push(f);const I=this.getLabels(D,2*Math.PI,2*Math.PI,!1,d?.[M],u?.[M],p?.[M]);c&&I.legendItem!==void 0?k.push(I.legendItem.text):r&&r!==a&&I.calloutLabel?.text!==void 0?k.push(I.calloutLabel?.text):l&&l!==a&&I.sectorLabel?.text!==void 0&&k.push(I.sectorLabel?.text),k.length!==0&&x.push({legendType:"category",id:e,datum:D,itemId:M,seriesId:e,enabled:i&&o.getItemEnabled({seriesId:e,itemId:M}),label:{text:k.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,o)=>i.toggleItem(n,e,o)),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=vc(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Fe(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),ee(this,"callout",e,this.calloutLabelSelection),ee(this,"sector",e,this.labelSelection),ee(this,"highlight",e,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.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 d=vc(!1,this.properties.rotation,n,o);Fe(this.id,"nodes",a,[t,e,i],d.nodes,(u,p)=>this.getDatumId(p.datum,p.datumIndex),r),ee(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ee(this,"sector",this.ctx.animationManager,this.labelSelection),ee(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:o}=this.ctx,a=vc(!1,this.properties.rotation,s,n);Fe(this.id,"nodes",o,[t,e,i],a.nodes,(r,l)=>this.getDatumId(l.datum,l.datumIndex)),sl(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),sl(this,"sector",this.ctx.animationManager,this.labelSelection),sl(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?Gi(t[n]):i?Gi(t[i]):s?Gi(t[s]):`${e}`:`${e}`}};um.className="PieSeries",um.type="pie";var QU={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:V0,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Jr,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},qU={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:t=>new um(t),tooltipDefaults:{range:"exact"},themeTemplate:QU},JU={type:"series",name:"pie",chartType:"polar",options:hm,create:t=>new um(t)};function pm(){Zo.register(ZN,qH,gH,kU,jw,FU,$w,WU,$U,qU,GU);for(const t of[qa,fc,Zr,mc,nd])lc.register(t.type,{moduleFactory:e=>new t(e)})}function tY(){for(const t of Zo.modules){if(t.packageType==="enterprise"&&!Z3(t)&&$.errorOnce("Unexpected enterprise module registered: "+t.identifier),t.type==="root"&&t.themeTemplate)for(const e of t.chartTypes)Wv.set(e,t.themeTemplate);if(t.type==="series"){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);Fn.register(t.identifier,t)}if(t.type==="series-option"&&t.themeTemplate)for(const e of t.seriesTypes)Fn.setThemeTemplate(e,t.themeTemplate);if(t.type==="axis-option"&&t.themeTemplate)for(const e of t.axisTypes){const i=lc.getThemeTemplate(e),s=jt(t.themeTemplate,i);lc.setThemeTemplate(e,s)}t.type==="axis"&&lc.register(t.identifier,t),t.type==="legend"&&jv.register(t.identifier,t)}if(Zo.hasEnterpriseModules()){const t=Q3();t.length>0&&$.errorOnce("Enterprise modules expected but not registered: ",t)}}var eY=["top","right","bottom","left"],gm=class I_ extends Sy{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:o,visible:a}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=a,this.seriesRect=o,this.animationRect=e.layoutBox;const{x:r,y:l}=o;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const u of[i,s])u.translationX=Math.floor(r),u.translationY=Math.floor(l);else{const{translationX:u,translationY:p}=i;Ya(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:u,translationY:p},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=o.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||n?c:void 0,{lastUpdateClipRect:d}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&d!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:d,to:c,onUpdate:u=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(e,{axes:this.axes.map(u=>u.getLayoutState()),series:{visible:a,rect:o,paddedRect:c},clipSeries:n})}updateAxes(e){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(e);for(const o of this.axes)o.update(),o.setCrossLinesVisible(!n),this.clipAxis(o,s,e);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(e){let i,s,n=0;const o=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone()),n++>o){$.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 o=!1,a=!1;for(const m of eY){const b=this.seriesArea.padding[m],S=this.axes.findLast(M=>M.position===m);S?S.seriesAreaPadding=b:i.shrink(b,m)}const r=(e.get("left")??0)+(e.get("right")??0),l=(e.get("top")??0)+(e.get("bottom")??0),c=this.buildCrossLinePadding(e);i.width<=r+c.hPadding||i.height<=l+c.vPadding?o=!0:i.shrink(c);const h=i.clone().shrink(Object.fromEntries(e));for(const m of this.axes){const{position:b="left",direction:S}=m;this.sizeAxis(m,h,b);const M=S==="y",{primaryTickCount:D,bbox:C}=m.calculateLayout(m.nice?n[S]:void 0);n[S]??(n[S]=D),a||(a=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 d=wS(this.axes,m=>m.position??"left"),{width:u,height:p,pixelRatio:g}=this.ctx.scene,f=new Map,x=new Map;for(const[m,b]of ke(d)){let M=m==="left"||m==="right"?p%g:u%g,D=0;for(const C of b??[]){x.set(C.id,M);const k=s.get(C.id)??0;D=Math.max(D,M+k),C.layoutConstraints.stacked&&(M+=k+I_.AxesPadding)}f.set(m,Math.ceil(D))}for(const[m,b]of ke(d))this.positionAxes({axes:b??[],position:m,axisWidths:s,axisOffsets:x,axisAreaWidths:f,axisBound:i,seriesRect:h});return{clipSeries:a,seriesRect:h,axisAreaWidths:f,overflows:o}}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 ke(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 o=s==="x"?e.x:e.y,a=s==="x"?e.width:e.height;return n===1?Math.min(i,o+a):Math.max(i,o)}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:o}=e.scale;if(he.is(e.scale)){const[a,r]=oi(s);n=a!==o[0]||r!==o[1]}else n=!Xo(s,o);n&&!this.skipSync&&i.updateSiblings()}return s}sizeAxis(e,i,s){const n=e instanceof fc,o=s==="left"||s==="right",{width:a,height:r}=i,l=o?r:a;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:p,unit:g,align:f}=e.layoutConstraints;g==="px"?h=c+p:h=h*p/100,f==="end"&&(c=l-(h-c),h=l),o&&(n?[d,u]=[1-u,1-d]:[c,h]=[h,c]),e.range=[c,h],e.visibleRange=[d,u],e.gridLength=o?a:r}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:o,axisAreaWidths:a,seriesRect:r,position:l}=e,c=a.get(l)??0;let h="x",d="y",u=1;(l==="top"||l==="bottom")&&(h="y",d="x");let p=s[h];(l==="right"||l==="bottom")&&(u=-1,p+=h==="x"?s.width:s.height);for(const g of i){const f=a.get(d==="x"?"left":"top")??0,x=n.get(g.id)??0,m=o.get(g.id)??0;g.gridPadding=c-m-x,g.translation[d]=s[d]+f,g.translation[h]=this.clampToOutsideSeriesRect(r,p+u*(m+x),h,u)}}shouldFlipXY(){return this.series.every(e=>e instanceof nl&&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 o=e.axisAreaWidths.get(s);if((n!=null||o!=null)&&n!==o)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),o=Math.ceil(e.line?.width??0);let{width:a,height:r}=i;switch(a+=e.direction==="x"?n:o,r+=e.direction==="y"?n:o,e.clipGrid(i.x,i.y,a,r),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(he.is(h)&&l.enabled&&l.avoidCollisions&&c.length>1){const d=c.toSorted((f,x)=>f.translationY-x.translationY),u=d.at(-1),p=u.getBBox(),g=i.x+p.y+p.height<=s.x+s.width+this.padding.right;if(u.visible=g,g||e.visibleRange[0]>0||e.visibleRange[1]<1)d[0].visible=!0;else{const f=d[0].getBBox();d[0].visible=f.y>=0}}break}}};gm.className="CartesianChart",gm.type="cartesian",gm.AxesPadding=15;var iY=gm,sY=ne(t=>typeof HTMLElement>"u"||t instanceof HTMLElement,"an html element"),Mc={mode:st("integrated","standalone"),container:sY,theme:cn,series:On,annotations:cn,navigator:cn,initialState:cn},aO={...Ps,...Mc,axes:cn,data:On},rO={...Ps,...Mc,axes:cn,data:On},nY={...Ps,...Mc,data:On,topology:Ko},oY={...Ps,...Mc,data:On},aY={...Ps,...Mc,data:On},rY={...Ps,...Mc,data:On,nodes:On},lY={...Ps,...Mc,data:On},cY={type:"chart",name:"cartesian",options:aO,detect:r0,create(t,e){return new iY(t,e)}},jp=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},hY={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:sN,create:jp},dY={type:"chart",name:"gauge",placeholder:!0,options:{},detect:c0,create:jp},uY={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:eN,create:jp},pY={type:"chart",name:"standalone",placeholder:!0,options:{},detect:l0,create:jp},gY={type:"chart",name:"topology",placeholder:!0,options:{},detect:iN,create:jp},md=class extends s0{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}updatePosition(){super.updatePosition();const t=fy(this),e=e0(t);this.axisGroup.setProperties(this.getAxisTransform()),this.gridLineGroupSelection.each(e),this.tickLineGroupSelection.each(e),this.tickLabelGroupSelection.each(i0())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};v([A(le(["polygon","circle"],"a polar axis shape"))],md.prototype,"shape",2),v([A(ae)],md.prototype,"innerRadiusRatio",2);var MM=class extends Sy{constructor(t,e){super(t,e),this.padding=new Wr(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"),o=this.axes.find(l=>l.direction==="y");if(!(n instanceof md)||!(o instanceof md))return;const a=n.scale,r=o.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,o.gridAngles=a.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>a.convert(l)),o.gridRange=n.range,o.range=[s,s*r],[n,o].forEach(l=>{l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()})}async computeCircle(t){const e=this.series.filter(fY),i=this.axes.filter(yY),s=(c,h,d)=>{this.updateAxes(t,c,h,d),e.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=d});const u=e.filter(p=>p.type==="donut"||p.type==="pie");if(u.length>1){const p=u.map(g=>{const f=g.getInnerRadius();return{series:g,innerRadius:f}}).sort((g,f)=>g.innerRadius-f.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g<p.length-1;g++)p[g].series.surroundingRadius=p[g+1].innerRadius}},n=t.width/2,o=t.height/2,a=Math.max(0,Math.min(t.width,t.height)/2);let r=a;s(n,o,r);const l=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const p of Pr(i,e)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},t);g&&h.push(g)}if(h.length===0){s(n,o,a);return}const d=pt.merge(h),u=this.refineCircle(d,r,t);s(u.centerX,u.centerY,u.radius),r=u.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of Pr(i,e))await c.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:r,centerX:n,centerY:o}}refineCircle(t,e,i){const n=-e,o=-e,a=e,r=e;let l=Math.max(0,n-t.x),c=Math.max(0,o-t.y),h=Math.max(0,t.x+t.width-a),d=Math.max(0,t.y+t.height-r);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let g=Math.min(u,p)/2;const f=.5*i.width/2,x=.5*i.height/2,m=Math.min(f,x);if(g<m){g=m;const M=l+h,D=c+d;if(2*g+D>i.height){const C=i.height-2*g;Math.min(c,d)*2>C?(c=C/2,d=C/2):c>d?c=C-d:d=C-c}if(2*g+M>i.width){const C=i.width-2*g;Math.min(l,h)*2>C?(l=C/2,h=C/2):l>h?l=C-h:h=C-l}}const b=l+2*g+h,S=c+2*g+d;return{centerX:(i.width-b)/2+l+g,centerY:(i.height-S)/2+c+g,radius:g}}};MM.className="PolarChart",MM.type="polar";function fY(t){return t instanceof lm}function yY(t){return t instanceof md}var mY={type:"chart",name:"polar",options:rO,detect:tN,create(t,e){return new MM(t,e)}},xY={...pd,...$y(J),type:K(Ct("number")),label:{format:Yy,...ud},crosshair:gd(!0)},bY={...pd,...$y(J),type:K(Ct("log")),base:Ze(gf,ne(t=>t!==1,"not equal to 1")),label:{format:Yy,...ud},crosshair:gd(!0)},SY={...pd,...$y(Qt(J,Xl),!0),type:K(Ct("time")),label:{...ud,format:E},crosshair:gd(!0)},vY={...pd,type:K(Ct("category")),label:ud,paddingInner:H,paddingOuter:H,groupPaddingInner:H,crosshair:gd()},MY={...pd,type:K(Ct("grouped-category")),label:ud,crosshair:gd(),paddingInner:H,groupPaddingInner:H,depthOptions:gs({label:{enabled:j,avoidCollisions:j,...ge},tick:{enabled:j,stroke:dt,width:H}},"depth options objects array")},DY={type:"axis",name:"number",chartType:"cartesian",options:xY,create:t=>new qa(t)},AY={type:"axis",name:"log",chartType:"cartesian",options:bY,create:t=>new nd(t)},IY={type:"axis",name:"time",chartType:"cartesian",options:SY,create:t=>new Zr(t)},TY={type:"axis",name:"category",chartType:"cartesian",options:vY,create:t=>new fc(t)},kY={type:"axis",name:"grouped-category",chartType:"cartesian",options:MY,create:t=>new mc(t)},CY=[cY,DY,AY,IY,TY,kY,zw,Ww,Uw,Kw,Xw,Qw],LY=[mY,XU,JU],NY=[...CY,...LY,hY,dY,uY,pY,gY],nr={isEnterprise:!1},fm=["bar","line","scatter"],wY=void 0,OY=void 0;OY=wY;var EY=void 0,RY=void 0;RY=EY;var DM=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(DM||{}),AM=(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))(AM||{}),IM=(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))(IM||{}),PY=void 0,BY=void 0;BY=PY;var zY=void 0,FY=void 0;FY=zY;var Ks=Symbol("IGNORED_PROP");function yn(t,e){const i={};for(const s of Object.keys(e)){const n=e[s];n!==Ks&&Object.hasOwn(t,s)&&(i[s]=n)}return i}function _Y(t){return t.type==="radial-gauge"}function GY(t){return t.type==="linear-gauge"}function lO(t){const{enabled:e,mode:i,showArrow:s,range:n,position:o,pagination:a,delay:r,wrapping:l,interaction:c,renderer:h,...d}=t,u=yn(t,{enabled:e,showArrow:s,range:n,position:o,interaction:c,renderer:h,...d});return{chartTooltipOptions:yn(t,{enabled:Ks,showArrow:Ks,range:Ks,position:Ks,mode:i,pagination:a,delay:r,wrapping:l,...d}),seriesTooltipOptions:u}}function VY(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,width:x,type:m,cursor:b,nodeClickRange:S,tooltip:M={},value:D,scale:C={},startAngle:k,endAngle:I,highlightStyle:L,segmentation:N,bar:O,needle:w,targets:R,outerRadius:G,innerRadius:B,outerRadiusRatio:P,innerRadiusRatio:V,cornerRadius:W,cornerMode:F,label:_,secondaryLabel:z,spacing:U,...Y}=t,{chartTooltipOptions:Z,seriesTooltipOptions:q}=lO(M),Q=yn(t,{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,tooltip:Z,width:x}),tt=yn(t,{needle:w!=null?{enabled:!0,...w}:Ks,startAngle:k,endAngle:I,scale:C,type:m,cursor:b,nodeClickRange:S,listeners:r,tooltip:q,value:D,highlightStyle:L,segmentation:N,bar:O,targets:R,outerRadius:G,innerRadius:B,outerRadiusRatio:P,innerRadiusRatio:V,cornerRadius:W,cornerMode:F,label:_,secondaryLabel:z,spacing:U,...Y});return{...Q,series:[tt]}}function jY(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,width:x,type:m,cursor:b,nodeClickRange:S,tooltip:M={},value:D,scale:C={},direction:k="vertical",thickness:I,highlightStyle:L,segmentation:N,bar:O,targets:w,cornerRadius:R,cornerMode:G,label:B,...P}=t,{chartTooltipOptions:V,seriesTooltipOptions:W}=lO(M),F=yn(t,{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,tooltip:V,width:x}),_=yn(t,{scale:C,type:m,cursor:b,nodeClickRange:S,listeners:r,tooltip:W,value:D,direction:k,thickness:I,highlightStyle:L,segmentation:N,bar:O,targets:w,cornerRadius:R,cornerMode:G,label:B,...P});return{...F,series:[_]}}function cO(t,e){if(e==null)return t;const{targets:i,...s}=e;return t=jt(t,s),t.targets!=null&&i!=null&&(t.targets=kf(t.targets,i)),t}function WY(t,e){if(_Y(t)){const b=cO(t,e);return VY(b)}else if(GY(t)){const b=cO(t,e);return jY(b)}const{animation:i,background:s,container:n,contextMenu:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,padding:u,subtitle:p,theme:g,title:f,tooltip:x,width:m}=t;return yn(t,{animation:i,background:s,container:n,contextMenu:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,padding:u,subtitle:p,theme:g,title:f,tooltip:x,width:m})}var Hn={stroke:Ge},Ji={fill:yp},hO={color:"white",fill:Ge},or={color:Ge},ym={color:fp,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},mm={...ym,textAlign:"left"},TM={...ym,fontSize:{$ref:"fontSize"},color:bp,fill:mp,stroke:xp,strokeWidth:1,divider:{stroke:Sp,strokeWidth:1,strokeOpacity:.5}},kM={...Hn,background:{fill:mi,fillOpacity:.2},handle:{...Ji},text:{...or},statistics:{...TM}},HY={line:{...Hn,handle:{...Ji},text:{...or}},"horizontal-line":{...Hn,handle:{...Ji},axisLabel:{...hO},text:{...or}},"vertical-line":{...Hn,handle:{...Ji},axisLabel:{...hO},text:{...or}},"disjoint-channel":{...Hn,background:{fill:mi,fillOpacity:.2},handle:{...Ji},text:{...or}},"parallel-channel":{...Hn,background:{fill:mi,fillOpacity:.2},handle:{...Ji},text:{...or}},"fibonacci-retracement":{...Hn,strokes:gp,rangeStroke:Ge,handle:{...Ji},text:{...or,position:"center"},label:{...ym,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...Hn,strokes:gp,rangeStroke:Ge,handle:{...Ji},text:{...or,position:"center"},label:{...ym,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...Hn,...mm,color:{$ref:"textColor"},handle:{...Ji},fill:mi,fillOpacity:.2},comment:{...mm,color:"white",fontWeight:700,handle:{...Ji},fill:Ge},note:{...mm,color:Ip,fill:Ge,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Ji},background:{fill:Dp,stroke:Ap,strokeWidth:1}},text:{...mm,handle:{...Ji}},arrow:{...Hn,handle:{...Ji},text:{...or}},"arrow-up":{fill:up,handle:{...Ji,stroke:Ge}},"arrow-down":{fill:pp,handle:{...Ji,stroke:Ge}},"date-range":{...kM},"price-range":{...kM},"date-price-range":{...kM},"quick-date-price-range":{up:{...Hn,fill:mi,fillOpacity:.2,handle:{...Ji},statistics:{...TM,color:"#fff",fill:mi,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Hn,stroke:Mp,fill:vp,fillOpacity:.2,handle:{...Ji,stroke:Mp},statistics:{...TM,color:"#fff",fill:vp,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},UY=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],YY=[{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 KY(t,e,i){const{dateKey:s="date",highKey:n="high",openKey:o="open",lowKey:a="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:d=!0,rangeButtons:u=!0,statusBar:p=!0,toolbar:g=!0,zoom:f=!0,theme:x,data:m,...b}=t,S=XY(c,s,n,a,o,r),M=$Y(i,o,r,d,l),C={navigator:{enabled:h,...d?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:By,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},k={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,toolbar:{enabled:g,buttons:YY,padding:0},data:m,xKey:s,volumeKey:d?l:void 0}},I=p?{statusBar:{enabled:!0,data:m,highKey:n,openKey:o,lowKey:a,closeKey:r,volumeKey:d?l:void 0}}:null,L={zoom:{enabled:f,autoScaling:{enabled:!0},enableIndependentAxes:!0}},N={ranges:{enabled:u}},O=d?[{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",...jt(typeof x=="object"?x:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:g},annotations:{...HY},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...pO(c,{hlc:{stroke:Ey,strokeWidth:2},line:{stroke:cd},"step-line":{stroke:cd,interpolation:{type:"step"}}})}},candlestick:{series:{...pO(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:[o,r,n,a],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...O,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:m,...k,...C,...I,...L,...N,...b}}function $Y(t,e,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:o}){const{up:a,down:r}=t().palette;return{fill:o[e]<o[i]?a?.fill:r?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}var dO="range-area";function XY(t,e,i,s,n,o){const a={xKey:e,openKey:n,closeKey:o,highKey:i,lowKey:s},r={xKey:e,yKey:o},l={pickOutsideVisibleMinorAxis:!0};switch(t??"candlestick"){case"ohlc":return ZY(l,a);case"line":case"step-line":return QY(l,r);case"hlc":return qY(l,r,a);case"high-low":return JY(l,a);case"candlestick":case"hollow-candlestick":return uO(l,a);default:return $.warnOnce(`unknown chart type: ${t}; expected one of: ${UY.join(", ")}`),uO(l,a)}}function ZY(t,e){return[{type:"ohlc",focusPriority:0,...t,...e}]}function QY(t,e){return[{type:"line",focusPriority:0,...t,...e}]}function qY(t,e,{xKey:i,highKey:s,closeKey:n,lowKey:o}){return[{type:dO,focusPriority:0,...t,xKey:i,yHighKey:s,yLowKey:n,fill:up,stroke:Ny},{type:dO,focusPriority:0,...t,xKey:i,yHighKey:n,yLowKey:o,fill:pp,stroke:wy},{type:"line",...t,...e}]}function JY(t,{xKey:e,highKey:i,lowKey:s}){return[{type:"range-bar",...t,xKey:e,yHighKey:i,yLowKey:s,fill:Oy,stroke:cd,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function uO(t,e){return[{type:"candlestick",focusPriority:0,...t,...e}]}function pO(t,e){return e[t]??e.default}var gO={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Py,lineDash:[0],label:{enabled:!1}}},CM={...gO,nice:!1},xm={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},LM={style:[{stroke:{$ref:"gridLineColor"}}],width:2},t5={number:{gridLine:LM},time:{gridLine:LM},category:{gridLine:LM}},e5={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:{...CM,interval:{values:[0]}},log:{...CM},time:{...CM},category:{...gO}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...xm,position:{...xm.position,anchorTo:"pointer"},range:"nearest"},axes:t5},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:xm},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:xm}}},fO=Rs(i5);function i5(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:fO(t.baseTheme,e)}:e}function yO(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 s5(t,e){switch(t?.type){case"number":{const{type:i,min:s,max:n,reverse:o}=t;return yn(t,{type:i,reverse:o,min:s,max:n})}case"time":{const{type:i,min:s,max:n,reverse:o}=t;return yn(t,{type:i,reverse:o,min:s,max:n})}case"category":{const{type:i,paddingInner:s,paddingOuter:n,reverse:o}=t;return yn(t,{type:i,reverse:o,paddingInner:s,paddingOuter:n})}}return{type:e}}function n5(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 o5=Rs((t,e,i)=>s=>{const n=s.datum[s.xKey],o=s.datum[s.yKey],a=i!=null?s.datum[i]:s.datum,r=e?.renderer?.({context:t,datum:a,xValue:n,yValue:o});return typeof r=="string"?r:{heading:void 0,title:void 0,data:[{label:r?.title,value:r?.content??o.toFixed(2)}]}});function a5(t){const{background:e,container:i,height:s,listeners:n,locale:o,minHeight:a,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,theme:d,data:u,crosshair:p,axis:g,min:f,max:x,tooltip:m,context:b,...S}=t,M=yn(t,{background:e,container:i,height:s,listeners:n,locale:o,minHeight:a,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,tooltip:Ks,context:Ks,data:Ks,crosshair:Ks,axis:Ks,min:Ks,max:Ks,theme:Ks}),{data:D,series:[C]=[],datumKey:k}=yO(u),I=S;C!=null&&Object.assign(I,C),I.tooltip={...m,renderer:o5(b,m,k)},M.theme=fO(d,e5),M.data=D,M.series=[I];const L=I.type!=="bar"||I.direction!=="horizontal",[N,O]=L?["bottom","left"]:["left","bottom"],w={...s5(g,"category"),position:N,...yn(t,{crosshair:p})},R={type:"number",gridLine:n5(g,!1,t),position:O,...yn(t,{min:f,max:x})};return M.axes=L?[R,w]:[w,R],M}var r5={"price-volume":KY,gauge:WY,sparkline:a5},l5={sparkline:yO};function mO(t,e){let i=[];const s=c0(t),n=$a(t),o=n?Ce.get(n):"unknown";for(const a of Zu)if(!(o!=="unknown"&&!a.chartTypes.includes(o))){if(a.type==="root"||a.type==="legend"){const r=t[a.optionsKey];if(r==null)continue;a.optionsInnerKey?r[a.optionsInnerKey]&&(i.push(`${a.optionsKey}.${a.optionsInnerKey}`),delete r[a.optionsInnerKey]):(i.push(a.optionsKey),delete t[a.optionsKey])}else if(a.type==="axis"){if(!("axes"in t)||!wt(t.axes)||!t.axes?.some(r=>r.type===a.identifier))continue;i.push(`axis[type=${a.identifier}]`),t.axes=t.axes.filter(r=>r.type!==a.identifier)}else if(a.type==="axis-option"){if(!("axes"in t)||!wt(t.axes)||!t.axes?.some(r=>r[a.optionsKey]))continue;i.push(`axis.${a.optionsKey}`),t.axes.forEach(r=>{r[a.optionsKey]&&delete r[a.optionsKey]})}else if(a.type==="series"){if(a.community||!wt(t.series)||!t.series?.some(r=>r.type===a.identifier))continue;i.push(`series[type=${a.identifier}]`),t.series=t.series.filter(r=>r.type!==a.identifier)}else if(a.type==="series-option"){if(!wt(t.series)||!t.series?.some(r=>r[a.optionsKey]))continue;i.push(`series.${a.optionsKey}`),t.series.forEach(r=>{r[a.optionsKey]&&delete r[a.optionsKey]})}}if(i.length&&!e){s&&(i=["AgCharts.createGauge"]);let a="ag-charts-enterprise",r="https://www.ag-grid.com/charts/javascript/installation/";t.mode==="integrated"&&(a="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",r="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),$.warnOnce([`unable to use these enterprise features as '${a}' has not been loaded:`,"",...i,"",`See: ${r}`].join(`
`))}}function c5(t){const e="mode"in t&&t.mode==="integrated";for(const i of Zo.byType("root","legend")){const s=t[i.optionsKey],n=s!=null&&s.enabled===!1,o=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!e;n&&o&&delete t[i.optionsKey]}}function xO(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var NM="white",wM={get cartesian(){return{seriesTypes:Ce.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Ce.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Ce.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Ce.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Ce.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Ce.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Ce.gaugeTypes,commonOptions:[]}}},h5={"radial-gauge":!0,"linear-gauge":!0};function bO(t){return h5[t]===!0}var d5=Object.values(wM).reduce((t,{commonOptions:e})=>t.concat(e),[]),Un=class rf{static getDefaultColors(){return{fills:Je,fillsFallback:Object.values(Je),strokes:ra,sequentialColors:fn(Je),divergingColors:[Je.ORANGE,Je.YELLOW,Je.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:oe.interpolate([oe.fromHexString(Je.BLUE),oe.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[Je.GREEN,Je.YELLOW,Je.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Je.GREEN,stroke:ra.GREEN},down:{fill:Je.RED,stroke:ra.RED},neutral:{fill:Je.GRAY,stroke:ra.GRAY},altUp:{fill:Je.BLUE,stroke:ra.BLUE},altDown:{fill:Je.ORANGE,stroke:ra.ORANGE},altNeutral:{fill:Je.GRAY,stroke:ra.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:NM,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 jt(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:tl,textAlign:el},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:tl,textAlign:el},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:tl,textAlign:el},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:ld,delay:0,pagination:!1},overlays:{darkTheme:ld},listeners:{}}}constructor(e={}){const{overrides:i,palette:s}=Se(e),n=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.mergeOverrides(n,o,i);const{fills:a,strokes:r,sequentialColors:l,...c}=this.getDefaultColors();this.palette=Ql(jt(s,{fills:Object.values(a),strokes:Object.values(r),sequentialColors:Object.values(l),...c})),this.paletteType=xO(s),this.config=Ql(this.templateTheme(n)),this.presets=Ql(o)}mergeOverrides(e,i,s){for(const{seriesTypes:n,commonOptions:o}of Object.values(wM)){const a={...s.common};for(const r of d5)o.includes(r)||delete a[r];if(a)for(const r of n){const l=r;bO(l)||(e[l]=jt(a,e[l]))}}Ce.seriesTypes.forEach(n=>{const o=n,a=s[o];bO(o)?i[o]=a:e[o]=jt(a,e[o])})}createChartConfigPerChartType(e){for(const[i,{seriesTypes:s}]of ke(wM)){const n=Wv.get(i);for(const o of s)e[o]??(e[o]=Se(n))}return e}getDefaults(){const e=(i,s)=>{const n={},o={axes:{},...jv.getThemeTemplates(),...this.getChartDefaults(),...Wv.get(i)};for(const a of s){n[a]=jt(Fn.getThemeTemplate(a),n[a]??Se(o));const{axes:r}=n[a];for(const l of lc.keys())r[l]=jt(r[l],lc.getThemeTemplate(l),rf.axisDefault[l])}return n};return jt(e("cartesian",Ce.cartesianTypes),e("polar",Ce.polarTypes),e("hierarchy",Ce.hierarchyTypes),e("topology",Ce.topologyTypes),e("flow-proportion",Ce.flowProportionTypes),e("standalone",Ce.standaloneTypes),e("gauge",Ce.gaugeTypes))}static applyTemplateTheme(e,i,s){if(wt(e))for(let n=0;n<e.length;n++){const o=e[n];typeof o=="symbol"&&s?.has(o)&&(e[n]=s.get(o))}else for(const n of Object.keys(e)){const o=e[n];typeof o=="symbol"&&s?.has(o)&&(e[n]=s.get(o))}}templateTheme(e,i=!0){const s=i?Se(e):e,n=this.getTemplateParameters();return _a(s,rf.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return rf.getDefaultColors()}getPublicParameters(){return rf.getDefaultPublicParameters()}getTemplateParameters(){const{isEnterprise:e}=nr,i=new Map;i.set(ld,!1),i.set(P0,e),i.set(R0,!e),i.set(dp,"#d9d9d9"),i.set(Jr,"#00000080"),i.set(Py,"#aaa"),i.set(tl,"block"),i.set(el,"center"),i.set(gp,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),i.set(Ry,NM),i.set(Ge,Je.BLUE),i.set(mi,Je.BLUE),i.set(fp,Je.BLUE),i.set(yp,NM),i.set(mp,"#fafafa"),i.set(xp,"#ddd"),i.set(bp,"#000"),i.set(Sp,"#181d1f"),i.set(vp,"#e35c5c"),i.set(Mp,"#e35c5c"),i.set(Dp,"#fafafa"),i.set(Ap,"#ddd"),i.set(Ip,"#000"),i.set(Tp,"top"),i.set(oa,!1);const s=this.getDefaultColors();return i.set(Ny,this.palette.up?.stroke??s.up.stroke),i.set(up,this.palette.up?.fill??s.up.fill),i.set(wy,this.palette.down?.stroke??s.down.stroke),i.set(pp,this.palette.down?.fill??s.down.fill),i.set(cd,this.palette.neutral?.stroke??s.neutral.stroke),i.set(Oy,this.palette.neutral?.fill??s.neutral.fill),i.set(B0,this.palette.altUp?.stroke??s.up.stroke),i.set(F0,this.palette.altUp?.fill??s.up.fill),i.set(z0,this.palette.altDown?.stroke??s.down.stroke),i.set(_0,this.palette.altDown?.fill??s.down.fill),i.set(G0,this.palette.altNeutral?.fill??s.altNeutral.fill),i.set(Ey,this.palette.altNeutral?.stroke??s.altNeutral.stroke),i}};Un.axisDefault={number:Un.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}}),log:Un.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}}),category:Un.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:oa},crosshair:{enabled:!1}}),"grouped-category":Un.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:dp},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}}),time:Un.getAxisDefaults({keys:[],gridLine:{enabled:oa},crosshair:{enabled:!0}}),"ordinal-time":Un.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:oa},crosshair:{enabled:!0}}),"angle-category":Un.getAxisDefaults({label:{spacing:5},gridLine:{enabled:oa},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},!1),"angle-number":Un.getAxisDefaults({label:{spacing:5},gridLine:{enabled:oa}},!1),"radius-category":Un.getAxisDefaults({positionAngle:0,line:{enabled:!1}}),"radius-number":Un.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}})};var To=Un,OM="#192232",ts={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Dc={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},xd=class extends To{getDefaultColors(){return{fills:ts,fillsFallback:Object.values(ts),strokes:Dc,sequentialColors:fn(ts),divergingColors:[ts.ORANGE,ts.YELLOW,ts.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[ts.GREEN,ts.YELLOW,ts.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:ts.GREEN,stroke:Dc.GREEN},down:{fill:ts.RED,stroke:Dc.RED},neutral:{fill:ts.GRAY,stroke:Dc.GRAY},altUp:{fill:ts.BLUE,stroke:Dc.BLUE},altDown:{fill:ts.ORANGE,stroke:Dc.ORANGE},altNeutral:{fill:ts.GRAY,stroke:Dc.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:OM,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(ld,!0),t.set(Ry,OM),t.set(dp,"#7f8389"),t.set(Ge,ts.BLUE),t.set(fp,"#fff"),t.set(mi,ts.BLUE),t.set(yp,OM),t.set(mp,"#28313e"),t.set(xp,"#4b525d"),t.set(bp,"#fff"),t.set(Sp,"#fff"),t.set(Dp,"#28313e"),t.set(Ap,"#4b525d"),t.set(Ip,"#fff"),t}constructor(t){super(t)}},$s={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Ac={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},u5=class extends xd{getDefaultColors(){return{...super.getDefaultColors(),fills:{...$s},fillsFallback:Object.values({...$s}),strokes:{...Ac},sequentialColors:fn($s),divergingColors:[$s.GREEN,$s.BLUE,$s.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:$s.GREEN,stroke:Ac.GREEN},down:{fill:$s.RED,stroke:Ac.RED},neutral:{fill:$s.BLUE,stroke:Ac.BLUE},altUp:{fill:$s.GREEN,stroke:Ac.GREEN},altDown:{fill:$s.RED,stroke:Ac.RED},altNeutral:{fill:$s.GRAY,stroke:Ac.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,$s.BLUE),t.set(mi,$s.BLUE),t.set(tl,"overlay"),t.set(el,"left"),t.set(Tp,"bottom"),t.set(oa,!0),t}},Xs={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Ic={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},p5=class extends To{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Xs},fillsFallback:Object.values({...Xs}),strokes:{...Ic},sequentialColors:fn(Xs),divergingColors:[Xs.GREEN,Xs.BLUE,Xs.RED],up:{fill:Xs.GREEN,stroke:Ic.GREEN},down:{fill:Xs.RED,stroke:Ic.RED},neutral:{fill:Xs.BLUE,stroke:Ic.BLUE},altUp:{fill:Xs.GREEN,stroke:Ic.GREEN},altDown:{fill:Xs.RED,stroke:Ic.RED},altNeutral:{fill:Xs.GRAY,stroke:Ic.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,Xs.BLUE),t.set(mi,Xs.BLUE),t.set(tl,"overlay"),t.set(el,"left"),t.set(Tp,"bottom"),t.set(oa,!0),t}},es={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Tc={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},g5=class extends xd{getDefaultColors(){return{...super.getDefaultColors(),fills:es,fillsFallback:Object.values(es),strokes:Tc,sequentialColors:fn(es),divergingColors:[es.ORANGE,es.YELLOW,es.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[es.GREEN,es.YELLOW,es.RED],up:{fill:es.GREEN,stroke:Tc.GREEN},down:{fill:es.RED,stroke:Tc.RED},neutral:{fill:es.GRAY,stroke:Tc.GRAY},altUp:{fill:es.BLUE,stroke:Tc.BLUE},altDown:{fill:es.RED,stroke:Tc.RED},altNeutral:{fill:es.GRAY,stroke:Tc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,es.BLUE),t.set(mi,es.BLUE),t}},is={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},kc={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},f5=class extends To{getDefaultColors(){return{...super.getDefaultColors(),fills:is,fillsFallback:Object.values(is),strokes:kc,sequentialColors:fn(is),divergingColors:[is.ORANGE,is.YELLOW,is.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[is.GREEN,is.YELLOW,is.RED],up:{fill:is.GREEN,stroke:kc.GREEN},down:{fill:is.RED,stroke:kc.RED},neutral:{fill:is.GRAY,stroke:kc.GRAY},altUp:{fill:is.BLUE,stroke:kc.BLUE},altDown:{fill:is.RED,stroke:kc.RED},altNeutral:{fill:is.GRAY,stroke:kc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,is.BLUE),t.set(mi,is.BLUE),t}},Ve={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Cc={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},y5=class extends xd{getDefaultColors(){return{fills:Ve,fillsFallback:Object.values(Ve),strokes:Cc,sequentialColors:fn(Ve),divergingColors:[Ve.BLUE,Ve.RED],hierarchyColors:[],secondSequentialColors:[Ve.BLUE,Ve.PURPLE,Ve.MAGENTA,Ve.PINK,Ve.RED,Ve.ORANGE,Ve.YELLOW,Ve.GREEN],secondDivergingColors:[Ve.BLUE,Ve.RED],secondHierarchyColors:[],up:{fill:Ve.GREEN,stroke:Cc.GREEN},down:{fill:Ve.RED,stroke:Cc.RED},neutral:{fill:Ve.GRAY,stroke:Cc.GRAY},altUp:{fill:Ve.BLUE,stroke:Cc.BLUE},altDown:{fill:Ve.RED,stroke:Cc.RED},altNeutral:{fill:Ve.GRAY,stroke:Cc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,Ve.BLUE),t.set(mi,Ve.BLUE),t}},je={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Lc={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},m5=class extends To{getDefaultColors(){return{...super.getDefaultColors(),fills:je,fillsFallback:Object.values(je),strokes:Lc,sequentialColors:fn(je),divergingColors:[je.BLUE,je.RED],hierarchyColors:[],secondSequentialColors:[je.BLUE,je.PURPLE,je.MAGENTA,je.PINK,je.RED,je.ORANGE,je.YELLOW,je.GREEN],secondDivergingColors:[je.BLUE,je.RED],secondHierarchyColors:[],up:{fill:je.GREEN,stroke:Lc.GREEN},down:{fill:je.RED,stroke:Lc.RED},neutral:{fill:je.GRAY,stroke:Lc.GRAY},altUp:{fill:je.BLUE,stroke:Lc.BLUE},altDown:{fill:je.RED,stroke:Lc.RED},altNeutral:{fill:je.GRAY,stroke:Lc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,je.BLUE),t.set(mi,je.BLUE),t}},Si={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"},rl={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"},x5=class extends xd{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Si,RED:Si.ORANGE},fillsFallback:Object.values({...Si,RED:Si.ORANGE}),strokes:{...rl,RED:rl.ORANGE},sequentialColors:fn({...Si,RED:Si.ORANGE}),divergingColors:[Si.ORANGE,Si.YELLOW,Si.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Si.GREEN,Si.YELLOW,Si.ORANGE],up:{fill:Si.GREEN,stroke:rl.GREEN},down:{fill:Si.ORANGE,stroke:rl.ORANGE},neutral:{fill:Si.GRAY,stroke:rl.GRAY},altUp:{fill:Si.BLUE,stroke:rl.BLUE},altDown:{fill:Si.ORANGE,stroke:rl.ORANGE},altNeutral:{fill:Si.GRAY,stroke:rl.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,Si.BLUE),t.set(mi,Si.BLUE),t}},Ei={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"},ar={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"},b5=class extends To{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ei,RED:Ei.ORANGE},fillsFallback:Object.values({...Ei,RED:Ei.ORANGE}),strokes:{...ar,RED:ar.ORANGE},sequentialColors:fn({...Ei,RED:Ei.ORANGE}),divergingColors:[Ei.ORANGE,Ei.YELLOW,Ei.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Ei.GREEN,Ei.YELLOW,Ei.ORANGE],secondHierarchyColors:[],up:{fill:Ei.GREEN,stroke:ar.GREEN},down:{fill:Ei.ORANGE,stroke:ar.ORANGE},neutral:{fill:ar.GRAY,stroke:ar.GRAY},altUp:{fill:Ei.BLUE,stroke:ar.BLUE},altDown:{fill:Ei.ORANGE,stroke:ar.ORANGE},altNeutral:{fill:Ei.GRAY,stroke:ar.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,Ei.BLUE),t.set(mi,Ei.BLUE),t}},ss={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Nc={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},S5=class extends xd{getDefaultColors(){return{fills:ss,fillsFallback:Object.values(ss),strokes:Nc,sequentialColors:fn(ss),divergingColors:[ss.ORANGE,ss.YELLOW,ss.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ss.GREEN,ss.YELLOW,ss.RED],secondHierarchyColors:[],up:{fill:ss.GREEN,stroke:Nc.GREEN},down:{fill:ss.RED,stroke:Nc.RED},neutral:{fill:ss.GRAY,stroke:Nc.GRAY},altUp:{fill:ss.BLUE,stroke:Nc.BLUE},altDown:{fill:ss.ORANGE,stroke:Nc.ORANGE},altNeutral:{fill:ss.GRAY,stroke:Nc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,ss.BLUE),t.set(mi,ss.BLUE),t}},ns={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},wc={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},v5=class extends To{getDefaultColors(){return{...super.getDefaultColors(),fills:ns,fillsFallback:Object.values(ns),strokes:wc,sequentialColors:fn(ns),divergingColors:[ns.ORANGE,ns.YELLOW,ns.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ns.GREEN,ns.YELLOW,ns.RED],secondHierarchyColors:[],up:{fill:ns.GREEN,stroke:wc.GREEN},down:{fill:ns.RED,stroke:wc.RED},neutral:{fill:ns.GRAY,stroke:wc.GRAY},altUp:{fill:ns.BLUE,stroke:wc.BLUE},altDown:{fill:ns.ORANGE,stroke:wc.ORANGE},altNeutral:{fill:ns.GRAY,stroke:wc.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ge,ns.BLUE),t.set(mi,ns.BLUE),t}},bd=Rs(()=>new To),M5=Rs(()=>new xd),D5=qt.create(!0,"perf"),ko=(t,e,i)=>{D5("[CACHE] ChartTheme",t,e.name,i)},EM={"ag-default-dark":M5,"ag-sheets-dark":Rs(()=>new x5,ko),"ag-polychroma-dark":Rs(()=>new y5,ko),"ag-vivid-dark":Rs(()=>new S5,ko),"ag-material-dark":Rs(()=>new g5,ko),"ag-financial-dark":Rs(()=>new u5,ko),null:bd,undefined:bd,"ag-default":bd,"ag-sheets":Rs(()=>new b5,ko),"ag-polychroma":Rs(()=>new m5,ko),"ag-vivid":Rs(()=>new v5,ko),"ag-material":Rs(()=>new f5,ko),"ag-financial":Rs(()=>new p5,ko)},bm=Rs(A5,ko);function A5(t){if(t instanceof To)return t;if(t==null||typeof t=="string"){const i=EM[t];return i?i():($.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),bd())}const{errors:e}=wn(t,SO,"theme");if(!e.length){const i=I5(t),s=i.baseTheme?bm(i.baseTheme):bd();return new s.constructor(i)}for(const{message:i}of e)$.warnOnce(i);return bd()}function I5(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:jt(...n),params:s,palette:i}}var SO={baseTheme:Qt(E,Ko),overrides:Ko,params:{accentColor:dt,axisColor:dt,backgroundColor:dt,borderColor:dt,foregroundColor:dt,fontFamily:E,fontSize:J,fontWeight:Qt(E,J),gridLineColor:dt,padding:J,subtleTextColor:dt,textColor:dt,chromeBackgroundColor:dt,chromeFontFamily:E,chromeFontSize:J,chromeFontWeight:Qt(E,J),chromeSubtleTextColor:dt,chromeTextColor:dt,inputBackgroundColor:dt,inputTextColor:dt,crosshairLabelBackgroundColor:dt,crosshairLabelTextColor:dt},palette:{fills:mt($o),strokes:mt(dt),up:{fill:Qt(dt,NS),stroke:dt},down:{fill:Qt(dt,NS),stroke:dt},neutral:{fill:Qt(dt,NS),stroke:dt}}},vO=t=>`'${t}'`,Sd=class yi{constructor(e,i,s,n,o,a,r=!1){this.themeParameters={},this.optionMetadata=o??{},this.processedOverrides=s??{};let l=null;e instanceof yi?(l=e,this.specialOverrides=l.specialOverrides,a===void 0&&(a=ea(l.userOptions,i,yi.JSON_DIFF_OPTS)),this.userOptions=Se(Cu(a,l.userOptions),yi.OPTIONS_CLONE_OPTS)):(this.userOptions=Se(e??i,yi.OPTIONS_CLONE_OPTS),this.specialOverrides=this.specialOverridesDefaults({...n})),r&&this.removeLeftoverSymbols(this.userOptions);let c,h,d,u,p,g;!r&&a!==void 0&&yi.isFastPathDelta(a)&&l!=null?({activeTheme:c,processedOptions:h,defaultAxes:d,fastDelta:u}=this.fastSetup(a,l),p=l.themeParameters,g=l.annotationThemes):(yi.perfDebug("ChartOptions.slowSetup()"),{activeTheme:c,processedOptions:h,defaultAxes:d,themeParameters:p,annotationThemes:g}=this.slowSetup(s,a,r)),this.activeTheme=c,this.processedOptions=h,this.defaultAxes=d,this.fastDelta=u??void 0,this.themeParameters=p,this.annotationThemes=g,qt.inDevelopmentMode(()=>Ql(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return yi.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return yi.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(e,i){const{activeTheme:s,defaultAxes:n,processedOptions:o}=i,{presetType:a}=this.optionMetadata,r=a?l5[a]:void 0;if(a!=null&&e?.data!=null&&r!=null){const{series:c,data:h}=r(e.data);e=jt({series:c,data:h},e)}this.fastSeriesSetup(e,o);const l=jt(e,o);return yi.debug("ChartOptions.fastSetup() - processed options",l),{activeTheme:s,defaultAxes:n,processedOptions:l,fastDelta:e}}fastSeriesSetup(e,i){e?.series&&(e.series?.every((s,n)=>Hk(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>Cu(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=Se(this.userOptions,yi.OPTIONS_CLONE_OPTS);i&&(n=jt(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:o}=this.optionMetadata;if(o!=null){const b=r5[o],S=n,M=n.type,D=M!=null?bm(n.theme).presets[M]:void 0;yi.debug(">>> AgCharts.createOrUpdate() - applying preset",S),n=b?.(S,D,()=>this.activeTheme)??n}this.soloSeriesIntegrity(n),nr.isEnterprise||mO(n);const a=bm(n.theme);if(o!=null&&a.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=ln.detectChartDefinition(n),!this.chartDef.placeholder){const{valid:b,errors:S}=wn(n,this.chartDef.options);S.forEach(M=>$.warn(M)),n=b}this.validatePluginOptions(n),this.validateAxesOptions(n),this.removeDisabledOptions(n);const r=this.optionsType(n),{annotations:l={},axes:c={},series:h,...d}=this.getSeriesThemeConfig(r,a),[u,p]=this.splitAnnotationsOptions(l),g=Se(p),f=this.getDefaultAxes(n,h);let x=jt(e,n,u,d,f);this.processAxesOptions(x,c),this.processSeriesOptions(x,a),x=Se(x,yi.OPTIONS_CLONE_OPTS),(r0(x)||l0(x)||LW(x))&&x.legend?.enabled==null&&(x.legend??(x.legend={}),x.legend.enabled=x.series.length>1),this.enableConfiguredOptions(x,n);const m=this.getThemeParameters(a,x);return m.__palette=Se(a.palette),m.__palette.type=Rt(n.theme)?xO(n.theme?.palette):"inbuilt",this.resolveThemeOperations(m,m),this.resolveThemeOperations(m,x),this.resolveThemeOperations(m,g),this.processMiniChartSeriesOptions(x),a.templateTheme(x,!1),c5(x),nr.isEnterprise||mO(x,!0),this.validateSeriesOptions(x),this.validateAxesOptions(x),yi.debug(()=>["ChartOptions.slowSetup() - processed options",Se(x)]),{activeTheme:a,processedOptions:x,defaultAxes:f,themeParameters:m,annotationThemes:g}}validatePluginOptions(e){for(const i of ln.listModulesByType(df.Plugin)){const s=i.name;if(s in e&&(!i.chartType||i.chartType===this.chartDef?.name)){const{valid:n,errors:o}=wn(e[s],i.options,i.name);o.forEach(a=>$.warn(a)),e[s]=n}}}validateSeriesOptions(e){const i=this.chartDef?.name,s=[],n=e.series?.length??0;let o;for(let a=0;a<n;a++){const r=`series[${a}]`,l=e.series[a],c=ln.getSeriesModule(l.type??"line");if(c==null){o??(o=TS(Array.from(ln.listModulesByType(df.Series)).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",vO)),$.warn(`Unknown type \`${l.type}\` at \`${r}.type\`; expecting ${o}, ignoring.`);continue}else if(i&&c.chartType!==i){$.warn(`Series type \`${c.name}\` at \`${r}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=wn}=c,{valid:d,errors:u}=h(l,c.options,r);u.forEach(p=>$.warn(p)),u.some(p=>p.required&&p.path===r)||s.push(d)}e.series=s}validateAxesOptions(e){if(!("axes"in e)||!e.axes)return;const i=this.chartDef?.name,s=[],n=e.axes.length??0;let o;for(let a=0;a<n;a++){const r=`axes[${a}]`,l=e.axes[a],c=ln.getAxisModule(l.type);if(c==null){o??(o=TS(Array.from(ln.listModulesByType(df.Axis)).filter(p=>p.chartType===i).map(p=>p.name),"or",vO)),$.warn(`Unknown type \`${l.type}\` at  \`${r}.type\`; expecting one of ${o}, ignoring all axes options.`),delete e.axes;break}else if(c.chartType!==i){$.warn(`Axis type \`${c.name}\` at  \`${r}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=wn}=c,{valid:d,errors:u}=h(l,c.options,r);u.forEach(p=>$.warn(p)),u.some(p=>p.required&&p.path===r)||s.push(d)}e.axes=s}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??ea(e.processedOptions,this.processedOptions,yi.JSON_DIFF_OPTS)}getSeriesThemeConfig(e,i){return i?.config[e]??{}}getDefaultAxes(e,i){const s=this.optionsType(e),n=e.series?.find(a=>(a.type??"line")===s)??{},o=Fn.cloneDefaultAxes(s);return Hf(o,{},void 0,jt(n,i)),o}optionsType(e){return e.series?.[0]?.type??"line"}splitAnnotationsOptions(e){const{axesButtons:i=null,enabled:s=null,optionsToolbar:n=null,toolbar:o=null,...a}=e;return i==null&&s==null&&n==null&&o==null?[{},a]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:n,toolbar:o}},a]}processAxesOptions(e,i){"axes"in e&&(e.axes=e.axes?.map(s=>{const{crossLines:n,...o}=jt(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=kf(s.crossLines,n));const a=o.gridLine?.style;s.gridLine?.style&&a?.length&&(s.gridLine.style=s.gridLine.style.map((u,p)=>u.stroke!=null||u.lineDash!=null?jt(u,a.at(p%a.length)):u));const{top:r,right:l,bottom:c,left:h,...d}=jt(s,o);return d}))}processSeriesOptions(e,i){const s=this.getTooltipPositionDefaults(e),n=e.series?.map(o=>{o.type??(o.type="line");const{innerLabels:a,...r}=this.getSeriesThemeConfig(o.type,i).series??{},l=ln.getSeriesModule(o.type),c=!!l?.options.tooltip,h=!!l?.options.visible,d=c&&this.getTooltipRangeDefaults(e,o.type),u=jt(this.getSeriesGroupingOptions(o),o,c&&s,d,r,h&&{visible:!0});return u.innerLabels&&(u.innerLabels=kf(u.innerLabels,a)),u});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(!Xe(i.theme)||!i.theme.params)return s;const{valid:n,errors:o}=wn(i.theme.params,SO.params);for(const{message:a}of o)$.warnOnce(a);return jt(n,s)}resolveThemeOperations(e,i){const s=Hf(i,e,new Set(["palette","data","theme"]));yi.debug("ChartOptions.resolveTheme()",s)}getSeriesGroupingOptions(e){const i=Fn.isGroupable(e.type),s=Fn.isStackable(e.type),n=Fn.isStackedByDefault(e.type);e.grouped&&!i&&$.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&$.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:o,stacked:a}=e;return a??(a=(n||e.stackGroup!=null)&&!(i&&o)),o??(o=!0),{stacked:s&&a,grouped:i&&o&&!(s&&a)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);yi.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((o,a)=>{var r;return a.groupType==="default"||(o[r=a.seriesType]??(o[r]=0),o[a.seriesType]+=a.groupType==="stack"?1:a.series.length),o},{});return i.flatMap(o=>{var a;switch(s[a=o.seriesType]??(s[a]=0),o.groupType){case"stack":{const r=s[o.seriesType]++;return o.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:o.groupId,groupIndex:r,groupCount:n[o.seriesType],stackIndex:c,stackCount:o.series.length}}))}case"group":return o.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:o.groupId,groupIndex:s[o.seriesType]++,groupCount:n[o.seriesType],stackIndex:0,stackCount:0}}))}return o.series}).map(({stacked:o,grouped:a,...r})=>r)}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 o=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:o,series:[n],groupId:"__default__"});else{const a=this.getSeriesGroupId(n);if(!i.has(a)){const l={groupType:n.stacked?"stack":"group",seriesType:o,series:[],groupId:a};i.set(a,l),s.push(l)}i.get(a).series.push(n)}return s},[])}getTooltipPositionDefaults(e){const i=e.tooltip?.position;if(!Xe(i))return;const{type:s,anchorTo:n,placement:o,xOffset:a,yOffset:r}=i,l={};return Ti(s)&&CS(IM,s)&&(l.type=s),Ti(n)&&CS(DM,n)&&(l.anchorTo=n),Ti(o)&&CS(AM,o)&&(l.placement=o),Pt(a)&&(l.xOffset=a),Pt(r)&&(l.yOffset=r),{tooltip:{position:l}}}getTooltipRangeDefaults(e,i){return{tooltip:{range:e.tooltip?.range??Fn.getTooltipDefauls(i)?.range}}}soloSeriesIntegrity(e){if(!wt(e.series))return;const i=e.series;if(i&&i.length>1&&i.some(s=>Fn.isSolo(s.type))){const s=this.optionsType(e);if(Fn.isSolo(s))$.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:o}=wS(i,r=>Fn.isSolo(r.type)?"solo":"nonSolo"),a=YT(n.map(r=>r.type)).join(", ");$.warn(`Unable to mix these series types with the lead series type: ${a}`),e.series=o}}}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){_a(i,yi.enableConfiguredJsonOptions,new Set(["data","theme"]),e),_a(e,yi.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){_a(e,yi.removeDisabledOptionJson,new Set(["data","theme"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!Rt(e)))for(const i of Object.keys(e)){const s=e[i];sG(s)&&delete e[i]}}removeLeftoverSymbols(e){_a(e,yi.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=re():q_(e.window),e.document==null?e.document=Ea():Q_(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}};Sd.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Sd.JSON_DIFF_OPTS=new Set(["data"]),Sd.perfDebug=qt.create(!0,"perf"),Sd.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Sd.debug=qt.create(!0,"opts");var RM=Sd,T5=1e3,PM=class Ul{constructor(e,i,s,n,o,a=T5){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=o,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,o){return this.pools.has(e)||this.pools.set(e,new Ul(e,i,s,n,o)),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),Ul.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):Ul.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 Ul.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.");Ul.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),Ul.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);Ul.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()}};PM.pools=new Map,PM.debug=qt.create(!0,"pool");var k5=PM;ln.registerMany(NY);var rr=qt.create(!0,"opts"),Yn=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=nr.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return nr.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return MO.getInstance(t)}static create(t,e){return rr.group("AgCharts.create()",()=>{t=qt.inDevelopmentMode(()=>Ql(Se(t)))??t,this.licenseCheck(t);const i=MO.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&nr.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(t){return rr.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return rr.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge"}))}static __createSparkline(t){return rr.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal"})})}};Yn.licenseChecked=!1;var la=class Yl{static getInstance(e){const i=Sy.getInstance(e);return i?TN.chartInstances.get(i):void 0}static initialiseModules(){Yl.initialised||(pm(),tY(),Yl.initialised=!0)}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:s,licenseManager:n,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,stripSymbols:c=!1}=e,h=nr.styles!=null?[["ag-charts-enterprise",nr.styles]]:[],{presetType:d}=r;Yl.initialiseModules(),rr(()=>[">>> AgCharts.createOrUpdate() user options",Se(s)]);let u=s;Yn.optionsMutationFn&&u&&(u=Yn.optionsMutationFn(Se(u),d),rr(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Se(u)]));const p=this.getPool(r);let g=!1,f,x=i?.chart;x==null&&p?.hasFree()&&(f=p.obtainFree(),x=f.item);const{document:m,window:b,styleContainer:S,...M}=u??{},D=x?.getChartOptions(),C=new RM(D,M,o,{...a,document:m,window:b,styleContainer:S},r,l,c);return(x==null||ln.detectChartDefinition(C.processedOptions)!==ln.detectChartDefinition(x.chartOptions.processedOptions))&&(f?.release(),f=this.getPool(C.optionMetadata)?.obtain(C),f?x=f.item:(g=!0,x=Yl.createChartInstance(C,x))),h.forEach(([k,I])=>{x.ctx.domManager.addStyles(k,I)}),i==null?(i=new TN(x,Yl.callbackApi,n),i.releaseChart=f?.release):(f||g)&&(i.releaseChart?.(),i.chart=x,i.releaseChart=f?.release),rr.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[x.id]=x),x.queuedUserOptions.push(C.userOptions),x.queuedChartOptions.push(C),x.requestFactoryUpdate(k=>{rr.group(">>>> Chart.applyOptions()",()=>{k.applyOptions(C);const I=k.queuedUserOptions.indexOf(C.userOptions)+1;k.queuedUserOptions.splice(0,I),k.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=Se(i,RM.OPTIONS_CLONE_OPTS);const s=_a(i,Yl.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);rr(()=>[">>> AgCharts.updateUserDelta() user delta",Se(i)]),Yl.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0});return ln.detectChartDefinition(e.processedOptions).create(e,s)}static getPool(e){if(e.pool===!0)return k5.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};la.caretaker=new oC(nc),la.initialised=!1,la.callbackApi={caretaker:la.caretaker,create(t,e,i,s){return la.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s})},update(t,e){return la.createOrUpdate({userOptions:t,proxy:e})},updateUserDelta(t,e){return la.updateUserDelta(t,e)}},la.detachAndClear=t=>t.detachAndClear(),la.destroy=t=>t.destroy();var MO=la,Sm={};ho(Sm,{Arc:()=>ca,BBox:()=>pt,Caption:()=>Ae,CategoryScale:()=>np,Group:()=>It,Line:()=>pn,LinearScale:()=>Do,Marker:()=>Oi,Path:()=>Es,RadialColumnShape:()=>Kn,Rect:()=>ms,Scene:()=>Jf,Sector:()=>ji,Shape:()=>Bn,TranslatableGroup:()=>Ns,getRadialColumnWidth:()=>DO,toRadians:()=>Me});var ca=class extends Es{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 de(me(this.startAngle),me(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 pt(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)}};ca.className="Arc",v([Lt()],ca.prototype,"centerX",2),v([Lt()],ca.prototype,"centerY",2),v([Lt()],ca.prototype,"radius",2),v([Lt()],ca.prototype,"startAngle",2),v([Lt()],ca.prototype,"endAngle",2),v([Lt()],ca.prototype,"counterClockwise",2),v([Lt()],ca.prototype,"type",2);function BM(t,e,i){const s=Math.sqrt(t**2+e**2),o=Math.atan2(e,t)+i;return{x:Math.cos(o)*s,y:Math.sin(o)*s}}var Kn=class extends Es{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,o=i/2,a=-e,r=-t;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:p,y:g}=BM(u%2===0?n:o,u<2?a:r,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),d=Math.max(g,d)}return new pt(l,c,h-l,d-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=Cf(t,e);return me(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,o=t/2,a=-i,r=-e,l=this.getRotation(),c=[[n,r],[n,a],[o,a],[o,r]].map(([h,d])=>BM(h,d,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:o,isRadiusAxisReversed:a}=this,r=de(s,n),l=Math.asin(t/2/s),c=this.getRotation(),h=(I,L)=>BM(I,L,c),d=(I,L)=>Math.sqrt(I**2+L**2),u=(I,L)=>L>I?0:Math.sqrt(I**2-L**2),p=(I,L,N)=>N?I<L:I>L,g=r&&!isNaN(l)&&l<Math.PI/6;let f=-t/2,x=t/2;const m=-i,b=-s*(g?Math.cos(l):1),S=p(o,d(s,t/2),!a);if(S){const I=u(o,s);f=-I,x=I}e.clear(!0);const M=h(f,b);e.moveTo(M.x,M.y);const D=de(s,i),C=p(o,d(i,t/2),!a);if(D&&g)e.arc(0,0,s,me(-l-Math.PI/2)+c,me(l-Math.PI/2)+c,!1);else if(C){const I=-u(o,t/2),L=u(o,i);if(!S){const N=h(f,I);e.lineTo(N.x,N.y)}if(e.arc(0,0,o,Math.atan2(I,f)+c,Math.atan2(m,-L)+c,!1),!de(L,0)){const N=h(L,m);e.lineTo(N.x,N.y)}e.arc(0,0,o,Math.atan2(m,L)+c,Math.atan2(I,x)+c,!1)}else{const I=h(f,m),L=h(x,m);e.lineTo(I.x,I.y),e.lineTo(L.x,L.y)}const k=h(x,b);if(e.lineTo(k.x,k.y),g)e.arc(0,0,s,me(l-Math.PI/2)+c,me(-l-Math.PI/2)+c,!0);else{const I=h(f,b);e.lineTo(I.x,I.y)}e.closePath()}};Kn.className="RadialColumnShape",v([Lt()],Kn.prototype,"isBeveled",2),v([Lt()],Kn.prototype,"columnWidth",2),v([Lt()],Kn.prototype,"startAngle",2),v([Lt()],Kn.prototype,"endAngle",2),v([Lt()],Kn.prototype,"outerRadius",2),v([Lt()],Kn.prototype,"innerRadius",2),v([Lt()],Kn.prototype,"axisInnerRadius",2),v([Lt()],Kn.prototype,"axisOuterRadius",2),v([Lt()],Kn.prototype,"isRadiusAxisReversed",2);function DO(t,e,i,s,n){const o=Cf(t,e),a=o*(1-s)/2;if(t+=a,e-=a,o<.001)return 2*i*n;if(o>=2*Math.PI){const p=t+o/2;t=p-Math.PI,e=p+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),d=Math.floor(Math.sqrt((r-c)**2+(l-h)**2)),u=2*i*n;return Math.max(1,Math.min(u,d))}var vm={};ho(vm,{ChartTheme:()=>To,DEFAULT_ANNOTATION_HANDLE_FILL:()=>yp,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>bp,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Sp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>vp,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Mp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>mp,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>xp,DEFAULT_CAPTION_ALIGNMENT:()=>el,DEFAULT_CAPTION_LAYOUT_STYLE:()=>tl,DEFAULT_FIBONACCI_STROKES:()=>gp,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>mi,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ge,DEFAULT_GRIDLINE_ENABLED:()=>oa,DEFAULT_POLAR_SERIES_STROKE:()=>Ry,DEFAULT_SEPARATION_LINES_COLOUR:()=>dp,DEFAULT_SHADOW_COLOUR:()=>Jr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Py,DEFAULT_TEXTBOX_COLOR:()=>Ip,DEFAULT_TEXTBOX_FILL:()=>Dp,DEFAULT_TEXTBOX_STROKE:()=>Ap,DEFAULT_TEXT_ANNOTATION_COLOR:()=>fp,DEFAULT_TOOLBAR_POSITION:()=>Tp,IS_COMMUNITY:()=>R0,IS_DARK_THEME:()=>ld,IS_ENTERPRISE:()=>P0,PALETTE_ALT_DOWN_FILL:()=>_0,PALETTE_ALT_DOWN_STROKE:()=>z0,PALETTE_ALT_NEUTRAL_FILL:()=>G0,PALETTE_ALT_NEUTRAL_STROKE:()=>Ey,PALETTE_ALT_UP_FILL:()=>F0,PALETTE_ALT_UP_STROKE:()=>B0,PALETTE_DOWN_FILL:()=>pp,PALETTE_DOWN_STROKE:()=>wy,PALETTE_NEUTRAL_FILL:()=>Oy,PALETTE_NEUTRAL_STROKE:()=>cd,PALETTE_UP_FILL:()=>up,PALETTE_UP_STROKE:()=>Ny,getChartTheme:()=>bm,resolveOperation:()=>L5,themeNames:()=>C5,themeSymbols:()=>E0,themes:()=>EM});var C5=Object.keys(EM);function L5(t){const e=To.getDefaultPublicParameters();e.__palette=To.getDefaultColors();const i={operation:t};return Hf(i,e),i.operation}var Mm={};ho(Mm,{Color:()=>oe,interpolateColor:()=>CC});var T={};ho(T,{AND:()=>_r,ARRAY:()=>Jl,ARRAY_OF:()=>ki,AbstractBarSeries:()=>Fw,AbstractBarSeriesProperties:()=>hM,ActionOnSet:()=>Hs,AnchoredPopover:()=>CO,Animation:()=>OC,AnimationManager:()=>zC,Arc:()=>ca,Axis:()=>s0,AxisGroupZIndexMap:()=>QL,AxisInterval:()=>hc,AxisLabel:()=>wi,AxisTick:()=>Jh,AxisTickGenerator:()=>qL,AxisTicks:()=>Q5,BBox:()=>pt,BBoxValues:()=>vf,BOOLEAN:()=>xt,BOOLEAN_ARRAY:()=>t4,Background:()=>od,BackgroundModule:()=>ZN,BandScale:()=>Hu,BarSeries:()=>_p,BarSeriesModule:()=>jw,BaseModuleInstance:()=>Sf,BaseProperties:()=>kt,BaseToolbar:()=>KM,ButtonWidget:()=>Fu,COLOR_GRADIENT:()=>qo,COLOR_PATTERN:()=>Jo,COLOR_STRING:()=>zt,COLOR_STRING_ARRAY:()=>Gr,CachedTextMeasurer:()=>tC,CachedTextMeasurerPool:()=>Va,Caption:()=>Ae,CartesianAxis:()=>qu,CartesianSeries:()=>nl,CartesianSeriesNodeEvent:()=>W0,CartesianSeriesProperties:()=>ir,CategoryAxis:()=>fc,CategoryScale:()=>np,ChangeDetectableProperties:()=>T0,Chart:()=>Sy,ChartAxisDirection:()=>fv,ChartEventManager:()=>FC,ChartOptions:()=>RM,ChartUpdateType:()=>Xu,CollapseMode:()=>yw,Color:()=>oe,ColorScale:()=>Eh,ConicGradient:()=>bk,ContextMenuRegistry:()=>_C,ContinuousScale:()=>he,DATE:()=>US,DATE_ARRAY:()=>e4,DATE_OR_DATETIME_MS:()=>YS,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>bc,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Sc,DEFAULT_TOOLTIP_CLASS:()=>_i,DEFAULT_TOOLTIP_DARK_CLASS:()=>gN,DIRECTION:()=>kk,DIRECTION_SWAP_AXES:()=>ow,DOMManager:()=>yC,DataController:()=>LL,DataModel:()=>kL,DataModelSeries:()=>j0,DataService:()=>ty,Debug:()=>qt,Deprecated:()=>lN,DeprecatedAndRenamedTo:()=>jW,DragInterpreter:()=>KC,DraggablePopover:()=>LO,DropShadow:()=>Ao,ExtendedPath2D:()=>Bh,FILL_PATTERN_DEFAULTS:()=>il,FONT_SIZE_RATIO:()=>O0,FONT_STYLE:()=>za,FONT_WEIGHT:()=>Fa,FUNCTION:()=>Ls,FillGradientDefaults:()=>Vn,FillPatternDefaults:()=>_e,FloatingToolbar:()=>oK,GREATER_THAN:()=>Pf,Gradient:()=>Nf,Group:()=>It,GroupedCategoryAxis:()=>mc,HdpiCanvas:()=>Av,HierarchyNode:()=>K5,HierarchySeries:()=>$5,HierarchySeriesProperties:()=>ha,HighlightManager:()=>GC,HighlightProperties:()=>k0,HighlightStyle:()=>cp,INTERACTION_RANGE:()=>zf,INTERPOLATION_STEP_POSITION:()=>lw,INTERPOLATION_TYPE:()=>rw,Image:()=>Md,InteractionManager:()=>PC,InteractionState:()=>RC,InterpolationProperties:()=>hd,Invalidating:()=>Oh,LABEL_PLACEMENT:()=>XS,LARGEST_KEY_INTERVAL:()=>GN,LESS_THAN:()=>Rf,LINE_CAP:()=>i4,LINE_DASH:()=>ta,LINE_JOIN:()=>s4,LINE_STYLE:()=>n4,Label:()=>Ni,LayoutElement:()=>yv,LayoutManager:()=>iC,LegendMarkerLabel:()=>jn,Line:()=>pn,LineSeries:()=>Vp,LineSeriesModule:()=>$w,LinearGradient:()=>Sk,LinearScale:()=>Do,Listeners:()=>ja,LogScale:()=>I0,LonLatBBox:()=>X5,MARKER_SHAPE:()=>C0,MATCHING_CROSSLINE_TYPE:()=>qv,MAX_SPACING:()=>Lk,MIN_SPACING:()=>Ck,Marker:()=>Oi,Menu:()=>iK,MercatorScale:()=>Z5,ModuleRegistry:()=>ln,Motion:()=>kv,NAN:()=>wf,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>xo,NUMBER:()=>Et,NUMBER_ARRAY:()=>Ak,NUMBER_OR_NAN:()=>Of,NativeWidget:()=>jh,NewAreaSeriesModule:()=>zw,NewBarSeriesModule:()=>Ww,NewBubbleSeriesModule:()=>Uw,NewHistogramSeriesModule:()=>Kw,NewLineSeriesModule:()=>Xw,NewScatterSeriesModule:()=>Qw,NiceMode:()=>KL,Node:()=>Pa,NumberAxis:()=>qa,OBJECT:()=>at,OBJECT_ARRAY:()=>KS,OR:()=>Zi,OVERFLOW_STRATEGY:()=>a4,ObserveChanges:()=>Hr,OrdinalTimeScale:()=>Ua,PHASE_METADATA:()=>Gu,PHASE_ORDER:()=>Hh,PLACEMENT:()=>r4,PLAIN_OBJECT:()=>vk,POSITION:()=>$S,POSITION_TOP_COORDINATES:()=>uy,POSITIVE_NUMBER:()=>ot,PREV_NEXT_KEYS:()=>Gh,Padding:()=>Wr,ParallelStateMachine:()=>oW,Path:()=>Es,PointerEvents:()=>dk,PolarAxis:()=>md,PolarSeries:()=>lm,PolarZIndexMap:()=>nO,Popover:()=>YM,PropertiesArray:()=>wu,ProxyInteractionService:()=>MC,ProxyOnWrite:()=>J4,ProxyProperty:()=>ue,ProxyPropertyOnWrite:()=>zi,QUICK_TRANSITION:()=>ey,RATIO:()=>ae,REAL_NUMBER:()=>Mk,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Fy,RadialColumnShape:()=>Kn,Range:()=>bo,Rect:()=>ms,RepeatType:()=>wC,Rotatable:()=>zh,RotatableGroup:()=>D4,RotatableText:()=>eC,SAFE_FILLS_OPERATION:()=>V0,SAFE_FILL_OPERATION:()=>JH,SAFE_RANGE2_OPERATION:()=>tU,SAFE_STROKE_FILL_OPERATION:()=>By,SKIP_JS_BUILTINS:()=>_S,SMALLEST_KEY_INTERVAL:()=>_N,SORT_DOMAIN_GROUPS:()=>VN,STRING:()=>et,STRING_ARRAY:()=>Ik,Scalable:()=>tv,ScalableGroup:()=>M4,Scene:()=>Jf,SceneChangeDetection:()=>gt,ScenePathChangeDetection:()=>Lt,Sector:()=>ji,SectorBox:()=>qw,Selection:()=>ai,Series:()=>xy,SeriesContentZIndexMap:()=>aN,SeriesGroupingChangedEvent:()=>d0,SeriesItemHighlightStyle:()=>tr,SeriesMarker:()=>Vi,SeriesNodeEvent:()=>Ju,SeriesNodePickMode:()=>rN,SeriesProperties:()=>gn,SeriesTooltip:()=>xs,SeriesZIndexMap:()=>oN,Shape:()=>Bn,SimpleTextMeasurer:()=>pv,SliderWidget:()=>Mv,StateMachine:()=>Qu,StateMachineProperty:()=>nW,StopProperties:()=>ZS,SvgPath:()=>HM,TEXT_ALIGN:()=>Tk,TEXT_WRAP:()=>Bf,TICK_INTERVAL:()=>YL,TempValidate:()=>A,Text:()=>Li,TextUtils:()=>De,TextWrapper:()=>gv,ThemeConstants:()=>JN,ThemeSymbols:()=>E0,TimeScale:()=>pL,Toolbar:()=>sK,ToolbarButtonProperties:()=>Wp,ToolbarButtonWidget:()=>NO,ToolbarWidget:()=>Qf,Tooltip:()=>Gn,TooltipManager:()=>sy,TooltipPosition:()=>Xa,Transformable:()=>Be,TransformableText:()=>_h,Translatable:()=>ec,TranslatableGroup:()=>Ns,TranslatableLine:()=>yy,UNION:()=>le,UpdateService:()=>ML,VERTICAL_ALIGN:()=>o4,Validate:()=>qG,Vec2:()=>vd,Vec4:()=>$u,WIDGET_HTML_EVENTS:()=>lv,Widget:()=>ia,WidgetEventUtil:()=>Ga,ZIndexMap:()=>kC,ZoomManager:()=>SL,accumulateGroup:()=>WN,accumulateStack:()=>HN,accumulatedValue:()=>wN,accumulativeValueProperty:()=>ap,addHitTestersToQuadtree:()=>lM,adjustLabelPlacement:()=>Vw,angleBetween:()=>Cf,animationValidation:()=>id,applyShapeFillBBox:()=>my,applyShapeStyle:()=>pc,areScalingEqual:()=>dd,area:()=>b0,autoSizedLabelOptionsDefs:()=>IU,buildFormatter:()=>Vu,buildResetPathFn:()=>J0,calculateDefaultTimeTickFormat:()=>oL,calculateDerivativeExtrema:()=>QS,calculateDerivativeExtremaXY:()=>Rk,calculateLabelChartPadding:()=>zL,calculateLabelTranslation:()=>Jv,calculatePlacement:()=>cN,cartesianAxisCrosshairOptions:()=>gd,cartesianAxisLabelOptionsDefs:()=>ud,cartesianAxisOptionsDefs:()=>pd,cartesianChartOptionsDefs:()=>aO,cartesianCrossLineOptionsDefs:()=>Rw,checkCrisp:()=>_w,clampArray:()=>Ov,clippedRoundRect:()=>ky,collapsedStartingBarPosition:()=>Bp,commonAxisLabelOptionsDefs:()=>eM,commonAxisOptionsDefs:()=>Ky,commonChartOptionsDefs:()=>Ps,commonCrossLineLabelOptionsDefs:()=>tM,commonCrossLineOptionsDefs:()=>Ew,commonSeriesOptionsDefs:()=>Io,compareDates:()=>XC,computeBarFocusBounds:()=>pM,computeMarkerFocusBounds:()=>Ep,continuousAxisOptions:()=>$y,countExpandingSearch:()=>WC,createButton:()=>q5,createCheckbox:()=>J5,createDatumId:()=>Gi,createDeprecationWarning:()=>u0,createElementId:()=>k4,createIcon:()=>TO,createId:()=>hn,createSelect:()=>tK,createTextArea:()=>eK,dateToNumber:()=>ys,datesSortOrder:()=>Rv,datumKeys:()=>cy,datumStylerProperties:()=>Yr,deconstructSelectionsOrNodes:()=>iy,deepClone:()=>Se,deepFreeze:()=>Ql,defaultTimeTickFormat:()=>Bv,diff:()=>sd,drawCorner:()=>lp,drawMarkerUnitPolygon:()=>ep,easing:()=>kv,enterpriseModule:()=>nr,errorBarOptionsDefs:()=>qy,evaluateBezier:()=>_f,extent:()=>Za,extractDecoratedProperties:()=>pk,findMinMax:()=>oi,findQuadtreeMatch:()=>cM,findRangeExtent:()=>Uh,fixNumericExtent:()=>Us,flowProportionChartOptionsDefs:()=>rY,focusCursorAtEnd:()=>I4,formatNumber:()=>SC,formatPercent:()=>xC,formatValue:()=>Wa,fromToMotion:()=>Fe,gaugeChartOptionsDefs:()=>lY,generateUUID:()=>BS,getAngleRatioRadians:()=>fk,getColorStops:()=>wk,getCrossLineValue:()=>PL,getDateTicksForInterval:()=>Fv,getDatumRefPoint:()=>Lv,getElementBBox:()=>jk,getIconClassNames:()=>Wf,getLastFocus:()=>bv,getMissCount:()=>Gv,getPath:()=>wh,getPathComponents:()=>TL,getRadialColumnWidth:()=>DO,getSequentialColors:()=>fn,getShapeFill:()=>uc,getShapeStyle:()=>na,groupAccumulativeValueProperty:()=>Xr,groupAverage:()=>NN,groupCount:()=>x0,groupStackValueProperty:()=>FN,groupSum:()=>LN,hasNoModifiers:()=>Zf,hierarchyChartOptionsDefs:()=>aY,initMenuKeyNav:()=>hC,initRovingTabIndex:()=>cC,interpolatePoints:()=>Gy,interpolationValidator:()=>rM,isAgFlowProportionChartOptions:()=>sN,isAgGaugeChartOptions:()=>c0,isAgHierarchyChartOptions:()=>eN,isAgStandaloneChartOptions:()=>l0,isAgTopologyChartOptions:()=>iN,isBetweenAngles:()=>Fr,isButtonClickEvent:()=>xv,isContinuous:()=>dy,isDecoratedObject:()=>ku,isDenseInterval:()=>Zh,isGradientFill:()=>uo,isGradientOrPatternFill:()=>v4,isInputPending:()=>Wk,isPatternFill:()=>tc,isProperties:()=>Pn,isScaleValid:()=>Lp,jsonApply:()=>Bu,jsonDiff:()=>ea,jsonPropertyCompare:()=>Hk,jsonResolveOperations:()=>Hf,jsonWalk:()=>_a,keyProperty:()=>Mo,labelDirectionHandling:()=>UL,legendSymbolSvg:()=>pN,lineDistanceSquared:()=>Eu,listDecoratedProperties:()=>Br,makeAccessibleClickListener:()=>CV,mapValues:()=>gk,markerFadeInAnimation:()=>Np,markerOptionsDefs:()=>Rp,markerScaleInAnimation:()=>Z0,markerSwipeScaleInAnimation:()=>Q0,merge:()=>Cu,mergeArrayDefaults:()=>kf,mergeDefaults:()=>jt,midpointStartingBarPosition:()=>CU,moduleRegistry:()=>Zo,motion:()=>rK,nearestSquared:()=>Af,nearestSquaredInContainer:()=>RG,normaliseGroupTo:()=>Dy,normalisePropertyTo:()=>yc,normalisedExtentWithMetadata:()=>m0,normalizeAngle180:()=>Nu,normalizeAngle360:()=>me,normalizeAngle360Inclusive:()=>$G,numberFormatValidator:()=>Yy,objectsEqual:()=>Qo,objectsEqualWith:()=>FS,pairUpSpans:()=>Cp,partialAssign:()=>VS,pathFadeInAnimation:()=>Wy,pathMotion:()=>zy,pathSwipeInAnimation:()=>q0,pickByMatchingAngle:()=>SM,plotAreaPathFill:()=>Nw,plotInterpolatedAreaSeriesFillSpans:()=>jy,plotInterpolatedLinePathStroke:()=>Vy,plotLinePathStroke:()=>K0,polarChartOptionsDefs:()=>rO,predicateWithMessage:()=>ce,prepareAreaFillAnimationFns:()=>ww,prepareAreaPathAnimation:()=>Ow,prepareAxisAnimationContext:()=>fy,prepareAxisAnimationFunctions:()=>$L,prepareBarAnimationFunctions:()=>zp,prepareLinePathAnimation:()=>Lw,prepareLinePathPropertyAnimation:()=>X0,prepareLinePathStrokeAnimationFns:()=>$0,preparePieSeriesAnimationFunctions:()=>vc,range:()=>Ku,rangedValueProperty:()=>S0,resetAxisGroupFn:()=>XL,resetAxisLabelSelectionFn:()=>i0,resetAxisLineSelectionFn:()=>ZL,resetAxisSelectionFn:()=>e0,resetBarSelectionsFn:()=>Fp,resetIds:()=>zG,resetLabelFn:()=>er,resetMarkerFn:()=>wp,resetMarkerPositionFn:()=>Op,resetMotion:()=>Fi,resetPieSelectionsFn:()=>bM,rowCountProperty:()=>BN,scale:()=>bs,sectorBox:()=>Jw,seriesLabelFadeInAnimation:()=>ee,seriesLabelFadeOutAnimation:()=>sl,seriesLabelOptionsDefs:()=>ol,setAttribute:()=>fe,setAttributes:()=>sc,setElementBBox:()=>jf,setElementStyle:()=>yo,setPath:()=>GS,shadowOptionsDefs:()=>Pp,shallowClone:()=>nv,solveBezier:()=>Gf,sortAndUniqueDates:()=>Ev,splitBezier:()=>Vf,standaloneChartOptionsDefs:()=>oY,staticFromToMotion:()=>Ya,stopPageScrolling:()=>dC,sum:()=>yH,sumValues:()=>My,toDegrees:()=>XG,toRadians:()=>Me,toolbarButtonOptionsDefs:()=>aM,tooltipContentAriaLabel:()=>yN,tooltipHtml:()=>bN,tooltipOptionsDefs:()=>sr,topologyChartOptionsDefs:()=>nY,trailingAccumulatedValue:()=>ON,trailingAccumulatedValueProperty:()=>SH,updateClipPath:()=>Hy,updateLabelNode:()=>Gw,validateCrossLineValue:()=>BL,valueProperty:()=>Wt,visibleRangeIndices:()=>jC,without:()=>zr});var vd={add:N5,angle:B5,apply:U5,equal:W5,distance:E5,distanceSquared:R5,from:H5,gradient:F5,intercept:_5,intersectAtX:V5,intersectAtY:G5,length:FM,lengthSquared:O5,multiply:w5,normalized:P5,origin:AO,required:Y5,rotate:z5,round:j5,sub:zM};function N5(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 zM(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 w5(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 FM(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function O5(t){return t.x*t.x+t.y*t.y}function E5(t,e){const i=zM(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)}function R5(t,e){const i=zM(t,e);return i.x*i.x+i.y*i.y}function P5(t){const e=FM(t);return{x:t.x/e,y:t.y/e}}function B5(t,e){return e==null?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function z5(t,e,i=AO()){const s=FM(t);return{x:i.x+s*Math.cos(e),y:i.y+s*Math.sin(e)}}function F5(t,e,i){const s=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/s}function _5(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function G5(t,e,i=0,s){return{x:t===1/0?1/0:(i-e)/t,y:s==null?i:s-i}}function V5(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 j5(t,e=2){return{x:ES(t.x,e),y:ES(t.y,e)}}function W5(t,e){return t.x===e.x&&t.y===e.y}function H5(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 U5(t,e){return t.x=e.x,t.y=e.y,t}function Y5(t){return{x:t?.x??0,y:t?.y??0}}function AO(){return{x:0,y:0}}var IO=class AS{constructor(e,i,s,n,o,a,r,l,c){this.series=e,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=o,this.sumSize=a,this.depth=r,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=AS.Walk.PreOrder){i===AS.Walk.PreOrder&&e(this),this.children.forEach(s=>{s.walk(e,i)}),i===AS.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};IO.Walk={PreOrder:0,PostOrder:1};var K5=IO,$5=class extends xy{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Eh,this.animationState=new Qu("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 o=0,a=1/0,r=-1/0;const l=(u,p,g)=>{const f=g.depth!=null?g.depth+1:0,x=e!=null?u[e]:void 0,m=x==null||x.length===0;let b=i!=null?u[i]:void 0;Number.isFinite(b)?b=Math.max(b,0):b=m?1:0;const S=b;o=Math.max(o,f);const M=s!=null?u[s]:void 0;return typeof M=="number"&&(a=Math.min(a,M),r=Math.max(r,M)),c(new t(this,p,u,b,M,S,f,g,[]),x)},c=(u,p)=>{const{datumIndex:g}=u;return p?.forEach((f,x)=>{const m=l(f,g.concat(x),u);u.children.push(m),u.sumSize+=m.sumSize}),u},h=c(new t(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),d=[a,r];this.colorScale.domain=a<r?[a,r]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=o,this.colorDomain=d}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:o},visible:a}=this;return t==="gradient"&&e!=null&&s!=null?[{legendType:"gradient",enabled:a&&o.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(Xo(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=ft(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=t;let n=this.removeMeIndexPathForIndex(e);const o=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&o.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=o.parent.children.length-1;n=n.slice(),n[n.length-1]=ft(0,n[n.length-1]+i,l)}const a=n.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(e+1));if(r!=null)return{datum:a,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:a.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){$.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){}},ha=class extends gn{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Je),this.fillGradientDefaults=new Vn,this.fillPatternDefaults=new _e,this.strokes=Object.values(ra)}};v([A(et)],ha.prototype,"childrenKey",2),v([A(et,{optional:!0})],ha.prototype,"sizeKey",2),v([A(et,{optional:!0})],ha.prototype,"colorKey",2),v([A(et,{optional:!0})],ha.prototype,"colorName",2),v([A(ki(Zi(qo,Jo,zt)))],ha.prototype,"fills",2),v([A(at)],ha.prototype,"fillGradientDefaults",2),v([A(at)],ha.prototype,"fillPatternDefaults",2),v([A(Gr)],ha.prototype,"strokes",2),v([A(Gr,{optional:!0})],ha.prototype,"colorRange",2);var X5=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)}},Dm=Math.PI/180,_M=t=>t*Dm,GM=t=>-Math.log(Math.tan(Math.PI*.25+t*Dm*.5)),VM=t=>t/Dm,jM=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(Dm*.5),Z5=class ET extends Lf{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.bounds=ET.bounds(e)}static bounds(e){const[[i,s],[n,o]]=e,a=_M(i),r=GM(s),l=_M(n),c=GM(o);return new pt(Math.min(a,l),Math.min(r,c),Math.abs(l-a),Math.abs(c-r))}static fixedScale(){return new ET([[VM(0),jM(0)],[VM(1),jM(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,o=1/0;for(const a of e)for(const[r,l]of a)i=Math.min(r,i),s=Math.max(r,s),n=Math.min(l,n),o=Math.max(l,o);return{domain:[[i,n],[s,o]],animatable:!0}}convert([e,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[(_M(e)-this.bounds.x)*r+s,(GM(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[VM((e-s)/r+this.bounds.x),jM((i-n)/l+this.bounds.y)]}},WM=class RT{constructor(){this.id=hn(this),this.axisGroup=new Ns({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=ai.select(this.axisGroup,Li),this.interval=new hc,this.label=new wi,this.scale=new Do,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(o=>this.createLabelDatum(o)),void 0,o=>o.tickId),this.labelSelection.each((o,a)=>{o.setProperties(a),a.visible&&e.push(o.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:n}),e.length>0?pt.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]=oi(this.scale.range);return e>=s-i&&e<=n+i}createLabelDatum(e){const{x:i,y:s,textBaseline:n,textAlign:o}=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:o,textBaseline:n,x:i,y:s}}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:o}=uL(Uh(this.scale.range),1,e,i,RT.DefaultTickCount,RT.DefaultMinSpacing),a=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:o,minTickCount:n,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const r=Va.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;a.ticks=a.ticks.filter(u=>Math.sign(u.translate-d)!==h?!1:(d=u.translate+r.textWidth(u.tickLabel,!0)*h,!0))}return a}getTicksData(e){const i=[],s=e.nice?this.scale.niceDomain(e):this.scale.domain,n=this.scale.ticks(e,s),o=n.reduce((c,h)=>Math.max(c,Au(h)),0),a=[],r=n0(),l=this.label.format?this.scale.tickFormatter({domain:s,ticks:n,fractionDigits:o,specifier:this.label.format}):c=>Wa(c,o);for(let c=0;c<n.length;c++){const h=n[c],d=this.scale.convert(h);if(!this.inRange(d))continue;const u=this.label.formatter?.({value:h,index:c,domain:s,fractionDigits:o,boundSeries:a})??l(h),p=r(u);i.push({tick:h,tickId:p,tickLabel:u,translate:d})}return{rawTicks:n,fractionDigits:o,ticks:i}}};WM.DefaultTickCount=5,WM.DefaultMinSpacing=10;var Q5=WM;function q5(t,e){const i=Mt("button",Am("ag-charts-input ag-charts-button",e));return t.label!==void 0?i.append(t.label):(i.append(TO(t.icon)),i.ariaLabel=t.altText),i.addEventListener("click",t.onPress),sc(i,e),i}function J5(t,e){const i=Mt("input",Am("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=>{xv(s)&&(s.preventDefault(),i.click())}),sc(i,e),i}function tK(t,e){const i=Mt("select",Am("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(s=>{const n=Mt("option");return n.value=s.value,n.textContent=s.label,n})),fe(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",s=>t.onChange(i.value,s)),sc(i,e),i}function eK(t,e){const i=Mt("textarea",Am("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",s=>t.onChange(i.value,s)),sc(i,e),fe(i,"data-preventdefault",!1),i}function TO(t){const e=Mt("span",`ag-charts-icon ag-charts-icon-${t}`);return fe(e,"aria-hidden",!0),e}function Am(t,e){return e==null?t:`${t} ${e.class}`}var HM=class extends Es{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[o,a]of this.commands)switch(o){case"M":t.moveTo(e+a[0],i+a[1]),s=e+a[0];break;case"C":t.cubicCurveTo(e+a[0],i+a[1],e+a[2],i+a[3],e+a[4],i+a[5]),s=e+a[4],n=i+a[5];break;case"H":t.lineTo(e+a[0],n),s=i+a[0];break;case"L":t.lineTo(e+a[0],i+a[1]),s=e+a[0],n=i+a[1];break;case"V":t.lineTo(s,i+a[0]),n=i+a[0];break;case"Z":t.closePath();break;default:throw new Error(`Could not translate command '${o}' with '${a.join(" ")}'`)}t.closePath()}};v([Lt()],HM.prototype,"x",2),v([Lt()],HM.prototype,"y",2);var Md=class extends Pa{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)}};v([gt()],Md.prototype,"x",2),v([gt()],Md.prototype,"y",2),v([gt()],Md.prototype,"width",2),v([gt()],Md.prototype,"height",2),v([gt()],Md.prototype,"opacity",2);var UM={};ho(UM,{ButtonWidget:()=>Fu,NativeWidget:()=>jh,SliderWidget:()=>Mv,ToolbarWidget:()=>Qf,WIDGET_HTML_EVENTS:()=>lv,Widget:()=>ia,WidgetEventUtil:()=>Ga});var kO="canvas-overlay",YM=class extends Sf{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.moduleId=`popover-${e}`,i?.detached?this.element=Mt("div"):this.element=t.domManager.addChild(kO,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>t.domManager.removeChild(kO,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=Mt("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=bv(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)}},CO=class extends YM{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),re().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:o,offsetHeight:a}=s;let r=ft(0,t.x,n.width-o),l=ft(0,t.y,n.height-a);r!==t.x&&i?.x!=null&&(r=ft(0,i.x-o,n.width-o)),l!==t.y&&i?.y!=null&&(l=ft(0,i.y-a,n.height-a)),this.updatePosition({x:r,y:l})}},iK=class extends CO{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=hC({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=Mt("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=Mt("span",`ag-charts-menu__icon ${Wf(e.icon)}`);n.appendChild(l)}const o=e.strokeWidth!=null;if(o&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",o),n.style.setProperty("--strokeWidth",o?`${e.strokeWidth}px`:null)),e.label!=null){const l=Mt("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 a=()=>{t.onPress?.(e)},r=l=>{xv(l)&&(a(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",r),n.addEventListener("click",r),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},LO=class extends YM{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:vd.from(t.clientX,t.clientY),position:vd.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=vd.sub(vd.from(t.clientX,t.clientY),e.client),n=vd.add(e.position,s),o=this.ctx.domManager.getBoundingClientRect(),a={};n.x>=0&&n.x+i.offsetWidth<=o.width&&(a.x=n.x),n.y>=0&&n.y+i.offsetHeight<=o.height&&(a.y=n.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},Wp=class extends kt{};v([A(et,{optional:!0})],Wp.prototype,"icon",2),v([A(et,{optional:!0})],Wp.prototype,"label",2),v([A(et,{optional:!0})],Wp.prototype,"ariaLabel",2),v([A(et,{optional:!0})],Wp.prototype,"tooltip",2);var NO=class extends Fu{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="${Wf(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){fe(this.elem,"aria-checked",t)}},wO="ag-charts-toolbar__button--active",KM=class extends Qf{constructor(t,e="horizontal"){super(e),this.localeManager=t,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new ja,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(wO,!1)}toggleActiveButtonByIndex(t){if(t!==-1)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(wO,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 pt(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[o,a]of t.entries())i=!e&&o===0||n!=a.section,s=o===t.length-1||a.section!=t.at(o+1)?.section,a.toggleClass("ag-charts-toolbar__button--first",i),a.toggleClass("ag-charts-toolbar__button--last",s),a.toggleClass("ag-charts-toolbar__button--gap",o>0&&i),n=a.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 kt?e.toJson():e},o=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:o})}),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}},sK=class extends KM{createButtonWidget(){return new NO(this.localeManager)}},nK=class extends LO{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 pt(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:o,offsetHeight:a}=s;let r=t.y-a-i,l=t.x-o/2;n==="below"?r=t.y+i:n==="right"?(r=t.y-a/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:r})}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(ft(0,t.x,i.width-e.width)),t.y=Math.floor(ft(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},oK=class extends KM{constructor(t,e){super(t.localeManager),this.hasPrefix=!0,this.popover=new nK(t,e,this.onPopoverMoved.bind(this)),this.dragHandle=new aK(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 pt(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},aK=class extends jh{constructor(t){super(Mt("div","ag-charts-floating-toolbar__drag-handle"));const e=new jh(Mt("span",`${Wf("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},rK={...wL,...OL},lK={VERSION:nc,_Scene:Sm,_Theme:vm,_Util:Mm,create:Yn.create.bind(Yn),createSparkline:Yn.__createSparkline.bind(Yn),setup:pm,isEnterprise:!1},cK=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,e){let i=t[0],s=t[1],n=t[2],o=t[3];i=this.ff(i,s,n,o,e[0],7,-680876936),o=this.ff(o,i,s,n,e[1],12,-389564586),n=this.ff(n,o,i,s,e[2],17,606105819),s=this.ff(s,n,o,i,e[3],22,-1044525330),i=this.ff(i,s,n,o,e[4],7,-176418897),o=this.ff(o,i,s,n,e[5],12,1200080426),n=this.ff(n,o,i,s,e[6],17,-1473231341),s=this.ff(s,n,o,i,e[7],22,-45705983),i=this.ff(i,s,n,o,e[8],7,1770035416),o=this.ff(o,i,s,n,e[9],12,-1958414417),n=this.ff(n,o,i,s,e[10],17,-42063),s=this.ff(s,n,o,i,e[11],22,-1990404162),i=this.ff(i,s,n,o,e[12],7,1804603682),o=this.ff(o,i,s,n,e[13],12,-40341101),n=this.ff(n,o,i,s,e[14],17,-1502002290),s=this.ff(s,n,o,i,e[15],22,1236535329),i=this.gg(i,s,n,o,e[1],5,-165796510),o=this.gg(o,i,s,n,e[6],9,-1069501632),n=this.gg(n,o,i,s,e[11],14,643717713),s=this.gg(s,n,o,i,e[0],20,-373897302),i=this.gg(i,s,n,o,e[5],5,-701558691),o=this.gg(o,i,s,n,e[10],9,38016083),n=this.gg(n,o,i,s,e[15],14,-660478335),s=this.gg(s,n,o,i,e[4],20,-405537848),i=this.gg(i,s,n,o,e[9],5,568446438),o=this.gg(o,i,s,n,e[14],9,-1019803690),n=this.gg(n,o,i,s,e[3],14,-187363961),s=this.gg(s,n,o,i,e[8],20,1163531501),i=this.gg(i,s,n,o,e[13],5,-1444681467),o=this.gg(o,i,s,n,e[2],9,-51403784),n=this.gg(n,o,i,s,e[7],14,1735328473),s=this.gg(s,n,o,i,e[12],20,-1926607734),i=this.hh(i,s,n,o,e[5],4,-378558),o=this.hh(o,i,s,n,e[8],11,-2022574463),n=this.hh(n,o,i,s,e[11],16,1839030562),s=this.hh(s,n,o,i,e[14],23,-35309556),i=this.hh(i,s,n,o,e[1],4,-1530992060),o=this.hh(o,i,s,n,e[4],11,1272893353),n=this.hh(n,o,i,s,e[7],16,-155497632),s=this.hh(s,n,o,i,e[10],23,-1094730640),i=this.hh(i,s,n,o,e[13],4,681279174),o=this.hh(o,i,s,n,e[0],11,-358537222),n=this.hh(n,o,i,s,e[3],16,-722521979),s=this.hh(s,n,o,i,e[6],23,76029189),i=this.hh(i,s,n,o,e[9],4,-640364487),o=this.hh(o,i,s,n,e[12],11,-421815835),n=this.hh(n,o,i,s,e[15],16,530742520),s=this.hh(s,n,o,i,e[2],23,-995338651),i=this.ii(i,s,n,o,e[0],6,-198630844),o=this.ii(o,i,s,n,e[7],10,1126891415),n=this.ii(n,o,i,s,e[14],15,-1416354905),s=this.ii(s,n,o,i,e[5],21,-57434055),i=this.ii(i,s,n,o,e[12],6,1700485571),o=this.ii(o,i,s,n,e[3],10,-1894986606),n=this.ii(n,o,i,s,e[10],15,-1051523),s=this.ii(s,n,o,i,e[1],21,-2054922799),i=this.ii(i,s,n,o,e[8],6,1873313359),o=this.ii(o,i,s,n,e[15],10,-30611744),n=this.ii(n,o,i,s,e[6],15,-1560198380),s=this.ii(s,n,o,i,e[13],21,1309151649),i=this.ii(i,s,n,o,e[4],6,-145523070),o=this.ii(o,i,s,n,e[11],10,-1120210379),n=this.ii(n,o,i,s,e[2],15,718787259),s=this.ii(s,n,o,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(s,t[1]),t[2]=this.add32(n,t[2]),t[3]=this.add32(o,t[3])}cmn(t,e,i,s,n,o){return e=this.add32(this.add32(e,t),this.add32(s,o)),this.add32(e<<n|e>>>32-n,i)}ff(t,e,i,s,n,o,a){return this.cmn(e&i|~e&s,t,e,n,o,a)}gg(t,e,i,s,n,o,a){return this.cmn(e&s|i&~s,t,e,n,o,a)}hh(t,e,i,s,n,o,a){return this.cmn(e^i^s,t,e,n,o,a)}ii(t,e,i,s,n,o,a){return this.cmn(i^(e|~s),t,e,n,o,a)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=t.length;s+=64)this.md5cycle(i,this.md5blk(t.substring(s-64,s)));t=t.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<t.length;s++)n[s>>2]|=t.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=e*8,this.md5cycle(i,n),i}md5blk(t){const e=[];for(let i=0;i<64;i+=4)e[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}rhex(t){const e="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=e[t>>s*8+4&15]+e[t>>s*8&15];return i}hex(t){for(let e=0;e<t.length;e++)t[e]=this.rhex(t[e]);return t.join("")}md5(t){return this.hex(this.md51(t))}add32(t,e){return this.ieCompatibility?this.add32Compat(t,e):this.add32Std(t,e)}add32Std(t,e){return t+e&4294967295}add32Compat(t,e){const i=(t&65535)+(e&65535);return(t>>16)+(e>>16)+(i>>16)<<16|i&65535}};function $M(t){return t==null||t.length===0}var Im={"01":"GRID","02":"CHARTS","0102":"BOTH"},OO="https://www.ag-grid.com/charts/licensing/",XM=class Ii{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new cK,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(Ii.licenseKey,Ii.gridContext),i=`AG ${e.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(e.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":e.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":e.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(e.expired){const n=Ii.getChartsReleaseDate(),o=Ii.formatDate(n);this.outputExpiredKey(e.expiry,o,s)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,s):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,s)}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(parseInt(Ii.decode(i),10))}static extractLicenseComponents(e){let i=e.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),o=i.substring(0,s),[a,r,l]=Ii.extractBracketedInformation(i);return{md5:n,license:o,version:a,isTrial:r,type:l}}getLicenseDetails(e,i=!1){const s="CHARTS";if($M(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:s};const n=Ii.getChartsReleaseDate(),{md5:o,license:a,version:r,isTrial:l,type:c}=Ii.extractLicenseComponents(e);let h=o===this.md5.md5(a)&&e.indexOf("For_Trialing_ag-Grid_Only")===-1,d,u,p=null,g=!1,f;function x(){d=p<new Date,u=void 0}if(h&&(p=Ii.extractExpiry(a),h=!isNaN(p.getTime()),h))switch(u=n>p,r){case"legacy":case"2":{h=!1;break}case"3":$M(c)?h=!1:(f=c,c!==Im["02"]&&c!==Im["0102"]?(h=!1,g=!0):l&&x())}return h?{licenseKey:e,valid:h,expiry:Ii.formatDate(p),expired:u,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}:{licenseKey:e,valid:h,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!$M(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??window;if(!e)return"localhost";const i=e.location,{hostname:s=""}=i;return s}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??typeof window<"u"?window:void 0;if(!e)return!1;const{pathname:i}=e.location;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){const e=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)!==null}isLocalhost(){const e=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(e)!==null}static formatDate(e){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=e.getDate(),n=e.getMonth(),o=e.getFullYear();return s+" "+i[n]+" "+o}static getChartsReleaseDate(){return new Date(parseInt(Ii.decode(Ii.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,o,a,r,l,c,h,d=0;const u=e.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)r=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),h=i.indexOf(u.charAt(d++)),n=r<<2|l>>4,o=(l&15)<<4|c>>2,a=(c&3)<<6|h,s=s+String.fromCharCode(n),c!=64&&(s=s+String.fromCharCode(o)),h!=64&&(s=s+String.fromCharCode(a));return s=Ii.utf8_decode(s),s}static utf8_decode(e){e=e.replace(/rn/g,"n");let i="";for(let s=0;s<e.length;s++){const n=e.charCodeAt(s);n<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(n&63|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(n&63|128))}return i}static setGridContext(e=!1){Ii.gridContext=e}static setLicenseKey(e){Ii.licenseKey=e}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const i=e.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(r=>r==="TRIAL").length===1,n=i.filter(r=>r.startsWith("v"))[0],o=n?n.replace("v",""):"legacy",a=Im[i.filter(r=>Im[r])[0]];return[o,s,a]}centerPadAndOutput(e){const i=this.totalMessageLength-e.length;console.error(e.padStart(i/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,i="*",s=""){console.error(e.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(e,i,s){Ii.gridContext||(e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${OO}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${OO}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,s){Ii.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){Ii.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,i,s){Ii.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};XM.RELEASE_INFORMATION="MTc0NDM2MDQwOTAxMw==",XM.gridContext=!1;var Dd=XM;function ZM(t,e,i){const s=(o,a,r,l)=>{let c=t[0];for(let h=o;r>0?h<=a:h>a;h+=r){const d=t[h];if(l(c,d))return!0;c=d}return!1},n=Math.floor(t.length/2);return s(e,n,e,i)?!0:s(t.length-e,n,-e,i)}var{OR:hK,POSITIVE_NUMBER:dK,NAN:uK,AxisInterval:pK,TempValidate:gK}=T,QM=class extends pK{};y([gK(hK(dK,uK))],QM.prototype,"minSpacing",2);var{BaseProperties:EO,ChartAxisDirection:fK,ARRAY:yK,BOOLEAN:qM,COLOR_STRING:JM,FONT_STYLE:mK,FONT_WEIGHT:xK,LINE_DASH:bK,NUMBER:RO,OBJECT:SK,POSITIVE_NUMBER:vK,RATIO:PO,STRING:BO,UNION:zO,AND:MK,COLOR_STRING_ARRAY:DK,TempValidate:ti,MATCHING_CROSSLINE_TYPE:FO,createId:AK,Group:tD}=T,Co=class extends EO{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};y([ti(qM,{optional:!0})],Co.prototype,"enabled",2),y([ti(BO,{optional:!0})],Co.prototype,"text",2),y([ti(mK,{optional:!0})],Co.prototype,"fontStyle",2),y([ti(xK,{optional:!0})],Co.prototype,"fontWeight",2),y([ti(vK)],Co.prototype,"fontSize",2),y([ti(BO)],Co.prototype,"fontFamily",2),y([ti(RO)],Co.prototype,"padding",2),y([ti(JM,{optional:!0})],Co.prototype,"color",2),y([ti(qM,{optional:!0})],Co.prototype,"parallel",2);var Bs=class extends EO{constructor(){super(...arguments),this.id=AK(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Co,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=fK.X,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new tD({name:this.id}),this.rangeGroup=new tD({name:this.id}),this.labelGroup=new tD({name:this.id}),this._isRange=void 0}assignCrossLineGroup(t,e){t!==this._isRange&&(t?this.rangeGroup.appendChild(e):this.lineGroup.appendChild(e)),this._isRange=t}setSectorNodeProps(t){t.fill=this.fill,t.fillOpacity=this.fillOpacity??1,t.stroke=this.stroke,t.strokeOpacity=this.strokeOpacity??1,t.strokeWidth=this.strokeWidth??1,t.lineDash=this.lineDash}setLabelNodeProps(t,e,i,s,n){const{label:o}=this;t.x=e,t.y=i,t.text=o.text,t.textAlign="center",t.textBaseline=s,t.rotation=n,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=o.color,t.fontFamily=o.fontFamily,t.fontSize=o.fontSize,t.fontStyle=o.fontStyle,t.visible=!0}};y([ti(qM,{optional:!0})],Bs.prototype,"enabled",2),y([ti(zO(["range","line"],"a crossLine type"))],Bs.prototype,"type",2),y([ti(MK(FO("range"),yK.restrict({length:2})),{optional:!0})],Bs.prototype,"range",2),y([ti(FO("value"),{optional:!0})],Bs.prototype,"value",2),y([ti(DK)],Bs.prototype,"defaultColorRange",2),y([ti(JM,{optional:!0})],Bs.prototype,"fill",2),y([ti(PO,{optional:!0})],Bs.prototype,"fillOpacity",2),y([ti(JM,{optional:!0})],Bs.prototype,"stroke",2),y([ti(RO,{optional:!0})],Bs.prototype,"strokeWidth",2),y([ti(PO,{optional:!0})],Bs.prototype,"strokeOpacity",2),y([ti(bK,{optional:!0})],Bs.prototype,"lineDash",2),y([ti(zO(["polygon","circle"],"a shape"))],Bs.prototype,"shape",2),y([ti(SK)],Bs.prototype,"label",2);var{ChartAxisDirection:IK,getCrossLineValue:_O,validateCrossLineValue:TK,normalizeAngle360:eD,Group:kK,Path:GO,Sector:CK,RotatableText:LK,ContinuousScale:NK}=T,iD=class extends Bs{constructor(){super(),this.direction=IK.X,this.polygonNode=new GO,this.sectorNode=new CK,this.lineNode=new GO,this.crossLineRange=new kK,this.labelNode=new LK,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!NK.is(this.scale))return!0;const[t,e]=this.scale.domain,i=_O(this);if(wt(i)){const[s,n]=i;return s>=t&&s<=e&&n>=s&&n<=e}else return i>=t&&i<=e}update(t){const{scale:e}=this;if(!e||!this.isValid()||!TK(_O(this),e)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:s,lineNode:n}=this;if(!t||i!=="line"||!e){n.visible=!1;return}const o=e.convert(s);if(isNaN(o)){n.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this;n.visible=!0,n.stroke=this.stroke,n.strokeOpacity=this.strokeOpacity??1,n.strokeWidth=this.strokeWidth??1,n.fill=void 0,n.lineDash=this.lineDash;const l=r*Math.cos(o),c=r*Math.sin(o),h=a*Math.cos(o),d=a*Math.sin(o);n.path.clear(!0),n.path.moveTo(h,d),n.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:s,shape:n,type:o,ticks:a}=this;if(!t||o!=="range"||n!=="polygon"||!s||!i){e.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=a.indexOf(i[0]),h=a.indexOf(i[1]),u=(c<=h?a.slice(c,h+1):a.slice(c).concat(a.slice(0,h+1))).map(g=>s.convert(g));e.visible=!0,this.setSectorNodeProps(e);const{path:p}=e;p.clear(!0),u.forEach((g,f)=>{const x=l*Math.cos(g),m=l*Math.sin(g);f===0?p.moveTo(x,m):p.lineTo(x,m)}),r===0?p.lineTo(0,0):u.slice().reverse().forEach(g=>{const f=r*Math.cos(g),x=r*Math.sin(g);p.lineTo(f,x)}),e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:s,shape:n,type:o}=this;if(!t||o!=="range"||n!=="circle"||!s||!i){e.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,h=s instanceof T.BandScale?c/2:0;e.visible=!0,this.setSectorNodeProps(e),e.centerX=0,e.centerY=0,e.innerRadius=a,e.outerRadius=r,e.startAngle=l[0]-h,e.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(t){const{label:e,labelNode:i,range:s,scale:n,type:o,ticks:a}=this;if(!t||e.enabled===!1||!e.text||!n||o==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,d,u;if(o==="line"){const p=eD(n.convert(this.value)),g=1.5*Math.PI,f=de(p,g)||p>g||p<Math.PI/2,x=(r+l)/2*Math.cos(p),m=(r+l)/2*Math.sin(p);c=x+e.padding*Math.cos(p+Math.PI/2),h=m+e.padding*Math.sin(p+Math.PI/2),u=f?"top":"bottom",d=f?p:p-Math.PI}else{const[p,g]=s.map(b=>eD(n.convert(b)));let f=(p+g)/2;p>g&&(f-=Math.PI),f=eD(f);const x=(de(f,0)||f>0)&&f<Math.PI;let m;this.shape==="circle"||a.length<3?m=l-e.padding:m=l*Math.cos(Math.PI/a.length)-e.padding,c=m*Math.cos(f),h=m*Math.sin(f),u=x?"bottom":"top",d=x?f-Math.PI/2:f+Math.PI/2}this.setLabelNodeProps(i,c,h,u,d)}};iD.className="AngleCrossLine";var{ChartAxisDirection:wK,NUMBER:VO,UNION:OK,ProxyOnWrite:EK,TextWrapper:RK,TextUtils:PK,TempValidate:sD,toRadians:Tm,normalizeAngle360:Ad,normalizeAngle360Inclusive:BK,Path:zK,RotatableText:FK,Transformable:_K,BBox:GK}=T,nD=class extends T.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};y([sD(OK(["fixed","parallel","perpendicular"],"a label orientation"))],nD.prototype,"orientation",2);var Hp=class extends T.PolarAxis{constructor(t,e){super(t,e),this.startAngle=0,this.endAngle=void 0,this.labelData=[],this.tickData=[],this.radiusLine=this.axisGroup.appendChild(new zK),this.includeInvisibleDomains=!0}get direction(){return wK.X}createLabel(){return new nD}calculateTickLayout(t){const{nice:e,scale:i}=this,s={nice:e,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=e?i.niceDomain(s,t):t,o=this.generateAngleTicks(n);this.tickData=o;const a=o.map(l=>l.value),r=a.reduce((l,c)=>Math.max(typeof c=="number"?Au(c):0,l),0);return{niceDomain:n,primaryTickCount:void 0,tickDomain:n,ticks:a,fractionDigits:r,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine()}normalizedAngles(){const t=Ad(-Math.PI/2+Tm(this.startAngle)),e=this.endAngle!=null?BK(Tm(this.endAngle)-Tm(this.startAngle)):2*Math.PI,i=t+e;return[t,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const t=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?t:[]),this.tickLineGroupSelection.update(this.tick.enabled?t:[]),this.tickLabelGroupSelection.update(this.label.enabled?t:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){const{translation:t,axisGroup:e,gridGroup:i,crossLineRangeGroup:s,crossLineLineGroup:n,crossLineLabelGroup:o}=this,a=Math.floor(t.x),r=Math.floor(t.y);e.translationX=a,e.translationY=r,i.translationX=a,i.translationY=r,s.translationX=a,s.translationY=r,n.translationX=a,n.translationY=r,o.translationX=a,o.translationY=r}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:n,y:o,moveTo:a,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0})=>{r?e.arc(n,o,l,c,h):a?e.moveTo(n,o):e.lineTo(n,o)}),s&&e.closePath(),t.visible=this.line.enabled,t.stroke=this.line.stroke,t.strokeWidth=this.line.width,t.fill=void 0}getAxisLinePoints(){const{scale:t,shape:e,gridLength:i}=this,[s,n]=this.range,o=de(n-s,2*Math.PI),a=[];if(e==="circle")o?a.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):a.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Ad(s),endAngle:Ad(n),arc:!0,moveTo:!1});else if(e==="polygon"){const r=t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>t.convert(l));r&&r.length>2&&r.forEach((l,c)=>{const h=i*Math.cos(l),d=i*Math.sin(l),u=c===0;a.push({x:h,y:d,moveTo:u})})}return{points:a,closePath:o}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&e>0))return;const o=e*n,a=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:d,lineDash:u}=i[c%a],p=t.convert(h);r.x1=o*Math.cos(p),r.y1=o*Math.sin(p),r.x2=e*Math.cos(p),r.y2=e*Math.sin(p),r.stroke=d,r.strokeWidth=s,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((i,s,n)=>{const o=this.labelData[n];if(!o||o.hidden){i.visible=!1;return}i.text=o.text,i.setFont(t),i.fill=t.color,i.x=o.x,i.y=o.y,i.textAlign=o.textAlign,i.textBaseline=o.textBaseline,i.visible=!0,o.rotation?(i.rotation=o.rotation,i.rotationCenterX=o.x,i.rotationCenterY=o.y):i.rotation=0})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:s}=this;s.each((n,o)=>{const{value:a}=o,r=t.convert(a),l=Math.cos(r),c=Math.sin(r);n.x1=e*l,n.y1=e*c,n.x2=(e+i.size)*l,n.y2=(e+i.size)*c,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:s,gridLength:n,scale:o,tick:a}=this;if(!s.enabled)return[];const r=new FK,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,h=t.map((d,u)=>{const{value:p}=d,g=n+s.spacing+a.size,f=o.convert(p),x=Math.cos(f),m=Math.sin(f),b=g*x,S=g*m,{textAlign:M,textBaseline:D}=this.getLabelAlign(f),C=u===t.length-1&&p!==t[0]&&de(Ad(f),Ad(o.convert(t[0]))),k=this.getLabelRotation(f);let I=this.formatTick(p,u,o.domain);r.text=I,r.x=b,r.y=S,r.setFont(s),r.textAlign=M,r.textBaseline=D,r.rotation=k,k&&(r.rotationCenterX=b,r.rotationCenterY=S);let L=k?_K.toCanvas(r):r.getBBox();if(L&&e.hideWhenNecessary&&!k){const N=l-L.x,O=L.x+L.width-c,w=1;if(N>w||O>w){const R=L.width-Math.max(N,O);I=RK.wrapText(I,{maxWidth:R,font:s,textWrap:"never"}),I===PK.EllipsisChar&&(I=""),r.text=I,L=r.getBBox()}}return{text:I,x:b,y:S,textAlign:M,textBaseline:D,hidden:I===""||d.hidden||C,rotation:k,box:L}});return s.avoidCollisions&&this.avoidLabelCollisions(h),h}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:GK.merge(i)}getLabelOrientation(){const{label:t}=this;return t instanceof nD?t.orientation:"fixed"}getLabelRotation(t){let e=Tm(this.label.rotation??0);t=Ad(t);const i=this.getLabelOrientation();return i==="parallel"?(e+=t,t>=0&&t<Math.PI?e-=Math.PI/2:e+=Math.PI/2):i==="perpendicular"&&(e+=t,t>=Math.PI/2&&t<1.5*Math.PI&&(e+=Math.PI)),e}getLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let s,n;const o=this.getLabelOrientation(),a=de(e,0),r=de(i,0),l=de(e,1),c=de(i,-1),h=e>0&&!a,d=i>0&&!r;return o==="parallel"?(s="center",n=l&&r||d?"top":"bottom"):o==="perpendicular"?(s=c||h?"left":"right",n="middle"):(s="right",a?s="center":h&&(s="left"),n="bottom",r?n="middle":d&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof iD&&(s.ticks=this.tickData.map(n=>n.value),s.shape=t,s.axisOuterRadius=e,s.axisInnerRadius=e*i)}),super.updateCrossLines()}};Hp.CrossLineConstructor=iD,y([EK("rotation"),sD(VO)],Hp.prototype,"startAngle",2),y([sD(VO,{optional:!0})],Hp.prototype,"endAngle",2);var{RATIO:jO,OBJECT:VK,TempValidate:oD,CategoryScale:jK}=T,ll=class extends Hp{constructor(t){super(t,new jK),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new QM}generateAngleTicks(){const{scale:t,gridLength:e}=this,{values:i,minSpacing:s}=this.interval,n=i??t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})??[];if(n.length<2||s==null)return n.map(c=>({value:c,visible:!0}));const o=n[0],a=t.convert(o),r=e*Math.cos(a),l=e*Math.sin(a);for(let c=1;c<n.length-1;c++){const h=n[c],d=t.convert(h);if(d-a>Math.PI)break;const u=e*Math.cos(d),p=e*Math.sin(d);if(Math.sqrt((u-r)**2+(p-l)**2)>s){const f=new Set([o]);return ZM(n,c,(x,m)=>{f.add(m)}),n.map(x=>{const m=f.has(x);return{value:x,visible:m}})}}return[{value:o,visible:!0}]}avoidLabelCollisions(t){const{minSpacing:e}=this.label;if(t.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(e==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(e/2),d=c.box.clone().grow(e/2);return h.collidesBBox(d)},s=t[0],n=t.at(-1),o=new Set([s]),a=de(s.x,n.x)&&de(s.y,n.y),r=Math.floor(t.length/2);for(let l=1;l<=r;l++){const c=a?t.slice(0,-1):t;if(!ZM(c,l,i)){ZM(c,l,(d,u)=>{o.add(u)});break}}t.forEach(l=>{o.has(l)||(l.hidden=!0,l.box=void 0)})}};ll.className="AngleCategoryAxis",ll.type="angle-category",y([oD(jO)],ll.prototype,"groupPaddingInner",2),y([oD(jO)],ll.prototype,"paddingInner",2),y([oD(VK)],ll.prototype,"interval",2);var WK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:t=>new ll(t)},{range:WO,isDenseInterval:HK,LinearScale:aD}=T,HO=class PT extends aD{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,i){const[s,n]=i;let o=aD.getTickStep(s,n,e);const a=isNaN(e.maxTickCount)?1/0:e.maxTickCount,r=Math.abs(n-s)/o;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>a&&(l/=2,o*=2),{count:l,step:o}}ticks(e,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||s<=0)return[];const{nice:n,interval:o}=e,[a,r]=i;if(o){const c=Math.abs(o),h=this.getPixelRange();if(!HK((r-a)/c,h))return WO(a,r,c)}let l;if(n&&this.hasNiceRange()){const c=super.niceDomain(e,i);l=PT.getNiceStepAndTickCount(e,c).step}else l=aD.getTickStep(a,r,e);return WO(a,r,l)}hasNiceRange(){const e=this.range.slice().sort((s,n)=>s-n);return[Math.PI,2*Math.PI].some(s=>de(s,e[1]-e[0]))}niceDomain(e,i=this.domain){const s=super.niceDomain(e,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],o=n?s[1]:s[0],{step:a,count:r}=PT.getNiceStepAndTickCount(e,s),l=1/a,c=a>=1?Math.ceil(o/a+r)*a:Math.ceil((o+r*a)*l)/l;return n?[c,o]:[o,c]}getPixelRange(){return this.arcLength}},{AND:UO,GREATER_THAN:UK,LESS_THAN:YK,NUMBER_OR_NAN:YO,OBJECT:KK,TempValidate:rD,angleBetween:$K,normalisedExtentWithMetadata:XK,findMinMax:ZK}=T,Oc=class extends Hp{constructor(t){super(t,new HO),this.shape="circle",this.interval=new QM}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=XK(t,e,i);return{domain:s,clipped:n}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:t}=this,e=Math.min(...t),i=Math.max(...t),s=$K(e,i)||2*Math.PI,n=this.gridLength;return s*n}generateAngleTicks(t){const{scale:e,range:i,nice:s}=this,{values:n,step:o,minSpacing:a,maxSpacing:r}=this.interval;let l;if(n==null){const{arcLength:c}=e,h=r?Math.floor(c/r):1,d=a?Math.floor(c/a):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(h,Math.min(d,u)),g={nice:s,interval:o,tickCount:p,minTickCount:h,maxTickCount:d};l=e.ticks(g,t)}else{const[c,h]=ZK(t.map(Number));l=n.filter(d=>d>=c&&d<=h).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(t){const{minSpacing:e}=this.label,i=(o,a)=>{if(o.hidden||a.hidden)return!1;if(e==null)return o.box.collidesBBox(a.box);const r=o.box.clone().grow(e/2),l=a.box.clone().grow(e/2);return r.collidesBBox(l)},s=t[0],n=t.at(-1);s!==n&&de(s.x,n.x)&&de(s.y,n.y)&&(n.hidden=!0);for(let o=1;o<t.length;o*=2){let a=!1;for(let r=o;r<t.length;r+=o){const l=t[r],c=t[r-o];if(i(c,l)){a=!0;break}}if(!a){t.forEach((r,l)=>{l%o>0&&(r.hidden=!0,r.box=void 0)});return}}t.forEach((o,a)=>{a>0&&(o.hidden=!0,o.box=void 0)})}};Oc.className="AngleNumberAxis",Oc.type="angle-number",y([rD(UO(YO,YK("max")),{optional:!0})],Oc.prototype,"min",2),y([rD(UO(YO,UK("min")),{optional:!0})],Oc.prototype,"max",2),y([rD(KK)],Oc.prototype,"interval",2);var QK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:t=>new Oc(t)},{OrdinalTimeScale:qK}=T,km=class extends T.CategoryAxis{constructor(t){super(t,new qK)}};km.className="OrdinalTimeAxis",km.type="ordinal-time";var JK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:t=>new km(t)},{ChartAxisDirection:t$,TempValidate:e$,NUMBER:i$,getCrossLineValue:s$,validateCrossLineValue:n$,normalizeAngle360:o$,toRadians:a$,Group:r$,Path:l$,Sector:c$,RotatableText:h$}=T,KO=class extends Co{constructor(){super(...arguments),this.positionAngle=void 0}};y([e$(i$,{optional:!0})],KO.prototype,"positionAngle",2);var lD=class extends Bs{constructor(){super(),this.direction=t$.Y,this.label=new KO,this.polygonNode=new l$,this.sectorNode=new c$,this.crossLineRange=new r$,this.labelNode=new h$,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e}=this;if(!e||!this.isValid()||!n$(s$(this),e)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;t&&(t=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:t,scale:e,type:i,axisInnerRadius:s,axisOuterRadius:n}=this;if(!e)return{innerRadius:0,outerRadius:0};const o=l=>n+s-l;let a,r;if(i==="line")a=o(e.convert(this.value)),r=a;else{const l=Math.abs(e?.bandwidth??0),c=t.map(h=>e.convert(h));a=o(Math.max(...c)),r=o(Math.min(...c))+l}this.outerRadius=a,this.innerRadius=r}drawPolygon(t,e,i){e.forEach((s,n)=>{const o=t*Math.cos(s),a=t*Math.sin(s);n===0?i.path.moveTo(o,a):i.path.lineTo(o,a)}),i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:s,shape:n,type:o,innerRadius:a,outerRadius:r}=this;if(!t||n!=="polygon"||!s||!e){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,e,i);const c=e.slice().reverse(),h=o==="line"?r-l:a+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:s,sectorNode:n,shape:o,innerRadius:a,outerRadius:r}=this;if(!t||o!=="circle"||!s){n.visible=!1;return}n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const l=this.getPadding(),c=ft(e,a+l,i),h=ft(e,r-l,i);n.innerRadius=Math.min(c,h),n.outerRadius=Math.max(c,h),this.setSectorNodeProps(n)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:s,scale:n,shape:o,type:a}=this;if(!t||i.enabled===!1||!i.text||!n){s.visible=!1;return}const r=o$(a$((i.positionAngle??0)-90)),l=(de(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let h;const d=this.gridAngles??[];a==="line"?h=e+i.padding:o==="circle"||d.length<3?h=e-i.padding:h=e*Math.cos(Math.PI/d.length)-i.padding;const u=h*Math.cos(r),p=h*Math.sin(r);let g;a==="line"?g=l?"top":"bottom":g=l?"bottom":"top",this.setLabelNodeProps(s,u,p,g,c)}getPadding(){const{scale:t}=this;if(!t)return 0;const e=Math.abs(t.bandwidth??0),i=Math.abs(t.step??0);return t instanceof T.BandScale?(i-e)/2:0}};lD.className="RadiusCrossLine";var{ChartAxisDirection:d$,ZIndexMap:u$,NUMBER:$O,BOOLEAN:p$,TempValidate:cD,normalizeAngle360:XO,toRadians:g$,Caption:f$,Group:y$,Path:m$,Line:x$,Selection:b$,AxisTickGenerator:S$,AxisGroupZIndexMap:v$}=T,hD=class extends T.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};y([cD(p$,{optional:!0})],hD.prototype,"autoRotate",2),y([cD($O)],hD.prototype,"autoRotateAngle",2);var Cm=class extends T.PolarAxis{constructor(t,e){super(t,e),this.positionAngle=0,this.tickGenerator=new S$(this),this.generatedTicks=void 0,this.lineNode=this.axisGroup.appendChild(new x$({name:`${this.id}-Axis-line`,zIndex:v$.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new y$({name:`${this.id}-gridPaths`,zIndex:u$.AXIS_GRID})),this.gridPathSelection=b$.select(this.gridPathGroup,m$),this.axisGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return d$.Y}getAxisTransform(){const t=this.scale.range[0],{translation:e,positionAngle:i,innerRadiusRatio:s}=this,n=t*s,o=g$(i);return{translationX:e.x,translationY:e.y-t-n,rotation:o,rotationCenterX:0,rotationCenterY:t+n}}update(){super.update(),this.updateTitle();const{enabled:t,stroke:e,width:i}=this.line;this.lineNode.setProperties({stroke:e,strokeWidth:t?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}calculateTickLayout(t,e,i,s){const{parallelFlipRotation:n,regularFlipRotation:o}=this.calculateRotations(),a=[0,1],r=this.label.getSideFlag(),l=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),c=this.tickGenerator.generateTicks({domain:t,niceMode:e,visibleRange:a,primaryTickCount:s,parallelFlipRotation:n,regularFlipRotation:o,labelX:l,sideFlag:r}),{tickData:h,primaryTickCount:d=s}=c,{ticks:u,rawTicks:p,tickDomain:g,fractionDigits:f,niceDomain:x=t}=h,m=u.map(b=>this.getTickLabelProps(b,c));return this.generatedTicks={ticks:u,labels:m},{ticks:p,tickDomain:g,niceDomain:x,primaryTickCount:d,fractionDigits:f}}updateSelections(){const{generatedTicks:t}=this;if(!t)return;const{ticks:e,labels:i}=t;this.gridLineGroupSelection.update(this.gridLength?e:[]),this.tickLineGroupSelection.update(e),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(e):[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const t=T.resetAxisLabelSelectionFn();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",e.setProperties(t(e,i))})}updateGridLines(){super.updateGridLines();const{gridLine:{style:t,width:e},shape:i,generatedTicks:s}=this;if(!t||!s)return;const n=t.length,o=(u,p)=>{const{stroke:g,lineDash:f}=t[p%n];u.stroke=g,u.strokeWidth=e,u.lineDash=f,u.fill=void 0},[a,r]=this.gridRange??[0,2*Math.PI],l=de(r-a,2*Math.PI),d=i==="circle"?(u,p)=>{const{path:g}=u;g.clear(!0);const f=this.getTickRadius(p);l?(g.moveTo(f,0),g.arc(0,0,f,0,2*Math.PI)):(g.moveTo(f*Math.cos(a),f*Math.sin(a)),g.arc(0,0,f,XO(a),XO(r))),l&&g.closePath()}:(u,p)=>{const{path:g}=u,f=this.gridAngles;if(g.clear(!0),!f||f.length<3)return;const x=this.getTickRadius(p);f.forEach((m,b)=>{const S=x*Math.cos(m),M=x*Math.sin(m);b===0?g.moveTo(S,M):g.lineTo(S,M),f.forEach((D,C)=>{const k=x*Math.cos(D),I=x*Math.sin(D);C===0?g.moveTo(k,I):g.lineTo(k,I)}),g.closePath()}),g.closePath()};this.gridPathSelection.each((u,p,g)=>{o(u,g),d(u,p)})}updateTitle(){const t=r=>r.defaultValue,{title:e,range:i,moduleCtx:{callbackCache:s}}=this,{formatter:n=t}=this.title;e.caption.enabled=e.enabled,e.caption.fontFamily=e.fontFamily,e.caption.fontSize=e.fontSize,e.caption.fontStyle=e.fontStyle,e.caption.fontWeight=e.fontWeight,e.caption.color=e.color,e.caption.wrapping=e.wrapping;let o=!1;const a=e.caption.node;e.enabled&&(o=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-f$.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=s.call(this,n,this.getTitleFormatterParams(this.scale.domain))),a.visible=o}updateCrossLines(){this.crossLines.forEach(t=>{if(t instanceof lD){const{shape:e,gridAngles:i,range:s,innerRadiusRatio:n}=this,o=s[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=o,t.axisInnerRadius=o*n}}),super.updateCrossLines()}createLabel(){return new hD}getTickLabelProps(t,e){const{label:i}=this,{combinedRotation:s,textBaseline:n,textAlign:o}=e,a=this.scale.range,r=t.tickLabel,c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null;return{...this.getLabelStyles({value:t.tickLabel}),tickId:t.tickId,rotation:s,rotationCenterX:c,translationY:t.translationY,text:r,textAlign:o,textBaseline:n,visible:h,x:c,y:0,range:a}}};Cm.CrossLineConstructor=lD,y([cD($O)],Cm.prototype,"positionAngle",2);var{RATIO:dD,ProxyPropertyOnWrite:ZO,TempValidate:uD,CategoryScale:QO}=T,cl=class extends Cm{constructor(t){super(t,new QO),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(t){return{domain:t,clipped:!1}}prepareGridPathTickData(t){return t.slice().reverse()}getTickRadius(t){const{scale:e,innerRadiusRatio:i}=this,s=e.range[0],n=s*i;if(QO.is(e)){const o=e.domain,a=o.length-1-o.indexOf(t.tick);return a===0?n:e.inset+e.step*(a-.5)+e.bandwidth/2}else{const o=(s-n)/e.domain.length;return s-t.translationY+n-o/2}}};cl.className="RadiusCategoryAxis",cl.type="radius-category",y([uD(dD)],cl.prototype,"groupPaddingInner",2),y([ZO("scale","paddingInner"),uD(dD)],cl.prototype,"paddingInner",2),y([ZO("scale","paddingOuter"),uD(dD)],cl.prototype,"paddingOuter",2);var M$={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:t=>new cl(t)},{AND:qO,GREATER_THAN:D$,LESS_THAN:A$,NUMBER_OR_NAN:JO,TempValidate:tE,normalisedExtentWithMetadata:I$,LinearScale:T$}=T,Id=class extends Cm{constructor(t){super(t,new T$),this.shape="polygon"}prepareGridPathTickData(t){const{scale:e}=this,i=e.domain[1];return t.filter(({tick:s})=>s!==i).sort((s,n)=>n.tick-s.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],s=i*this.innerRadiusRatio;return i-t.translationY+s}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=I$(t,e,i);return{domain:s,clipped:n}}};Id.className="RadiusNumberAxis",Id.type="radius-number",y([tE(qO(JO,A$("max")),{optional:!0})],Id.prototype,"min",2),y([tE(qO(JO,D$("min")),{optional:!0})],Id.prototype,"max",2);var k$={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:t=>new Id(t)},{BOOLEAN:C$,POSITIVE_NUMBER:L$,ObserveChanges:eE,TempValidate:iE}=T,pD=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1),this.destroyFns.push(()=>{t.animationManager.skip(!0)})}};y([eE((t,e)=>{t.ctx.animationManager.skip(!e)}),iE(C$)],pD.prototype,"enabled",2),y([eE((t,e)=>{t.ctx.animationManager.defaultDuration=e}),iE(L$,{optional:!0})],pD.prototype,"duration",2);var N$={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new pD(t),themeTemplate:{animation:{enabled:!0}}},w$='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>',{focusCursorAtEnd:O$}=T,sE="text-input",nE="canvas-overlay",E$=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=t.domManager.addChild(nE,sE),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>t.domManager.removeChild(nE,sE))}setKeyDownHandler(t){this.element.addEventListener("keydown",t),this.destroyFns.push(()=>this.element.removeEventListener("keydown",t))}show(t){this.element.innerHTML=w$;const e=this.element.firstElementChild;T.setAttribute(e,"data-preventdefault",!1),e.isContentEditable||(e.contentEditable="true"),e.setAttribute("placeholder",this.ctx.localeManager.t(t.placeholderText??"inputTextareaPlaceholder")),t.styles?.placeholderColor&&e.style.setProperty("--placeholder-text-color",t.styles?.placeholderColor),e.innerText=t.text??"",e.style.color=t.styles?.color??"inherit",e.style.fontFamily=t.styles?.fontFamily??"inherit",e.style.fontSize=t.styles?.fontSize?`${t.styles.fontSize}px`:"inherit",e.style.fontStyle=t.styles?.fontStyle??"inherit",e.style.fontWeight=typeof t.styles?.fontWeight=="number"?`${t.styles.fontWeight}`:t.styles?.fontWeight??"inherit",O$(e),e.addEventListener("input",()=>{this.updatePosition(),t.onChange?.(this.getValue(),this.getBBox())}),e.addEventListener("click",i=>{i.stopPropagation()}),t.layout&&(this.layout=t.layout,this.updatePosition()),t.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(t){this.element.firstElementChild&&(this.element.firstElementChild.style.color=t)}updateFontSize(t){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${t}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:t}=this,e=t.firstElementChild;if(!e)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:n,getTextPosition:o,alignment:a,textAlign:r}=this.layout;t.style.setProperty("width",s?`${s}px`:"unset");const l=e.getBoundingClientRect(),c=n(l.height);let h=c.x;a==="center"?h-=(s??l.width)/2:a==="right"&&(h-=s??l.width);const d=o();let u=c.y;d==="center"?u-=l.height/2:d==="bottom"&&(u-=l.height),t.style.setProperty("top",`${u}px`),t.style.setProperty("left",`${h}px`),t.style.setProperty("max-width",`${i.width-h}px`),t.style.setProperty("text-align",a),e.style.setProperty("text-align",r)}getBBox(){const{left:t,top:e,width:i,height:s}=this.element.getBoundingClientRect();return new T.BBox(t,e,i,s)}},{BOOLEAN:R$,BaseProperties:P$,TempValidate:oE,UNION:B$}=T,z$=B$(["x","y","xy"],"an axis type"),gD=class extends P${constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};y([oE(R$)],gD.prototype,"enabled",2),y([oE(z$,{optional:!0})],gD.prototype,"axes",2);var fD=(t=>(t.Line="line",t.HorizontalLine="horizontal-line",t.VerticalLine="vertical-line",t.DisjointChannel="disjoint-channel",t.ParallelChannel="parallel-channel",t.FibonacciRetracement="fibonacci-retracement",t.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",t.Callout="callout",t.Comment="comment",t.Note="note",t.Text="text",t.Arrow="arrow",t.ArrowUp="arrow-up",t.ArrowDown="arrow-down",t.DateRange="date-range",t.PriceRange="price-range",t.DatePriceRange="date-price-range",t.QuickDatePriceRange="quick-date-price-range",t))(fD||{}),F$=Object.values(fD);function _$(t){for(const e of F$)if(e===t)return e}var{BOOLEAN:Up,COLOR_STRING:yD,DATE:Yp,FONT_STYLE:G$,FONT_WEIGHT:V$,FUNCTION:j$,LINE_DASH:W$,LINE_STYLE:H$,NUMBER:Ec,OBJECT:Kp,OR:$p,POSITIVE_NUMBER:mD,RATIO:aE,STRING:hl,TEXT_ALIGN:U$,UNION:Lm,BaseProperties:dl,TempValidate:Ht,predicateWithMessage:Y$,generateUUID:K$}=T,$$=["value","groupPercentage"],Xp=Y$(t=>Rt(t)&&Object.keys(t).every(e=>$$.includes(e)),"objects with grouping value properties such as 'value' or 'groupPercentage'"),Zp=class extends dl{};y([Ht($p(hl,Ec,Yp,Xp))],Zp.prototype,"x",2),y([Ht($p(hl,Ec,Yp,Xp))],Zp.prototype,"y",2);var X$=class extends Ss(lr(hE(dl))){},xD=class extends Ss(lr(da(vD(Bc(dl))))){constructor(){super(...arguments),this.cornerRadius=2}};y([Ht(Up)],xD.prototype,"enabled",2),y([Ht(mD)],xD.prototype,"cornerRadius",2);var Z$=class extends da(dl){},Q$=class extends Ss(lr(da(dl))){},Rc=class extends Bc(dl){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};y([Ht(hl)],Rc.prototype,"label",2),y([Ht(Lm(["top","center","bottom"]),{optional:!0})],Rc.prototype,"position",2),y([Ht(Lm(["left","center","right"]),{optional:!0})],Rc.prototype,"alignment",2);var q$=class extends Bc(dl){},Qp=class extends Bc(dl){constructor(){super(...arguments),this.label=""}};y([Ht(hl)],Qp.prototype,"label",2),y([Ht(Lm(["top","inside","bottom"]),{optional:!0})],Qp.prototype,"position",2),y([Ht(Lm(["left","center","right"]),{optional:!0})],Qp.prototype,"alignment",2);function Pc(t){class e extends t6(hE(t)){constructor(){super(...arguments),this.id=K$()}isValidWithContext(s,n){return super.isValid(n)}}return e}function bD(t){class e extends t{constructor(){super(...arguments),this.start=new Zp,this.end=new Zp}}return y([Ht(Kp)],e.prototype,"start",2),y([Ht(Kp)],e.prototype,"end",2),e}function rE(t){class e extends t{}return y([Ht($p(hl,Ec,Yp,Xp))],e.prototype,"x",2),y([Ht($p(hl,Ec,Yp,Xp))],e.prototype,"y",2),e}function lE(t){class e extends t{}return y([Ht($p(hl,Ec,Yp,Xp))],e.prototype,"value",2),e}function SD(t){class e extends t{constructor(){super(...arguments),this.background=new Z$}}return y([Ht(Kp,{optional:!0})],e.prototype,"background",2),e}function ul(t){class e extends t{constructor(){super(...arguments),this.handle=new Q$}}return y([Ht(Kp,{optional:!0})],e.prototype,"handle",2),e}function cE(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new xD}}return y([Ht(Kp,{optional:!0})],e.prototype,"axisLabel",2),e}function vD(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return y([Ht(mD,{optional:!0})],e.prototype,"padding",2),y([Ht(U$,{optional:!0})],e.prototype,"textAlign",2),y([Ht(j$,{optional:!0})],e.prototype,"formatter",2),e}function J$(t){class e extends t{}return e}function MD(t){class e extends t{}return y([Ht(Up,{optional:!0})],e.prototype,"extendStart",2),y([Ht(Up,{optional:!0})],e.prototype,"extendEnd",2),e}function t6(t){class e extends t{}return y([Ht(Up,{optional:!0})],e.prototype,"locked",2),e}function DD(t){class e extends t{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return e}function hE(t){class e extends t{}return y([Ht(Up,{optional:!0})],e.prototype,"visible",2),e}function da(t){class e extends t{}return y([Ht(yD,{optional:!0})],e.prototype,"fill",2),y([Ht(aE,{optional:!0})],e.prototype,"fillOpacity",2),e}function Ss(t){class e extends t{}return y([Ht(yD,{optional:!0})],e.prototype,"stroke",2),y([Ht(aE,{optional:!0})],e.prototype,"strokeOpacity",2),y([Ht(Ec,{optional:!0})],e.prototype,"strokeWidth",2),e}function lr(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return y([Ht(W$,{optional:!0})],e.prototype,"lineDash",2),y([Ht(Ec,{optional:!0})],e.prototype,"lineDashOffset",2),y([Ht(H$,{optional:!0})],e.prototype,"lineStyle",2),e}function Bc(t){class e extends t{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return y([Ht(G$,{optional:!0})],e.prototype,"fontStyle",2),y([Ht(V$,{optional:!0})],e.prototype,"fontWeight",2),y([Ht(mD)],e.prototype,"fontSize",2),y([Ht(hl)],e.prototype,"fontFamily",2),y([Ht(yD,{optional:!0})],e.prototype,"color",2),e}function dE(t){return pe(t)||Ti(t)||Yo(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}function li(t){return dE(t)?.value}var{clampArray:e6}=T;function zs(t,e){if(t.start==null||t.end==null)return;const i=We(t.start,e),s=We(t.end,e);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function We(t,e){const i=cr(t.x,e.xAxis),s=cr(t.y,e.yAxis);return{x:i,y:s}}function cr(t,e){if(t==null)return 0;const{value:i,groupPercentage:s}=dE(t),{scale:n,snapToGroup:o}=e,a=n.bandwidth===0?n.step??0:n.bandwidth??0,r=o?a/2:a*s;return n.convert(i)+r}function Fs(t,e){const i=Nm(t.x,e.xAxis),s=Nm(t.y,e.yAxis);return{x:i,y:s}}function Nm(t,e){const{scale:i}=e;if(e.continuous&&i.step==null)return e.scaleInvert(t);const s=e.scaleInvertNearest(t),n=i.bandwidth===0?i.step:i.bandwidth??0,o=i.convert(s),a=o+n,r=e6(t,i.range),l=o===a?0:(r-o)/(a-o);return{value:s,groupPercentage:l}}var{BaseProperties:i6}=T,AD=class extends Pc(bD(ul(i6))){constructor(){super(...arguments),this.snapToAngle=45}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},{STRING:s6,TempValidate:n6}=T,uE=class extends DD(vD(Bc(AD))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;let e=this.text;return t&&(e=this.placeholderText??"",this.localeManager&&(e=this.localeManager.t(e))),{text:e,isPlaceholder:t}}getTextInputCoords(t,e){return We(this.end,t)}getTextPosition(){return this.position}};y([n6(s6)],uE.prototype,"text",2);var{STRING:o6,TempValidate:a6,Color:pE}=T,r6={top:6,right:12,bottom:9,left:12},Lo=class extends da(Ss(uE)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return Rt(t)&&t.type==="callout"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=pE.fromString(this.color??"#888888");return new pE(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return t==null?{...r6}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding(),n=s.left??0,o=s.bottom??0;return{x:i.x+n,y:i.y-o}}};y([a6(o6)],Lo.prototype,"type",2);var{STRING:l6,BaseProperties:c6,TempValidate:h6}=T,wm=class extends Pc(rE(ul(vD(Bc(c6))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;return{text:t?this.placeholderText??"":this.text,isPlaceholder:t}}getTextInputCoords(t,e){return We(this,t)}getTextPosition(){return this.position}};y([h6(l6)],wm.prototype,"text",2);var{STRING:d6,TempValidate:u6,Color:gE}=T,Om={top:8,right:14,bottom:8,left:14},ua=class extends da(Ss(wm)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return Rt(t)&&t.type==="comment"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=gE.fromString(this.color??"#888888");return new gE(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return t==null?{top:Math.max(e*.4,Om.top),bottom:Math.max(e*.4,Om.bottom),left:Math.max(e*.8,Om.left),right:Math.max(e*.8,Om.right)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};y([u6(d6)],ua.prototype,"type",2);var{Vec2:zc}=T;function qp(t,e){return t?"dashed":e??"solid"}function fE(t,e){switch(e){case"solid":return[];case"dashed":return[t*4,t*2];case"dotted":return[0,t*2]}}function Td(t,e,i,s){const n=qp(t,i);return e??t??fE(s??1,n)}function kd(t,e,i){const s=qp(e,i);return t??s==="dotted"?"round":void 0}function p6(t,e){const[i,s]=zc.from(t),n=e.height,o=zc.gradient(s,i,n),a=zc.intercept(s,o,n),r=[{x:i.x,y:n??0},{x:i.x,y:n==null?e.height:n-e.height}];if(o===1/0)return r;let l=[zc.intersectAtY(o,a,0,n),zc.intersectAtY(o,a,e.height,n),zc.intersectAtX(o,a,0,n),zc.intersectAtX(o,a,e.width,n)];return l=l.filter(c=>c.x>=e.x&&c.x<=e.width&&c.y>=e.y&&c.y<=e.height).sort((c,h)=>c.x===h.x?0:c.x<h.x?-1:1),l.length!==2?r:l}var{BOOLEAN:Em,OBJECT:Cd,STRING:Rm,BaseProperties:ID,TempValidate:Zs}=T,g6=class extends Ss(ID){},TD=class extends Bc(da(Ss(ID))){constructor(){super(...arguments),this.divider=new g6}};y([Zs(Cd,{optional:!0})],TD.prototype,"divider",2);var kD=class extends da(Ss(ul(ID))){constructor(){super(...arguments),this.statistics=new TD}};y([Zs(Cd,{optional:!0})],kD.prototype,"statistics",2);var Ld=class extends DD(SD(Ss(lr(AD)))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new TD,this.getVolume=()=>{},this.text=new Rc}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Td(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return kd(this.lineCap,this.lineDash,this.lineStyle)}};y([Zs(Cd,{optional:!0})],Ld.prototype,"statistics",2),y([Zs(Cd,{optional:!0})],Ld.prototype,"text",2);function CD(t){class e extends t{constructor(){super(...arguments),this.hasDateRange=!0}}return e}function LD(t){class e extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}return e}var $n=class extends CD(Ld){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return Rt(t)&&t.type==="date-range"}};y([Zs(Rm)],$n.prototype,"type",2),y([Zs(Em,{optional:!0})],$n.prototype,"extendAbove",2),y([Zs(Em,{optional:!0})],$n.prototype,"extendBelow",2);var Xn=class extends LD(Ld){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return Rt(t)&&t.type==="price-range"}};y([Zs(Rm)],Xn.prototype,"type",2),y([Zs(Em,{optional:!0})],Xn.prototype,"extendLeft",2),y([Zs(Em,{optional:!0})],Xn.prototype,"extendRight",2);var hr=class extends CD(LD(Ld)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return Rt(t)&&t.type==="date-price-range"}};y([Zs(Rm)],hr.prototype,"type",2);var mn=class extends CD(LD(Ld)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new kD,this.down=new kD,this.direction="both"}static is(t){return Rt(t)&&t.type==="quick-date-price-range"}};y([Zs(Rm)],mn.prototype,"type",2),y([Zs(Cd,{optional:!0})],mn.prototype,"up",2),y([Zs(Cd,{optional:!0})],mn.prototype,"down",2);var{TextWrapper:f6,CachedTextMeasurerPool:y6,BBox:m6}=T,Jp=1.38;function yE(t){return{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},textAlign:t.textAlign,textBaseline:t.position=="center"?"middle":t.position,lineHeight:Jp,avoidOrphans:!1,textWrap:"always"}}function Pm(t,e,i){return i?f6.wrapText(e,{...yE(t),maxWidth:i}):e}function x6(t,e){const i=yE(t),{lineMetrics:s,width:n}=y6.measureLines(e,i),o=s.length*(t.fontSize??14)*Jp;return{width:n,height:o}}function ND(t,e,i,s){let n=s?.width??0,o=s?.height??0;if(!s){const a=t.width!=null?Pm(t,e,t.width):e;({width:n,height:o}=x6(t,a))}return new m6(i.x,i.y,n,o)}function mE(t,e,i,s,{x:n,y:o},a){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=s,p=c*Jp;a??(a=s.position=="center"?"middle":s.position);const g=i?s.getPlaceholderColor():s.color;t.setProperties({x:n,y:o,visible:r,text:e,fill:g,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:a})}var{OBJECT:b6,STRING:S6,BaseProperties:v6,TempValidate:xE}=T,M6=10,D6=11,bE=20,A6=22,I6=10,SE=bE+I6,vE=34,T6=class extends da(Ss(v6)){},Qs=class extends da(Ss(wm)){constructor(){super(...arguments),this.type="note",this.background=new T6,this.position="bottom",this.alignment="center",this.width=200}static is(t){return Rt(t)&&t.type==="note"}getDefaultColor(t){switch(t){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(t){switch(t){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const t=this.padding??M6;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:s}=this,n=super.getTextInputCoords(t,e),o=this.getPadding().top,a=ND(this,s,n);a.x=ft(i/2,a.x,t.seriesRect.width-i/2);const r=a.y-SE-o*2,l=a.y+D6+o*2,c=Math.max(a.height,e);return r-c-vE<0?(a.y=l,this.position="top"):(a.y=r+o,this.position="bottom"),{x:a.x,y:a.y}}};y([xE(S6)],Qs.prototype,"type",2),y([xE(b6,{optional:!0})],Qs.prototype,"background",2);var{BaseProperties:k6}=T,C6=class extends Pc(rE(ul(k6))){isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},wD=class T_ extends da(C6){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof T_}getDefaultColor(e){return e==="fill-color"?this.fill:void 0}getDefaultOpacity(e){return e==="fill-color"?this.fillOpacity:void 0}},{ContinuousScale:ME}=T;function Fc(t,e,i={overflowContinuous:!1},s){let n=!0;return n&&(n=Nd(t,e.start,i,s&&`${s}[start] `)),n&&(n=Nd(t,e.end,i,s&&`${s}[end] `)),n}function DE(t,e,i){const s=e.direction==="horizontal"?t.yAxis:t.xAxis,n=OD(e.value,s);if(!n&&i){const o=li(e.value);$.warnOnce(`${i}is outside the axis domain, ignoring. - value: [${o}]]`)}return n}function Nd(t,e,i={overflowContinuous:!1},s){if(e.x==null||e.y==null)return s&&$.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:n,yAxis:o}=t,a=i.overflowContinuous&&ME.is(n.scale),r=i.overflowContinuous&&ME.is(o.scale),l=a||OD(e.x,n),c=r||OD(e.y,o);if(l&&c)return!0;if(s){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=li(e.x),u=li(e.y);$.warnOnce(`${s}is outside the ${h}, ignoring. - x: [${d}], y: ${u}]`)}return!1}function OD(t,e){const{domain:i}=e.scale,s=li(t);return i&&s!=null&&e.continuous?s>=i[0]&&s<=i.at(-1):!0}var{OBJECT:AE,STRING:IE,BaseProperties:TE,TempValidate:Bm}=T,vs=class extends Pc(lE(ul(cE(Ss(lr(TE)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Rc}static is(t){return Rt(t)&&t.type==="horizontal-line"}isValidWithContext(t,e){return super.isValid(e)&&DE(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Td(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return kd(this.lineCap,this.lineDash,this.lineStyle)}};y([Bm(IE)],vs.prototype,"type",2),y([Bm(AE,{optional:!0})],vs.prototype,"text",2);var pa=class extends Pc(lE(ul(cE(Ss(lr(TE)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Rc}static is(t){return Rt(t)&&t.type==="vertical-line"}isValidWithContext(t,e){return super.isValid(e)&&DE(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Td(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return kd(this.lineCap,this.lineDash,this.lineStyle)}};y([Bm(IE)],pa.prototype,"type",2),y([Bm(AE,{optional:!0})],pa.prototype,"text",2);var{NUMBER:kE,OBJECT:L6,STRING:N6,BaseProperties:w6,TempValidate:zm}=T,Zn=class extends Pc(SD(bD(ul(MD(Ss(lr(w6))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Qp,this.snapToAngle=45}static is(t){return Rt(t)&&t.type==="disjoint-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.startHeight,t.end.y-=this.endHeight):$.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&Fc(t,this,{overflowContinuous:!0},e)&&Fc(t,this.bottom,{overflowContinuous:!0},e)}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Td(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return kd(this.lineCap,this.lineDash,this.lineStyle)}};y([zm(N6)],Zn.prototype,"type",2),y([zm(kE)],Zn.prototype,"startHeight",2),y([zm(kE)],Zn.prototype,"endHeight",2),y([zm(L6,{optional:!0})],Zn.prototype,"text",2);var{OBJECT:O6,STRING:CE,TempValidate:ED}=T,Fm=class extends DD(J$(MD(Ss(lr(AD))))){constructor(){super(...arguments),this.text=new Rc}isValidWithContext(t,e){return super.isValid(e)&&Fc(t,this,void 0,e)}getDefaultColor(t){switch(t){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Td(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return kd(this.lineCap,this.lineDash,this.lineStyle)}};y([ED(O6,{optional:!0})],Fm.prototype,"text",2);var dr=class extends Fm{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return Rt(t)&&t.type==="arrow"}};y([ED(CE)],dr.prototype,"type",2);var ur=class extends Fm{constructor(){super(...arguments),this.type="line"}static is(t){return Rt(t)&&t.type==="line"}};y([ED(CE)],ur.prototype,"type",2);var{OBJECT:E6,BOOLEAN:RD,COLOR_STRING:R6,COLOR_STRING_ARRAY:P6,TempValidate:_c,predicateWithMessage:B6}=T,z6=[10,6,4],F6=B6(t=>Pt(t)&&z6.includes(t),"Number of fibonacci ranges, 10, 6 or 4"),pr=class extends Fm{constructor(){super(...arguments),this.label=new q$,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(t){switch(t){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};y([_c(E6,{optional:!0})],pr.prototype,"label",2),y([_c(RD,{optional:!0})],pr.prototype,"reverse",2),y([_c(RD,{optional:!0})],pr.prototype,"showFill",2),y([_c(RD,{optional:!0})],pr.prototype,"isMultiColor",2),y([_c(P6,{optional:!0})],pr.prototype,"strokes",2),y([_c(R6,{optional:!0})],pr.prototype,"rangeStroke",2),y([_c(F6,{optional:!0})],pr.prototype,"bands",2);var{STRING:_6,OBJECT:G6,TempValidate:LE}=T,ga=class extends pr{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new Zp}static is(t){return Rt(t)&&t.type==="fibonacci-retracement-trend-based"}isValidWithContext(t,e){return Fc(t,this,{overflowContinuous:!0},e)}};y([LE(_6)],ga.prototype,"type",2),y([LE(G6)],ga.prototype,"endRetracement",2);var{STRING:V6,TempValidate:j6}=T,gr=class extends pr{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return Rt(t)&&t.type==="fibonacci-retracement"}isValidWithContext(t,e){return Fc(t,this,{overflowContinuous:!0},e)}};y([j6(V6)],gr.prototype,"type",2);var{NUMBER:W6,STRING:H6,OBJECT:NE,BaseProperties:U6,TempValidate:_m}=T,Qn=class extends Pc(SD(bD(ul(MD(Ss(lr(U6))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new X$,this.text=new Qp,this.snapToAngle=45}static is(t){return Rt(t)&&t.type==="parallel-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.height,t.end.y-=this.height):$.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&Fc(t,this,{overflowContinuous:!0},e)&&Fc(t,this.bottom,{overflowContinuous:!0},e)}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Td(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return kd(this.lineCap,this.lineDash,this.lineStyle)}};y([_m(H6)],Qn.prototype,"type",2),y([_m(W6)],Qn.prototype,"height",2),y([_m(NE,{optional:!0})],Qn.prototype,"middle",2),y([_m(NE,{optional:!0})],Qn.prototype,"text",2);var{STRING:Y6,TempValidate:K6}=T,fr=class extends wm{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return Rt(t)&&t.type==="text"}};y([K6(Y6)],fr.prototype,"type",2);function pl(t){return mn.is(t)}function Gm(t){return ur.is(t)||vs.is(t)||pa.is(t)||dr.is(t)||wE(t)}function yr(t){return Zn.is(t)||Qn.is(t)}function wE(t){return gr.is(t)||ga.is(t)}function fa(t){return Lo.is(t)||ua.is(t)||Qs.is(t)||fr.is(t)}function tg(t){return $n.is(t)||Xn.is(t)||hr.is(t)||mn.is(t)}function PD(t){return fa(t)&&!Qs.is(t)}function gl(t){return Gm(t)||yr(t)||tg(t)&&!mn.is(t)}function $6(t){return Gm(t)||yr(t)||tg(t)||Lo.is(t)||Qs.is(t)}function X6(t){return Qs.is(t)}function Z6(t){return yr(t)||tg(t)||Lo.is(t)||ua.is(t)||wD.is(t)}function Q6(t){return fa(t)&&!Qs.is(t)}function wd(t){return(Gm(t)||yr(t)||tg(t))&&!pl(t)&&Rt(t.text)}function q6(t,e){"fontSize"in t&&(t.fontSize=e),wd(t)&&(t.text.fontSize=e)}function OE(t,e){const i=e?.strokeWidth??t.strokeWidth??1,s=e?.type??t.lineStyle,n=s??qp(t.lineDash,s),o=fE(i,n);t.strokeWidth=i,t.computedLineDash=o,t.lineStyle=n,t.lineCap=n==="dotted"?"round":void 0}function Vm(t,e,i,s,n,o){switch(e){case"fill-color":{"fill"in t&&(t.fill=s),"fillOpacity"in t&&(t.fillOpacity=n),"background"in t&&(t.background.fill=s,t.background.fillOpacity=n);break}case"line-color":{"axisLabel"in t&&(t.axisLabel.fill=s,t.axisLabel.fillOpacity=n,t.axisLabel.stroke=s,t.axisLabel.strokeOpacity=n),"fill"in t&&"fillOpacity"in t&&X6(t)?(t.fill=s,t.fillOpacity=n):("strokeOpacity"in t&&(t.strokeOpacity=n),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=o,t.rangeStroke=s):"stroke"in t&&(t.stroke=s));break}case"text-color":{"color"in t&&(t.color=i),wd(t)&&(t.text.color=s);break}}}var{deepClone:qn}=T,J6=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(fD).map(t=>[t,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:qn(this.colors),fontSizes:qn(this.fontSizes),lineStyles:qn(this.lineStyles),lineTextAlignments:qn(this.lineTextAlignments),lineTextPositions:qn(this.lineTextPositions),fibonacciOptions:qn(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=qn(i.colors),this.fontSizes=qn(i.fontSizes),this.lineStyles=qn(i.lineStyles),this.lineTextAlignments=qn(i.lineTextAlignments),this.lineTextPositions=qn(i.lineTextPositions),this.fibonacciOptions=qn(i.fibonacciOptions)}setDefaultColor(t,e,i,s,n,o){this.colors.get(t)?.set(e,[i,s,n,o])}setDefaultFontSize(t,e){this.fontSizes.set(t,e)}setDefaultLineStyleType(t,e){const i=this.lineStyles.get(t);i?i.type=e:this.lineStyles.set(t,{type:e})}setDefaultLineStyleWidth(t,e){const i=this.lineStyles.get(t);i?i.strokeWidth=e:this.lineStyles.set(t,{strokeWidth:e})}setDefaultLineTextAlignment(t,e){this.lineTextAlignments.set(t,e)}setDefaultLineTextPosition(t,e){this.lineTextPositions.set(t,e)}setDefaultFibonacciOptions(t,e,i){if(t!="fibonacci-retracement"&&t!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(t);s[e]=i,this.fibonacciOptions.set(t,s)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[s,[n,o,a,r]=[]]of i)n&&o&&a!=null&&r!=null&&Vm(t,s,n,o,a,r);for(const[e,i]of this.fontSizes)t.type!==e||i==null||q6(t,i);for(const[e,i]of this.lineStyles)t.type!==e||i==null||OE(t,i);for(const[e,i]of this.lineTextPositions)t.type!==e||i==null||(t.text.position=i);for(const[e,i]of this.lineTextAlignments)t.type!==e||i==null||(t.text.alignment=i);for(const[e,i]of this.fibonacciOptions)t.type!==e||i==null||Object.keys(i).forEach(s=>{const n=i[s];n!=null&&t.set({[s]:n})})}},tX='<div class="ag-charts-color-picker__palette" tabindex="0"></div><div class="ag-charts-color-picker__color-row"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field"><span class="ag-charts-color-picker__color-label">Color</span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',{Color:BD}=T,EE=t=>{try{const e=BD.fromString(t),[i,s,n]=e.toHSB();return[i,s,n,e.a]}catch{return}},RE=class extends T.AnchoredPopover{constructor(t,e){super(t,"color-picker",e),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(t){this.hasChanged=!1,this.onChangeHide=t.onChangeHide;const{element:e,initialFocus:i}=this.createColorPicker(t),s=this.showWithChildren([e],{initialFocus:i,...t});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(t){let e=t.isMultiColor??!1,[i,s,n,o]=EE(t.color??"#f00")??[0,1,.5,1];o=t.opacity??o;const a=Mt("div","ag-charts-color-picker__content");a.innerHTML=tX,a.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const r=a.querySelector(".ag-charts-color-picker__palette"),l=a.querySelector(".ag-charts-color-picker__hue-input"),c=a.querySelector(".ag-charts-color-picker__multi-color-button"),h=a.querySelector(".ag-charts-color-picker__alpha-input"),d=a.querySelector(".ag-charts-color-picker__color-input"),u=a.querySelector(".ag-charts-color-picker__color-label");c.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!t.hasMultiColorOption);const p=(m=!0)=>{const S=BD.fromHSB(i,s,n,o).toHexString();if(a.style.setProperty("--h",`${i}`),a.style.setProperty("--s",`${s}`),a.style.setProperty("--v",`${n}`),a.style.setProperty("--a",`${o}`),a.style.setProperty("--color",S.slice(0,7)),a.style.setProperty("--color-a",S),l.value=`${i}`,h.value=`${o}`,h.classList.toggle("ag-charts-color-picker__alpha-input--opaque",o===1),c.classList.toggle("ag-charts-color-picker__multi-color-button--active",e),u.classList.toggle("ag-charts-color-picker__color-label--multi-color",e),document.activeElement!==d&&(d.value=e?"Multi Colour":S.toUpperCase()),m||t.color==null){const M=BD.fromHSB(i,s,n,1).toHexString();t.onChange?.(S,M,o,e)}m&&(this.hasChanged=!0)};p(!1);const g=m=>m.preventDefault(),f=m=>m.stopPropagation(),x=m=>{m.preventDefault();const b=m.currentTarget;b.focus();const S=b.getBoundingClientRect(),M=({clientX:C,clientY:k})=>{e=!1,s=Math.min(Math.max((C-S.left)/S.width,0),1),n=1-Math.min(Math.max((k-S.top)/S.height,0),1),p()},D=()=>{window.removeEventListener("pointermove",M)};M(m),window.addEventListener("pointermove",M),window.addEventListener("pointerup",D,{once:!0})};return a.addEventListener("mousedown",f),a.addEventListener("touchstart",f),a.addEventListener("touchmove",f),a.addEventListener("keydown",m=>{switch(m.stopPropagation(),m.key){case"Enter":case"Escape":this.hide();break;default:return}m.preventDefault()}),r.addEventListener("pointerdown",x),r.addEventListener("touchstart",g,{passive:!1}),r.addEventListener("touchmove",g,{passive:!1}),r.addEventListener("keydown",m=>{if(m.key==="ArrowLeft")s=ft(0,s-.01,1);else if(m.key==="ArrowRight")s=ft(0,s+.01,1);else if(m.key==="ArrowUp")n=ft(0,n+.01,1);else if(m.key==="ArrowDown")n=ft(0,n-.01,1);else return;m.preventDefault(),p()}),c.addEventListener("click",()=>{e=!e,p()}),l.addEventListener("input",m=>{e=!1,i=m.currentTarget.valueAsNumber??0,p()}),h.addEventListener("input",m=>{e=!1,o=m.currentTarget.valueAsNumber??0,p()}),d.addEventListener("input",m=>{e=!1;const b=EE(m.currentTarget.value);b!=null&&([i,s,n,o]=b,p())}),d.addEventListener("blur",()=>p()),d.addEventListener("keydown",m=>{m.key==="Enter"&&(m.currentTarget.blur(),p())}),{element:a,initialFocus:r}}};function PE(t){return!(t instanceof T.LogScale)&&!(t instanceof T.BandScale)}var eX=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:PE},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:PE}],iX=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],sX=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],nX=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],oX=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],aX=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],BE=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],eg=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],zE=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{ARRAY:rX,BOOLEAN:lX,NUMBER:cX,OBJECT:hX,STRING:dX,UNION:uX,Color:FE,FloatingToolbar:pX,Listeners:gX,Menu:zD,PropertiesArray:fX,ToolbarButtonProperties:_E,ToolbarButtonWidget:yX,TempValidate:Gc}=T,Od=class extends _E{constructor(){super(...arguments),this.checkedOverrides=new _E}};y([Gc(uX(["line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings","lock"]))],Od.prototype,"value",2),y([Gc(hX,{optional:!0})],Od.prototype,"checkedOverrides",2),y([Gc(dX,{optional:!0})],Od.prototype,"color",2),y([Gc(cX,{optional:!0})],Od.prototype,"strokeWidth",2),y([Gc(Boolean,{optional:!0})],Od.prototype,"isMultiColor",2);var mX=class extends yX{update(t){super.update(t),t.value==="line-stroke-width"&&this.updateLineStrokeWidth(t),(t.value==="fill-color"||t.value==="line-color"||t.value==="text-color")&&this.updateFillColor(t)}updateFillColor(t){const e=this.getElement();e.classList.add("ag-charts-annotations__color-picker-button"),e.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",t.isMultiColor),e.style.setProperty("--color",t.color??null)}updateLineStrokeWidth(t){const e=this.getElement();e.classList.add("ag-charts-annotations__stroke-width-button"),e.style.setProperty("--stroke-width",`${t.strokeWidth}px`)}},xX=class extends pX{createButtonWidget(){return new mX(this.localeManager)}},FD=class extends T.BaseProperties{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new fX(Od),this.destroyFns=[],this.events=new gX,this.visibleButtons=[],this.toolbar=new xX(this.ctx,"annotation-options"),this.colorPicker=new RE(this.ctx),this.textSizeMenu=new zD(this.ctx,"text-size"),this.lineStyleTypeMenu=new zD(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new zD(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),t.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),t.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(t){if(!this.enabled)return;const e={"line-style-type":gl(t),"line-stroke-width":gl(t),"line-color":$6(t),"text-color":Q6(t),"fill-color":Z6(t),"text-size":PD(t),settings:wd(t),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>e[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(t)}setAnchorScene(t){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(t.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(t){this.updateColorPickerColor("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("text-color",t.getDefaultColor("text-color"),t.getDefaultOpacity("text-color"),"isMultiColor"in t&&t?.isMultiColor)}updateColorPickerColor(t,e,i,s){if(e!=null&&i!=null){const{r:n,g:o,b:a}=FE.fromString(e);e=FE.fromArray([n,o,a,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:s})}updateFontSize(t){this.updateButtonByValue("text-size",{label:t!=null?String(t):void 0})}updateLineStyleType(t){this.updateButtonByValue("line-style-type",{icon:t.icon})}updateStrokeWidth(t){this.updateButtonByValue("line-stroke-width",{label:t.label,strokeWidth:t.value})}dispatch(t,e){this.events.dispatch(t,e)}onButtonPress({event:t,button:e}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),e.value){case"line-style-type":{const s=gl(i)?qp(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:eg,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onLineStyleTypeMenuPress(n,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=gl(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:BE,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onLineStrokeWidthMenuPress(n,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(e.index),this.colorPicker.show({color:i?.getDefaultColor(e.value),opacity:i?.getDefaultOpacity(e.value),sourceEvent:t.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:i!=null?this.onColorPickerChange.bind(this,e.value,i):void 0,onChangeHide:(s=>{this.dispatch("saved-color",{type:i.type,colorPickerType:e.value,color:i.getDefaultColor(s)})}).bind(this,e.value)});break}case"text-size":{const s=fa(i)?i.fontSize:void 0;this.textSizeMenu.show({items:zE,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onTextSizeMenuPress(n,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.dispatch("pressed-delete");break}case"lock":{i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break}case"settings":{this.toolbar.toggleActiveButtonByIndex(e.index),this.dispatch("pressed-settings",t);break}}}onToolbarMoved(t){const{buttonBounds:e,popoverBounds:i}=t,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[o,a]of e.entries()){const r=this.visibleButtons.at(o);if(!r)continue;const l={x:a.x,y:a.y+a.height-1},c={y:a.y};switch(r.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(t,e,i,s,n,o){this.dispatch("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:s,opacity:n,isMultiColor:o}),this.updateColorPickerColor(t,i,n,o)}onTextSizeMenuPress(t,e){if(!PD(e))return;const i=t.value;this.dispatch("updated-font-size",{type:e.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(t,e){if(!gl(e))return;const i=t.value;this.dispatch("updated-line-style",{type:e.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(t)}onLineStrokeWidthMenuPress(t,e){if(!gl(e))return;const i=t.value;this.dispatch("updated-line-width",{type:e.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(t)}refreshButtons(t){const e=t.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,e),this.updateButtonByIndex(i,e?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!e));PD(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!gl(t))return;const e=t.strokeWidth??1,i=qp(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(eg.find(s=>s.value===i)??eg[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(s=>s.value===t);i!==-1&&this.updateButtonByIndex(i,e)}updateButtonByIndex(t,e){const i=this.visibleButtons.at(t);i&&this.toolbar.updateButtonByIndex(t,{...i.toJson(),...e,value:e.value??i.value})}};y([Gc(lX)],FD.prototype,"enabled",2),y([Gc(rX)],FD.prototype,"buttons",2);var{StateMachine:GE,StateMachineProperty:_D,Vec2:VE,Debug:bX}=T,ci=class extends GE{constructor(t){const e=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),t.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:e,keyUp:e,drag:({offset:i,context:s})=>{this.hasMoved=VE.lengthSquared(VE.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),t.update()},dragEnd:{target:GE.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=bX.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};y([_D()],ci.prototype,"snapping",2),y([_D()],ci.prototype,"datum",2),y([_D()],ci.prototype,"node",2);var{STRING:SX,TempValidate:vX}=T,fl=class extends wD{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return Rt(t)&&t.type==="arrow-down"}};y([vX(SX)],fl.prototype,"type",2);var jE=class k_ extends T.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-i.x,y:e.y-i.y}}}toggleActive(e){this.active=e,e||(this.handle.strokeWidth=k_.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,i){return this.handle.containsPoint(e,i)}};jE.INACTIVE_STROKE_WIDTH=2;var yl=jE,GD=class C_ extends yl{constructor(){super(),this.handle=new T.Marker({shape:"circle"}),this.glow=new T.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=C_.HANDLE_SIZE,this.handle.strokeWidth=yl.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:yl.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};GD.HANDLE_SIZE=7,GD.GLOW_SIZE=9;var ml=GD,jm=class rn extends yl{constructor(){super(),this.handle=new T.Rect,this.glow=new T.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=rn.CORNER_RADIUS,this.handle.width=rn.HANDLE_SIZE,this.handle.height=rn.HANDLE_SIZE,this.handle.strokeWidth=yl.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=rn.CORNER_RADIUS,this.glow.width=rn.GLOW_SIZE,this.glow.height=rn.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){if(super.toggleLocked(e),e){const i=(rn.HANDLE_SIZE-ml.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=ml.HANDLE_SIZE,this.handle.height=ml.HANDLE_SIZE,this.glow.width=ml.GLOW_SIZE,this.glow.height=ml.GLOW_SIZE}else this.handle.cornerRadius=rn.CORNER_RADIUS,this.handle.width=rn.HANDLE_SIZE,this.handle.height=rn.HANDLE_SIZE,this.glow.width=rn.GLOW_SIZE,this.glow.height=rn.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(e){if(this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked){delete e.fill,delete e.strokeWidth;const i=(rn.HANDLE_SIZE-ml.HANDLE_SIZE)/2;e.x-=i,e.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(e),this.glow.setProperties({...e,x:(e.x??this.glow.x)-2,y:(e.y??this.glow.y)-2,strokeWidth:0,fill:e.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};jm.HANDLE_SIZE=12,jm.GLOW_SIZE=16,jm.CORNER_RADIUS=4;var Ed=jm,VD=class lf extends yl{constructor(){super(),this.handle=new T.Marker({shape:"circle"}),this.glow=new T.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=lf.HANDLE_SIZE,this.handle.strokeWidth=yl.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=lf.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){super.toggleLocked(e),e?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=ml.HANDLE_SIZE,this.glow.size=ml.GLOW_SIZE):(this.handle.size=lf.HANDLE_SIZE,this.glow.size=lf.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};VD.HANDLE_SIZE=11,VD.GLOW_SIZE=17;var He=VD,{ZIndexMap:MX}=T,Wi=class extends T.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=MX.CHART_ANNOTATION}static isCheck(t,e){return Rt(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t){this.toggleHandles(t)}*nonHandleChildren(){for(const t of this.children())t instanceof yl||(yield t)}computeBBoxWithoutHandles(){return T.Transformable.toCanvas(this,T.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(t,e,i){if(!i&&e){this.removeChild(e);return}return i&&e==null&&(e=new t,this.appendChild(e)),e}},{ContinuousScale:DX,Vec2:Jn,toRadians:AX}=T;function ig(t,e,i=!1,s,n=1){if(!i)return Fs(t,e);const o=s?We(s,e):Jn.origin();return Fs(Wm(t,o,n),e)}function Wm(t,e,i){const s=Jn.sub(t,e),n=AX(i),o=Math.round(Jn.angle(s)/n)*n;return Jn.rotate(s,o,e)}function Hm(t,e){const i={};for(const[s,n]of ke(t))i[s]=We(n,e);return i}function mr(t,e,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:n,yAxis:o}=i,a=Object.keys(t),r=[],l=[],c=new Set(s.translateVectors??a),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),u=Jn.multiply(e,Jn.from(1,-1));for(const m of a)d.has(m)&&(t[m]=Jn.add(t[m],h.has(m)?u:e),s.snap&&(t[m]=Wm(t[m],s.snap.vectors[m],s.snap.angle))),r.push(n.getRangeOverflow(t[m].x)),l.push(o.getRangeOverflow(t[m].y));const p=(m,b)=>Math.abs(m)-Math.abs(b),g=(m,b,S)=>s.overflowContinuous===0||!DX.is(m)?S.toSorted(p).at(-1)??0:a.length===d.size?S.toSorted(p).at(-s.overflowContinuous-1)??0:S.filter(D=>D!==0).length<=s.overflowContinuous?0:S.filter((D,C)=>D!==0&&Math.abs(D)<=Math.abs(b)&&d.has(a[C])).toSorted(p).at(-1)??0,f=Jn.from(g(n.scale,e.x,r),g(o.scale,e.y,l));if(!Jn.equal(f,Jn.origin()))for(const m of a)d.has(m)&&(t[m]=Jn.round(Jn.sub(t[m],f),4));const x={};for(const m of a)x[m]=Fs(t[m],i);return x}var{Vec2:IX}=T,WE=class extends Wi{constructor(){super(...arguments),this.handle=new He,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=We(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...Hm({handle:t},i)}}drag(t,e,i){const{dragState:s}=this;if(t.locked||!s)return;const{point:n}=mr({point:s.handle},IX.sub(e,s.offset),i);t.x=n.x,t.y=n.y}translate(t,e,i){if(t.locked)return;const{point:s}=mr({point:We(t,i)},e,i);t.x=s.x,t.y=s.y}toggleHandles(t){this.handle.visible=!!t,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(t){this.toggleHandles(t),this.handle.toggleActive(t)}stopDragging(){this.handle.toggleDragging(!1)}copy(t,e,i){const s=We(t,i),n=Fs({x:s.x-30,y:s.y-30},i);return e.x=n.x,e.y=n.y,e}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(t,e){if(this.handle.containsPoint(t,e))return"handle"}updateHandle(t,e,i){const{x:s,y:n}=this.getHandleCoords(t,e,i),o=this.getHandleStyles(t);this.handle.update({...o,x:s,y:n}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const s=this.getHandleCoords(t,e);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i){return{x:e.x,y:e.y}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},HE=class extends WE{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=We(t,e);this.updateShape(t,i)}updateShape(t,e){this.updateShapeStyles(t),this.updateShapePath(t,e)}updateShapeStyles(t){const{shape:e}=this;e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}updateShapePath(t,e){const{shape:i}=this;i.x=e.x,i.y=e.y,i.size=t.size}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}getNodeAtCoords(t,e){return this.shape.containsPoint(t,e)?"shape":super.getNodeAtCoords(t,e)}},UE=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function YE(t){T.drawMarkerUnitPolygon(t,UE)}YE.anchor={x:.5,y:0};var Um=class extends HE{constructor(){super(),this.type="arrow-up",this.shape=new T.Marker({shape:YE}),this.append([this.shape])}static is(t){return Wi.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=He.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y-=i,s}},TX=UE.map(([t,e])=>[t,1-e]);function KE(t){T.drawMarkerUnitPolygon(t,TX)}KE.anchor={x:.5,y:1};var Ym=class extends HE{constructor(){super(),this.type="arrow-down",this.shape=new T.Marker({shape:KE}),this.append([this.shape])}static is(t){return Wi.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i);return s.y-=t.size,s}getHandleCoords(t,e){const i=He.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y+=i,s}},{StateMachine:Km,StateMachineProperty:kX,Debug:CX}=T,jD=class extends Km{constructor(t){const e=({point:s})=>{const n=this.createDatum();n.set({x:s.x,y:s.y}),t.create(n)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},cancel:Km.parent,reset:Km.parent},"waiting-first-render":{render:{target:Km.parent,action:i}}}),this.debug=CX.create(!0,"annotations")}};y([kX()],jD.prototype,"node",2);var LX=class extends jD{createDatum(){return new fl}},$E={type:"arrow-down",datum:fl,scene:Ym,isDatum:fl.is,translate:(t,e,i,s)=>{fl.is(e)&&Ym.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(fl.is(e)&&fl.is(i)&&Ym.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{fl.is(e)&&Ym.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new LX({...t,create:e("arrow-down")}),dragState:t=>new ci(t)},{STRING:NX,TempValidate:wX}=T,xl=class extends wD{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return Rt(t)&&t.type==="arrow-up"}};y([wX(NX)],xl.prototype,"type",2);var OX=class extends jD{createDatum(){return new xl}},XE={type:"arrow-up",datum:xl,scene:Um,isDatum:xl.is,translate:(t,e,i,s)=>{xl.is(e)&&Um.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(xl.is(e)&&xl.is(i)&&Um.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{xl.is(e)&&Um.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new OX({...t,create:e("arrow-up")}),dragState:t=>new ci(t)},{Vec2:EX,Vec4:ZE}=T,QE=class extends Wi{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:t,y1:e,x2:i,y2:s},n,o){const a={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const[r,l]=p6(a,o.yAxis.bounds),c=a.x2<a.x1,h=a.y1>=a.y2,d=a.x2===a.x1;return n.extendEnd&&(d?a.y2=h?l.y:r.y:(a.x2=c?r.x:l.x,a.y2=c?r.y:l.y)),n.extendStart&&(d?a.y1=h?r.y:l.y:(a.x1=c?l.x:r.x,a.y1=c?l.y:r.y)),a}dragStart(t,e,i){this.dragState={offset:e,...Hm({start:t.start,end:t.end},i)}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints(t,s.start,s.end,EX.sub(e,s.offset),i)}translate(t,e,i){t.locked||this.translatePoints(t,We(t.start,i),We(t.end,i),e,i)}copy(t,e,i){const s=zs(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),o={x:-n.width/2,y:-n.height/2};return this.translatePoints(e,ZE.start(s),ZE.end(s),o,i),e}translatePoints(t,e,i,s,n){const o=this.getTranslatePointsVectors(e,i),a=mr(o,s,n,{overflowContinuous:this.overflowContinuous});t.start.x=a.start.x,t.end.x=a.end.x,t.start.y=a.start.y,t.end.y=a.end.y}getTranslatePointsVectors(t,e){return{start:t,end:e}}},{Vec2:RX,Vec4:qE}=T,WD=class extends QE{constructor(){super(...arguments),this.start=new He,this.end=new He,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=zs(t,e);i!=null&&(this.updateHandles(t,i),this.updateAnchor(t,i,e))}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of ke(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}dragHandle(t,e,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=n==="start"?"end":"start",r=s?{vectors:{[n]:We(t[a],i)},angle:t.snapToAngle}:void 0,{[n]:l}=mr({[n]:o[n]},RX.sub(e,o.offset),i,{overflowContinuous:0,snap:r});t[n].x=l.x,t[n].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):!1}getNodeAtCoords(t,e){if(this.start.containsPoint(t,e)||this.end.containsPoint(t,e))return"handle"}updateHandles(t,e,i){this.start.update({...this.getHandleStyles(t,"start"),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t,"end"),...this.getHandleCoords(t,e,"end",i)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}updateAnchor(t,e,i,s){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,s){return i==="start"?qE.start(e):qE.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},{Vec4:JE}=T,PX=class extends WD{constructor(){super(...arguments),this.label=new T.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualStartEndScene")}update(t,e){const i=zs(t,e);if(i==null)return;const s=this.getTextBBox(t,i);this.updateLabel(t,s,i),this.updateHandles(t,i,s),this.updateShape(t,s,i),this.updateAnchor(t,i,e,s)}containsPoint(t,e){return super.containsPoint(t,e)||this.label.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e){const{text:i}=t.getText();return ND(t,i,JE.end(e),this.textInputBBox)}updateLabel(t,e,i){const{text:s,isPlaceholder:n}=t.getText();mE(this.label,s,n,t,this.getLabelCoords(t,e,i))}updateShape(t,e,i){}getLabelCoords(t,e,i){return JE.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner:BX,Path:zX}=T,$m=class extends PX{constructor(){super(),this.type="callout",this.shape=new zX,this.append([this.shape,this.label,this.start,this.end])}static is(t){return Wi.isCheck(t,"callout")}drag(t,e,i,s){t.locked||(this.activeHandle==="end"?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const s=t.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:n.x+s.left,y:n.y-s.bottom}}getHandleStyles(t,e){return e==="start"?{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(t,e,i,s){const{bodyBounds:n}=this.getDimensions(t,s,e)??{},o=n??s;this.anchor={x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y-o.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:s}=this;s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeWidth=t.strokeWidth??1,s.strokeOpacity=t.strokeOpacity??1;const{tailPoint:n,bodyBounds:o}=this.getDimensions(t,e,i)??{};!n||!o||this.updatePath(n,o)}updatePath(t,e){const{x:i,y:s}=t,{x:n,y:o,width:a,height:r}=e,l=o-r,c=n+a,h=this.calculateCalloutPlacement({x:i,y:s},e),d=8,u=[{coordinates:{x0:n,x1:n+d,y0:l+d,y1:l,cx:h==="topLeft"?i:n+d,cy:h==="topLeft"?s:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:n+d,x1:c-d,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?s:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:o-d,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:o-d,y1:o,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?s:o-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:n+d,y0:o,y1:o,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:n+d,x1:n,y0:o,y1:o-d,cx:h==="bottomLeft"?i:n+d,cy:h==="bottomLeft"?s:o-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:o-d,y1:l+d,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(n,l+d),u.forEach(({coordinates:g,type:f})=>{this.drawPath(p,g,d,f)}),p.closePath()}drawPath(t,{x0:e,y0:i,x1:s,y1:n,cx:o,cy:a},r,l){switch(l){case"calloutCorner":{t.lineTo(o,a),t.lineTo(s,n);break}case"corner":{BX(t,{x0:e,x1:s,y0:i,y1:n,cx:o,cy:a},r,!1);break}case"calloutSide":{if(e!==s){const h=e>s?-1:1,d=Math.min(e,s)+Math.abs(s-e)/2;t.lineTo(d-6*h,i),t.lineTo(o,a),t.lineTo(d+6*h,i),t.lineTo(s,n)}else{const h=i>n?-1:1,d=Math.min(i,n)+Math.abs(i-n)/2;t.lineTo(e,d-6*h),t.lineTo(o,a),t.lineTo(e,d+6*h),t.lineTo(s,n)}break}case"side":default:{t.lineTo(s,n);break}}}calculateCalloutPlacement(t,e){const i=e.x+e.width,s=e.y-e.height;let n,o;return t.x>i?n="right":t.x<e.x&&(n="left"),t.y>e.y?o="bottom":t.y<s&&(o="top"),n&&o?`${o}${n[0].toUpperCase()}${n.substring(1)}`:o??n}getDimensions(t,e,i){const{fontSize:s}=t,n=t.getPadding(),o=n.left+n.right,a=n.top+n.bottom,r=e.width+o,l=Math.max(e.height+a,s+a);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:e.x,y:e.y,width:r,height:l}}}containsPoint(t,e){const{start:i,end:s,shape:n}=this;if(this.activeHandle=void 0,i.containsPoint(t,e))return this.activeHandle="start",!0;const o=s.containsPoint(t,e)||n.containsPoint(t,e);return o&&(this.activeHandle="end"),o}};function HD({key:t}){return t==="Escape"}function UD({key:t,shiftKey:e}){return!e&&t==="Enter"}var{StateMachine:No,StateMachineProperty:t2,Debug:FX}=T,YD=class extends No{constructor(t){const e=({point:u})=>{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),t.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},s=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},o=u=>{this.node?.setTextInputBBox(u),t.update()},a=({point:u})=>{const{datum:p,node:g}=this;p?.set({end:u}),g?.toggleActive(!0),g?.toggleHandles({end:!1}),t.update()},r=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:g,opacity:f,isMultiColor:x})=>{const{datum:m}=this;m&&(u==="text-color"&&t.updateTextInputColor(g),Vm(m,u,p,g,f,x),t.update())},c=u=>{const{datum:p,node:g}=this;!p||!g||!fa(p)||(p.fontSize=u,t.updateTextInputFontSize(u),t.update())},h=()=>{t.delete()},d=({textInputValue:u,bbox:p})=>{const{datum:g}=this;if(p!=null&&u!=null&&u.length>0){if(!fa(g))return;const f=Pm(g,u,p.width);g?.set({text:f}),t.update(),t.recordAction(`Create ${g?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:No.parent,reset:No.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:a,drag:a,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:No.parent,action:h},cancel:{target:No.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:o,color:l,fontSize:c,textInput:[{guard:HD,target:No.parent,action:h},{guard:UD,target:No.parent,action:d}],click:{target:No.parent,action:d},dragStart:{target:No.parent,action:d},resize:{target:No.parent,action:d},onExit:n,cancel:{target:No.parent,action:h}}}),this.debug=FX.create(!0,"annotations")}};y([t2()],YD.prototype,"datum",2),y([t2()],YD.prototype,"node",2);var _X=class extends YD{createDatum(){return new Lo}},e2={type:"callout",datum:Lo,scene:$m,isDatum:Lo.is,translate:(t,e,i,s)=>{if(Lo.is(e)&&$m.is(t))return t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Lo.is(e)&&Lo.is(i)&&$m.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Lo.is(e)&&$m.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new _X({...t,create:e("callout")}),dragState:t=>new ci(t)},KD=class extends WE{constructor(){super(...arguments),this.label=new T.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualPointScene")}update(t,e){const i=We(t,e),s=this.getTextBBox(t,i,e);this.updateLabel(t,s),this.updateHandle(t,i,s),this.updateShape(t,s),this.anchor=this.updateAnchor(t,s,e)}copy(t,e,i){const s=We(t,i),n=this.getTextBBox(t,s,i),o=t.getPadding(),a=o.left+o.right,r=o.top+o.bottom,l=(n.width+a)/2,c=n.height+r,h=Fs({x:s.x-l,y:s.y-c},i);return e.x=h.x,e.y=h.y,e}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.visible&&i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.visible&&this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e,i){const{text:s}=t.getText();return ND(t,s,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e){const{text:i,isPlaceholder:s}=t.getText();mE(this.label,i,s,t,this.getLabelCoords(t,e),this.getTextBaseline(t))}updateShape(t,e){}updateAnchor(t,e,i){return{x:e.x+i.seriesRect.x,y:e.y+i.seriesRect.y-e.height,position:this.anchor.position}}getLabelCoords(t,e){return e}getTextBaseline(t){return t.position=="center"?"middle":t.position}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:$D}=T,Xm=class extends KD{constructor(){super(),this.type="comment",this.shape=new T.Path,this.append([this.shape,this.label,this.handle])}static is(t){return Wi.isCheck(t,"comment")}updateShape(t,e){const{shape:i}=this;i.fill=t.fill,i.fillOpacity=t.fillOpacity??1,i.stroke=t.stroke??"transparent",i.strokeWidth=t.strokeWidth??1,i.strokeOpacity=t.strokeOpacity??1,this.updatePath(t,e)}getLabelCoords(t,e){const i=t.getPadding();return{x:e.x+i.left,y:e.y-i.bottom}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i),n=t.getPadding();return s.y-=n.bottom+n.top,s}updatePath(t,e){const i=t.getPadding(),{x:s,y:n}=e;let{width:o,height:a}=e;const{fontSize:r}=t,l=i.left+i.right,c=i.top+i.bottom;o=o+l,a=Math.max(a+c,r+c);const h=n-a,d=s+o,u=(r*Jp+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,h+u),$D(p,{x0:s,x1:s+u,y0:h+u,y1:h,cx:s+u,cy:h+u},u,!1),p.lineTo(d-u,h),$D(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,n-u),$D(p,{x0:d,x1:d-u,y0:n-u,y1:n,cx:d-u,cy:n-u},u,!1),p.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}},{StateMachine:xr,StateMachineProperty:i2,Debug:GX}=T,sg=class extends xr{constructor(t){const e=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),t.create(d)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()},s=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},o=h=>{this.node?.setTextInputBBox(h),t.update()},a=({colorPickerType:h,colorOpacity:d,color:u,opacity:p,isMultiColor:g})=>{this.datum&&(h==="text-color"&&t.updateTextInputColor(u),Vm(this.datum,h,d,u,p,g),t.update())},r=h=>{const{datum:d,node:u}=this;!d||!u||!fa(d)||(d.fontSize=h,t.updateTextInputFontSize(h),t.update())},l=()=>{t.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!fa(u))return;const p=Pm(u,h,d.width);u?.set({text:p}),t.update(),t.recordAction(`Create ${u?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:xr.parent,reset:xr.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:o,color:a,fontSize:r,textInput:[{guard:HD,target:xr.parent,action:l},{guard:UD,target:xr.parent,action:c}],click:{target:xr.parent,action:c},dragStart:{target:xr.parent,action:c},resize:{target:xr.parent,action:c},onExit:n,cancel:{target:xr.parent,action:l}}}),this.debug=GX.create(!0,"annotations")}};y([i2()],sg.prototype,"datum",2),y([i2()],sg.prototype,"node",2);var VX=class extends sg{createDatum(){return new ua}},s2={type:"comment",datum:ua,scene:Xm,isDatum:ua.is,translate:(t,e,i,s)=>{ua.is(e)&&Xm.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ua.is(e)&&ua.is(i)&&Xm.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ua.is(e)&&Xm.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new VX({...t,create:e("comment")}),dragState:t=>new ci(t)},{calculateLabelTranslation:jX,ChartAxisDirection:WX}=T,n2=class extends T.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new T.Text({zIndex:1}),this.rect=new T.Rect;const{label:t}=this;t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.textBaseline="middle",t.textAlign="center",this.append([this.rect,this.label])}update(t){this.updateLabel(t),this.updateRect(t),this.updatePosition(t)}updateLabel({value:t,styles:e,context:i}){const{fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,color:l="white",formatter:c}=e,h=c?c({value:t}):i.scaleValueFormatter()(t);this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,fill:l,text:h})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:o,strokeOpacity:a}=t;e.setProperties({cornerRadius:i,fill:s,fillOpacity:n,stroke:o,strokeOpacity:a})}updatePosition({x:t,y:e,context:i,styles:{padding:s}}){const{label:n,rect:o}=this,a=n.getBBox()?.clone(),r=s??8,l=s??5;a.grow(r,"horizontal"),a.grow(l,"vertical");const c=i.direction===WX.X?Math.round(l/2):r,{xTranslation:h,yTranslation:d}=jX({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:a}),u=t+h,p=e+d;n.x=u,n.y=p,o.y=p-Math.round(a.height/2),o.x=u-Math.round(a.width/2),o.height=a.height,o.width=a.width}};n2.className="AxisLabel";var{Vec2:ya}=T,qs=class extends T.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(t,e){return super.setProperties(t,e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:t,strokeWidth:e,x1:i,y1:s,x2:n,y2:o}=this;let a=e+t;a%2===0&&(a+=1);const r=ya.from(i,s-Math.floor(a/2)),l=ya.from(n,o),c=ya.distance(r,l);this.collisionBBox=new T.BBox(r.x,r.y,c,a)}isPointInPath(t,e){const{collisionBBox:i,x1:s,y1:n,x2:o,y2:a}=this;if(!i)return!1;const r=ya.from(s,n),l=ya.from(o,a),c=ya.sub(ya.from(t,e),r),h=ya.sub(l,r),d=ya.rotate(c,ya.angle(c,h),r);return i.containsPoint(d.x,d.y)??!1}render(t){this.applyClipMask(t.ctx),super.render(t),this.closeClipMask(t.ctx)}setClipMask(t,e){const i=this.clipMask.get(t);T.jsonDiff(i,e)!=null&&this.markDirty("CollidableLine"),e?this.clipMask.set(t,e):this.clipMask.delete(t)}applyClipMask(t){const{clipMask:e}=this;e.size!==0&&this.clipMask.forEach(i=>{const{x:s,y:n,radius:o}=i;t.save(),t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height),t.ellipse(s,n,o,o,0,Math.PI*2,0,!0),t.clip()})}closeClipMask(t){this.clipMask.size!==0&&t.restore()}},Vc=class extends T.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}},{Vec2:Ms}=T;function Rd(t,e,i,s,n,o,a){if(!o||!n||!s){e.setClipMask(t);return}const{alignment:r,position:l}=s,c=a2(i,s.fontSize,a),{point:h,textBaseline:d}=r2(c,l,r);l2(n,o,s,h,c.angle,d);const{x:u,y:p,width:g,height:f}=n.getBBox(),x=Ms.length(Ms.from(g,f)),m={x:u+g/2,y:p+f/2,radius:x/2+Ms.length(c.offset)};return l==="center"?e.setClipMask(t,m):e.setClipMask(t),{clipMask:m,numbers:c}}function o2(t,e,i,s,n,o,a){if(!a||!o)return;const{alignment:r,position:l}=s,[c,h]=e.y1<=i.y1?[e,i]:[i,e];let d=c;l==="bottom"?d=h:l==="inside"&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=a2(d,s.fontSize,n),{point:p,textBaseline:g}=r2(u,l==="inside"?"center":l,r,t);l2(o,a,s,p,u.angle,g)}function a2(t,e,i){let[s,n]=Ms.from(t);s.x>n.x&&([s,n]=[n,s]);const o=Ms.normalized(Ms.sub(n,s)),a=Ms.angle(o),r=Ms.multiply(o,He.HANDLE_SIZE/2+(e??14)/2),l=Ms.multiply(o,(i??2)/2+(e??14)/3);return{left:s,right:n,normal:o,angle:a,inset:r,offset:l}}function r2({left:t,right:e,normal:i,angle:s,inset:n,offset:o},a,r,l){let c;r==="right"?c=Ms.sub(e,n):r==="center"?c=Ms.add(t,Ms.multiply(i,Ms.distance(t,e)/2)):c=Ms.add(t,n);let h="bottom";return a==="bottom"?(c=Ms.rotate(o,s+Math.PI/2,c),h="top"):a==="center"&&!l?h="middle":c=Ms.rotate(o,s-Math.PI/2,c),{point:c,textBaseline:h}}function l2(t,e,i,s,n,o){t.setProperties({text:e,x:s.x,y:s.y,rotation:n,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:o})}var{ChartAxisDirection:HX,Vec2:jc,Vec4:XD}=T,bl=class extends Wi{constructor(){super(),this.type="cross-line",this.line=new qs,this.middle=new Ed,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return Wi.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=vs.is(t);const s=this.isHorizontal?e.yAxis:e.xAxis,n=this.convertCrossLine(t,s);if(n==null){this.visible=!1;return}this.visible=t.visible??!0,this.visible&&(this.updateLine(t,n),this.updateHandle(t,n),this.updateText(t,n),this.updateAxisLabel(t,s,n))}updateLine(t,e){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:o,strokeOpacity:a}=t,{x1:r,y1:l,x2:c,y2:h}=e;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:o,strokeOpacity:a,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:o,strokeOpacity:a}=t,r={fill:t.handle.fill,stroke:t.handle.stroke??n,strokeOpacity:t.handle.strokeOpacity??a,strokeWidth:t.handle.strokeWidth??o},l=jc.sub(XD.center(e),jc.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(t,e){this.text=this.updateNode(Vc,this.text,!!t.text.label),Rd(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new n2;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(e));const{axisLabel:s,seriesRect:n}=this,{direction:o,position:a}=e;if(t.axisLabel.enabled){s.visible=this.visible;const r=a==="left"||a==="top"?XD.start(i):XD.end(i),l=o===HX.X?r.x:r.y;if(!e.inRange(l)){s.visible=!1;return}const c=li(t.value);s.update({...jc.add(r,jc.required(n)),value:c,styles:t.axisLabel,context:e})}else s.visible=!1}setAxisLabelOpacity(t){this.axisLabel&&(this.axisLabel.opacity=t)}setAxisLabelVisible(t){this.axisLabel&&(this.axisLabel.visible=t)}toggleHandles(t){this.middle.visible=t,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(t){this.toggleHandles(t),this.middle.toggleActive(t)}dragStart(t,e,i){const s=vs.is(t)?{x:e.x,y:cr(t.value,i.yAxis)}:{x:cr(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:s}}drag(t,e,i){const{activeHandle:s,dragState:n}=this;t.locked||!n||(s&&this[s].toggleDragging(!0),this.translatePoint(t,n.middle,jc.sub(e,n.offset),i))}translate(t,e,i){if(t.locked)return;const s=vs.is(t)?jc.from(0,cr(t.value,i.yAxis)):jc.from(cr(t.value,i.xAxis),0);this.translatePoint(t,s,e,i)}translatePoint(t,e,i,s){const n=vs.is(t);n?i.x=0:i.y=0;const{point:o}=mr({point:e},i,s);t.value=n?o.y:o.x}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const s=vs.is(t),n=this.isHorizontal?i.yAxis:i.xAxis,o=this.convertCrossLine(t,n);if(!o)return;const a=s?-30:0,r=s?0:-30,l=Fs({x:o.x1+r,y:o.y1+a},i);return e.set({value:s?l.y:l.x}),e}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):s.isPointInPath(t,e)||!!n?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.line.isPointInPath(t,e))return"line";if(this.middle.containsPoint(t,e))return"handle"}getAnchor(){const t=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:t.x+t.width/2,y:t.y}:{x:t.x+t.width,y:t.y+t.height/2,position:"right"}}convertCrossLine(t,e){if(t.value==null)return;let i=0,s=0,n,o;const{bounds:a}=e,r=cr(t.value,e);return vs.is(t)?(n=a.width,s=r,o=r):(i=r,n=r,o=a.height),{x1:i,y1:s,x2:n,y2:o}}},{StateMachine:Zm,StateMachineProperty:UX,Debug:YX}=T,ZD=class extends Zm{constructor(t,e){const i=({point:n})=>{const o=t==="horizontal",a=o?new vs:new pa;a.set({value:o?n.y:n.x}),e.create(a),e.recordAction(`Create ${o?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Zm.parent,cancel:Zm.parent},"waiting-first-render":{render:{target:Zm.parent,action:s}}}),this.debug=YX.create(!0,"annotations")}};y([UX()],ZD.prototype,"node",2);var c2={type:"horizontal-line",datum:vs,scene:bl,isDatum:vs.is,translate:(t,e,i,s)=>{vs.is(e)&&bl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(vs.is(e)&&vs.is(i)&&bl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{vs.is(e)&&bl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ZD("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new ci(t)},h2={type:"vertical-line",datum:pa,scene:bl,isDatum:pa.is,translate:(t,e,i,s)=>{pa.is(e)&&bl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(pa.is(e)&&pa.is(i)&&bl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{pa.is(e)&&bl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ZD("vertical",{...t,create:e("vertical-line")}),dragState:t=>new ci(t)},{Vec4:KX}=T,d2=class{static updateBackground(t,e,i,s){const{background:n}=this,{seriesRect:o}=s;n.path.clear(!0);const a=KX.from(0,0,o.width,o.height),r=this.getBackgroundPoints(t,e,i,a);for(let c=0;c<r.length;c++){const h=r[c];c===0?n.path.moveTo(h.x,h.y):n.path.lineTo(h.x,h.y)}n.path.closePath(),n.checkPathDirty();const l=this.getBackgroundStyles?.(t)??t.background;n.setProperties({fill:l.fill,fillOpacity:l.fillOpacity})}},u2=class extends QE{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new qs,this.bottomLine=new qs,this.background=new T.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=d2.updateBackground.bind(this)}update(t,e){const{locked:i,visible:s}=t,n=zs(t,e),o=zs(t.bottom,e);if(n==null||o==null){this.visible=!1;return}else this.visible=s??!0;const a=this.extendLine(n,t,e),r=this.extendLine(o,t,e);this.updateLines(t,a,r,e,n,o),this.updateHandles(t,n,o),this.updateText(t,n,o),this.updateBackground(t,a,r,e),this.updateAnchor(n,o);for(const l of Object.values(this.handles))l.toggleLocked(i??!1)}toggleHandles(t){const{handles:e}=this;if(typeof t=="boolean"){for(const[i,s]of Object.entries(e))s.visible=t,s.toggleHovered(this.activeHandle===i);return}for(const[i,s]of Object.entries(t)){const n=e[i];n.visible=s??!0,n.toggleHovered(this.activeHandle===i)}}toggleActive(t){this.toggleHandles(t);for(const e of Object.values(this.handles))e.toggleActive(t)}stopDragging(){const{activeHandle:t,handles:e}=this;t!=null&&e[t].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return this.activeHandle==null?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(t,e){const{handles:i,topLine:s,bottomLine:n,text:o}=this;this.activeHandle=void 0;for(const[a,r]of Object.entries(i))if(r.containsPoint(t,e))return this.activeHandle=a,!0;return s.containsPoint(t,e)||n.containsPoint(t,e)||!!o?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.topLine.containsPoint(t,e)||this.bottomLine.containsPoint(t,e))return"line";for(const[i,s]of Object.entries(this.handles))if(s.containsPoint(t,e))return"handle"}updateAnchor(t,e){const{x:i,y:s}=T.Transformable.toCanvasPoint(this.topLine,(t.x1+t.x2)/2,Math.min(t.y1,t.y2,e.y1,e.y2));this.anchor.x=i,this.anchor.y=s}},{Vec2:to,Vec4:Sl}=T,Qm=class extends u2{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new He,topRight:new He,bottomLeft:new He,bottomRight:new Ed},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return Wi.isCheck(t,"disjoint-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(e);o[n].toggleDragging(!0),n==="bottomRight"&&(a.x=0);let r=[],l=[],c=s;switch(n){case"topLeft":r=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":r=["bottomLeft"],l=["topLeft"];break;case"topRight":r=["topRight"],l=["bottomRight"];break;case"bottomRight":r=["bottomLeft","bottomRight"],c=!1;break}const h=zs(t,i),d=zs(t.bottom,i);if(!h||!d)return;const u={topLeft:Sl.start(h),topRight:Sl.end(h),bottomLeft:Sl.start(d),bottomRight:Sl.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:t.snapToAngle},g=mr(u,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,invertYVectors:l,snap:c?p:void 0});t.start.x=g.topLeft.x,t.start.y=g.topLeft.y,t.end.x=g.topRight.x,t.end.y=g.topRight.y,t.startHeight=g.topLeft.y-g.bottomLeft.y,t.endHeight=g.topRight.y-g.bottomRight.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,bottomRight:s,topLeft:n,topRight:o}=this.handles,a=i.getBBox().y-n.getBBox().y,r=s.getBBox().y-o.getBBox().y,l=to.add(t,to.from(0,a)),c=to.add(e,to.from(0,r));return{start:t,end:e,bottomStart:l,bottomEnd:c}}updateLines(t,e,i){const{topLine:s,bottomLine:n}=this,{lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l}=t,c={lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l};s.setProperties({...e,...c}),n.setProperties({...i,...c})}updateHandles(t,e,i){const{handles:{topLeft:s,topRight:n,bottomLeft:o,bottomRight:a}}=this,r={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};s.update({...r,...Sl.start(e)}),n.update({...r,...Sl.end(e)}),o.update({...r,...Sl.start(i)}),a.update({...r,...to.sub(Sl.end(i),to.from(a.handle.width/2,a.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(Vc,this.text,!!t.text.label),o2(!1,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,o=e.y1>e.y2,a=o?s.y2:s.y1,r=o?s.y1:s.y2,l=to.from(e);return t.extendEnd&&e.y2===r&&l.push(to.from(n?s.x1:s.x2,o?s.y1:s.y2)),t.extendEnd&&i.y2===a&&l.push(to.from(n?s.x1:s.x2,o?s.y2:s.y1)),l.push(...to.from(i).reverse()),t.extendStart&&i.y1===r&&l.push(to.from(n?s.x2:s.x1,o?s.y1:s.y2)),t.extendStart&&e.y1===a&&l.push(to.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},{StateMachine:vl,StateMachineProperty:QD,Debug:$X}=T,qm=class extends vl{constructor(t){const e=({point:l})=>{const c=new Zn;c.set({start:l,end:l,startHeight:0,endHeight:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:ig(l,c,d,h.start,h.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=li(c?.end.y),u=li(c?.start.y),{y:p}=l;if(c==null||!pe(u)||!pe(d)||!pe(p))return;const g=d-(p??0),f=(u-d)*2+g,x={x:c?.start.x,y:u-f},m={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint(x,{overflowContinuous:!0})||!t.validatePoint(m,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:g}),t.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=li(c?.end.y),u=li(c?.start.y),{y:p}=l;if(c==null||!pe(u)||!pe(d)||!pe(p))return;const g=d-(p??0),f=(u-d)*2+g,x={x:c.start.x,y:u-g},m={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!t.validatePoint(x,{overflowContinuous:!0})||!t.validatePoint(m,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:g}),t.recordAction("Create disjoint-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:vl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:vl.parent,action:r},cancel:{target:vl.parent,action:r}},height:{hover:o,click:{target:vl.parent,action:a},drag:{target:vl.parent,action:a},reset:{target:vl.parent,action:r},cancel:{target:vl.parent,action:r}}}),this.debug=$X.create(!0,"annotations"),this.snapping=!1}};y([QD()],qm.prototype,"datum",2),y([QD()],qm.prototype,"node",2),y([QD()],qm.prototype,"snapping",2);var p2={type:"disjoint-channel",datum:Zn,scene:Qm,isDatum:Zn.is,translate:(t,e,i,s)=>{Zn.is(e)&&Qm.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Zn.is(e)&&Zn.is(i)&&Qm.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Zn.is(e)&&Qm.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qm({...t,create:e("disjoint-channel")}),dragState:t=>new ci(t)},qD=[0,23.6,38.2,50,61.8,78.6,100],XX=[161.8,261.8,361.8,423.6],ZX=[...qD,...XX],QX={10:ZX,6:qD,4:qD.filter(t=>t!==78.6&&t!==23.6)},qX=10;function JX(t,e){const{x2:i,y1:s,y2:n}=t,o=s-n;return e==null?{x1:i,x2:i,y1:n-o,y2:n}:{x1:e.x1,x2:e.x2,y1:e.y2-o,y2:e.y2}}function g2({x1:t,y1:e,x2:i,y2:s},n,o,a,r=10){const l=e-s,c=o?-1:1;let h=a;const d=[];return QX[r].forEach((u,p)=>{const g=a+l*(u/100)*c,f=n.yAxis.scaleInvert(g);d.push({id:p,x1:t,x2:i,y1:h,y2:g,tag:u==100?0:1,label:{x1:Math.min(t,i)-qX,x2:i,y1:g,y2:g,text:`${(u/100).toFixed(3)} (${f.toFixed(2)})`}}),h=g}),d}var{Vec2:tZ,Vec4:f2}=T,y2=class extends Wi{constructor(){super(),this.trendLine=new qs,this.rangeFillsGroup=new T.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=T.Selection.select(this.rangeFillsGroup,T.Range),this.rangeStrokesGroup=new T.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=T.Selection.select(this.rangeStrokesGroup,qs),this.labelsGroup=new T.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=T.Selection.select(this.labelsGroup,Vc),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=zs(t,e);if(i==null){this.visible=!1;return}if(i=f2.round(i),this.visible=t.visible??!0,!this.visible)return;this.updateLine(t,i,this.trendLine),this.updateHandles(t,i),this.updateAnchor(t,i,e);const{reverse:s}=t,n=this.extendLine(i,t,e),o=s?n.y1:n.y2,a=s?n.y2:n.y1,r=g2(n,e,t.reverse,o,t.bands);this.updateRanges(t,r,e);const l={...n,y1:a,y2:a};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:s},n,o){const a={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const{x:r,width:l}=o.xAxis.bounds;return n.extendEnd&&(a[t>i?"x1":"x2"]=r+l),n.extendStart&&(a[t>i?"x2":"x1"]=r),a}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:o,stroke:a}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:o,fillOpacity:0,stroke:a})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,isMultiColor:a}=t;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,g=a?n[u%n.length]:o;r.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:d})})}updateRanges(t,e,i){const s=n=>n.id;this.rangeFillsGroupSelection.update(e,void 0,s),this.rangeStrokesGroupSelection.update(e,void 0,s),this.labelsGroupSelection.update(e,void 0,s),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,showFill:a,isMultiColor:r}=t;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const g=r?n[p%n.length]:o;if(!a){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,isRange:!0,stroke:g,strokeOpacity:s,fill:g,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0})})}updateRangeLabels(t,{xAxis:e}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:n,rangeStroke:o,isMultiColor:a,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=t,u={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(e,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((g,f,x)=>{const m=d??(a?s[x%s.length]:o),b=i.at(x);if(!b)return;const{text:S,...M}=f.label;if(p)g.setProperties({...u,text:S,x:M.x1,y:M.y1,textBaseline:"middle",textAlign:"end",fill:m}),Rd(g.id,b,M);else{const D={...u,label:S,position:"center",alignment:"left",color:m};Rd(g.id,b,M,D,g,S,n)}})}checkWithinBounds(t,e,i){if(!i)return!1;const{text:s,...n}=i.datum.label;i.setProperties({...e,text:s,x:n.x1,y:n.y1,textBaseline:"middle",textAlign:"end"});const{x:o}=i.getBBox();return o>=t.bounds.x&&o<=t.bounds.x+t.bounds.width}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=t;this.text=this.updateNode(Vc,this.text,!!s.label),Rd(i.id,i,e,s,this.text,s.label,n)}updateAnchor(t,e,i,s){const n=f2.topCenter(e);tZ.apply(this.anchor,T.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let o=!1;return s.each(a=>o||(o=a.isPointInPath(t,e))),o||i.isPointInPath(t,e)||!!n?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.trendLine.isPointInPath(t,e))return"line"}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{Vec2:eZ,Vec4:Wc}=T,Jm=class extends y2{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new qs,this.start=new He,this.end=new He,this.endRetracement=new He,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return Wi.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:s}=this.getCoords(t,e);if(i==null||s==null){this.visible=!1;return}if(i=Wc.round(i),s=Wc.round(s),this.visible=t.visible??!0,!this.visible)return;(t.endRetracement.x==null||t.endRetracement.y==null)&&(s=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,s,this.endRetracementLine),this.updateHandles(t,i,s),this.updateAnchor(t,s??i,e);const{reverse:n,bands:o}=t,a=JX(i,s),r=this.extendLine(a,t,e),l=r.y2,c=r.y1,h=s?g2(r,e,n,l,o):[];this.updateRanges(t,h,e);const d={...r,y1:c,y2:c};this.updateText(t,d)}containsPoint(t,e){const{start:i,end:s,endRetracement:n,endRetracementLine:o}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):n.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):o.isPointInPath(t,e)||super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)||this.endRetracement.containsPoint(t,e)?"handle":this.endRetracementLine.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...Hm({start:t.start,end:t.end,endRetracement:t.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:eZ.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(t,e,i):Fs(this[n].drag(e).point,i);!a||!Nd(i,a)||(t[n].x=a.x,t[n].y=a.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const o=(n.indexOf(s)+1)%n.length,a=n[o];this[s].toggleDragging(!0);const r=We(t[a],i);return Fs(Wm(e,r,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:s,translation:n,context:o}){const a=mr({start:e,end:i,endRetracement:s},n,o,{overflowContinuous:2});t.start.x=a.start.x,t.end.x=a.end.x,t.endRetracement.x=a.endRetracement.x,t.start.y=a.start.y,t.end.y=a.end.y,t.endRetracement.y=a.endRetracement.y}translate(t,e,i){this.translatePoints({datum:t,start:We(t.start,i),end:We(t.end,i),endRetracement:We(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:s,coords2:n}=this.getCoords(t,i);if(!s||!n)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:Wc.start(s),end:Wc.end(s),endRetracement:Wc.end(n),translation:{x:-o.width/2,y:-o.height/2},context:i}),e}getCoords(t,e){return{coords1:zs(t,e),coords2:zs({start:t.end,end:t.endRetracement},e)}}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t,this.endRetracement.visible=t;else for(const[e,i]of ke(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t),this.endRetracement.toggleActive(t)}updateHandles(t,e,i,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return i==="start"?Wc.start(e):Wc.end(e)}},{StateMachine:Ml,StateMachineProperty:JD,Debug:iZ}=T,tx=class extends Ml{constructor(t){const e=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),t.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},s=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({end:ig(c,h,u,d.start,d.snapToAngle)}),t.update())},n=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),t.update())},o=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({endRetracement:ig(c,h,u,d.end,d.snapToAngle)}),t.update())},a=()=>{this.node?.toggleHandles({endRetracement:!0}),t.update()},r=()=>t.delete(),l=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Ml.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:n},drag:s,dragEnd:{target:"endRetracement",action:n},reset:{target:Ml.parent,action:r},cancel:{target:Ml.parent,action:r},onExit:l},endRetracement:{hover:o,click:{target:Ml.parent,action:a},drag:{target:Ml.parent,action:a},reset:{target:Ml.parent,action:r},cancel:{target:Ml.parent,action:r}}}),this.debug=iZ.create(!0,"annotations"),this.snapping=!1}createDatum(){return new ga}};y([JD()],tx.prototype,"datum",2),y([JD()],tx.prototype,"node",2),y([JD()],tx.prototype,"snapping",2);var m2={type:"fibonacci-retracement-trend-based",datum:ga,scene:Jm,isDatum:ga.is,translate:(t,e,i,s)=>{ga.is(e)&&Jm.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ga.is(e)&&ga.is(i)&&Jm.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ga.is(e)&&Jm.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new tx({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new ci(t)},{Vec2:sZ,Vec4:x2}=T,ex=class extends y2{constructor(){super(),this.type="fibonacci-retracement",this.start=new He,this.end=new He,this.append([this.start,this.end])}static is(t){return Wi.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...Hm({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,translation:sZ.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(t,e,i):Fs(this[n].drag(e).point,i);!a||!Nd(i,a)||(t[n].x=a.x,t[n].y=a.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,o=["start","end"].find(r=>r!==s);if(!s||!o)return;this[s].toggleDragging(!0);const a=We(t[o],i);return Fs(Wm(e,a,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:s,context:n}){const o=mr({start:e,end:i},s,n,{overflowContinuous:1});t.start.x=o.start.x,t.end.x=o.end.x,t.start.y=o.start.y,t.end.y=o.end.y}translate(t,e,i){this.translatePoints({datum:t,start:We(t.start,i),end:We(t.end,i),translation:e,context:i})}copy(t,e,i){const s=zs(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.height/2},context:i}),e}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of ke(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}updateHandles(t,e,i,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return i==="start"?x2.start(e):x2.end(e)}},{StateMachine:Pd,StateMachineProperty:tA,Debug:nZ}=T,Bd=class extends Pd{constructor(t){const e=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),t.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},s=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:ig(r,l,h,c.start,c.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({end:!0}),t.update()},o=()=>t.delete(),a=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Pd.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:Pd.parent,action:n},drag:s,dragEnd:{target:Pd.parent,action:n},reset:{target:Pd.parent,action:o},cancel:{target:Pd.parent,action:o},onExit:a}}),this.debug=nZ.create(!0,"annotations"),this.snapping=!1}};y([tA()],Bd.prototype,"datum",2),y([tA()],Bd.prototype,"node",2),y([tA()],Bd.prototype,"snapping",2);var oZ=class extends Bd{createDatum(){return new dr}},aZ=class extends Bd{createDatum(){return new ur}},rZ=class extends Bd{createDatum(){return new gr}},b2={type:"fibonacci-retracement",datum:gr,scene:ex,isDatum:gr.is,translate:(t,e,i,s)=>{gr.is(e)&&ex.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(gr.is(e)&&gr.is(i)&&ex.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{gr.is(e)&&ex.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new rZ({...t,create:e("fibonacci-retracement")}),dragState:t=>new ci(t)},{Vec2:ng}=T,lZ=class extends T.Group{},ix=class extends lZ{constructor(){super(),this.type="arrow",this.path=new T.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:s,angle:n,...o}=t,a=ng.from(i,s),r=3*Math.PI/4,l=this.armLength+(t.strokeWidth??0)*2,c=ng.rotate(ng.from(0,l),n+r,a),h=ng.rotate(ng.from(l,0),n-r,a);e.setProperties(o),e.fillOpacity=0,e.path.clear(),e.path.moveTo(c.x,c.y),e.path.lineTo(a.x,a.y),e.path.lineTo(h.x,h.y)}},{Vec2:wo,Vec4:S2}=T,Dl=class extends WD{constructor(){super(),this.type="line",this.line=new qs,this.append([this.line,this.start,this.end])}static is(t){return Wi.isCheck(t,"line")}update(t,e){let i=zs(t,e);if(i==null){this.visible=!1;return}i=S2.round(i),this.visible=t.visible??!0,this.visible&&(this.updateLine(t,i,e),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateAnchor(t,i,e))}updateLine(t,e,i){const{line:s}=this,{lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r}=t,l=this.extendLine(e,t,i);s.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(Vc,this.text,!!t.text.label),Rd(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}updateCaps(t,e){if(!t.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!t.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!t.startCap&&!t.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:n}=t,[o,a]=wo.from(e),r=wo.angle(wo.sub(a,o));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),this.startCap==null&&(this.startCap=new ix,this.append([this.startCap])),this.startCap.update({x:o.x,y:o.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),this.endCap==null&&(this.endCap=new ix,this.append([this.endCap])),this.endCap.update({x:a.x,y:a.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(t,e,i,s){const n=S2.topCenter(e);wo.apply(this.anchor,T.Transformable.toCanvasPoint(this.line,n.x,n.y))}containsPoint(t,e){const{line:i,text:s}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}getHandleCoords(t,e,i,s){const{startCap:n,endCap:o}=this;let[a,r]=wo.from(e);const l=wo.angle(wo.sub(r,a));return n&&(a=wo.rotate(wo.from(0,-He.HANDLE_SIZE/2),l,a)),o&&(r=wo.rotate(wo.from(0,He.HANDLE_SIZE/2),l,r)),i==="start"?a:r}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},v2={type:"line",datum:ur,scene:Dl,isDatum:ur.is,translate:(t,e,i,s)=>{ur.is(e)&&Dl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ur.is(e)&&ur.is(i)&&Dl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ur.is(e)&&Dl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new aZ({...t,create:e("line")}),dragState:t=>new ci(t)},M2={type:"arrow",datum:dr,scene:Dl,isDatum:dr.is,translate:(t,e,i,s)=>{dr.is(e)&&Dl.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(dr.is(e)&&dr.is(i)&&Dl.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{dr.is(e)&&Dl.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new oZ({...t,create:e("arrow")}),dragState:t=>new ci(t)};function D2(t,e=0,i=0){let s=e;for(const n of t)if(Array.isArray(n)){for(const o of n)A2(o,s);s+=T.Group.computeChildrenBBox(n).width+i}else A2(n,s),s+=n.getBBox().width+i}function cZ(t,e=0,i=0){let s=e;for(const n of t)if(Array.isArray(n)){for(const o of n)I2(o,s);s+=T.Group.computeChildrenBBox(n).height+i}else I2(n,s),s+=n.getBBox().height+i}function A2(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function I2(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function T2(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function k2(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var{Vec4:eA}=T,C2=class extends T.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new T.Rect,this.dateRangeBarsText=new T.Text,this.dateRangeDivider=new T.Line,this.dateRangeValueText=new T.Text,this.priceRangeValueText=new T.Text,this.priceRangeDivider=new T.Line,this.priceRangePercentageText=new T.Text,this.volumeText=new T.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(t,e,i,s,n,o,a){this.verticalDirection=o;const r=this.updateStatistics(t,e,i,a),l=T.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(t,l,c),this.reposition(r,c,n),this.checkVisibility(t,n,s)}checkVisibility(t,e,i){const s=eA.from(new T.BBox(0,0,e.seriesRect.width,e.seriesRect.height));eA.collides(i,s)?this.visible=t.visible??!0:this.visible=!1}updateStatistics(t,e,i,s){const{dateRangeBarsText:n,dateRangeDivider:o,dateRangeValueText:a,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,u=6,p=t.statistics.fontSize+3,g=-2,f=this.getTextStyles(t),x={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:p},m=[n,o,a],b=[r,l,c],S=[];return e.priceRange&&(r.setProperties({...f,text:this.formatPriceRangeValue(e.priceRange.value,s)}),l.setProperties(x),c.setProperties({...f,text:this.formatPriceRangePercentage(e.priceRange.percentage,s)}),D2(b,i.x,d),S.push(b)),e.dateRange&&(n.setProperties({...f,text:this.formatDateRangeBars(e.dateRange.bars,s)}),o.setProperties(x),a.setProperties({...f,text:this.formatDateRangeValue(e.dateRange.value)}),D2(m,i.x,d),S.push(m)),e.volume!=null?(h.setProperties({...f,x:i.x,text:this.formatVolume(e.volume,s),visible:!0}),S.push(h)):h.visible=!1,cZ(S,i.y,u),l.y1+=g,l.y2+=g,o.y1+=g,o.y2+=g,S}updateBackground(t,e,i){const s=this.getBackgroundStyles(t);this.background.setProperties({...s,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:s,height:n}=i.seriesRect,o=eA.from(this.background.getBBox());let a=0;o.x1<0&&(a=-o.x1),o.x2>s&&(a=s-o.x2);const r=Math.min(e,n-o.y2);for(const l of t)if(Array.isArray(l)){const c=T.Group.computeChildrenBBox(l).width;for(const h of l)T2(h,a-c/2),k2(h,r)}else T2(l,a-l.getBBox().width/2),k2(l,r);this.background.x+=a,this.background.y+=r}getTextStyles(t){return{fill:t.statistics.color,fontFamily:t.statistics.fontFamily,fontSize:t.statistics.fontSize,fontStyle:t.statistics.fontStyle,fontWeight:t.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(t){return{stroke:t.statistics.divider.stroke,strokeOpacity:t.statistics.divider.strokeOpacity,strokeWidth:t.statistics.divider.strokeWidth}}getBackgroundStyles(t){return{fill:t.statistics.fill,stroke:t.statistics.stroke,strokeOpacity:t.statistics.strokeOpacity,strokeWidth:t.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(t,e){return e?.t("measurerDateRangeBars",{value:t})??`${t}`}formatDateRangeValue(t){const e=[],i=t>=0?"":"-";t=Math.abs(t);const s=1e3*60,n=s*60,o=n*24,a=Math.floor(t/s),r=Math.floor(t/n),l=Math.floor(t/o),c=r%(o/n),h=a%(n/s);return l>=1&&e.push(`${l}d`),r>=1&&(t<o||c!==0)&&e.push(`${c}h`),(t<n||h!==0)&&e.push(`${h}m`),e[0]=`${i}${e[0]}`,e.join(" ")}formatPriceRangeValue(t,e){return e?.t("measurerPriceRangeValue",{value:Number(t.toFixed(2))})??`${t}`}formatPriceRangePercentage(t,e){return e?.t("measurerPriceRangePercent",{value:t})??`${t}`}formatVolume(t,e){const i=isNaN(t)?"":this.volumeFormatter.format(t);return e?.t("measurerVolume",{value:i})??i}},hZ=class extends C2{getDirectionStyles(t){return this.verticalDirection==="down"?t.down.statistics:t.up.statistics}getTextStyles(t){const e=this.getDirectionStyles(t);return{...super.getTextStyles(t),fill:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight}}getDividerStyles(t){const e=this.getDirectionStyles(t);return{stroke:e.divider.stroke,strokeOpacity:e.divider.strokeOpacity,strokeWidth:e.divider.strokeWidth}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{...super.getBackgroundStyles(t),fill:e.fill,stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}}},{Vec2:ma,Vec4:Hc}=T,xn=class extends WD{constructor(){super(),this.type="measurer",this.horizontalLine=new qs,this.verticalLine=new qs,this.horizontalStartLine=new qs,this.horizontalEndLine=new qs,this.verticalStartLine=new qs,this.verticalEndLine=new qs,this.horizontalEndCap=new ix,this.verticalEndCap=new ix,this.background=new T.Path({zIndex:-1}),this.updateBackground=d2.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(t){return Wi.isCheck(t,"measurer")}createStatisticsScene(){return new C2}update(t,e){const i=zs(t,e);if(i==null){this.visible=!1;return}if(this.visible=t.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,t,e),n={...s,y2:s.y1},o={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(t),this.updateLines(t,i),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateBoundingLines(t,s),this.updateBackground(t,n,o,e),this.updateStatistics(t,i,e),this.updateAnchor(t,i,e)}extendPerpendicular(t,e,i){const s={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)},[n,o]=ma.from(i.yAxis.bounds);return $n.is(e)?(e.extendAbove&&(s.y1=n.y),e.extendBelow&&(s.y2=o.y)):Xn.is(e)&&(e.extendLeft&&(s.x1=n.x),e.extendRight&&(s.x2=o.x)),s}updateVisibilities(t){const{horizontalStartLine:e,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:n,verticalEndLine:o,verticalEndCap:a}=this,{direction:r}=t;n.visible=r!=="vertical",o.visible=r!=="vertical",s.visible=r!=="vertical",e.visible=r!=="horizontal",i.visible=r!=="horizontal",a.visible=r!=="horizontal"}updateLines(t,e){const{horizontalLine:i,verticalLine:s}=this,{direction:n}=t,{x1:o,y1:a,x2:r,y2:l}=e,c=ma.round(Hc.center(e),0),h=this.getLineStyles(t);n!=="vertical"&&i.setProperties({...h,x1:o,x2:r,y1:c.y,y2:c.y}),n!=="horizontal"&&s.setProperties({...h,x1:c.x,x2:c.x,y1:a,y2:l})}updateText(t,e){const{direction:i}=t,s=ma.round(Hc.center(e),0);let n;const o={...e};i==="vertical"?(n=this.verticalLine,o.x1=s.x,o.x2=s.x):(n=this.horizontalLine,o.y1=s.y,o.y2=s.y),this.text=this.updateNode(Vc,this.text,!!t.text.label);const{id:a}=n,r=Rd(a,n,o,t.text,this.text,t.text.label,t.strokeWidth);let l;if(i==="both"&&r&&this.text){const c=Hc.from(this.text.getBBox()),{offset:h}=r.numbers;c.x1<=s.x+h.x&&c.x2>=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+ma.length(h)})}this.verticalLine.setClipMask(a,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=t,{x1:o,y1:a,x2:r,y2:l}=e,c=ma.round(Hc.center(e),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(t),p={stroke:h,strokeWidth:d,strokeOpacity:u};if(n!=="vertical"){const g=o<=r?0:Math.PI;let f=r;n==="horizontal"&&(f+=o<=r?-2:2),i.update({...p,x:f,y:c.y,angle:g})}if(n!=="horizontal"){const g=a<=l?Math.PI/2:Math.PI/-2;let f=l;n==="vertical"&&(f+=a<=l?-2:2),s.update({...p,x:c.x,y:f,angle:g})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:o}=this,{direction:a}=t,{x1:r,y1:l,x2:c,y2:h}=e,d=this.getLineStyles(t);a==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),a==="vertical"&&(n.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),o.setProperties({...d,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(t,e,i){const s=ma.add(Hc.bottomCenter(e),ma.from(0,10)),n={volume:this.getVolume(t)};t.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,n,s,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,s){const n=Hc.topCenter(e);ma.apply(this.anchor,T.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(t,e,i,s){const[n,o]=ma.from(e),[a,r]=ma.from(i);return[n,o,r,a]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n,fillOpacity:0}}getBackgroundStyles(t){const{background:e}=t;return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}containsPoint(t,e){const{horizontalLine:i,text:s,verticalLine:n,horizontalStartLine:o,horizontalEndLine:a,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||n.isPointInPath(t,e)||o.visible&&o.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":"line"}getDateRangeBars(t,e){const{step:i}=e.xAxis.scale,s=t.x1<=t.x2?1:-1;return i?Math.round(Hc.width(t)/i)*s:0}getDateRangeValue(t){const e=li(t.start.x),i=li(t.end.x);if(!Yo(e)||!Yo(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-e.getTime()}getPriceRangePercentage(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=li(t.end.y),i=li(t.start.y);if(!pe(e)||!pe(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(e-i)/i}getPriceRangeValue(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=li(t.end.y),i=li(t.start.y);if(!pe(e)||!pe(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return e-i}getVolume(t){return t.getVolume(t.start.x,t.end.x)}},sx=class extends xn{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return Wi.isCheck(t,"quick-measurer")}createStatisticsScene(){return new hZ}getDirectionStyles(t){return this.verticalDirection==="down"?t.down:t.up}getLineStyles(t){const e=this.getDirectionStyles(t);return{...super.getLineStyles(t),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){const e=this.getDirectionStyles(t);return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},{StateMachine:zd,StateMachineProperty:L2,Debug:dZ}=T,Fd=class extends zd{constructor(t){const e=({point:a})=>{const r=this.createDatum();r.set({start:a,end:a}),t.create(r)},i=({point:a})=>{const{datum:r,node:l}=this;r?.set({end:a}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),t.update()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>t.delete(),o=()=>{t.showAnnotationOptions(),!pl(this.datum)&&t.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:zd.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:zd.parent,action:s},dragEnd:{target:zd.parent,action:s},reset:{target:zd.parent,action:n},cancel:{target:zd.parent,action:n},onExit:o}}),this.debug=dZ.create(!0,"annotations")}};y([L2()],Fd.prototype,"datum",2),y([L2()],Fd.prototype,"node",2);var uZ=class extends Fd{createDatum(){return new $n}},pZ=class extends Fd{createDatum(){return new Xn}},gZ=class extends Fd{createDatum(){return new hr}},fZ=class extends Fd{createDatum(){return new mn}},N2={type:"date-range",datum:$n,scene:xn,isDatum:$n.is,translate:(t,e,i,s)=>{$n.is(e)&&xn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if($n.is(e)&&$n.is(i)&&xn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{$n.is(e)&&xn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new uZ({...t,create:e("date-range")}),dragState:t=>new ci(t)},w2={type:"price-range",datum:Xn,scene:xn,isDatum:Xn.is,translate:(t,e,i,s)=>{Xn.is(e)&&xn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Xn.is(e)&&Xn.is(i)&&xn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Xn.is(e)&&xn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new pZ({...t,create:e("date-range")}),dragState:t=>new ci(t)},O2={type:"date-price-range",datum:hr,scene:xn,isDatum:hr.is,translate:(t,e,i,s)=>{hr.is(e)&&xn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(hr.is(e)&&hr.is(i)&&xn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{hr.is(e)&&xn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new gZ({...t,create:e("date-range")}),dragState:t=>new ci(t)},E2={type:"quick-date-price-range",datum:mn,scene:sx,isDatum:mn.is,translate:(t,e,i,s)=>{mn.is(e)&&sx.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(mn.is(e)&&mn.is(i)&&sx.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{mn.is(e)&&sx.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new fZ({...t,create:e("quick-date-price-range")}),dragState:t=>new ci(t)},{ZIndexMap:R2,TextWrapper:yZ}=T,nx=class extends KD{constructor(){super(),this.type="note",this.shape=new T.Rect,this.iconBackground=new T.SvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new T.SvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new T.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return Wi.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const s=super.getTextBBox(t,e,i);s.x-=t.width/2,s.x=ft(0,s.x,i.seriesRect.width-t.width);const n=t.getPadding().top,o=s.y-SE-n*2,a=s.y+He.HANDLE_SIZE+n*2;return o-s.height-vE<0?(s.y=a,t.position="top"):(s.y=o+n,t.position="bottom"),s}updateLabel(t,e){const i=t.visible===!1?!1:this.label.visible;super.updateLabel(t,e),this.label.visible=i,this.label.text=yZ.wrapText(t.text,{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},avoidOrphans:!1,textAlign:t.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(t,e){const{shape:i}=this;i.fill=t.background.fill,i.fillOpacity=t.background.fillOpacity??1,i.stroke=t.background.stroke,i.strokeOpacity=t.background.strokeOpacity??1,i.strokeWidth=t.background.strokeWidth??1,i.cornerRadius=4;const s=t.getPadding().top,n=t.position==="top";i.x=e.x-s,i.width=t.width+s*2,i.height=e.height+s*2,i.y=e.y+(n?0:-e.height)-s}updateIcon(t,e){const{active:i,iconBackground:s,iconLines:n}=this,{x:o,y:a}=We(t,e);s.x=o-A6/2,s.y=a-bE,n.x=s.x,n.y=s.y,s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeOpacity=t.strokeOpacity??1,s.strokeWidth=t.strokeWidth??1,n.fill=t.stroke,i?s.fillShadow.color=t.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const s=t.getPadding().top,n=t.position==="top",o=n?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+o*(e.height+s),position:n?"below":"above"}}getLabelCoords(t,e){const i=t.position==="top",s=t.getPadding().top+t.fontSize*Jp/2;return{x:e.x,y:e.y+(i?s/2:0)}}getTextBaseline(t){return t.position==="top"?"middle":t.position}getHandleCoords(t,e,i){return{x:e.x,y:e.y+He.HANDLE_SIZE/2+4}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}toggleHovered(t){super.toggleHovered(t),this.label.visible=t,this.shape.visible=t,this.zIndex=t?R2.CHART_ANNOTATION_FOCUSED:R2.CHART_ANNOTATION}toggleActive(t){super.toggleActive(t),this.label.visible=t,this.shape.visible=t,this.active=t}containsPoint(t,e){return this.shape.visible&&this.shape.containsPoint(t,e)||this.iconBackground.containsPoint(t,e)?!0:super.containsPoint(t,e)}},mZ=class extends sg{createDatum(){return new Qs}},P2={type:"note",datum:Qs,scene:nx,isDatum:Qs.is,translate:(t,e,i,s)=>{Qs.is(e)&&nx.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Qs.is(e)&&Qs.is(i)&&nx.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Qs.is(e)&&nx.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new mZ({...t,create:e("note")}),dragState:t=>new ci(t)},{Vec2:eo,Vec4:xa}=T,ox=class extends u2{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new He,topMiddle:new Ed,topRight:new He,bottomLeft:new He,bottomMiddle:new Ed,bottomRight:new He},this.middleLine=new qs,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return Wi.isCheck(t,"parallel-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(e);o[n].toggleDragging(!0),(n==="topMiddle"||n==="bottomMiddle")&&(a.x=0);let r=[],l=s;switch(n){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],a.y-=Ed.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],a.y-=Ed.HANDLE_SIZE/2,l=!1;break}const c=zs(t,i),h=zs(t.bottom,i);if(!c||!h)return;const d={topLeft:xa.start(c),topRight:xa.end(c),bottomLeft:xa.start(h),bottomRight:xa.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:t.snapToAngle},p=mr(d,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});t.start.x=p.topLeft.x,t.start.y=p.topLeft.y,t.end.x=p.topRight.x,t.end.y=p.topRight.y,t.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,topLeft:s}=this.handles,n=i.getBBox().y-s.getBBox().y,o=eo.add(t,eo.from(0,n)),a=eo.add(e,eo.from(0,n));return{start:t,end:e,bottomStart:o,bottomEnd:a}}containsPoint(t,e){return super.containsPoint(t,e)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)}getNodeAtCoords(t,e){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)?"line":super.getNodeAtCoords(t,e)}updateLines(t,e,i,s,n,o){const{topLine:a,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=t,p=t.getLineDash(),g={lineCap:t.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};a.setProperties({...e,...g}),l.setProperties({...i,...g});const f=this.extendLine({x1:n.x1,y1:o.y1+(n.y1-o.y1)/2,x2:n.x2,y2:o.y2+(n.y2-o.y2)/2},t,s);r.setProperties({...f,lineDash:t.middle.lineDash??p,lineDashOffset:t.middle.lineDashOffset??c,stroke:t.middle.stroke??h,strokeOpacity:t.middle.strokeOpacity??d,strokeWidth:t.middle.strokeWidth??u,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:s,topMiddle:n,topRight:o,bottomLeft:a,bottomMiddle:r,bottomRight:l}}=this,c={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};s.update({...c,...xa.start(e)}),o.update({...c,...xa.end(e)}),a.update({...c,...xa.start(i)}),l.update({...c,...xa.end(i)}),n.update({...c,...eo.sub(xa.center(e),eo.from(n.handle.width/2,n.handle.height/2))}),r.update({...c,...eo.sub(xa.center(i),eo.from(r.handle.width/2,r.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(Vc,this.text,!!t.text.label),o2(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,o=e.y1>e.y2,a=e.x1!==i.x1&&e.y1!==i.y1,r=e.x2!==i.x2&&e.y2!==i.y2,l=eo.from(e);return t.extendEnd&&r&&l.push(eo.from(n?s.x1:s.x2,o?s.y1:s.y2)),l.push(...eo.from(i).reverse()),t.extendStart&&a&&l.push(eo.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},{StateMachine:Al,StateMachineProperty:iA,Debug:xZ}=T,ax=class extends Al{constructor(t){const e=({point:l})=>{const c=new Qn;c.set({start:l,end:l,height:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:ig(l,c,d,h.start,h.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=li(c?.end.y),u=li(c?.start.y),{y:p}=l;if(c==null||!pe(u)||!pe(d)||!pe(p))return;const g=d-(p??0),f=u-g;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),t.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=li(c?.end.y),u=li(c?.start.y),{y:p}=l;if(c==null||!pe(u)||!pe(d)||!pe(p))return;const g=d-(p??0),f=u-g;h?.toggleHandles(!0),!(!t.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),t.recordAction("Create parallel-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Al.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:Al.parent,action:r},cancel:{target:Al.parent,action:r}},height:{hover:o,click:{target:Al.parent,action:a},drag:{target:Al.parent,action:a},reset:{target:Al.parent,action:r},cancel:{target:Al.parent,action:r}}}),this.debug=xZ.create(!0,"annotations"),this.snapping=!1}};y([iA()],ax.prototype,"datum",2),y([iA()],ax.prototype,"node",2),y([iA()],ax.prototype,"snapping",2);var B2={type:"parallel-channel",datum:Qn,scene:ox,isDatum:Qn.is,translate:(t,e,i,s)=>{Qn.is(e)&&ox.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Qn.is(e)&&Qn.is(i)&&ox.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Qn.is(e)&&ox.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ax({...t,create:e("parallel-channel")}),dragState:t=>new ci(t)},rx=class extends KD{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return Wi.isCheck(t,"text")}getHandleCoords(t,e){const i=He.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},bZ=class extends sg{createDatum(){return new fr}},z2={type:"text",datum:fr,scene:rx,isDatum:fr.is,translate:(t,e,i,s)=>{fr.is(e)&&rx.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(fr.is(e)&&fr.is(i)&&rx.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{fr.is(e)&&rx.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new bZ({...t,create:e("text")}),dragState:t=>new ci(t)},bn={[v2.type]:v2,[c2.type]:c2,[h2.type]:h2,[B2.type]:B2,[p2.type]:p2,[b2.type]:b2,[m2.type]:m2,[e2.type]:e2,[s2.type]:s2,[P2.type]:P2,[z2.type]:z2,[M2.type]:M2,[XE.type]:XE,[$E.type]:$E,[N2.type]:N2,[w2.type]:w2,[O2.type]:O2,[E2.type]:E2};function Uc(t){for(const{isDatum:e}of Object.values(bn))if(e(t))return t}var{ActionOnSet:SZ,ParallelStateMachine:vZ,StateMachine:sA,StateMachineProperty:ba,Debug:MZ}=T,lx=class extends vZ{constructor(t){super(new DZ(e=>{this.snapping=e}),new AZ(()=>{this.node=this.active==null?void 0:t.node(this.active)}),new Il(t,e=>{this.active=e,this.datum=this.active==null?void 0:t.datum(this.active),this.node=this.active==null?void 0:t.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(t){return t===this.active}};y([ba()],lx.prototype,"snapping",2),y([ba()],lx.prototype,"datum",2),y([ba()],lx.prototype,"node",2);var DZ=class extends sA{constructor(t){super("idle",{idle:{hover:({shiftKey:e})=>t(e),keyDown:({shiftKey:e})=>t(e),keyUp:({shiftKey:e})=>t(e),click:({shiftKey:e})=>t(e),drag:({shiftKey:e})=>t(e)},dragging:{},translating:{},"text-input":{}})}},AZ=class extends sA{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},translating:{onEnter:t,render:t},"text-input":{render:t}})}},Il=class extends sA{constructor(t,e){const i=S=>M=>{t.create(S,M),this.active=t.selectLast()},s=()=>{this.active!=null&&t.delete(this.active),this.active=void 0,t.select()},n={createDatum:i},o={...t,delete:s,showTextInput:()=>{this.active!=null&&t.showTextInput(this.active)},deselect:()=>{const S=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,S)},showAnnotationOptions:()=>{this.active!=null&&t.showAnnotationOptions(this.active)}},a=Object.fromEntries(Object.entries(bn).map(([S,M])=>[S,M.createState(o,n)])),r=Object.fromEntries(Object.entries(bn).map(([S,M])=>[S,M.dragState(t,n)])),l=({colorPickerType:S,colorOpacity:M,color:D,opacity:C,isMultiColor:k})=>{this.datum&&(S==="text-color"&&t.updateTextInputColor(D),Vm(this.datum,S,M,D,C,k),t.update())},c=S=>{const{datum:M,node:D}=this;!M||!D||(fa(M)?(M.fontSize=S,t.updateTextInputFontSize(S)):wd(M)&&(M.text.fontSize=S),t.update())},h=S=>{const{datum:M,node:D}=this;!M||!D||!gl(M)||(OE(M,S),t.update())},d=S=>{const{node:M}=this;!M||!("setTextInputBBox"in M)||(M.setTextInputBBox(S),t.update())},u=({textInputValue:S,bbox:M})=>{const{datum:D}=this;if(M!=null&&S!=null&&S.length>0){if(!fa(D))return;const C=Pm(D,S,M.width);D.set({text:C}),t.update(),t.recordAction(`Change ${D.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${D?.type} annotation`)},p=()=>{t.updateTextInputBBox(void 0)},g=()=>this.active!=null,f=()=>this.copied!=null,x=()=>{const{active:S,datum:M}=this;return S==null||!M?!1:wd(M)&&!M.locked},m=()=>this.active!=null&&!pl(this.datum),b=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{t.select(this.active,this.active),this.hoverCoords&&(this.hovered=t.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:S})=>{this.hovered=t.hoverAtCoords(S,this.active,this.hovered),this.hoverCoords=S},translate:{guard:g,target:"translating",action:({translation:S})=>{t.startInteracting(),t.translate(this.active,S),t.update()}},copy:{guard:m,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:m,action:()=>{this.copied=t.copy(this.active),s()}},paste:{guard:f,action:()=>{t.paste(this.copied)}},selectLast:()=>{const S=this.active;this.active=t.selectLast(),t.select(this.active,S)},click:[{guard:()=>{const{active:S,hovered:M,datum:D}=this;return S==null||M!==S||!D?!1:fa(D)&&!D.locked},target:"text-input"},{action:()=>{const S=this.active;this.active=this.hovered,t.select(this.active,S)}}],dblclick:{guard:x,action:({offset:S})=>{const M=t.getNodeAtCoords(S,this.active)==="text"?"text":"line";t.showAnnotationSettings(this.active,void 0,M)}},dragStart:[{guard:b,target:"dragging",action:()=>{const S=this.active;this.active=this.hovered,t.select(this.active,S),t.startInteracting()}},{action:()=>{const S=this.active;this.active=this.hovered,t.select(this.active,S)}}],color:{guard:g,action:l},fontSize:{guard:g,action:c},lineProps:{guard:g,action:S=>{const M=Uc(this.datum);M?.set(S),t.update(),t.recordAction(`Change ${M?.type} ${Object.entries(S).map(([D,C])=>`${D} to ${C}`).join(", ")}`)}},lineStyle:{guard:g,action:h},lineText:{guard:g,action:S=>{const M=Uc(this.datum);wd(M)&&(yr(M)&&S.position==="center"&&(S.position="inside"),M.text.set(S),t.update())}},updateTextInputBBox:{guard:g,action:d},toolbarPressSettings:{guard:x,action:S=>{t.showAnnotationSettings(this.active,S)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,t.select(this.active,this.active),t.resetToIdle()},delete:()=>{this.active!=null&&(t.delete(this.active),!pl(this.datum)&&t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...a},dragging:{onEnter:(S,M)=>{if(this.active==null)return;const D=t.getAnnotationType(this.active);D&&(this.transitionRoot(D),this.transitionRoot("dragStart",M))},...r},translating:{onEnter:()=>{},translate:{guard:g,target:"translating",action:({translation:S})=>{t.startInteracting(),t.translate(this.active,S),t.update()}},translateEnd:{guard:g,target:"idle"},onExit:()=>{t.stopInteracting(),t.update(),t.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const S=Uc(this.datum);!S||!("getTextInputCoords"in S)||(t.startInteracting(),t.showTextInput(this.active),S.visible=!1,t.update())},updateTextInputBBox:{guard:g,action:d},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:HD,target:"idle",action:p},{guard:UD,target:"idle",action:u}],color:{guard:g,action:l},fontSize:{guard:g,action:c},cancel:{target:"idle",action:p},onExit:()=>{t.stopInteracting(),t.hideTextInput();const S=this.active;if(this.active=this.hovered=void 0,t.select(this.active,S),S==null)return;const M=t.datum(S),D=t.node(S);!M||!D||(M.visible=!0)}}}),this.setActive=e,this.debug=MZ.create(!0,"annotations"),this.snapping=!1}};y([SZ({changeValue(t){this.setActive(t)}}),ba()],Il.prototype,"active",2),y([ba()],Il.prototype,"hovered",2),y([ba()],Il.prototype,"hoverCoords",2),y([ba()],Il.prototype,"copied",2),y([ba()],Il.prototype,"snapping",2),y([ba()],Il.prototype,"datum",2),y([ba()],Il.prototype,"node",2);var{ARRAY:IZ,BOOLEAN:TZ,UNION:kZ,POSITIVE_NUMBER:CZ,ActionOnSet:LZ,LayoutElement:NZ,Menu:wZ,PropertiesArray:OZ,ToolbarButtonProperties:EZ,TempValidate:cx,ChartAxisDirection:RZ}=T,F2=class extends EZ{};y([cx(kZ(["line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","clear"]))],F2.prototype,"value",2);var hx=class extends T.BaseProperties{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new OZ(F2),this.events=new T.Listeners,this.annotationMenu=new wZ(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=t.sharedToolbar.getSharedToolbar("annotations");const e=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",e),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),t.layoutManager.registerElement(NZ.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",e),this.toolbar.destroy()})}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}toggleVisibility(t){this.toolbar.setHidden(!t)}toggleClearButtonEnabled(t){const e=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(e,t)}resetButtonIcons(){for(const[t,e]of this.buttons.entries())switch(e.value){case"line-menu":this.updateButtonByIndex(t,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(t,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(t,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(t,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(t,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(t,e){this.events.dispatch(t,e)}onLayoutStart(t){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(t.layoutBox,this.padding))}refreshButtonsEnabled(t){for(const[e,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(e,t)}onToolbarButtonPress({event:t,button:e,buttonBounds:i}){const s=this.ctx.axisManager.getAxisContext(RZ.Y)[0].scale;switch(e.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsLineAnnotations",eX.filter(n=>n.visible?n.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsFibonacciAnnotations",iX);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsTextAnnotations",nX);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsShapeAnnotations",oX);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsMeasurerAnnotations",aX);break}}onToolbarButtonPressShowMenu(t,e,i,s,n){this.dispatch("pressed-show-menu");const o=this.buttons.findIndex(a=>a.value===i);this.toolbar.toggleActiveButtonByIndex(o),this.annotationMenu.setAnchor({x:e.x+e.width+6,y:e.y}),this.annotationMenu.show({items:n,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(s=>s.value===t);this.updateButtonByIndex(i,{icon:e.icon}),this.dispatch("pressed-create-annotation",{annotation:e.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:t}){t.key==="Escape"&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(t,e){const i=this.buttons.at(t);i&&(i.set({...i.toJson(),...e,value:e.value??i.value}),this.toolbar.updateButtonByIndex(t,{...i.toJson()}))}};y([cx(TZ),LZ({changeValue(t){this.toolbar?.setHidden(!t)}})],hx.prototype,"enabled",2),y([cx(CZ)],hx.prototype,"padding",2),y([cx(IZ)],hx.prototype,"buttons",2);var{BaseModuleInstance:PZ,InteractionState:og,TempValidate:BZ,BOOLEAN:zZ,ChartAxisDirection:FZ,getIconClassNames:_Z}=T,ag="ag-charts-annotations__axis-button",_2=class extends PZ{constructor(t,e,i,s){super(),this.ctx=t,this.axisCtx=e,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!e.scale.bandwidth,t.domManager.addEventListener("focusin",({target:n})=>{const o=n instanceof HTMLElement?n:void 0;!(o&&t.domManager.contains(o,"series-area"))&&o!==this.button.getElement()&&this.hide()}),this.destroyFns.push(t.widgets.seriesWidget.addListener("drag-move",n=>this.onMouseDrag(n)),t.widgets.seriesWidget.addListener("mousemove",n=>this.onMouseMove(n)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter.addListener("click",n=>this.onClick(n)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.hide()),t.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(t,e){this.seriesRect=t,this.padding=e}setup(){const t=new UM.ButtonWidget;return t.addClass(ag),t.setTabIndex(-1),t.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(t.getElement()),t}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",ag)}onMouseMove(t){this.ctx.interactionManager.isState(og.Clickable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(og.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(og.Clickable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(og.Clickable)&&t.device==="touch"&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:s}=t;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(e.target))){this.hide();return}this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(og.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:o,axisCtx:a,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,n.height],[u,p]=[0,n.width];if(o&&(t=cr(Nm(t-n.x,a),a)+n.x,e=cr(Nm(e-n.y,a),a)+n.y),i===FZ.X){const f=c-Math.max(0,r-5);t=t-l/2,e=s==="top"?h-c+f:d-f}else{const f=l-Math.max(0,r-9);t=s==="left"?u-l+f:p-f,e=e-c/2}return{x:t,y:e}}toggleVisibility(t){const{button:e}=this;if(e==null)return;const i=this.enabled&&t;this.toggleClass("-hidden",!i)}toggleClass(t,e){this.button.toggleClass(`${ag}-${t}`,e)}updatePosition({x:t,y:e}){this.button.getElement().style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`}updateButtonElement(){const{button:t}=this;t.addListener("click",()=>this.onButtonClick(this.coords)),t.addListener("touchend",()=>this.onButtonClick(this.coords)),t.addListener("drag-start",()=>{}),t.setInnerHTML(`<span class="${_Z("zoom-in")} ${ag}-icon"></span>`)}};y([BZ(zZ)],_2.prototype,"enabled",2);var{Color:G2,DraggablePopover:GZ,NativeWidget:nA,Vec2:vi,createButton:dx,createCheckbox:VZ,createElementId:V2,createSelect:jZ,createTextArea:WZ,initRovingTabIndex:j2,getIconClassNames:HZ,mapValues:oA,setAttribute:UZ,setAttributes:aA}=T,W2=class BT extends GZ{constructor(e,i){super(e,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new RE(this.ctx,{detached:!0}),this.destroyFns.push(e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,i){const s=super.showWithChildren(e,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",n=>{n.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),re().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(e){super.updatePosition(e);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(e,i,s){const n=Mt("div","ag-charts-dialog__tabs"),o=oA(s,()=>V2("ag-charts-dialog__tab")),a=oA(s,()=>V2("ag-charts-dialog__tab-panel"));for(const[p,g]of ke(s))aA(g.panel,{id:a[p],role:"tabpanel","aria-labelledby":o[p]});const r=p=>{for(const[g,f]of ke(s))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",g===p),h[g].classList.toggle("ag-charts-dialog__tab-button--active",g===p),UZ(h[g],"aria-selected",g===p),g===p&&f.onShow?.()},l=new nA(Mt("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:g}=p;g.target instanceof Element&&g.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new KZ;this.setDragHandle(c);const h=oA(s,(p,g)=>dx({label:this.ctx.localeManager.t(p.label),onPress:()=>r(g)},{id:o[g],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":a[g]})),d=Mt("div","ag-charts-dialog__tab-list");aA(d,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),n.append(l.getElement(),...Object.values(s).map(p=>p.panel)),r(i),j2({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[i]}}createTabPanel(){return Mt("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return Mt("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:i,value:s,onChange:n}){const o=this.createInputGroup(e);aA(o,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const a="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,d=this.ctx.localeManager.t(h),u=dx({icon:c,altText:d,onPress:()=>{for(const p of Array.from(o.children))p.classList.remove(a),p.ariaChecked="false";u.classList.add(a),u.ariaChecked="true",n(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===s&&u.classList.add(a),o.appendChild(u),r.push(u)}return j2({orientation:"horizontal",buttons:r}),o}createSelect({altText:e,label:i,options:s,value:n,onChange:o}){const a=this.createInputGroup(i),r=this.ctx.localeManager.t(e),l=jZ({value:n,options:s,onChange:o},{class:"ag-charts-dialog__select","aria-label":r,title:r});return a.append(l),a}createTextArea({placeholder:e,value:i,onChange:s}){const n=e?this.ctx.localeManager.t(e):void 0;return WZ({value:i,onChange:s},{placeholder:n})}createCheckbox({label:e,checked:i,onChange:s}){const n=`ag-charts__${e}`,o=this.createInputGroup(e,{for:n}),a=VZ({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return o.append(a),o}createColorPicker({color:e,opacity:i,label:s,altText:n,onChange:o,onChangeHide:a,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(n),d=dx({label:h,onPress:u=>{const{anchor:p,fallbackAnchor:g}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:p,fallbackAnchor:g,color:e,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(f,x,m,b)=>{d.style.setProperty("--color",f),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",b),o(f,x,m,b)},onChangeHide:a})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const u=G2.fromString(e),p=new G2(u.r,u.g,u.b,i);d.style.setProperty("--color",p.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return dx({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,i){const s=Mt("div","ag-charts-dialog__input-group"),n=Mt("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(e),i?.for&&n.setAttribute("for",i.for),s.appendChild(n),s}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||e.key!=="Escape"||this.hide()}reposition(){const{seriesRect:e,ctx:i}=this,s=i.domManager.getBoundingClientRect(),n=this.getPopoverElement();if(!e||!n)return;const o=vi.from(0,e.y),a=vi.from(s.width,e.height),r=vi.from(n),l=vi.from(.5,1);let c;if(e.width>1e3){const h=vi.sub(vi.add(o,vi.multiply(a,l)),vi.multiply(r,l));c=vi.sub(h,vi.from(0,BT.offset))}else{const h=vi.sub(vi.add(o,a),r);c=vi.sub(h,BT.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),n=vi.sub(vi.from(i.x,i.y),vi.from(s.left,s.top)),o=vi.add(n,vi.from(0,i.height+5)),a=vi.sub(n,vi.from(0,5));return{anchor:o,fallbackAnchor:a}}};W2.offset=60;var YZ=W2,KZ=class extends nA{constructor(){super(Mt("div","ag-charts-dialog__drag-handle"));const t=new nA(Mt("span",HZ("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},{Listeners:$Z,focusCursorAtEnd:XZ}=T,ZZ=class extends YZ{constructor(t){super(t,"settings"),this.events=new $Z,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(t,e){return this.events.addListener(t,e)}show(t,e){const i=this.createLinearLineTab(t,e),s=this.createLinearTextTab(t,e);let n="dialogHeaderLine";yr(t)?n="dialogHeaderChannel":wE(t)?n="dialogHeaderFibonacciRange":t.type==="date-range"?n="dialogHeaderDateRange":t.type==="price-range"?n="dialogHeaderPriceRange":t.type==="date-price-range"&&(n="dialogHeaderDatePriceRange");const{tabs:o,initialFocus:a}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});e.initialFocus=a,this.showWithChildren([o],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),o="isMultiColor"in t,a=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),o?t.isMultiColor:!1,o,e.onChangeLineColor,e.onChangeHideLineColor),r=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(s.append(a),"background"in t){const c=this.createColorPickerInput("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),!1,!1,e.onChangeFillColor,e.onChangeHideFillColor);s.append(c),n.append(r)}else"showFill"in t?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:c=>e.onChangeLine({showFill:c})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"bands"in t&&i.append(this.createFibonacciRatioSelect(t.bands??10,c=>e.onChangeLine({bands:c}))),"extendStart"in t&&"extendEnd"in t&&i.append(this.createCheckbox({label:yr(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:c=>e.onChangeLine({extendStart:c})}),this.createCheckbox({label:yr(t)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:t.extendEnd??!1,onChange:c=>e.onChangeLine({extendEnd:c})})),"extendAbove"in t&&"extendBelow"in t&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:t.extendAbove??!1,onChange:c=>e.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:t.extendBelow??!1,onChange:c=>e.onChangeLine({extendBelow:c})})),"extendLeft"in t&&"extendRight"in t&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:t.extendLeft??!1,onChange:c=>e.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:t.extendRight??!1,onChange:c=>e.onChangeLine({extendRight:c})})),"reverse"in t&&"showFill"in t&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:t.reverse??!1,onChange:c=>e.onChangeLine({reverse:c})})),i}createLinearTextTab(t,e){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:h=>e.onChangeText({label:h})}),n=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),o=this.createColorPickerInput("text-color",t.text.color,1,!1,!1,e.onChangeTextColor,e.onChangeHideTextColor),a=t.text.position==="inside"?"center":t.text.position,r=this.createPositionRadioGroup(a??"top",h=>e.onChangeText({position:h})),l=this.createAlignmentRadioGroup(t.text.alignment??"center",h=>e.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(n,o,r,l),i.append(s,c),{panel:i,onShow:()=>XZ(s)}}createColorPickerInput(t,e,i,s,n,o,a){const r=t==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=t==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:e,opacity:i,isMultiColor:s,hasMultiColorOption:n,onChange:o,onChangeHide:a})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:BE.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(t),onChange:i=>e(Number(i))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:sX.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(t),onChange:i=>e(Number(i))})}createLineStyleRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:t,onChange:e})}createFontSizeSelect(t,e){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:zE.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(t),onChange:i=>e(Number(i))})}createPositionRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:t,onChange:e})}createAlignmentRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:t,onChange:e})}};function rA(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}function QZ(t,e,i){for(const{update:s}of Object.values(bn))s(t,e,i)}var{BOOLEAN:H2,OBJECT:lA,ChartUpdateType:qZ,InteractionState:Js,ObserveChanges:JZ,PropertiesArray:t9,TempValidate:rg,ChartAxisDirection:e9,Vec2:Yc,keyProperty:i9,valueProperty:s9,Selection:n9,BBox:o9}=T,_d=class L_ extends T.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.toolbar=new hx(this.ctx),this.optionsToolbar=new FD(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return Uc(this.annotationData.at(i))}),this.axesButtons=new gD,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new t9(L_.createAnnotationDatum),this.defaults=new J6,this.container=new T.Group({name:"static-annotations"}),this.annotations=new n9(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new ZZ(this.ctx),this.textInput=new E$(this.ctx),this.isRestoringAnnotations=!0,this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(e.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:e}=this;return new lx({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(Js.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,n)=>{let o;return this.annotations.each((a,r,l)=>{const c=a.containsPoint(i.x,i.y);c&&(o??(o=l)),a.toggleHovered(c||s===l)}),o!=null?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",o==null?void 0:this.annotations.at(o)?.getCursor()),o!==n&&this.update(),o},getNodeAtCoords:(i,s)=>{const n=this.annotations.at(s);if(n)return n.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const n=this.annotations.at(i),o=Uc(this.annotationData.at(i));if(!(!n||!o))return this.translateNode(n,o,s)},copy:i=>{const s=this.annotations.at(i),n=Uc(this.annotationData.at(i));if(!(!s||!n))return this.createAnnotationDatumCopy(s,n)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:n,optionsToolbar:o,toolbar:a}=this;this.hideOverlays(),a.clearActiveButton(),a.resetButtonIcons();const r=i!=null?n.at(i):null,l=s!=null?n.at(s):null;l===r&&r!=null||(l?.toggleActive(!1),o.hide(),r?(this.pushAnnotationState(Js.AnnotationsSelected),r.toggleActive(!0),o.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{o.show(),o.setAnchorScene(r)})):(this.popAnnotationState(Js.AnnotationsSelected),this.popAnnotationState(Js.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Js.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Js.Annotations)},stopInteracting:()=>{this.popAnnotationState(Js.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:(i,s)=>{const n=this.getAnnotationContext();return n?Nd(n,i,s):!0},getAnnotationType:i=>_$(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),s=i!=null?this.annotations.at(i):null;s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=Uc(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const o={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},a=this.getAnnotationContext(),r=c=>Yc.add(s.getTextInputCoords(a,c),Yc.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:o,layout:{getTextInputCoords:r,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||pl(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,n="line")=>{const o=this.annotationData.at(i);if(!Gm(o)&&!yr(o)&&!tg(o)||pl(o))return;const a=c=>(h,d,u,p)=>{this.setColorAndDefault(o.type,c,h,d,u,p),this.optionsToolbar.updateColorPickerColor(c,d,u,p)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${o.type} ${c} to ${o.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:n,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(o.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(o.type,c.position),this.recordActionAfterNextUpdate(`Change ${o.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:a("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:a("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(o.type,c),this.optionsToolbar.updateLineStyleType(eg.find(h=>h.value===c)??eg[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(o.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:a("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(o.type,c)}};this.settingsDialog.show(o,l)}})}setupListeners(){const{ctx:e,optionsToolbar:i,settingsDialog:s,toolbar:n}=this,{seriesWidget:o,seriesDragInterpreter:a,chartWidget:r}=e.widgets;this.destroyFns.push(a.addListener("click",this.hoverTouchPreHandler.bind(this)),a.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),a.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),a.addListener("mousemove",this.onHover.bind(this)),a.addListener("click",this.onClick.bind(this)),a.addListener("dblclick",this.onDoubleClick.bind(this)),a.addListener("drag-start",this.onDragStart.bind(this)),a.addListener("drag-move",this.onDrag.bind(this)),a.addListener("drag-end",this.onDragEnd.bind(this)),o.addListener("keydown",this.onKeyDown.bind(this)),o.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),e.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.zoomManager.addListener("zoom-change",()=>this.onResize()),e.domManager.addListener("resize",()=>this.onResize()),n.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.addListener("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Js.Annotations),this.state.transition(l),this.update()}),n.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.addListener("pressed-unrelated",()=>{this.reset()}),i.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.addListener("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.addListener("pressed-lock",()=>{this.update()}),i.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),i.addListener("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.addListener("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:d,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,d,u,p)}),i.addListener("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.addListener("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.addListener("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:i}=this;this.destroyFns.push(e.annotationManager.attachNode(this.container),()=>e.domManager.removeStyles(ag),()=>i.destroy())}async processData(e){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[i9(this.xKey,void 0,{id:"date"}),s9(this.volumeKey,"number",{id:"volume"})],{dataModel:s,processedData:n}=await e.request("annotations",this.data,{props:i});this.dataModel=s,this.processedData=n}createAnnotationScene(e){if(e.type in bn)return new bn[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(bn)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in bn)return new bn[e.type].datum().set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(bn)}], ignoring.`)}createAnnotation(e,i,s=!0){if(this.annotationData.push(i),s){const n=this.ctx.annotationManager.getAnnotationTypeStyles(e);n&&i.set(n),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,i){const{dataModel:s,processedData:n}=this;let o=li(e),a=li(i);if(!Er(o)||!Er(a)||!s||!n||this.volumeKey==null)return;o>a&&([o,a]=[a,o]);const r=s.resolveKeysById({id:"annotations"},"date",n),l=s.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let h=0;h<n.input.count;h++){const d=r[h];Er(d)&&d>=o&&d<=a&&(c+=l[h])}return c}translateNode(e,i,s){const n=this.getAnnotationConfig(i),o=this.getAnnotationContext();o&&n.translate(e,i,s,o)}createAnnotationDatumCopy(e,i){const s=this.getAnnotationConfig(i),n=new s.datum;n.set(i.toJson());const o=this.getAnnotationContext();if(o)return s.copy(e,i,n,o)}getAnnotationConfig(e){if(e.type in bn)return bn[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(bn)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.isRestoringAnnotations=!0,this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(e){const i=e.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const s of e.axes??[])s.direction===T.ChartAxisDirection.X?this.xAxis=this.getAxis(s,i,this.xAxis?.button):this.yAxis=this.getAxis(s,i,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some(n=>n.hasData),s=this.yAxis.context.seriesIds().some(n=>this.ctx.chartService.series.find(a=>a.id===n)?.visible);return e&&s}animateAnnotations({from:e,to:i,phase:s}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:e,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(o){n.each(a=>{a.opacity=o,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(o)})},onStop(){n.each(o=>{o.opacity=i,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,i,s){const n=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:o="bottom",direction:a}=n,r=e.gridPadding+e.seriesAreaPadding,l=new o9(0,0,i.width,i.height).grow(r,o),c=n.direction===e9.X?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===a)){s??(s=new _2(this.ctx,{...n,snapToGroup:d},g=>this.onAxisButtonClick(g,c),i));const p=rA(e);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:e,context:n,bounds:l,button:s}}recordActionAfterNextUpdate(e,i=["annotations"]){const{defaults:s,ctx:{annotationManager:n,historyManager:o}}=this,a=i.map(r=>r==="defaults"?s:n);this.postUpdateFns.push(()=>{o.record(e,...a),n.fireChangedEvent()})}setColorAndDefault(e,i,s,n,o,a){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:n,opacity:o,isMultiColor:a}),this.defaults.setDefaultColor(e,i,s,n,o,a)}setFontSizeAndDefault(e,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(e,i),this.recordActionAfterNextUpdate(`Change ${e} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(e,i),this.recordActionAfterNextUpdate(`Change ${e} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(e,i),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:i,seriesRect:s,ctx:{annotationManager:n}}=this,o=this.getAnnotationContext();if(!s||!o)return;n.updateData(e.toJson().filter(r=>!pl(r)));const a=this.showAnnotations();this.toolbar.refreshButtonsEnabled(a),this.toolbar.toggleClearButtonEnabled(e.length>0&&a),i.update(e??[],void 0,r=>r.id).each((r,l)=>{if(!a||!this.validateDatum(l)){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),QZ(r,l,o)}),this.postUpdateFns.forEach(r=>r()),this.postUpdateFns=[],this.isRestoringAnnotations=!1}validateDatum(e){if(!this.isRestoringAnnotations)return!0;const i=this.getAnnotationContext(),s=`Annotation [${e.type}] `;return i?e.isValidWithContext(i,s):!0}getAnnotationContext(){const{seriesRect:e,xAxis:i,yAxis:s,snap:n}=this;if(e&&i&&s)return{seriesRect:e,xAxis:{...i.context,bounds:i.bounds,labelPadding:rA(i.layout),snapToGroup:n},yAxis:{...s.context,bounds:s.bounds,labelPadding:rA(i.layout),snapToGroup:n}}}onHover(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=e.sourceEvent.shiftKey,o=Yc.from(e),a=Fs(o,s);i.transition("hover",{offset:o,point:a,shiftKey:n,context:s})}onClick(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=e.sourceEvent.shiftKey,o=Fs(Yc.from(e),s),a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:o,shiftKey:n,textInputValue:a,bbox:r})}onDoubleClick(e){const{state:i}=this;if(!this.getAnnotationContext())return;const n=Yc.from(e);i.transition("dblclick",{offset:n})}onAxisButtonClick(e,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:n}=this;this.pushAnnotationState(Js.Annotations);const o=i==="horizontal";if(n.transition(o?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const a=Fs(e,s);Nd(s,a)&&(n.transition("click",{point:a,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:i})}hoverTouchPreHandler(e){e.device==="touch"&&this.onHover(e)}dragMoveTouchPreHandler(e){e.device==="touch"&&this.ctx.interactionManager.isState(Js.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(Js.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Yc.from(e),n=Fs(s,i),o=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:n,textInputValue:o,bbox:a})}onDrag(e){if(!this.ctx.interactionManager.isState(Js.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Yc.from(e),n=Fs(s,i),o=e.sourceEvent.shiftKey,a=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:n,shiftKey:o,textInputValue:a,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:i}=e??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:n,shiftKey:o}=e,a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:n,shiftKey:o,textInputValue:a,bbox:r,context:s})}onKeyDown(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:n}=e,{shiftKey:o,ctrlKey:a,metaKey:r}=n,l=a||r,c=a||o;i.transition("keyDown",{shiftKey:o,context:s});const h={x:0,y:0},d=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(n.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),n.stopPropagation(),n.preventDefault()),!!l)switch(n.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(e){const{shiftKey:i}=e.sourceEvent,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[e,i]of this.annotationData.entries())pl(i)&&this.annotationData.splice(e,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Js.Annotations)||this.ctx.interactionManager.isState(Js.AnnotationsSelected)}update(e=qZ.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};y([JZ((t,e,i)=>{const{ctx:{annotationManager:s,stateManager:n}}=t;e!==i&&(t.toolbar?.toggleVisibility(!!e),i===!1&&e===!0?n.restoreState(s):e===!1&&t.clear())}),rg(H2)],_d.prototype,"enabled",2),y([rg(lA)],_d.prototype,"toolbar",2),y([rg(lA)],_d.prototype,"optionsToolbar",2),y([rg(lA)],_d.prototype,"axesButtons",2),y([rg(H2)],_d.prototype,"snap",2);var a9=_d,{FONT_SIZE_RATIO:r9,ThemeSymbols:Ri}=T,io={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},os={fill:Ri.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},Kc={color:{$ref:"backgroundColor"},fontSize:{$rem:[r9.LARGE]},fontFamily:{$ref:"fontFamily"}},U2={...Kc,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},ux={...Kc,textAlign:"left"},$c={...Kc,position:"top",alignment:"center",color:{$ref:"textColor"}},Y2={...Kc,position:"top",alignment:"center",color:{$ref:"textColor"}},cA={...Kc,fontSize:{$ref:"fontSize"},color:Ri.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:Ri.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:Ri.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:Ri.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},hA={...io,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...os},text:{...$c},statistics:{...cA}},l9={buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],padding:{$ref:"padding"}},c9={buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]},h9={enabled:!1,line:{...io,handle:{...os},text:{...$c}},"horizontal-line":{...io,handle:{...os},axisLabel:{...U2},text:{...$c}},"vertical-line":{...io,handle:{...os},axisLabel:{...U2},text:{...$c}},"disjoint-channel":{...io,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...os},text:{...Y2}},"parallel-channel":{...io,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...os},text:{...Y2}},"fibonacci-retracement":{...io,strokes:Ri.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...os},text:{...$c,position:"center"},label:{...Kc,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...io,strokes:Ri.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...os},text:{...$c,position:"center"},label:{...Kc,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...io,...ux,color:{$ref:"textColor"},handle:{...os},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...ux,fontWeight:700,handle:{...os},fill:{$ref:"foregroundColor"}},note:{...ux,color:Ri.DEFAULT_TEXTBOX_COLOR,fill:Ri.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...os},background:{fill:Ri.DEFAULT_TEXTBOX_FILL,stroke:Ri.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...ux,color:{$ref:"textColor"},handle:{...os}},arrow:{...io,handle:{...os},text:{...$c}},"arrow-up":{fill:Ri.PALETTE_UP_FILL,handle:{...os,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:Ri.PALETTE_DOWN_FILL,handle:{...os,stroke:{$ref:"foregroundColor"}}},"date-range":{...hA},"price-range":{...hA},"date-price-range":{...hA},"quick-date-price-range":{up:{...io,fill:Ri.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...os},statistics:{...cA,color:"#fff",fill:Ri.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...io,stroke:Ri.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:Ri.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...os,stroke:Ri.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...cA,color:"#fff",fill:Ri.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:l9,optionsToolbar:c9},d9={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new a9(t),themeTemplate:{annotations:h9}},{BaseProperties:u9,ObserveChanges:p9,ProxyProperty:g9,TempValidate:Xc,NUMBER:px,POSITIVE_NUMBER:K2,RATIO:f9,calculatePlacement:y9}=T,Sa=class extends u9{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=Mt("img"),this.imageElement.onload=this.onImageLoad,this.node=new T.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(t,e){this.containerWidth=t,this.containerHeight=e;const i={width:t,height:e},s=y9(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};y([Xc(px,{optional:!0})],Sa.prototype,"top",2),y([Xc(px,{optional:!0})],Sa.prototype,"right",2),y([Xc(px,{optional:!0})],Sa.prototype,"bottom",2),y([Xc(px,{optional:!0})],Sa.prototype,"left",2),y([Xc(K2,{optional:!0})],Sa.prototype,"width",2),y([Xc(K2,{optional:!0})],Sa.prototype,"height",2),y([Xc(f9)],Sa.prototype,"opacity",2),y([g9("imageElement.src"),p9(t=>t.loadedSynchronously=t.complete)],Sa.prototype,"url",2);var{ActionOnSet:m9,OBJECT:x9,TempValidate:b9}=T,$2=class extends T.Background{constructor(){super(...arguments),this.image=new Sa}onLayoutComplete(t){if(super.onLayoutComplete(t),this.image){const{width:e,height:i}=t.chart;this.image.performLayout(e,i)}}onImageLoad(){this.ctx.updateService.update(T.ChartUpdateType.SCENE_RENDER)}};y([b9(x9,{optional:!0}),m9({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],$2.prototype,"image",2);var S9={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new $2(t)},{BOOLEAN:v9,ActionOnSet:M9,LayoutElement:D9,Menu:A9,TempValidate:I9}=T,dA=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],X2=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menu=new A9(this.ctx,"chart-toolbar"),this.toolbar=t.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),t.layoutManager.registerElement(D9.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(t){this.enabled&&(this.updateButton(),this.toolbar.layout(t.layoutBox))}onButtonPressed({event:t,buttonBounds:e}){this.menu.setAnchor({x:e.x+e.width+6,y:e.y}),this.menu.show({items:dA,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:t.sourceEvent,onPress:i=>{this.setChartType(i.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const t=this.getChartType(),e=dA.find(i=>i.value===t)?.icon;e!=null&&this.toolbar.updateButtons([{icon:e,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(t){const e={chartType:t};this.ctx.chartService.publicApi?.updateDelta(e).catch(i=>$.error(i))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return t==null||!dA.some(e=>e.value===t)?"candlestick":t}};y([I9(v9),M9({changeValue(t){this.toolbar?.setHidden(!t)}})],X2.prototype,"enabled",2);var T9={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new X2(t)},gx="ag-charts-context-menu",fx="ag-charts-dark-context-menu",{BOOLEAN:Z2,TempValidate:Q2,initMenuKeyNav:k9,makeAccessibleClickListener:C9,ContextMenuRegistry:lg}=T,uA="context-menu";function L9(t,e){const{children:i}=t??{};if(!i)return[];const s=[];for(const n of Array.from(i))n instanceof e&&s.push(n);return s}var pA=class extends T.BaseModuleInstance{constructor(t){if(super(),this.ctx=t,this.enabled=!0,this.darkTheme=!1,this.extraActions=[],this.extraNodeActions=[],this.extraSeriesAreaActions=[],this.extraLegendItemActions=[],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.interactionManager=t.interactionManager,this.registry=t.contextMenuRegistry,this.groups={default:[],extra:[],extraSeriesArea:[],extraNode:[],extraLegendItem:[]},this.element=t.domManager.addChild("canvas-overlay",uA),this.element.classList.add(gx),this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element)),this.doClose(),this.destroyFns.push(t.domManager.addListener("hidden",()=>this.hide())),typeof MutationObserver<"u"){const e=new MutationObserver(()=>{this.menuElement&&this.element.contains(this.menuElement)&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.destroyFns.push(()=>e.disconnect())}this.destroyFns.push(this.registry.registerDefaultAction({id:"download",type:"all",label:"contextMenuDownload",action:()=>{const e=t.chartService.title;let i="image";e?.enabled&&e?.text!==void 0&&(i=e.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{$.error("Unable to download chart",s)})}})),this.destroyFns.push(this.registry.addListener(e=>this.onContext(e)))}onContext(t){if(!this.enabled)return;t.sourceEvent.preventDefault(),this.showEvent=t.sourceEvent,this.x=t.x,this.y=t.y,this.groups.default=this.registry.filterActions(t.type);for(const r of this.groups.default)r.id==null||r.toggleEnabledOnShow==null||(r.toggleEnabledOnShow(t)?this.registry.enableAction(r.id):this.registry.disableAction(r.id));this.pickedNode=void 0,this.pickedLegendItem=void 0,this.groups.extra=this.extraActions.map(({label:r,action:l})=>({type:"all",label:r,action:l})),this.groups.extraSeriesArea=[],this.groups.extraNode=[],lg.check("series-area",t)&&(this.pickedNode=t.context.pickedNode,this.groups.extraSeriesArea=this.extraSeriesAreaActions.map(({label:r,action:l})=>({type:"series-area",label:r,action:l})),this.pickedNode&&(this.groups.extraNode=this.extraNodeActions.map(({label:r,action:l})=>({type:"node",label:r,action:l})))),this.groups.extraLegendItem=[],lg.check("legend",t)&&(this.pickedLegendItem=t.context.legendItem,this.pickedLegendItem&&(this.groups.extraLegendItem=this.extraLegendItemActions.map(({label:r,action:l})=>({type:"legend",label:r,action:l}))));const{default:e,extra:i,extraSeriesArea:s,extraNode:n,extraLegendItem:o}=this.groups;[e,i,s,n,o].reduce((r,l)=>l.length+r,0)!==0&&this.show(t.sourceEvent)}show(t){this.interactionManager.pushState(T.InteractionState.ContextMenu),this.element.classList.toggle(fx,this.darkTheme);const e=this.renderMenu();this.menuCloser?.close(),this.menuElement?this.element.replaceChild(e,this.menuElement):this.element.appendChild(e),this.menuElement=e,this.element.style.display="block";const i=t.pointerType==="touch"?!1:void 0,s=L9(e,HTMLButtonElement);this.menuCloser=k9({menu:e,buttons:s,orientation:"vertical",sourceEvent:t,overrideFocusVisible:i,autoCloseOnBlur:!0,closeCallback:()=>this.doClose()}),t.pointerType==="touch"&&this.ctx.chartService.overrideFocusVisible(!1)}hide(){this.menuCloser?.close()}doClose(){this.interactionManager.popState(T.InteractionState.ContextMenu),this.menuElement&&(this.element.removeChild(this.menuElement),this.menuElement=void 0,this.menuCloser=void 0),this.element.style.display="none"}renderMenu(){const t=Mt("div");return t.classList.add(`${gx}__menu`),t.classList.toggle(fx,this.darkTheme),t.role="menu",this.appendMenuGroup(t,this.groups.default,!1),this.appendMenuGroup(t,this.groups.extra),this.appendMenuGroup(t,this.groups.extraSeriesArea),this.pickedNode&&this.appendMenuGroup(t,this.groups.extraNode),this.pickedLegendItem&&this.appendMenuGroup(t,this.groups.extraLegendItem),t}appendMenuGroup(t,e,i=!0){e.length!==0&&(i&&t.appendChild(this.createDividerElement()),e.forEach(s=>{const n=this.renderItem(s);n&&t.appendChild(n)}))}renderItem(t){if(t&&typeof t=="object"&&t.constructor===Object)return this.createActionElement(t)}createDividerElement(){const t=Mt("div");return t.classList.add(`${gx}__divider`),t.classList.toggle(fx,this.darkTheme),t.role="separator",t}createActionElement({id:t,label:e,type:i,action:s}){const n=!!(t&&this.registry.isDisabled(t));return this.createButtonElement(i,e,s,n)}createButtonOnClick(t,e){return lg.checkCallback("legend",t,e)?i=>{if(this.pickedLegendItem){const{seriesId:s,itemId:n}=this.pickedLegendItem;e({type:"contextmenu",seriesId:s,itemId:n,event:i}),this.hide()}}:lg.checkCallback("series-area",t,e)?()=>{e({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:lg.checkCallback("node",t,e)?()=>{const{pickedNode:i,showEvent:s}=this,n=i?.series.createNodeContextMenuActionEvent(s,i);n?e(n):$.error("series node not found"),this.hide()}:()=>{e({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}createButtonElement(t,e,i,s){const n=Mt("button");return n.classList.add(`${gx}__item`),n.classList.toggle(fx,this.darkTheme),n.ariaDisabled=s.toString(),n.textContent=this.ctx.localeManager.t(e),n.role="menuitem",n.onclick=C9(n,this.createButtonOnClick(t,i)),n.addEventListener("mouseover",()=>n.focus({preventScroll:!0})),n}reposition(){let{x:t,y:e}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:n}=this.element;t=ft(0,t,i.width-s),e=ft(0,e,i.height-n),this.element.style.left=`${t}px`,this.element.style.top=`calc(${e}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(uA),this.ctx.domManager.removeChild("canvas-overlay",uA)}};y([Q2(Z2)],pA.prototype,"enabled",2),y([Q2(Z2)],pA.prototype,"darkTheme",2);var N9={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:t=>new pA(t),themeTemplate:{contextMenu:{enabled:!0,darkTheme:T.ThemeSymbols.IS_DARK_THEME}}},{BaseProperties:w9,BOOLEAN:q2,FUNCTION:J2,NUMBER:yx,STRING:tR,TempValidate:va,createId:O9,setAttribute:E9}=T,R9="ag-charts-crosshair-label",Gd=class extends T.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};y([va(q2)],Gd.prototype,"enabled",2),y([va(yx)],Gd.prototype,"xOffset",2),y([va(yx)],Gd.prototype,"yOffset",2),y([va(tR,{optional:!0})],Gd.prototype,"format",2),y([va(J2,{optional:!0})],Gd.prototype,"renderer",2);var Vd=class extends w9{constructor(t,e,i){super(),this.domManager=t,this.id=O9(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=t.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(R9),E9(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",e),this.element.setAttribute("data-axis-id",i)}show(t){const{element:e}=this,i=t.x+this.xOffset,s=t.y+this.yOffset;e.style.top=`${Math.round(s)}px`,e.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml(t){t!==void 0&&(this.element.innerHTML=t)}getBBox(){const{element:t}=this;return new T.BBox(t.clientLeft,t.clientTop,t.clientWidth,t.clientHeight)}toggle(t){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!t)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(t,e){if(typeof t=="string")return t;e=e??{};const{text:i=e.text??"",color:s=e.color,backgroundColor:n=e.backgroundColor,opacity:o=e.opacity??1}=t;return`<div class="ag-charts-crosshair-label-content" style="${`opacity: ${o}; background-color: ${n?.toLowerCase()}; color: ${s}`}">
                    <span>${i}</span>
                </div>`}};y([va(q2)],Vd.prototype,"enabled",2),y([va(yx)],Vd.prototype,"xOffset",2),y([va(yx)],Vd.prototype,"yOffset",2),y([va(tR,{optional:!0})],Vd.prototype,"format",2),y([va(J2,{optional:!0})],Vd.prototype,"renderer",2);var{Group:P9,TranslatableGroup:B9,Line:eR,BBox:iR,createId:z9,POSITIVE_NUMBER:sR,RATIO:F9,BOOLEAN:nR,COLOR_STRING:_9,LINE_DASH:G9,OBJECT:V9,InteractionState:mx,TempValidate:Tl,ZIndexMap:oR,formatNumber:j9,ChartAxisDirection:aR}=T,br=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=z9(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new Gd,this.seriesRect=new iR(0,0,0,0),this.bounds=new iR(0,0,0,0),this.crosshairGroup=new B9({name:"crosshairs",zIndex:oR.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new P9({name:`${this.id}-crosshair-lines`,zIndex:oR.SERIES_CROSSHAIR})),this.lineGroupSelection=T.Selection.select(this.lineGroup,eR,!1),this.activeHighlight=void 0,this.axisCtx=t.parent,this.labels={},this.hideCrosshairs(),t.domManager.addEventListener("focusin",({target:e})=>{const i=e instanceof HTMLElement&&t.domManager.contains(e,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(T.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(t.scene.attachNode(this.crosshairGroup),t.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseHoverLike(e)),t.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseHoverLike(e)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),t.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),t.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),t.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),t.layoutManager.addListener("layout:complete",e=>this.layout(e)),()=>Object.values(this.labels).forEach(e=>e.destroy()))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:s="left",axisId:n}=this.axisCtx,o=i.find(c=>c.id===n);if(!o)return;this.axisLayout=o,this.bounds=t.clone().grow(o.gridPadding+o.seriesAreaPadding,s);const{crosshairGroup:a,bounds:r}=this;a.translationX=Math.round(r.x),a.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(t){this.lineGroupSelection.update(t,e=>e.append(new eR),e=>e)}updateLabels(t){const{labels:e,ctx:i}=this;for(const s of t)this.label.enabled&&(e[s]??(e[s]=new Vd(i.domManager,s,this.axisCtx.axisId))),e[s]&&this.updateLabel(e[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(t){const{enabled:e,xOffset:i,yOffset:s,format:n,renderer:o}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=s,t.format=n,t.renderer=o}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,axisLayout:r}=this;if(!r)return;const l=this.isVertical();t.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=n,c.lineDash=o,c.lineDashOffset=a,c.y1=0,c.y2=l?e.height:0,c.x1=0,c.x2=l?0:e.width})}isVertical(){return this.axisCtx.direction===aR.X}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(t){const{labelFormatter:e,axisLayout:i,ctx:{callbackCache:s}}=this;if(e){const n=s.call(this.axisCtx,e,t);if(n!=null)return n}if(typeof t=="number"){const n=(i?.label.fractionDigits??0)+(QT(t)?0:1);return j9(t,n)}return String(t??"")}onClick(t){t.device==="touch"&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?mx.Clickable:mx.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(T.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(mx.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(T.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(mx.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:s,series:n}=t.currentHighlight??{},o=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=o?t.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const a=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(a),e.visible=!0}}isInRange(t){return this.axisCtx.inRange(t)}updatePositions(t){const{seriesRect:e,lineGroupSelection:i}=this;i.each((s,n)=>{const o=t[n];if(!o){s.visible=!1,this.hideLabel(n);return}s.visible=!0;const{value:a,position:r}=o;let l=0,c=0;this.isVertical()?(l=r,s.x=Math.round(l)):(c=r,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+e.x,c+e.y,a,n):this.hideLabel(n)})}getData(t){const{axisCtx:e}=this,i="pointer",{datum:s,xKey:n="",yKey:o=""}=this.activeHighlight??{},{currentX:a,currentY:r}=t,l=this.isVertical(),c=l?a:r;let h=s?.[l?n:o]??"";return e.continuous&&(h=e.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(t){const{axisCtx:e}=this,{datum:i,series:s,xKey:n="",aggregatedValue:o,cumulativeValue:a,midPoint:r}=t,l=s.getKeyProperties(e.direction),c=(e.scale.bandwidth??0)/2,h=s.axes[e.direction]?.id===e.axisId,d=l.indexOf("yKey")>-1&&h,u=l.indexOf("xKey")>-1&&h,p=o??a;if(d&&p!==void 0){const f=e.scale.convert(p)+c;return this.isInRange(f)?{yKey:{value:p,position:f}}:{}}if(u){const f=(this.isVertical()?r?.x:r?.y)??0,x=e.continuous?e.scaleInvert(f):i[n];return this.isInRange(f)?{xKey:{value:x,position:f}}:{}}const g={};return l.forEach(f=>{const x=s.properties[f],m=i[x],b=e.scale.convert(m)+c;this.isInRange(b)&&(g[f]={value:m,position:b})}),g}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),s):e.toLabelHtml(s)}showLabel(t,e,i,s){if(!this.axisLayout)return;const{bounds:n}=this,o=this.labels[s],a=this.getLabelHtml(i,o);o.setLabelHtml(a);const{width:r,height:l}=o.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===aR.X?(h-=4,o.show({x:t-r/2,y:c==="bottom"?n.y+n.height+h:n.y-l-h})):(h-=8,o.show({x:c==="right"?n.x+n.width+h:n.x-r-h,y:e-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const t of Object.keys(this.labels))this.hideLabel(t)}hideLabel(t){this.labels[t]?.toggle(!1)}};y([Tl(nR)],br.prototype,"enabled",2),y([Tl(_9,{optional:!0})],br.prototype,"stroke",2),y([Tl(G9,{optional:!0})],br.prototype,"lineDash",2),y([Tl(sR)],br.prototype,"lineDashOffset",2),y([Tl(sR)],br.prototype,"strokeWidth",2),y([Tl(F9)],br.prototype,"strokeOpacity",2),y([Tl(nR)],br.prototype,"snap",2),y([Tl(V9)],br.prototype,"label",2);var W9={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","number","log","time"],moduleFactory:t=>new br(t),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{BOOLEAN:H9,FUNCTION:U9,ActionOnSet:cg,TempValidate:rR}=T,jd=class extends T.BaseModuleInstance{constructor(t){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=t.dataService}updateCallback(t,e){this.dataService&&(t&&e!=null?this.dataService.updateCallback(e):this.dataService.clearCallback())}};y([cg({newValue(t){this.updateCallback(t,this.getData)}}),rR(H9)],jd.prototype,"enabled",2),y([cg({newValue(t){this.updateCallback(this.enabled,t)}}),rR(U9)],jd.prototype,"getData",2),y([cg({newValue(t){this.dataService.requestThrottle=t}})],jd.prototype,"requestThrottle",2),y([cg({newValue(t){this.dataService.dispatchThrottle=t}})],jd.prototype,"updateThrottle",2),y([cg({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],jd.prototype,"updateDuringInteraction",2);var Y9={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new jd(t),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:K9,partialAssign:$9,mergeDefaults:lR,BBox:Sr}=T,X9=class{constructor(t){this.components=t,this.union=Sr.merge(t)}containsPoint(t,e){if(!this.union.containsPoint(t,e))return!1;for(const i of this.components)if(i.containsPoint(t,e))return!0;return!1}},Z9=class extends T.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new T.Path,this.capsPath=new T.Path,this.bboxes=new X9([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(t){this._datum=t}calculateCapLength(t,e){const{lengthRatio:i=1,length:s}=t,{lengthRatioMultiplier:n,lengthMax:o}=e,a=s??i*n;return Math.min(a,o)}getItemStylerParams(t,e,i){const{datum:s}=this;if(s==null||t.itemStyler==null)return;const{xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r}=t;return{...e,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r,highlighted:i}}formatStyles(t,e,i,s){let{cap:n,...o}=t;const a=this.getItemStylerParams(e,t,s);if(a!=null&&e.itemStyler!=null){const r=i.callWithContext(e.itemStyler,a);o=lR(r,o),n=lR(r?.cap,r,n)}return{whiskerStyle:o,capsStyle:n}}applyStyling(t,e){$9(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i,s){if(this.datum===void 0)return;const{whiskerStyle:n,capsStyle:o}=this.formatStyles(t,e,i,s),{xBar:a,yBar:r,capDefaults:l}=this.datum,c=this.whiskerPath;this.applyStyling(c,n),c.path.clear(!0),r!==void 0&&(c.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),c.path.lineTo(r.upperPoint.x,r.upperPoint.y)),a!==void 0&&(c.path.moveTo(a.lowerPoint.x,a.lowerPoint.y),c.path.lineTo(a.upperPoint.x,a.upperPoint.y)),c.path.closePath(),this.capLength=this.calculateCapLength(o??{},l);const h=this.capLength/2,d=this.capsPath;this.applyStyling(d,o),d.path.clear(!0),r!==void 0&&(d.path.moveTo(r.lowerPoint.x-h,r.lowerPoint.y),d.path.lineTo(r.lowerPoint.x+h,r.lowerPoint.y),d.path.moveTo(r.upperPoint.x-h,r.upperPoint.y),d.path.lineTo(r.upperPoint.x+h,r.upperPoint.y)),a!==void 0&&(d.path.moveTo(a.lowerPoint.x,a.lowerPoint.y-h),d.path.lineTo(a.lowerPoint.x,a.lowerPoint.y+h),d.path.moveTo(a.upperPoint.x,a.upperPoint.y-h),d.path.lineTo(a.upperPoint.x,a.upperPoint.y+h)),d.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},o=t/2,a=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;a.push(new Sr(s.lowerPoint.x,s.upperPoint.y,e.strokeWidth,r),new Sr(s.lowerPoint.x-o,s.lowerPoint.y,t,i.strokeWidth),new Sr(s.upperPoint.x-o,s.upperPoint.y,t,i.strokeWidth))}if(n!==void 0){const r=n.upperPoint.x-n.lowerPoint.x;a.push(new Sr(n.lowerPoint.x,n.upperPoint.y,r,e.strokeWidth),new Sr(n.lowerPoint.x,n.lowerPoint.y-o,i.strokeWidth,t),new Sr(n.upperPoint.x,n.upperPoint.y-o,i.strokeWidth,t))}this.bboxes.components=a,this.bboxes.union=Sr.merge(a)}containsPoint(t,e){return this.bboxes.containsPoint(t,e)}pickNode(t,e){return this.containsPoint(t,e)?this:void 0}nearestSquared(t,e,i){const{bboxes:s}=this;if(s.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=Sr.nearestBox(t,e,s.components);return{nearest:this,distanceSquared:n}}},Q9=class extends T.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:s}=K9(t,e,{children:this.children()});if(i!==void 0&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:cR,TempValidate:Ne,BOOLEAN:hR,COLOR_STRING:dR,FUNCTION:q9,LINE_DASH:uR,NUMBER:J9,OBJECT:t8,POSITIVE_NUMBER:xx,RATIO:gA,STRING:kl}=T,vr=class extends cR{};y([Ne(hR,{optional:!0})],vr.prototype,"visible",2),y([Ne(dR,{optional:!0})],vr.prototype,"stroke",2),y([Ne(xx,{optional:!0})],vr.prototype,"strokeWidth",2),y([Ne(gA,{optional:!0})],vr.prototype,"strokeOpacity",2),y([Ne(uR,{optional:!0})],vr.prototype,"lineDash",2),y([Ne(xx,{optional:!0})],vr.prototype,"lineDashOffset",2),y([Ne(J9,{optional:!0})],vr.prototype,"length",2),y([Ne(gA,{optional:!0})],vr.prototype,"lengthRatio",2);var as=class extends cR{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new vr}};y([Ne(kl,{optional:!0})],as.prototype,"yLowerKey",2),y([Ne(kl,{optional:!0})],as.prototype,"yLowerName",2),y([Ne(kl,{optional:!0})],as.prototype,"yUpperKey",2),y([Ne(kl,{optional:!0})],as.prototype,"yUpperName",2),y([Ne(kl,{optional:!0})],as.prototype,"xLowerKey",2),y([Ne(kl,{optional:!0})],as.prototype,"xLowerName",2),y([Ne(kl,{optional:!0})],as.prototype,"xUpperKey",2),y([Ne(kl,{optional:!0})],as.prototype,"xUpperName",2),y([Ne(hR,{optional:!0})],as.prototype,"visible",2),y([Ne(dR,{optional:!0})],as.prototype,"stroke",2),y([Ne(xx,{optional:!0})],as.prototype,"strokeWidth",2),y([Ne(gA,{optional:!0})],as.prototype,"strokeOpacity",2),y([Ne(uR,{optional:!0})],as.prototype,"lineDash",2),y([Ne(xx,{optional:!0})],as.prototype,"lineDashOffset",2),y([Ne(q9,{optional:!0})],as.prototype,"itemStyler",2),y([Ne(t8)],as.prototype,"cap",2);var{fixNumericExtent:e8,groupAccumulativeValueProperty:i8,mergeDefaults:s8,valueProperty:bx,ChartAxisDirection:fA}=T;function n8(t){for(const e of fm)if(e===t.series.type)return t.series;throw new Error(`AG Charts - unsupported series type '${t.series.type}', error bars supported series types: ${fm.join(", ")}`)}var o8=class cf extends T.BaseModuleInstance{constructor(e){super(),this.properties=new as;const i=n8(e),{annotationGroup:s,annotationSelections:n}=i;this.cartesianSeries=i,this.groupNode=new Q9({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=T.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),i.addEventListener("seriesVisibilityChange",o=>this.onToggleSeriesItem(o)),this.destroyFns.push(i.addListener("data-processed",o=>this.onDataProcessed(o)),i.addListener("data-update",o=>this.onDataUpdate(o)),e.highlightManager.addListener("highlight-change",o=>this.onHighlightChange(o)),()=>s.removeChild(this.groupNode),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties;return $e(e)&&$e(i)||$e(s)&&$e(n)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return e==null?!1:e>0}getUnstackPropertyDefinition(e){const i=[],{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e;return o!=null&&a!=null&&i.push(bx(o,h,{id:`${l}-lower`}),bx(a,h,{id:`${l}-upper`})),s!=null&&n!=null&&i.push(bx(s,c,{id:`${r}-lower`}),bx(n,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(e){const i=[],{cartesianSeries:s}=this,{xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=e,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},g=(x,m,b,S)=>i8(x,"normal","current",{id:`${m}-${b}`,groupId:`errorGroup-${u}-${b}`,...p},S),f=(x,m,b,S)=>{i.push(...g(x,b,"lower",S),...g(m,b,"upper",S))};return a!=null&&r!=null&&f(a,r,c,d),n!=null&&o!=null&&f(n,o,l,h),i}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:i,xUpperKey:s,xErrorsID:n,yLowerKey:o,yUpperKey:a,yErrorsID:r}=this.getMaybeFlippedKeys();if(e===fA.X?$e(i)&&$e(s):$e(o)&&$e(a)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const u={x:n,y:r}[e],p=c.getDomain(d,`${u}-lower`,"value",h),g=c.getDomain(d,`${u}-upper`,"value",h),f=[Math.min(...p,...g),Math.max(...p,...g)];return e8(f)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,$e(e.dataModel)&&$e(e.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),i=this.cartesianSeries.axes[fA.X]?.scale,s=this.cartesianSeries.axes[fA.Y]?.scale;if(!(!i||!s||!e))for(let n=0;n<e.length;n++){const{midPoint:o,xLower:a,xUpper:r,yLower:l,yUpper:c}=this.getDatum(e,n);if(o!=null){let h,d;$e(a)&&$e(r)&&(h={lowerPoint:{x:this.convert(i,a),y:o.y},upperPoint:{x:this.convert(i,r),y:o.y}}),$e(l)&&$e(c)&&(d={lowerPoint:{x:o.x,y:this.convert(s,l)},upperPoint:{x:o.x,y:this.convert(s,c)}}),e[n].xBar=h,e[n].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties,[o,a]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([e,s]=[s,e],[i,n]=[n,i],[o,a]=[a,o]),{xLowerKey:e,xUpperKey:i,xErrorsID:o,yLowerKey:s,yUpperKey:n,yErrorsID:a}}static getDatumKey(e,i,s){if(i==null)return;const n=e.datum[i];if(n!=null){if(typeof n!="number"){$.warnOnce(`Found [${i}] error value of type ${typeof n}. Expected number type`);return}return n+s}}getDatum(e,i){const{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a}=this.getMaybeFlippedKeys(),r=e[i],l=r.cumulativeValue==null||!this.isStacked()?0:r.cumulativeValue-r.yValue,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:cf.getDatumKey(r,s,c),xUpper:cf.getDatumKey(r,n,c),yLower:cf.getDatumKey(r,o,h),yUpper:cf.getDatumKey(r,a,h)}}convert(e,i){const s=(e.bandwidth??0)/2;return e.convert(i)+s}update(){const e=this.getNodeData();e!=null&&(this.selection.update(e),this.selection.each((i,s,n)=>this.updateNode(i,s,n)))}updateNode(e,i,s){e.datum=i,e.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1),e.updateBBoxes()}pickNodeExact(e){const{x:i,y:s}=e,n=this.groupNode.pickNode(i,s);if(n!=null)return{datum:n.datum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e){return this.groupNode.nearestSquared(e.x,e.y)}getTooltipParams(){const{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n,xLowerName:o=e,xUpperName:a=i,yLowerName:r=s,yUpperName:l=n}=this.properties;return{xLowerKey:e,xLowerName:o,xUpperKey:i,xUpperName:a,yLowerKey:s,yLowerName:r,yUpperKey:n,yUpperName:l}}onToggleSeriesItem(e){this.groupNode.visible=e.visible}makeStyle(e){return{visible:e.visible,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cap:s8(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,i,s){const n=this.getNodeData();if(n!=null){for(let o=0;o<n.length;o++)if(e===n[o]){this.selection.at(o)?.update(i,this.properties,this.cartesianSeries,s);break}}}onHighlightChange(e){const{previousHighlight:i,currentHighlight:s}=e;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Z9}getWhiskerProperties(){const{stroke:e,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.properties;return{stroke:e,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}}},a8={series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}},r8={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:fm,moduleFactory:t=>new o8(t),themeTemplate:a8},{ZIndexMap:l8,ActionOnSet:c8,TempValidate:yA,ProxyPropertyOnWrite:pR,OBJECT:h8,RATIO:d8,COLOR_STRING:u8}=T,Sx=class extends T.Background{constructor(){super(...arguments),this.image=new Sa,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new T.Group({name:"foreground",zIndex:l8.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart;let s={x:0,y:0,width:e,height:i};this.image&&(s=this.image.performLayout(e,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(T.ChartUpdateType.SCENE_RENDER)}updateTextNode(t){const{textNode:e}=this;e.fontWeight="bold",e.fontFamily="Impact, sans-serif",e.fontSize=19,e.opacity=.7,e.fill="#9b9b9b",e.textBaseline="top";const i=this.textNode.getBBox(),s=10;e.x=t.x+t.width/2-i.width/2,e.y=t.y+t.height+s}};y([yA(h8,{optional:!0}),c8({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],Sx.prototype,"image",2),y([yA(u8,{optional:!0}),pR("rectNode","fill")],Sx.prototype,"fill",2),y([yA(d8,{optional:!0}),pR("rectNode","fillOpacity")],Sx.prototype,"fillOpacity",2);var p8={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Sx(t)},{TranslatableGroup:g8,ScenePathChangeDetection:gR}=T,mA=class extends g8{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:s}=this,{x:n,y:o,width:a,height:r}=e;t.beginPath(),t.roundRect(n+s,o+s,a-2*s,r-2*s,i),t.clip()}};y([gR()],mA.prototype,"inset",2),y([gR()],mA.prototype,"cornerRadius",2);var{TempValidate:xA,BOOLEAN:f8,POSITIVE_NUMBER:fR,ZIndexMap:Zc,ActionOnSet:yR,CategoryAxis:y8,TextUtils:m8,Padding:x8,Group:Qc,BBox:mR,ProxyProperty:xR}=T,bA=class{constructor(){this.top=0,this.bottom=0}};y([xA(fR)],bA.prototype,"top",2),y([xA(fR)],bA.prototype,"bottom",2);var Wd=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new bA,this.root=new Qc({name:"root"}),this.seriesRoot=this.root.appendChild(new mA({name:"Series-root",zIndex:Zc.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Qc({name:"Axes-Grids",zIndex:Zc.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Qc({name:"Axes-Grids",zIndex:Zc.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Qc({name:"Axes-Labels",zIndex:Zc.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Qc({name:"Axes-Crosslines-Range",zIndex:Zc.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Qc({name:"Axes-Crosslines-Line",zIndex:Zc.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Qc({name:"Axes-Crosslines-Label",zIndex:Zc.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(t=>t.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(t,e){const i=e?.filter(s=>!t.includes(s))??[];this.destroySeries(i);for(const s of t){if(e?.includes(s))continue;s.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const n=this;s.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return n.seriesRect}},s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled")}}destroySeries(t){t?.forEach(e=>{e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(t=>{t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)})}assignAxesToSeries(){const t={};this.axes.forEach(e=>{const i=e.direction;(t[i]??(t[i]=[])).push(e)}),this.series.forEach(e=>{e.directions.forEach(i=>{const s=t[i];if(!s){$.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const n=e.getKeys(i),o=this.findMatchingAxis(s,n);if(!o){$.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`);return}e.axes[i]=o})})}findMatchingAxis(t,e){for(const i of t){if(!i.keys.length)return i;if(e){for(const s of e)if(i.keys.includes(s))return i}}}updateData(t){this.series.forEach(e=>e.setChartData(t)),this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(e=>e.resetAnimation("disabled"))})}async processData(t){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(e=>(e.resetDatumCallbackCache(),e.processData(t))));for(const e of this.axes)e.processData()}computeAxisPadding(){const t=new x8;return this.enabled&&this.axes.forEach(({position:e,thickness:i,line:s,label:n})=>{if(e==null)return;let o;i?o=i:o=(s.enabled?s.width:0)+(n.enabled?m8.getLineHeight(n.fontSize??0)+n.spacing:0),t[e]=Math.ceil(o)}),t}async layout(t,e){const{padding:i}=this,s=this.seriesRect!=null,n=new mR(0,0,t,e-(i.top+i.bottom));this.seriesRect=n,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new mR(0,-i.top,t,e)),this.axes.forEach(o=>{const{position:a="left"}=o;switch(a){case"top":case"bottom":o.range=[0,n.width],o.gridLength=n.height;break;case"right":case"left":{const r=o instanceof y8;o.range=r?[0,n.height]:[n.height,0],o.gridLength=n.width;break}}o.gridPadding=0,o.translation.x=0,o.translation.y=0,a==="right"?o.translation.x=t:a==="bottom"&&(o.translation.y=e),s||o.resetAnimation("initial"),o.calculateLayout(),o.update()}),await Promise.all(this.series.map(o=>o.update({seriesRect:n})))}};y([xA(f8)],Wd.prototype,"enabled",2),y([xR(["seriesRoot","inset"])],Wd.prototype,"inset",2),y([xR(["seriesRoot","cornerRadius"])],Wd.prototype,"cornerRadius",2),y([yR({changeValue(t,e=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i)}})],Wd.prototype,"axes",2),y([yR({changeValue(t,e){this.onSeriesChange(t,e)}})],Wd.prototype,"series",2);var{SliderWidget:bR}=T,b8=class{constructor(t,e){this.ctx=t,this.sliderHandlers=e,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=t,this.toolbar=t.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[t.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const n=this.sliders[i];n.step=bR.STEP_HUNDRETH,n.keyboardStep=bR.STEP_ONE,n.orientation="horizontal",n.setPreventsDefault(!1),n.addListener("drag-start",o=>this.onDragStart(i,o,s)),n.addListener("drag-move",o=>this.onDrag(n,o,s)),n.addListener("drag-end",()=>this.updateSliderRatios()),n.addListener("contextmenu",o=>this.onContextMenu(n,o))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(t){this.toolbar.setHidden(!t)}updateZoom(){const{_min:t,_max:e}=this;if(!(t==null||e==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e}})}updateBounds(t){this.toolbar.setBounds(t)}updateSliderBounds(t,e){this.sliders[t].setBounds(e)}updateMinMax(t,e){this._min=t,this._max=e,this.updateSliderRatios()}updateSliderRatios(){let{_min:t,_max:e}=this;t=Math.round(t*100)/100,e=Math.round(e*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:t,max:e});this.sliders[0].setValueRatio(t),this.sliders[1].setValueRatio(t,{ariaValueText:i}),this.sliders[2].setValueRatio(e)}toCanvasOffsets(t){return{offsetX:this.dragStartX+t.originDeltaX}}moveToFront(t){if(t===1)return;const e=this.sliders[t],i=this.sliders[2-t];this.toolbar.moveChild(i,e.domIndex-1)}onDragStart(t,e,i){const s=this.sliders[t],n=this.toolbar.cssLeft(),o=s.cssLeft();this.dragStartX=n+o+e.offsetX,this.moveToFront(t),e.device==="touch"&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(e))}onDrag(t,e,i){e.device==="touch"&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(e))}onContextMenu(t,{sourceEvent:e,offsetX:i,offsetY:s}){const{x:n,y:o}=this.toolbar.getBounds(),{x:a,y:r}=t.getBounds(),l=i+n+a,c=s+o+r;this.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:e,canvasX:l,canvasY:c},{})}onPanSliderChange(){const t=this.sliders[1].getValueRatio(),e=this._max-this._min;this._min=ft(0,t,1-e),this._max=this._min+e,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{TempValidate:vx,ScenePathChangeDetection:Mx,POSITIVE_NUMBER:SA,BOOLEAN:S8,BBox:v8,ExtendedPath2D:M8}=T,Cl=class extends T.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new M8}setCenter(t,e){this.dirtyPath=!0,(this.centerX!==t||this.centerY!==e)&&(this.centerX=t,this.centerY=e,this.markDirty("center"))}static align(t,e,i,s,n,o,a,r,l){const c=t.align(i+n*a)+l,h=c+t.align(i+n*a,n*(r-a))-2*l,d=t.align(s+o/2);t.setCenter(c,d),e.setCenter(h,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:s}=this,n=t-i/2,o=e-s/2;return new v8(n,o,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:s,strokeWidth:n,cornerRadius:o,grip:a}=this,r=n/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(t-c+r,e-h+r,2*(c-r),2*(h-r),o);const d=3;if(a)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(t+u*d,e+p*d,1,0,2*Math.PI),s.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle=typeof i=="string"?i:"black",t.fill(this.gripPath.getPath2D())}};Cl.className="RangeHandle",y([vx(SA),Mx()],Cl.prototype,"width",2),y([vx(SA),Mx()],Cl.prototype,"height",2),y([vx(SA),Mx()],Cl.prototype,"cornerRadius",2),y([vx(S8),Mx()],Cl.prototype,"grip",2);var{Path:D8,BBox:hg,ExtendedPath2D:A8,clippedRoundRect:vA,POSITIVE_NUMBER:I8,TempValidate:T8,ScenePathChangeDetection:k8}=T,MA=class extends D8{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new A8}layout(t,e,i,s,n,o){n=isNaN(n)?this.min:n,o=isNaN(o)?this.max:o,(t!==this.x||e!==this.y||i!==this.width||this.height!==s||n!==this.min||o!==this.max)&&(this.x=t,this.y=e,this.width=i,this.height=s,this.min=n,this.max=o,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:t,y:e,width:i,height:s}=this;return new hg(t,e,i,s)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:s,min:n,max:o}=this,a=t+i*n,r=t+i*o;return new hg(a,e,r-a,s)}updatePath(){const{path:t,visiblePath:e,x:i,y:s,width:n,height:o,min:a,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;t.clear(),e.clear();const d=this.align(i)+h,u=this.align(s)+h,p=this.align(i,n)-2*h,g=this.align(s,o)-2*h,f=this.align(i+n*a)+h,x=f+this.align(i+n*a,n*(r-a))-2*h,m={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};vA(t,d,u,p,g,m,new hg(d,u,f-d,g)),vA(t,d,u,p,g,m,new hg(x,u,p+d-x,g)),x-f>1&&vA(e,d,u,p,g,m,new hg(f,u,x-f,g))}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};MA.className="RangeMask",y([T8(I8),k8()],MA.prototype,"cornerRadius",2);var C8=class extends T.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:T.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new T.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,s,n,o){this.x=t,this.y=e,this.width=i,this.height=s,this.lOffset=n,this.rOffset=o,this.background.translationX=t,this.background.translationY=e,this.markDirty("RangeSelector")}updateBackground(t,e){t!=null&&this.background.removeChild(t),e!=null&&this.background.appendChild(e),this.markDirty("RangeSelector")}computeBBox(){const{x:t,y:e,width:i,height:s,lOffset:n,rOffset:o}=this;return new T.BBox(t-n,e,i+(n+o),s)}},{BaseModuleInstance:L8,ObserveChanges:DA,TempValidate:Dx,BOOLEAN:N8,POSITIVE_NUMBER:AA}=T,Hd=class extends L8{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new MA,this.minHandle=new Cl,this.maxHandle=new Cl,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,i)=>({x:e,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new C8([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(t.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(T.LayoutElement.Navigator,e=>this.onLayoutStart(e)),this.ctx.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),t.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.domProxy=new b8(t,this),this.updateGroupVisibility(),this.miniChart=new Wd(t)}updateBackground(t,e){this.rangeSelector?.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;this.rangeSelector==null||t===this.rangeSelector.visible||(this.rangeSelector.visible=t,this.domProxy.updateVisibility(t),t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(t){if(this.enabled){const{layoutBox:e}=t,i=this.height+this.spacing;e.shrink(i,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:e,bottom:i}=this.miniChart.computeAxisPadding();t.layoutBox.shrink(e+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(t){const{x:e,width:i}=t.series.rect,{y:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:o,_max:a}=this.domProxy;this.layoutNodes(e,s,i,n,o,a),this.domProxy.updateBounds({x:e,y:s,width:i,height:n})}this.x=e,this.width=i,this.miniChart?.layout(i,n).catch(o=>$.error(o))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(T.InteractionState.ZoomDraggable)}onDragStart(t,{offsetX:e}){this.canDrag()&&(t==="pan"&&(this.panStart=(e-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(t,{offsetX:e}){if(!this.canDrag())return;const{panStart:i,x:s,width:n}=this,{minRange:o}=this.domProxy;let{_min:a,_max:r}=this.domProxy;const l=(e-s)/n;if(t==="min")a=ft(0,l,r-o);else if(t==="max")r=ft(a+o,l,1);else if(t==="pan"&&i!=null){const c=r-a;a=ft(0,l-i,1-c),r=a+c}this.domProxy._min=a,this.domProxy._max=r,this.updateZoom()}onZoomChange(t){const{x:e}=t;if(!e)return;const{x:i,y:s,width:n,height:o}=this,{min:a,max:r}=e;this.domProxy.updateMinMax(a,r),this.layoutNodes(i,s,n,o,a,r)}layoutNodes(t,e,i,s,n,o){const{rangeSelector:a,mask:r,minHandle:l,maxHandle:c}=this;r.layout(t,e,i,s,n,o),a.layout(t,e,i,s,l.width/2,c.width/2),Cl.align(l,c,t,e,i,s,n,o,r.strokeWidth/2),n+(o-n)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((h,d)=>{const u=h.getBBox(),p={x:u.x-t,y:u.y-e,height:u.height,width:u.width};this.domProxy.updateSliderBounds(d,p)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(t){return this.miniChart?.updateData(t)}async processData(t){if(this.miniChart)return this.miniChart?.processData(t)}};y([DA((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],Hd.prototype,"miniChart",2),y([Dx(N8),DA((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(!!e),t.updateGroupVisibility()})],Hd.prototype,"enabled",2),y([Dx(AA)],Hd.prototype,"height",2),y([Dx(AA),DA((t,e)=>{t.mask.cornerRadius=e})],Hd.prototype,"cornerRadius",2),y([Dx(AA)],Hd.prototype,"spacing",2);var w8={enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[T.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}},O8={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Hd(t),removable:!1,themeTemplate:{navigator:w8}},{AND:E8,ARRAY:SR,FUNCTION:R8,NUMBER:P8,OR:B8,ToolbarButtonProperties:z8,TempValidate:F8}=T,vR=class extends z8{};y([F8(B8(P8,E8(SR,SR.restrict({length:2})),R8))],vR.prototype,"value",2);var{BOOLEAN:_8,OBJECT:G8,ChartAxisDirection:IA,LayoutElement:V8,PropertiesArray:j8,Toolbar:W8,TempValidate:MR}=T,TA=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new j8(vR),this.verticalSpacing=10,this.container=t.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new W8(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),t.layoutManager.registerElement(V8.ToolbarBottom,this.onLayoutStart.bind(this)),t.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(t){const{buttons:e,ctx:i,enabled:s,toolbar:n,verticalSpacing:o}=this,{layoutBox:a}=t;if(!s||!i.zoomManager.isZoomEnabled()){n.setHidden(!0);return}n.setHidden(!1),n.updateButtons(e);const r=n.getBounds().height;n.setBounds({x:a.x,y:a.y+a.height-r,width:a.width,height:r}),a.shrink({bottom:r+o})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:t}}){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:s}=i;typeof s=="number"?e.extendToEnd("zoom-buttons",IA.X,s):Array.isArray(s)?e.updateWith("zoom-buttons",IA.X,()=>s):typeof s=="function"&&e.updateWith("zoom-buttons",IA.X,s),this.toolbar.toggleActiveButtonByIndex(t)}};y([MR(_8)],TA.prototype,"enabled",2),y([MR(G8)],TA.prototype,"buttons",2);var DR=1e3*60*60*24,kA=DR*30,H8=DR*365,U8={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new TA(t),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:kA},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*kA},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*kA},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:H8},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(t,e)=>[t,e]}]}}},AR=class hf extends T.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new T.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(e){const i=this.sharedToolbar,s={layout:(n,o)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const a=i.getBounds().width;i.setBounds({x:n.x,y:n.y,width:a}),n.shrink({left:a+i.horizontalSpacing+(o??0)})},addToolbarListener:(n,o)=>i.addToolbarListener(n,a=>{const r=this.getSectionIndex(e,a.button.index);if(r<0)return;const l={...a,button:this.sectionButtons[e][r]};o(l)}),updateButtons:n=>{this.sectionButtons[e]=n;const o=hf.SECTION_ORDER.flatMap(a=>this.sectionButtons[a]);i.updateButtons(o)},updateButtonByIndex:(n,o)=>{i.updateButtonByIndex(this.getIndex(e,n),o)},toggleActiveButtonByIndex:n=>{i.toggleActiveButtonByIndex(this.getIndex(e,n))},toggleButtonEnabledByIndex:(n,o)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,n),o)},setHidden:n=>{n?this.activeSections.delete(e):this.activeSections.add(e);let o=0;for(const a of hf.SECTION_ORDER){if(a!==e){o+=this.sectionButtons[a].length;continue}for(const r of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(o+r,n)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(e,i){let s=0;for(const n of hf.SECTION_ORDER){if(n===e)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(e,i){let s=0;for(const n of hf.SECTION_ORDER){if(n===e)return i>=s+this.sectionButtons[e].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};AR.SECTION_ORDER=["chartToolbar","annotations"];var Y8=AR,K8={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Y8(t)},{CachedTextMeasurerPool:dg,ZIndexMap:$8,LayoutElement:X8,TempValidate:_s,BaseProperties:Z8,OBJECT:Ud,BOOLEAN:Q8,STRING:Yd,COLOR_STRING:q8,RATIO:J8,valueProperty:tQ,TextUtils:eQ,Group:iQ,Label:ug,Rect:sQ,Text:Hi}=T,IR={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},nQ={up:"positive",down:"negative"},oQ={hlc:"altNeutral"},CA=class extends Z8{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};y([_s(q8)],CA.prototype,"fill",2),y([_s(J8)],CA.prototype,"fillOpacity",2);var tn=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new ug,this.positive=new ug,this.negative=new ug,this.neutral=new ug,this.altNeutral=new ug,this.background=new CA,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new iQ({name:"StatusBar",zIndex:$8.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new T.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new sQ),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Hi),value:this.labelGroup.appendChild(new Hi),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=t.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(t.scene.attachNode(this.layer),t.layoutManager.registerElement(X8.Overlay,e=>this.startPerformLayout(e)),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),t.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(t){if(!this.enabled||this.data==null)return;const e=[];for(const n of this.labels){const{id:o,key:a}=n,r=this[a];r==null?n.domain=void 0:e.push(tQ(r,"number",{id:o}))}if(e.length===0)return;const{processedData:i,dataModel:s}=await t.request(this.id,this.data,{props:e});for(const n of this.labels){const{id:o,key:a}=n;this[a]!=null&&(n.domain=s.getDomain(this,o,"value",i))}}startPerformLayout(t){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:e}=t,i=4,s=12,n=0,o=8;this.labelGroup.translationY=e.y+n;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),r=eQ.getLineHeight(a),l=IR[this.getChartType()]??0;let c=0,h,d="alphabetic";if(this.layoutStyle==="block")e.shrink(n+r+o,"top"),h=a+(r-a)/2;else{const{title:u}=this.ctx.chartService;if(d="top",h=n+u.padding,u.enabled){const p=u.node.getBBox();c=p.x+p.width+s}else c=u.padding}for(const{label:u,configuration:p,title:g,value:f,domain:x,formatter:m}of this.labels){if(x==null||!(l&p)){g.visible=!1,f.visible=!1;continue}const b=Math.max(dg.measureText(m.format(x[0]),{font:this.positive.getFont(),textBaseline:d,textAlign:"left"}).width,dg.measureText(m.format(x[1]),{font:this.positive.getFont(),textBaseline:d,textAlign:"left"}).width,dg.measureText(m.format(x[0]),{font:this.negative.getFont(),textBaseline:d,textAlign:"left"}).width,dg.measureText(m.format(x[1]),{font:this.negative.getFont(),textBaseline:d,textAlign:"left"}).width);g.visible=!0,f.visible=!0;const S=dg.measureText(u,{font:this.title.getFont(),textBaseline:d,textAlign:"left"});g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textBaseline=d,g.y=h,g.x=c,c+=S.width+i,f.textBaseline=d,f.y=h,f.x=c,c+=b+s}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-s,this.backgroundNode.height=r+n+o,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(t){this.labelGroup.translationX=t.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const t=this.highlightManager.getActiveHighlight(),e=t?.datum??this.data?.at(-1);if(e==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=t?.itemId;let s=i!=null?nQ[i]:void 0;s==null&&this.openKey!=null&&this.closeKey!=null&&(e[this.openKey]<e[this.closeKey]?s="positive":s="negative");for(const{domain:n,value:o,key:a,formatter:r,style:l}of this.labels){if(n==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=oQ[this.getChartType()]??c);const h=this[a],d=h!=null?e?.[h]:void 0;o.setFont(this[c]),o.fill=this[c].color,o.text=typeof d=="number"?r.format(d):""}}getChartType(){let t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(t==null||IR[t]==null)&&(t="candlestick"),t}};y([_s(Q8)],tn.prototype,"enabled",2),y([_s(Yd,{optional:!0})],tn.prototype,"openKey",2),y([_s(Yd,{optional:!0})],tn.prototype,"highKey",2),y([_s(Yd,{optional:!0})],tn.prototype,"lowKey",2),y([_s(Yd,{optional:!0})],tn.prototype,"closeKey",2),y([_s(Yd,{optional:!0})],tn.prototype,"volumeKey",2),y([_s(Ud)],tn.prototype,"title",2),y([_s(Ud)],tn.prototype,"positive",2),y([_s(Ud)],tn.prototype,"negative",2),y([_s(Ud)],tn.prototype,"neutral",2),y([_s(Ud)],tn.prototype,"altNeutral",2),y([_s(Ud)],tn.prototype,"background",2),y([_s(Yd)],tn.prototype,"layoutStyle",2);var aQ={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new tn(t),themeTemplate:{statusBar:{enabled:!1,layoutStyle:T.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:T.ThemeSymbols.PALETTE_UP_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:T.ThemeSymbols.PALETTE_DOWN_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:T.ThemeSymbols.PALETTE_NEUTRAL_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},{BOOLEAN:LA,STRING:rQ,UNION:lQ,BaseProperties:cQ,CartesianAxis:TR,ChartUpdateType:kR,ObserveChanges:pg,TooltipManager:hQ,TempValidate:gg}=T,qc=class extends cQ{constructor(t){super(),this.moduleContext=t,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0}updateSiblings(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(t??this.groupId))this.updateChart(i)}updateChart(t,e=kR.UPDATE_DATA){t.ctx.updateService.update(e,{skipSync:!0})}enabledZoomSync(){const{syncManager:t,zoomManager:e}=this.moduleContext;this.disableZoomSync=e.addListener("zoom-change",()=>{for(const i of t.getGroupSiblings(this.groupId))i.modulesManager.getModule("sync")?.zoom&&i.ctx.zoomManager.updateZoom("sync",this.mergeZoom(i))})}enabledNodeInteractionSync(){const{highlightManager:t,syncManager:e}=this.moduleContext;this.disableNodeInteractionSync=t.addListener("highlight-change",i=>{for(const s of e.getGroupSiblings(this.groupId))if(s.modulesManager.getModule("sync")?.nodeInteraction){if(!i.currentHighlight?.datum){s.ctx.highlightManager.updateHighlight(s.id),s.ctx.tooltipManager.removeTooltip(s.id);continue}for(const n of s.axes){const o=this.axes==="xy"?"x":this.axes;if(!TR.is(n)||n.direction!==o)continue;const a=s.series.map(r=>{const l=r.getKeys(n.direction);if(n.keys.length&&!n.keys.some(g=>l.includes(g)))return;const{nodeData:c}=r.contextNodeData;if(!c?.length)return;const h=c[0][`${n.direction}Key`];let d=i.currentHighlight.datum[h];const u=Yo(d);u&&(d=d.getTime());const p=c.find(g=>{const f=g.datum[h];return u?f.getTime()===d:f===d});return p?{series:r,nodeDatum:p}:null}).filter($e);if(a.length<2&&a[0]?.nodeDatum!==s.ctx.highlightManager.getActiveHighlight()){const{series:r,nodeDatum:l}=a[0]??{};if(s.ctx.highlightManager.updateHighlight(s.id,l),l){const c=l.midPoint?.x??l.point?.x??0,h=l.midPoint?.y??l.point?.y??0,d=hQ.makeTooltipMeta({type:"pointermove",canvasX:c,canvasY:h},r,l,void 0);s.ctx.tooltipManager.updateTooltip(s.id,d,s.getTooltipContent(r,l.datumIndex,l))}else s.ctx.tooltipManager.removeTooltip(s.id);this.updateChart(s,kR.SERIES_UPDATE)}}}})}getSyncedDomain(t){if(!TR.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroup(this.groupId),[{axes:s}]=i,{direction:n,min:o,max:a,nice:r,reverse:l}=t;for(const c of s)if(n===c.direction&&(r!==c.nice||l!==c.reverse||o!==c.min&&(Pt(o)||Pt(c.min))||a!==c.max&&(Pt(a)||Pt(c.max)))){$.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}return YT(i.flatMap(c=>c.series).filter(c=>{if(c.visible){const h=c.getKeys(t.direction);return t.keys.length?t.keys.some(d=>h.includes(d)):!0}}).flatMap(c=>c.getDomain(t.direction)))}mergeZoom(t){const{zoomManager:e}=this.moduleContext;if(this.axes==="xy")return e.getZoom();const i=t.ctx.zoomManager.getZoom()??{};return i[this.axes]=e.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:t}=this.moduleContext;this.enabled?t.subscribe(this.groupId):t.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(t,e){if(!this.enabled||t===e)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(e),i.subscribe(t),this.updateSiblings(e),this.updateSiblings(t)}onAxesChange(){if(!this.enabled)return;const{syncManager:t}=this.moduleContext;this.updateChart(t.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:t}=this.moduleContext;t.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};qc.className="Sync",y([gg(LA),pg(t=>t.onEnabledChange())],qc.prototype,"enabled",2),y([gg(rQ,{optional:!0}),pg((t,e,i)=>t.onGroupIdChange(e,i))],qc.prototype,"groupId",2),y([gg(lQ(["x","y","xy"],"an axis")),pg(t=>t.onAxesChange())],qc.prototype,"axes",2),y([gg(LA),pg(t=>t.onNodeInteractionChange())],qc.prototype,"nodeInteraction",2),y([gg(LA),pg(t=>t.onZoomChange())],qc.prototype,"zoom",2);var dQ={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new qc(t),themeTemplate:{sync:{enabled:!1}}},{COLOR_STRING:uQ,RATIO:pQ,TempValidate:CR}=T,LR="#2196f3",gQ="#8a8a8a",Ax=class extends T.Rect{constructor(){super(...arguments),this.fill=LR,this.fillOpacity=.2,this.zIndex=T.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=LR}updateInvalid(){this.fill=gQ}};Ax.className="ZoomRect",y([CR(uQ)],Ax.prototype,"fill",2),y([CR(pQ)],Ax.prototype,"fillOpacity",2);var{UNION:fQ}=T,we={min:0,max:1},Jc=we.max-we.min,NR="end",wR="middle",Ix=fQ(["pointer","start","middle","end"],"an anchor point"),Tx=(t,e=we.min,i=we.max)=>ft(e,t,i);function NA(){return{x:{...we},y:{...we}}}function Ui(t){return t.x.max-t.x.min}function Sn(t){return t.y.max-t.y.min}function OR(t,e,i=1e-10){return de(t.min,e.min,i)&&de(t.max,e.max,i)}function fg(t,e,i){return OR(t.x,e.x,i)&&OR(t.y,e.y,i)}function Ds(t){return{x:{min:t?.x?.min??we.min,max:t?.x?.max??we.max},y:{min:t?.y?.min??we.min,max:t?.y?.max??we.max}}}function Mr(t,e,i){if(!t)return{x:0,y:0};const s=Tx(e-t.x,0,t.x+t.width),n=Tx(i-t.y,0,t.y+t.height),o=1/t.width*s,a=1-1/t.height*n;return{x:Tx(o),y:Tx(a)}}function th(t,e,i){return{x:{min:t.x.min+e,max:t.x.max+e},y:{min:t.y.min+i,max:t.y.max+i}}}function kx(t,e,i){return{x:{min:t.x.min,max:t.x.min+Ui(t)*e},y:{min:t.y.min,max:t.y.min+Sn(t)*i}}}function ER(t,e,i){const s=Ui(t),n=Sn(t),o=t.x.min+s/2,a=t.y.min+n/2;return{x:{min:o-s*e/2,max:o+s*e/2},y:{min:a-n*i/2,max:a+n*i/2}}}function vn(t,e,i,s){const{min:n,max:o}=e,a=n+(o-n)/2,r=t.max-t.min;switch(i){case"start":return{min:n,max:e.min+r};case"end":return{min:e.max-r,max:o};case"middle":return{min:a-r/2,max:a+r/2};case"pointer":return yQ(t,e,s??a);default:return{min:n,max:o}}}function yQ(t,e,i){const s=t.max-t.min,n=e.max-e.min,o=i*(1-(n-s)),a=i-o,r=t.min+a,l=t.max+a;return{min:r,max:l}}function mQ(t,e,i){return{x:{min:t.x.min*e,max:t.x.max*e},y:{min:t.y.min*i,max:t.y.max*i}}}function so(t){return{x:Cx(t.x),y:Cx(t.y)}}function Cx(t){const e=t.max-t.min;let i=t.max>we.max?we.max-e:t.min,s=t.min<we.min?e:t.max;return i=Math.max(we.min,i),s=Math.min(we.max,s),{min:i,max:s}}var xQ=class{update(t,e,i,s,n,o){return this.oldZoom??(this.oldZoom=Ds(e===T.ChartAxisDirection.X?{...n,x:o}:{...n,y:o})),this.updateCoords(t.currentX,t.currentY),this.updateZoom(e,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(t,e){this.coords?(this.coords.x2=t,this.coords.y2=e):this.coords={x1:t,y1:e,x2:t,y2:e}}updateZoom(t,e,i){const{coords:s,oldZoom:n}=this;let o=Ds(n);if(!s||!n)return t===T.ChartAxisDirection.X?o.x:o.y;const a=Mr(i,s.x1,s.y1),r=Mr(i,s.x2,s.y2);if(t===T.ChartAxisDirection.X){const c=(r.x-a.x)*Ui(n);return o.x.max+=c,o.x=vn(o.x,n.x,e,a.x),o=so(o),o.x}const l=(r.y-a.y)*Sn(n);return o.y.max-=l,o.y=vn(o.y,n.y,e,a.y),o=so(o),o.y}},bQ="zoom-action",SQ="pan-action",vQ=class{constructor(t,e,i,s,n,o){this.contextMenuRegistry=t,this.zoomManager=e,this.getModuleProperties=i,this.getRect=s,this.updateZoom=n,this.isZoomValid=o}registerActions(t){if(!t)return;const{contextMenuRegistry:e}=this,i=e.registerDefaultAction({id:bQ,type:"series-area",label:"contextMenuZoomToCursor",action:this.onZoomToHere.bind(this),toggleEnabledOnShow:n=>{const o=this.getRect();if(!o)return!0;const a=Mr(o,n.x,n.y);return this.iterateFindNextZoomAtPoint(a)!=null}}),s=e.registerDefaultAction({id:SQ,type:"series-area",label:"contextMenuPanToCursor",action:this.onPanToHere.bind(this),toggleEnabledOnShow:()=>!fg(Ds(this.zoomManager.getZoom()),NA())});return()=>{i(),s()}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!e||!t?.target||!(t instanceof MouseEvent))return;const s={x:0,y:0,width:e.width,height:e.height};return Mr(s,t.offsetX,t.offsetY)}onZoomToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=this.iterateFindNextZoomAtPoint(e);i!=null&&this.updateZoom(i)}onPanToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=Ds(this.zoomManager.getZoom()),s=Ui(i),n=Sn(i),o=e.x*s,a=e.y*n,r=Jc/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};l=ER(l,s,n),l=th(l,i.x.min-e.x+o,i.y.min-e.y+a),this.updateZoom(so(l))}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const s=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=Ds(this.zoomManager.getZoom()),o=t.x*Ui(n),a=t.y*Sn(n),r=Jc/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};return l=ER(l,i?Ui(n)*e:Jc,s?Sn(n)*e:Jc),l=th(l,n.x.min-t.x+o,n.y.min-t.y+a),so(l)}},{BBoxValues:MQ,ChartAxisDirection:DQ}=T,AQ=class{constructor(t){this.axesHandlers=t,this.axes=[]}destroy(){this.axes.forEach(t=>t.div.destroy())}update(t,e){if(this.axes.forEach(r=>r.div.setHidden(!t)),!t)return;const{X:i,Y:s}=T.ChartAxisDirection,n=[...e.axisManager.getAxisContext(i),...e.axisManager.getAxisContext(s)],{removed:o,added:a}=this.diffAxisIds(n);o.length>0&&(this.axes=this.axes.filter(r=>o.includes(r.axisId)?(r.div.destroy(),!1):!0));for(const r of a){const{axisId:l,direction:c}=r;this.axes.push(this.initAxis(e,l,this.axesHandlers,c))}for(const r of this.axes){const c=n.find(h=>h.axisId===r.axisId).getCanvasBounds();r.div.setHidden(MQ.isEmpty(c)),c!==void 0&&r.div.setBounds(c)}}toggleAxisDraggingCursor(t,e){for(const i of this.axes)i.direction===t&&i.div.setCursor(e?this.getCursor(t):void 0)}getCursor(t){return t===DQ.X?"ew-resize":"ns-resize"}initAxis(t,e,i,s){const o=t.proxyInteractionService.createProxyElement({type:"region",domManagerId:e,where:"afterend"});return o.setCursor(this.getCursor(s)),o.addListener("drag-start",a=>{a.device==="touch"&&a.sourceEvent.preventDefault(),i.onDragStart(e,s)}),o.addListener("drag-move",a=>i.onDrag(a)),o.addListener("drag-end",i.onDragEnd),o.addListener("dblclick",()=>i.onDoubleClick(e,s)),{axisId:e,div:o,direction:s}}diffAxisIds(t){const e=this.axes.map(o=>o.axisId),i=t.map(o=>o.axisId),s=e.filter(o=>!i.includes(o)),n=t.filter(o=>!e.includes(o.axisId));return{removed:s,added:n}}},RR=16,IQ={off:1,short:.01,long:.002},TQ=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max(typeof t=="number"?t:IQ[t]??1,1e-4)}addListener(t,e){return this.onUpdate=e,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(t){this.updateCoords(t.currentX,t.currentY);const{x1:e=0,y1:i=0,x2:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:e-s,deltaY:i-n})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,s=0;if(t.length>0){const n=this.zoomCoordsHistoryIndex%RR;let o=n-1;o<0&&(o=t.length-1);let a=n;a>=t.length&&(a=0);const r=t[o],l=t[a];e=r.x-l.x,i=r.y-l.y,s=r.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const n=e/s,o=i/s,a=Math.hypot(n,o),r=Math.atan2(o,n),l=performance.now();this.inertiaHandle=re().requestAnimationFrame(c=>{this.animateInertia(c,c,l,a,r)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:s,y2:n}=t,o=Date.now();e[i%RR]={x:s,y:n,t:o},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,s,n){const o=1-this.decelerationValue,a=-s/Math.log(o),r=s*(o**(e-i)-1)/Math.log(o),l=s*(o**(t-i)-1)/Math.log(o);this.onUpdate?.({type:"update",deltaX:-Math.cos(n)*(l-r),deltaY:-Math.sin(n)*(l-r)}),!(l>=a-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,t,i,s,n)}))}updateCoords(t,e){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:t,y2:e}:this.coords={x1:t,y1:e,x2:t,y2:e}}translateZooms(t,e,i,s){const n=Mr(t,t.x+Math.abs(i),t.y+t.height-Math.abs(s)),o=Math.sign(i)*n.x,a=-Math.sign(s)*n.y,r={};for(const[l,{direction:c,zoom:h}]of ke(e)){if(h&&h.min===we.min&&h.max===we.max)continue;let d=Ds({[c]:h});d=so(th(d,o*Ui(d),a*Sn(d))),r[l]={direction:c,zoom:d[c]}}return r}},kQ=200,CQ=class{update(t,e,i,s){const n=t.deltaX*e*kQ;return this.translateZooms(i,s,n)}translateZooms(t,e,i){const s={},n=Mr(t,t.x+Math.abs(i),0),o=i<0?-n.x:n.x;for(const[a,{direction:r,zoom:l}]of ke(e)){if(r!==T.ChartAxisDirection.X)continue;let c=Ds({x:l});c=so(th(c,o*Ui(c),0)),s[a]={direction:r,zoom:c.x}}return s}},LQ=class{updateAxes(t,e,i,s){const n=t.sourceEvent,o={},{anchorPointX:a,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=e,d=Mr(i,n.offsetX??n.clientX,n.offsetY??n.clientY);for(const[u,{direction:p,zoom:g}]of ke(s)){if(g==null)continue;let f={...g};const x=h*t.deltaY*(g.max-g.min);if(p===T.ChartAxisDirection.X&&l)f.max+=x,f=vn(f,g,a,d.x);else if(p===T.ChartAxisDirection.Y&&c)f.max+=x,f=vn(f,g,r,d.y);else continue;o[u]={direction:p,zoom:Cx(f)}}return o}update(t,e,i,s){const{anchorPointX:n,anchorPointY:o,isScalingX:a,isScalingY:r,scrollingStep:l}=e,c=t.offsetX+i.x,h=t.offsetY+i.y,d=Mr(i,c,h),u=t.deltaY;let p=Ds(s);return p.x.max+=a?l*u*Ui(s):0,p.y.max+=r?l*u*Sn(s):0,a&&(p.x=vn(p.x,s.x,n,d.x)),r&&(p.y=vn(p.y,s.y,o,d.y)),p=so(p),p}updateDelta(t,e,i){const{anchorPointX:s,anchorPointY:n,isScalingX:o,isScalingY:a,scrollingStep:r}=e;let l=Ds(i);return l.x.max+=o?r*-t*Ui(i):0,l.y.max+=a?r*-t*Sn(i):0,o&&(l.x=vn(l.x,i.x,s)),a&&(l.y=vn(l.y,i.y,n)),l=so(l),l}},NQ=class{constructor(t,e,i){this.rect=t,this.getZoom=e,this.isZoomValid=i,this.rect.visible=!1}update(t,e,i){const s=t.currentX+(i?.x??0),n=t.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,n,e,i),this.updateRect(i)}stop(t,e,i){let s=Ds();if(!t||!e)return s;this.coords&&(s=this.createZoomFromCoords(e,i));const n=e.width/t.width,o=e.height/t.height;return s=so(mQ(s,n,o)),this.reset(),s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(t,e,i,s){if(!this.coords){this.coords={x1:t,y1:e,x2:t,y2:e};return}const{coords:n}=this;if(n.x2=t,n.y2=e,!s)return;const{isScalingX:o,isScalingY:a,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&o&&a){const c=s.width/s.height;n.y2<n.y1?n.y2=Math.min(n.y1-l.width/c,n.y1):n.y2=Math.max(n.y1+l.width/c,n.y1)}o||(n.x1=s.x,n.x2=s.x+s.width),a||(n.y1=s.y,n.y2=s.y+s.height)}updateRect(t){if(!t)return;const{rect:e}=this,i=this.getNormalisedDimensions(),{width:s,height:n}=i;let{x:o,y:a}=i;o=Math.max(o,t.x),o-=Math.max(0,o+s-(t.x+t.width)),a=Math.max(a,t.y),a-=Math.max(0,a+n-(t.y+t.height)),e.x=o,e.y=a,e.width=s,e.height=n;const r=this.createZoomFromCoords(t,this.getZoom());this.isZoomValid(r)?e.updateValid():e.updateInvalid()}createZoomFromCoords(t,e){const i=Ds(e),s=this.getNormalisedDimensions(),n=Mr(t,s.x,s.y+s.height),o=s.width/t.width,a=s.height/t.height;let r=kx(i,o,a);const l=n.x*Ui(i),c=n.y*Sn(i);return r=th(r,l,c),r=so(r),r}getNormalisedDimensions(){const{x1:t=0,y1:e=0,x2:i=0,y2:s=0}=this.coords??{},n=t<=i?t:i,o=e<=s?e:s,a=t<=i?i-t:t-i,r=e<=s?s-e:e-s;return{x:n,y:o,width:a,height:r}}},{ARRAY:wQ,BOOLEAN:OQ,STRING:EQ,UNION:PR,ActionOnSet:BR,BaseProperties:RQ,ChartAxisDirection:PQ,NativeWidget:BQ,PropertiesArray:zQ,Toolbar:FQ,ToolbarButtonProperties:_Q,TempValidate:eh}=T,wA=class extends _Q{};y([eh(PR(["reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"]))],wA.prototype,"value",2),y([eh(EQ)],wA.prototype,"section",2);var Kd=class extends RQ{constructor(t,e,i,s,n,o,a){super(),this.ctx=t,this.getModuleProperties=e,this.getResetZoom=i,this.updateZoom=s,this.updateAxisZoom=n,this.resetZoom=o,this.isZoomValid=a,this.enabled=!1,this.buttons=new zQ(wA),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new BQ(Mt("div")),this.container.addClass("ag-charts-zoom-buttons"),t.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new FQ(t.localeManager),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toggleVisibility(this.visible==="always"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),t.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),t.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const t of this.destroyFns)t()}toggleVisibleZoomed(t){this.visible==="zoomed"&&this.toggleVisibility(!t)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(t){const{buttons:e,container:i}=this,{rect:s}=t.series;this.toolbar.updateButtons(e),this.toggleButtons();const n=i.getBounds().height;i.setBounds({y:s.y+s.height-n})}onHover(t){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:e,detectionRange:i,ctx:{scene:s}}=this,{currentY:n,sourceEvent:{target:o}}=t,a=e.getElement(),r=a.offsetTop-i,l=n>r&&n<s.canvas.element.offsetHeight||o===a;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(t,e=!1){const{container:i,toolbar:s,verticalSpacing:n}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!t);const o=s.getElement();o.style.transitionDuration=e?"0s":"",o.style.transform=t?"translateY(0)":`translateY(${i.getBounds().height+n}px)`}toggleButtons(){const t=Ds(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&fg(this.previousZoom,t))){this.previousZoom=t;for(const[e,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=t.x.min>we.min;break;case"pan-end":s=t.x.max<we.max;break;case"pan-left":s=t.x.min>we.min;break;case"pan-right":s=t.x.max<we.max;break;case"zoom-out":s=!fg(t,NA());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",t,this.getModuleProperties()));break;case"reset":s=!fg(t,this.getResetZoom());break}this.toolbar.toggleButtonEnabledByIndex(e,s)}}}onButtonPress({button:t}){if(!this.enabled||this.toolbar.isHidden())return;const e=this.getModuleProperties();if(e.independentAxes&&t.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:n,zoom:o}]of ke(i))o!=null&&this.onButtonPressAxis(t,e,s,n,o)}else this.onButtonPressUnified(t,e)}onButtonFocus(t){this.toggleVisibility(!0,!0)}onButtonPressAxis(t,e,i,s,n){const{isScalingX:o,isScalingY:a,scrollingStep:r}=e;let l={...n};const c=n.max-n.min;switch(t.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=we.max;break;case"pan-left":l.min-=c*r,l.max-=c*r;break;case"pan-right":l.min+=c*r,l.max+=c*r;break;case"zoom-in":case"zoom-out":{const h=s===PQ.X,d=h&&o||!h&&a;let u=t.value==="zoom-in"?1-r:1+r;d||(u=1);const p=h?this.getAnchorPointX(e):this.getAnchorPointY(e);l.max=l.min+(l.max-l.min)*u,l=vn(l,n,p);break}}this.updateAxisZoom(i,s,Cx(l))}onButtonPressUnified(t,e){const{scrollingStep:i}=e,s=Ds(this.ctx.zoomManager.getZoom());let n=Ds(s);switch(t.value){case"reset":this.resetZoom();return;case"pan-start":n.x.max=Ui(n),n.x.min=0;break;case"pan-end":n.x.min=we.max-Ui(n),n.x.max=we.max;break;case"pan-left":n=th(n,-Ui(n)*i,0);break;case"pan-right":n=th(n,Ui(n)*i,0);break;case"zoom-in":case"zoom-out":{n=this.getNextZoomStateUnified(t.value,s,e);break}}this.updateZoom(so(n))}getNextZoomStateUnified(t,e,i){const{isScalingX:s,isScalingY:n,scrollingStep:o}=i,a=t==="zoom-in"?1-o:1+o,r=kx(e,s?a:1,n?a:1);return r.x=vn(r.x,e.x,this.getAnchorPointX(i)),r.y=vn(r.y,e.y,this.getAnchorPointY(i)),r}getAnchorPointX(t){const e=this.anchorPointX??t.anchorPointX;return e==="pointer"?NR:e}getAnchorPointY(t){const e=this.anchorPointY??t.anchorPointY;return e==="pointer"?wR:e}};y([eh(OQ),BR({changeValue(t){this.toolbar?.setHidden(!t)}})],Kd.prototype,"enabled",2),y([eh(wQ)],Kd.prototype,"buttons",2),y([eh(PR(["always","zoomed","hover"])),BR({changeValue(t,e){e!=null&&this.toggleVisibility(t==="always")}})],Kd.prototype,"visible",2),y([eh(Ix)],Kd.prototype,"anchorPointX",2),y([eh(Ix)],Kd.prototype,"anchorPointY",2);var ih=1e6;function Lx({min:t,max:e},i,s,n){return n===0?0:ih*((i-s)/n*(e-t)+t)}function GQ(t,e,i,s,n,o){[t,e]=[Math.min(t,e),Math.max(t,e)],[i,s]=[Math.min(i,s),Math.max(i,s)];const a=ih*(i-n)/o,r=ih*(s-n)/o,l=(i-n)/(s-n),c=(t-l*e)/(ih-a+l*(r-ih)),h=(e+(r-ih)*c)/r;return{min:c,max:h}}function zR(t,e,i,s){e===0&&(e=30),s===0&&(s=30);const n=t-e,o=t+e,a=i-s,r=i+s;return!(o<a||r<n)}var VQ=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(t,e,i){if(t.sourceEvent.targetTouches.length!==2)return!1;t.sourceEvent.preventDefault();const s=Array.from(t.sourceEvent.targetTouches),{x:n,y:o,width:a,height:r}=e.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(g=>g.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const g of[0,1]){const f=s[g].clientX,x=o+r-s[g].clientY;this.touchStart.origins[g].identifier=s[g].identifier,this.touchStart.origins[g].normalX=Lx(this.initialZoom.x,f,n,a),this.touchStart.origins[g].normalY=Lx(this.initialZoom.y,x,o,r)}const[l,c]=s,[h,d]=this.touchStart.origins,u=zR(l.clientX,l.radiusX,c.clientX,c.radiusX);return zR(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=d.normalY=(h.normalY+d.normalY)/2),u&&(h.normalX=d.normalX=(h.normalX+d.normalX)/2),!0}update(t,e){t.sourceEvent.preventDefault();const i=Array.from(t.sourceEvent.targetTouches),{x:s,y:n,width:o,height:a}=e.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(m=>i.find(b=>b.identifier===r[m].identifier)),c=r[0].normalX,h=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,g=r[1].normalY,f=n+a-l[0].clientY,x=n+a-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,g,f,x,s,n,o,a)}end(t){const e=Array.from(t.sourceEvent.targetTouches).map(i=>i.identifier);return!e.includes(this.touchStart.origins[0].identifier)||!e.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(t,e,i,s,n,o,a,r,l,c,h,d){const{initialZoom:u,previous:p}=this,g=FR(t,e,i,s,p,"a1","a2",l,h,u.x),f=FR(n,o,a,r,p,"b1","b2",c,d,u.y);return{x:g,y:f}}};function FR(t,e,i,s,n,o,a,r,l,c){if(t!=e){const h=n[o],d=n[a];return Math.abs(i-h)+Math.abs(s-d)<=1?(i=h,s=d):(n[o]=i,n[a]=s),GQ(t,e,i,s,r,l)}else{const h=Lx(c,i,r,l),d=Lx(c,s,r,l),u=(h+d)/2,p=(t-u)/ih;return{min:c.min+p,max:c.max+p}}}var{BOOLEAN:Ma,NUMBER:_R,POSITIVE_NUMBER:jQ,RATIO:OA,UNION:EA,OBJECT:GR,OR:WQ,ActionOnSet:Nx,ChartAxisDirection:sh,ChartUpdateType:VR,Deprecated:jR,TempValidate:ei,InteractionState:wx,ProxyProperty:HQ}=T,Ox=t=>ES(t,10),WR="zoom-cursor",RA="zoom-tooltip",PA=class extends T.BaseProperties{constructor(t){super(),this.onChange=t,this.enabled=!1,this.padding=0}};y([ei(Ma),Nx({changeValue(t){this.onChange({enabled:t,padding:this.padding})}})],PA.prototype,"enabled",2),y([ei(OA),Nx({changeValue(t){this.onChange({enabled:this.enabled,padding:t})}})],PA.prototype,"padding",2);var hi=class extends T.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=Jc/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=NR,this.anchorPointY=wR,this.autoScaling=new PA(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.buttons=new Kd(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new xQ,this.panner=new TQ,this.scroller=new LQ,this.scrollPanner=new CQ,this.twoFingers=new VQ,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=xG(()=>{this.isFirstWheelEvent=!0},100);const e=new Ax;this.selector=new NQ(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new vQ(t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new AQ({onDragStart:(i,s)=>this.onAxisDragStart(i,s),onDrag:i=>{this.onDragMove({...i,currentX:i.offsetX,currentY:i.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(i,s)=>{this.hoveredAxis={id:i,direction:s},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(t.scene.attachNode(e),t.chartEventManager.addListener("series-keynav-zoom",i=>this.onNavZoom(i)),t.widgets.seriesDragInterpreter.addListener("dblclick",i=>this.onDoubleClick(i)),t.widgets.seriesDragInterpreter.addListener("drag-move",i=>this.onDragMove(i)),t.widgets.seriesDragInterpreter.addListener("drag-start",i=>this.onDragStart(i)),t.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),t.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),t.widgets.seriesWidget.addListener("touchstart",(i,s)=>this.onTouchStart(i,s)),t.widgets.seriesWidget.addListener("touchmove",(i,s)=>this.onTouchMove(i,s)),t.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),t.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),t.updateService.addListener("process-data",i=>this.onProcessData(i)),t.layoutManager.addListener("layout:complete",i=>this.onLayoutComplete(i)),t.zoomManager.addListener("zoom-change",i=>this.onZoomChange(i)),t.zoomManager.addListener("zoom-pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(t){this.ctx.zoomManager.setZoomModuleEnabled(t),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(t))}isIgnoredTouch(t){if(t?.device!=="touch")return!1;if(this.ctx.chartService.touch.dragAction!=="drag")return!0;if(this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:e,y:i}=this.getZoom();return e.min===0&&e.max===1&&i.min===0&&i.max===1}onDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i,hoveredAxis:s,ctx:{zoomManager:n}}=this;!e||!i||!this.isState(wx.ZoomClickable)||(s?n.resetAxisZoom("zoom",s.id):t?.preventZoomDblClick||this.resetZoom())}onDragStart(t){const{enabled:e,enableAxisDragging:i,enablePanning:s,enableSelecting:n,hoveredAxis:o,ctx:{domManager:a,zoomManager:r}}=this;if(!e||!this.hoveredAxis&&(!this.isState(wx.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(t)))return;this.panner.stopInteractions();let l=0;if(i&&o)l=1;else if(t!=null){const c=this.isPanningKeyPressed(t.sourceEvent);s&&(!n||c)?(a.updateCursor(WR,"grabbing"),l=2,this.panner.start()):n&&!c&&(l=3)}(this.dragState=l)!==0&&r.fireZoomPanStartEvent("zoom")}onDragMove(t){const{anchorPointX:e,anchorPointY:i,axisDragger:s,dragState:n,enabled:o,paddedRect:a,panner:r,selector:l,seriesRect:c,shouldFlipXY:h,hoveredAxis:d,ctx:{interactionManager:u,tooltipManager:p,updateService:g,zoomManager:f}}=this;if(!o||!a||!c||!d&&(!this.isState(wx.ZoomDraggable)||this.isIgnoredTouch(t)))return;u.pushState(T.InteractionState.ZoomDrag),t.device==="touch"&&t.sourceEvent.preventDefault();const x=this.getZoom();switch(n){case 1:{if(!d)break;const{id:m,direction:b}=d;let S=b===sh.X?e:i;h&&(S=b===sh.X?i:e);const M=f.getAxisZoom(m),D=s.update(t,b,S,c,x,M);f.setAxisManuallyAdjusted("zoom",m),this.updateAxisZoom(m,b,D);break}case 2:r.update(t);break;case 3:l.update(t,this.getModuleProperties(),a);break;case 0:return}p.updateTooltip(RA),g.update(VR.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:t,dragState:e,enabled:i,panner:s,selector:n,ctx:{domManager:o,interactionManager:a,tooltipManager:r}}=this;if(a.popState(T.InteractionState.ZoomDrag),!(!i||e===0)){switch(e){case 1:this.hoveredAxis=void 0,t.stop();break;case 2:s.stop();break;case 3:{if(!n.didUpdate())break;const l=this.getZoom(),c=n.stop(this.seriesRect,this.paddedRect,l);this.updateZoom(c);break}}this.dragState=0,o.updateCursor(WR),r.removeTooltip(RA)}}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(T.InteractionState.Default)||!e||!i||(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:s,paddedRect:n}=this;if(!e||!s||!n||!this.isState(wx.ZoomWheelable))return;const{deltaX:o,deltaY:a}=t.sourceEvent,r=o!=null&&a!=null&&Math.abs(o)>Math.abs(a);i&&r?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:s,ctx:{zoomManager:n}}=this;if(!s)return;t.sourceEvent.preventDefault();const o=i.update(t,e,s,n.getAxisZooms());for(const[a,{direction:r,zoom:l}]of ke(o))this.updateAxisZoom(a,r,l)}onWheelScrolling(t){const{enableAxisDragging:e,enableIndependentAxes:i,hoveredAxis:s,scroller:n,seriesRect:o,ctx:{zoomManager:a}}=this;if(!o)return;const r=this.getZoom();let l=t.deltaY>0&&this.isMaxZoom(r);const c=e&&s!=null;let h=this.isScalingX(),d=this.isScalingY();c&&(h=s.direction===T.ChartAxisDirection.X,d=!h);const u=this.getModuleProperties({isScalingX:h,isScalingY:d});let p=!0;if(i===!0){const g=n.updateAxes(t,u,o,a.getAxisZooms());for(const[f,{direction:x,zoom:m}]of ke(g))c&&s.id!==f||p&&(p=this.updateAxisZoom(f,x,m))}else{const g=n.update(t,u,o,this.getZoom());p=this.updateUnifiedZoom(g)}l||(l=t.deltaY<0&&!p),(!this.isFirstWheelEvent||!l)&&t.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(t,e){this.hoveredAxis={id:t,direction:e},this.onDragStart(void 0)}onTouchStart(t,e){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(t,e,this.getZoom())&&(this.dragState=4)}onTouchMove(t,e){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(t,e);this.updateZoom(so(i))}onTouchEnd(t){!this.enableTwoFingerZoom||this.dragState!==4||(t.sourceEvent.preventDefault(),this.twoFingers.end(t)&&(this.dragState=0))}onProcessData(t){this.shouldFlipXY=t.series.shouldFlipXY}onLayoutComplete(t){this.domProxy.update(this.enableAxisDragging,this.ctx),this.enabled&&(this.seriesRect=t.series.rect,this.paddedRect=t.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursors())}onZoomChange(t){t.callerId!=="zoom"&&this.panner.stopInteractions();const e=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(e))}onZoomPanStart(t){t.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(t){const{panner:e,seriesRect:i,ctx:{tooltipManager:s,zoomManager:n}}=this;if(!i)return;const o=e.translateZooms(i,n.getAxisZooms(),t.deltaX,t.deltaY);for(const[a,{direction:r,zoom:l}]of ke(o))this.updateAxisZoom(a,r,l);s.updateTooltip(RA)}isPanningKeyPressed(t){switch(this.panKey){case"alt":return t.altKey;case"ctrl":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(t){return fg(t,NA())}isZoomValid(t){const{minVisibleItems:e,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:n}}=this;if(e===0)return!0;const o=this.getZoom(),a=Ox(Ui(t))<Ox(Ui(o)),r=Ox(Sn(t))<Ox(Sn(o));return!a&&!r?!0:i!=null&&a?n.isVisibleItemsCountAtLeast(t,i):s!=null&&r?n.isVisibleItemsCountAtLeast(t,s):n.isVisibleItemsCountAtLeast(t,e)}isAxisZoomValid(t,e){const{minVisibleItems:i,minVisibleItemsX:s,minVisibleItemsY:n,ctx:{zoomManager:o}}=this,a=this.getZoom(),r=e.max-e.min,l=a[t].max-a[t].min,c={...a,[t]:e},h=t===sh.X?s:n;return r>=l||o.isVisibleItemsCountAtLeast(c,h??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(t):this.updateUnifiedZoom(t)}updateUnifiedZoom(t){return this.isZoomValid(t)?(this.ctx.zoomManager.updateZoom("zoom",t),!0):(this.ctx.updateService.update(VR.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(t){this.updatePrimaryAxisZoom(t,sh.X),this.updatePrimaryAxisZoom(t,sh.Y)}updatePrimaryAxisZoom(t,e){const i=this.ctx.zoomManager.getPrimaryAxisId(e);i!=null&&this.updateAxisZoom(i,e,t[e])}updateAxisZoom(t,e,i){const{enableIndependentAxes:s,ctx:{zoomManager:n}}=this;if(!i)return!1;const o=this.getZoom();return s!==!0?(o[e]=i,this.updateUnifiedZoom(o)):this.isAxisZoomValid(e,i)?(n.updateAxisZoom("zoom",t,i),!0):!1}toggleAxisDraggingCursors(){const{anchorPointX:t,anchorPointY:e,domProxy:i}=this,s=this.getZoom();let n=Ui(s)!==Jc,o=Sn(s)!==Jc;if(!n){const a=kx(s,.999,1);a.x=vn(a.x,s.x,t),n=this.isZoomValid(a)}if(!o){const a=kx(s,1,.999);a.y=vn(a.y,s.y,e),o=this.isZoomValid(a)}i.toggleAxisDraggingCursor(sh.X,n),i.toggleAxisDraggingCursor(sh.Y,o)}getZoom(){return Ds(this.ctx.zoomManager.getZoom())}getResetZoom(){return Ds(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(t){return{anchorPointX:t?.anchorPointX??this.getAnchorPointX(),anchorPointY:t?.anchorPointY??this.getAnchorPointY(),enabled:t?.enabled??this.enabled,independentAxes:t?.independentAxes??this.enableIndependentAxes===!0,isScalingX:t?.isScalingX??this.isScalingX(),isScalingY:t?.isScalingY??this.isScalingY(),keepAspectRatio:t?.keepAspectRatio??this.keepAspectRatio,scrollingStep:t?.scrollingStep??this.scrollingStep}}};y([Nx({newValue(t){this.onEnabledChange(t)}}),ei(Ma)],hi.prototype,"enabled",2),y([ei(Ma)],hi.prototype,"enableAxisDragging",2),y([ei(Ma)],hi.prototype,"enableDoubleClickToReset",2),y([Nx({changeValue(t){this.ctx.zoomManager.setIndependentAxes(!!t)}}),ei(Ma,{optional:!0})],hi.prototype,"enableIndependentAxes",2),y([ei(Ma)],hi.prototype,"enablePanning",2),y([ei(Ma)],hi.prototype,"enableScrolling",2),y([ei(Ma)],hi.prototype,"enableSelecting",2),y([ei(Ma)],hi.prototype,"enableTwoFingerZoom",2),y([ei(EA(["alt","ctrl","meta","shift"],"a pan key"))],hi.prototype,"panKey",2),y([ei(EA(["x","y","xy"],"an axis"))],hi.prototype,"axes",2),y([ei(OA)],hi.prototype,"scrollingStep",2),y([ei(Ma)],hi.prototype,"keepAspectRatio",2),y([ei(jQ)],hi.prototype,"minVisibleItems",2),y([jR("Use [minVisibleItems] instead."),ei(_R.restrict({min:1}))],hi.prototype,"minVisibleItemsX",2),y([jR("Use [minVisibleItems] instead."),ei(_R.restrict({min:1}))],hi.prototype,"minVisibleItemsY",2),y([ei(Ix)],hi.prototype,"anchorPointX",2),y([ei(Ix)],hi.prototype,"anchorPointY",2),y([ei(GR)],hi.prototype,"autoScaling",2),y([ei(GR)],hi.prototype,"buttons",2),y([HQ("panner.deceleration"),ei(WQ(OA,EA(["off","short","long"],"a deceleration")))],hi.prototype,"deceleration",2);var UQ={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},YQ={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:t=>new hi(t),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:UQ,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},{BOOLEAN:HR,OBJECT:KQ,POSITION:$Q,POSITIVE_NUMBER:BA,BaseProperties:XQ,AxisTicks:ZQ,ZIndexMap:QQ,ProxyProperty:zA,TempValidate:nh,LayoutElement:qQ,createId:JQ,Group:tq,Rect:eq,Marker:iq,TranslatableGroup:sq,BBox:nq}=T,FA=class extends XQ{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};y([nh(BA)],FA.prototype,"thickness",2),y([nh(BA)],FA.prototype,"preferredLength",2);var Ex=class{constructor(t){this.axisTicks=t}};y([zA("axisTicks.label")],Ex.prototype,"label",2),y([zA("axisTicks.interval")],Ex.prototype,"interval",2),y([zA("axisTicks.padding")],Ex.prototype,"padding",2);var oh=class{constructor(t){this.ctx=t,this.id=JQ(this),this.legendGroup=new sq({name:"legend",zIndex:QQ.LEGEND}),this.gradientRect=new eq,this.arrow=new iq({shape:"triangle"}),this.ticksGroup=new tq({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new FA,this.spacing=20,this.data=[],this.highlightManager=t.highlightManager,this.axisTicks=new ZQ,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new Ex(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(t.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),t.layoutManager.registerElement(qQ.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){return this.position==="right"||this.position==="left"}destroy(){this.destroyFns.forEach(t=>t())}attachLegend(t){t.appendChild(this.legendGroup)}onStartLayout(t){const[e]=this.data;if(!this.enabled||!e?.enabled||e.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(e);this.updateGradientRect(t.layoutBox,i);const s=this.updateAxis(e)??new nq(0,0,0,0),{left:n,top:o}=this.getMeasurements(t.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=n,this.legendGroup.translationY=o}normalizeColorArrays(t){let e=t.colorDomain.slice();const i=t.colorRange.slice();if(e.length===i.length)return{colorDomain:e,colorRange:i};e.length>i.length&&i.splice(e.length);const[s,n]=e,o=i.length;return e=i.map((a,r)=>r===0?s:r===o-1?n:s+(n-s)*r/(o-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i}=this,{preferredLength:s,thickness:n}=this.gradient;let o;this.isVertical()?(o=0,i.width=n,i.height=Math.min(t.height,s)):(o=90,i.width=Math.min(t.width,s),i.height=n),i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:e.map((a,r)=>({stop:r/(e.length-1),color:a})),rotation:o}}updateAxis(t){const{axisTicks:e}=this,i=this.isVertical(),s=this.reverseOrder!==i;return e.position=this.position,e.translationX=i?this.gradient.thickness:0,e.translationY=i?0:this.gradient.thickness,e.scale.domain=s?t.colorDomain.slice().reverse():t.colorDomain,e.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],e.calculateLayout()}updateArrow(){const t=this.highlightManager.getActiveHighlight(),{arrow:e}=this;if(t?.colorValue==null){e.visible=!1;return}const{scale:i,label:s}=this.axisTicks,n=s.fontSize??0,o=i.convert(t.colorValue);let{x:a,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(a-=n/2,r+=o,l/=2):(a+=o,r-=n/2),e.visible=!0,e.fill=s.color,e.rotation=l,e.size=n,e.translationX=a,e.translationY=r}getMeasurements(t,e){let{x:i,y:s}=t,{width:n,height:o}=this.gradientRect;switch(this.isVertical()?n+=e.width+5:o+=e.height+5,this.position){case"left":s+=t.height/2-o/2,t.shrink(n+this.spacing,"left");break;case"right":i+=t.width-n,s+=t.height/2-o/2,t.shrink(n+this.spacing,"right");break;case"top":i+=t.width/2-n/2,t.shrink(o+this.spacing,"top");break;case"bottom":i+=t.width/2-n/2,s+=t.height-o,t.shrink(o+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};oh.className="GradientLegend",y([nh(HR)],oh.prototype,"enabled",2),y([nh($Q)],oh.prototype,"position",2),y([nh(HR)],oh.prototype,"reverseOrder",2),y([nh(KQ)],oh.prototype,"gradient",2),y([nh(BA)],oh.prototype,"spacing",2);var oq={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:t=>new oh(t),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function aq(t,e){const i=t.addChild("canvas-overlay","watermark"),s=Mt("span");s.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{cartesianAxisLabelOptionsDefs:rq,cartesianAxisOptionsDefs:lq,cartesianAxisCrosshairOptions:cq,continuousAxisOptions:_A,commonAxisLabelOptionsDefs:Rx,commonAxisOptionsDefs:Px,commonCrossLineOptionsDefs:Bx,commonCrossLineLabelOptionsDefs:UR,numberFormatValidator:YR}=T,hq={...lq,type:K(Ct("ordinal-time")),paddingInner:Tt,paddingOuter:Tt,groupPaddingInner:Tt,label:{...rq,format:E},interval:_A(Qt(J,Xl),!0).interval,crosshair:cq(!0)},dq={...Px,..._A(J),type:K(Ct("angle-number")),crossLines:gs(Bx),startAngle:J,endAngle:J,label:{...Rx,orientation:st("fixed","parallel","perpendicular"),format:YR}},uq={innerRadiusRatio:Tt},pq={...Px,...uq,type:K(Ct("angle-category")),shape:st("polygon","circle"),crossLines:gs(Bx),startAngle:J,endAngle:J,paddingInner:Tt,groupPaddingInner:Tt,label:{...Rx,orientation:st("fixed","parallel","perpendicular")}},gq={...Px,..._A(J),type:K(Ct("radius-number")),shape:st("polygon","circle"),positionAngle:J,innerRadiusRatio:Tt,crossLines:gs({...Bx,label:{...UR,positionAngle:J}},"cross-line options"),title:{enabled:j,text:E,spacing:H,formatter:bt,...ge},label:{...Rx,format:YR}},fq={...Px,type:K(Ct("radius-category")),positionAngle:J,innerRadiusRatio:Tt,paddingInner:Tt,paddingOuter:Tt,groupPaddingInner:Tt,label:Rx,crossLines:gs({...Bx,label:{...UR,positionAngle:J}},"cross-line options"),title:{enabled:j,text:E,spacing:H,formatter:bt,...ge}},yq={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:hq,create:t=>new km(t)},mq={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:dq,create:t=>new Oc(t)},xq={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:pq,create:t=>new ll(t)},bq={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:gq,create:t=>new Id(t)},Sq={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:fq,create:t=>new cl(t)},{Chart:vq,TempValidate:Mq,ARRAY:Dq}=T;function Aq(t){return t.type==="sankey"||t.type==="chord"}var zx=class extends vq{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const t=this.getOptions();this.nodes!==t.nodes&&(this.nodes=t.nodes);const{nodes:e}=this;this.series.forEach(i=>{Aq(i)&&i.setChartNodes(e)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n,e.visible=this.series.some(o=>o.visible);for(const o of[e,i])o.translationX=Math.floor(n.x),o.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:n,paddedRect:n}})}};zx.className="FlowProportionChart",zx.type="flow-proportion",y([Mq(Dq,{optional:!0})],zx.prototype,"nodes",2);var{isAgFlowProportionChartOptions:Iq,flowProportionChartOptionsDefs:Tq}=T,kq={type:"chart",name:"flow-proportion",enterprise:!0,options:Tq,detect:Iq,create(t,e){return new zx(t,e)}},{Chart:Cq}=T,GA=class extends Cq{getChartType(){return"gauge"}performLayout(t){const{seriesRoot:e,annotationRoot:i,series:s,seriesArea:n}=this,{layoutBox:o}=t,a=o.clone();o.shrink(n.padding.toJson()),this.seriesRect=a.clone().translate(a.x-o.x,a.y-o.y),this.animationRect=o,e.visible=s.some(r=>r.visible);for(const r of[e,i])r.translationX=Math.floor(o.x),r.translationY=Math.floor(o.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:a,paddedRect:o}})}getAriaLabel(){const t=[],e=this.getCaptionText();e.length!==0&&t.push(e);for(const s of this.series)t.push(s.getCaptionText());const i=t.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};GA.className="GaugeChart",GA.type="gauge";var{isAgGaugeChartOptions:Lq,gaugeChartOptionsDefs:Nq}=T,wq={type:"chart",name:"gauge",enterprise:!0,options:Nq,detect:Lq,create(t,e){return new GA(t,e)}},{Chart:Oq}=T,VA=class extends Oq{getChartType(){return"hierarchy"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const o of[e,i])o.translationX=Math.floor(n.x),o.translationY=Math.floor(n.y);e.visible=this.series[0].visible,e.setClipRect(n.clone()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:n}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};VA.className="HierarchyChart",VA.type="hierarchy";var{isAgHierarchyChartOptions:Eq,hierarchyChartOptionsDefs:Rq}=T,Pq={type:"chart",name:"hierarchy",enterprise:!0,options:Rq,detect:Eq,create(t,e){return new VA(t,e)}},{Chart:Bq}=T,jA=class extends Bq{getChartType(){return"standalone"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const o of[e,i])o.translationX=Math.floor(s.x),o.translationY=Math.floor(s.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:s}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};jA.className="StandaloneChart",jA.type="standalone";var{isAgStandaloneChartOptions:zq,standaloneChartOptionsDefs:Fq}=T,_q={type:"chart",name:"standalone",enterprise:!0,options:Fq,detect:zq,create(t,e){return new jA(t,e)}};function KR(t){return Array.isArray(t)&&t.length>=2&&t.every(Pt)}function Fx(t){return Array.isArray(t)&&t.length>=2&&t.every(KR)}var $R=.001;function Gq(t){return Math.abs(t[0][0]-t[t.length-1][0])<$R&&Math.abs(t[0][1]-t[t.length-1][1])<$R}function XR(t){return Array.isArray(t)&&t.every(Fx)&&t.every(Gq)}function ZR(t){if(t===null)return!0;if(typeof t!="object"||t.type==null)return!1;const{type:e,coordinates:i}=t;switch(e){case"GeometryCollection":return Array.isArray(t.geometries)&&t.geometries.every(ZR);case"MultiPolygon":return Array.isArray(i)&&i.every(XR);case"Polygon":return XR(i);case"MultiLineString":return Array.isArray(i)&&i.every(Fx);case"LineString":return Fx(i);case"MultiPoint":return Fx(i);case"Point":return KR(i)}}function Vq(t){return t!==null&&typeof t=="object"&&t.type==="Feature"&&ZR(t.geometry)}function jq(t){return t!==null&&typeof t=="object"&&t.type==="FeatureCollection"&&Array.isArray(t.features)&&t.features.every(Vq)}var $d=T.predicateWithMessage(jq,"a GeoJSON object"),{Chart:Wq,MercatorScale:QR,NumberAxis:qR,TempValidate:Hq}=T;function JR(t){return t.type==="map-shape"||t.type==="map-line"||t.type==="map-marker"||t.type==="map-shape-background"||t.type==="map-line-background"}var _x=class extends Wq{constructor(t,e){super(t,e),this.xAxis=new qR(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new qR(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const t=this.getOptions();this.topology!==t.topology&&(this.topology=t.topology);const{topology:e}=this;this.series.forEach(i=>{JR(i)&&i.setChartTopology(e)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;const o=this.series.filter(JR),a=o.reduce((c,h)=>{if(!h.visible)return c;const d=h.topologyBounds;return d==null?c:c==null?d:(c.merge(d),c)},void 0);let r;if(a!=null){const{lon0:c,lat0:h,lon1:d,lat1:u}=a,p=[[c,h],[d,u]],g=QR.bounds(p),{width:f,height:x}=n,m=Math.min(f/g.width,x/g.height),b=g.width*m,S=g.height*m,M=(f-b)/2,D=(x-S)/2,C=M,k=D,I=M+b,L=D+S,N=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),O=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),w=(I-C)/(N.max-N.min),R=C-w*N.min,G=(L-k)/(1-O.min-(1-O.max)),B=k-G*(1-O.max);r=new QR(p,[[R,B],[R+w,B+G]])}o.forEach(c=>{c.scale=r});const l=this.series.some(c=>c.visible);e.visible=l;for(const c of[e,i])c.translationX=Math.floor(n.x),c.translationY=Math.floor(n.y),c.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:l,rect:n,paddedRect:n}})}};_x.className="TopologyChart",_x.type="topology",y([Hq($d,{optional:!0})],_x.prototype,"topology",2);var{isAgTopologyChartOptions:Uq,topologyChartOptionsDefs:Yq}=T,Kq={type:"chart",name:"topology",enterprise:!0,options:Yq,detect:Uq,create(t,e){return new _x(t,e)}},{toolbarButtonOptionsDefs:Gx}=T,yg={enabled:j,axesButtons:{enabled:j,axes:st("x","y","xy")},toolbar:{enabled:j,padding:H,buttons:gs({...Gx,value:st("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:j,buttons:mt(Qt(Ra({...Gx,value:st("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings")}),Ra({...Gx,value:st("lock"),checkedOverrides:Gx})))}};yg.data=On,yg.xKey=E,yg.volumeKey=E,yg.snap=j;var mg=Ra({__type:K(Ct("date")),value:Qt(E,J)},"a serializable date object"),t1=Qt(E,J,mg),WA=Qt(t1,Ra({value:t1,groupPercentage:J})),e1={enabled:j,cornerRadius:H,formatter:bt,...ge,...St,...rt,...Ot},Ll={label:E,position:st("top","center","bottom"),alignment:st("left","center","right"),...ge},i1={label:E,position:st("top","inside","bottom"),alignment:st("left","center","right"),...ge},As={...St,...rt,...Ot},ve={x:WA,y:J},Oo={lineStyle:st("solid","dashed","dotted"),...Ot},s1={visible:j,extendStart:j,extendEnd:j,locked:j,text:Ll,handle:As,label:ge,showFill:j,isMultiColor:j,strokes:mt(dt),rangeStroke:dt,bands:st(4,6,10),...rt,...Oo},$q=vu({line:{visible:j,extendStart:j,extendEnd:j,locked:j,text:Ll,handle:As,start:ve,end:ve,...rt,...Oo},"horizontal-line":{visible:j,locked:j,value:WA,axisLabel:e1,text:Ll,handle:As,...rt,...Oo},"vertical-line":{visible:j,locked:j,value:WA,axisLabel:e1,text:Ll,handle:As,...rt,...Oo},"disjoint-channel":{visible:j,extendStart:j,extendEnd:j,locked:j,startHeight:H,endHeight:H,text:i1,handle:As,start:ve,end:ve,background:St,...rt,...Oo},"parallel-channel":{visible:j,extendStart:j,extendEnd:j,locked:j,height:H,text:i1,handle:As,start:ve,end:ve,background:St,middle:{visible:j,...rt,...Oo},...rt,...Oo},"fibonacci-retracement":{reverse:j,start:ve,end:ve,...s1},"fibonacci-retracement-trend-based":{reverse:j,start:ve,end:ve,endRetracement:ve,...s1},callout:{visible:j,locked:j,text:E,handle:As,start:ve,end:ve,...ge,...St,...rt},comment:{visible:j,locked:j,text:E,handle:As,...ve,...ge,...St},note:{visible:j,locked:j,text:E,handle:As,background:{...St,...rt},...ve,...ge,...St,...rt},text:{visible:j,locked:j,text:E,handle:As,...ve,...ge,...St},arrow:{visible:j,extendStart:j,extendEnd:j,locked:j,text:Ll,handle:As,start:ve,end:ve,...rt,...Oo},"arrow-up":{visible:j,locked:j,handle:As,...ve,...St},"arrow-down":{visible:j,locked:j,handle:As,...ve,...St},"date-range":{visible:j,extendAbove:j,extendBelow:j,locked:j,text:Ll,handle:As,start:ve,end:ve,statistics:{divider:rt,...ge,...St,...rt},...rt,...Oo},"price-range":{visible:j,extendLeft:j,extendRight:j,locked:j,text:Ll,handle:As,start:ve,end:ve,statistics:{divider:rt,...ge,...St,...rt},...rt,...Oo},"date-price-range":{visible:j,locked:j,text:Ll,handle:As,start:ve,end:ve,statistics:{divider:rt,...ge,...St,...rt},...rt,...Oo}}),Xq={chartType:st("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:mt($q),legend:gs({visible:j,seriesId:E,itemId:E,legendItemName:E},"legend state array"),zoom:{rangeX:{start:Qt(J,mg),end:Qt(J,mg)},rangeY:{start:Qt(J,mg),end:Qt(J,mg)},ratioX:{start:Tt,end:Tt},ratioY:{start:Tt,end:Tt},autoScaledAxes:mt(Ct("y"))}};function Zq(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function Qq(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{ScalableGroup:qq,Rect:xg,Line:bg,BBox:Jq,Selection:n1,applyShapeFillBBox:t7}=T,e7=class extends qq{constructor(){super(),this.append([new xg({tag:0}),new xg({tag:2}),new xg({tag:1}),new bg({tag:3}),new bg({tag:3}),new bg({tag:4}),new bg({tag:4})])}updateDatumStyles(t,e,i,s,n){const{bandwidth:o,scaledValues:{xValue:a,medianValue:r}}=t;let{minValue:l,q1Value:c,q3Value:h,maxValue:d}=t.scaledValues;(i&&!s||!i&&s)&&([d,h,c,l]=[l,c,h,d]);const u=(z,U,Y,Z)=>i?{y:z,x:U,width:Z,height:Y}:{x:z,y:U,width:Y,height:Z},p=(z,U,Y)=>i?{y1:z,y2:U,x:Y}:{x1:z,x2:U,y:Y},g=(z,U,Y)=>i?{x1:U,x2:Y,y:z}:{x:z,y1:U,y2:Y},f=(z,U,Y,Z)=>({x:z,y:U,width:Y,height:Z}=u(z,U,Y,Z),new Jq(z,U,Y,Z)),{fill:x,fillOpacity:m,stroke:b,strokeWidth:S,strokeOpacity:M,lineDash:D,lineDashOffset:C,cornerRadius:k,cap:I,whisker:L}=e,N=n1.select(this,xg),[O]=N.selectByTag(0),[w]=N.selectByTag(2),[R]=N.selectByTag(1),G=N.selectByTag(3),B=N.selectByTag(4);L.strokeWidth>o&&(L.strokeWidth=o);const P=u(c,a,h-c,o);w.setProperties(P),O.setProperties(P),O.setProperties({cornerRadius:k});const V=Math.max(Math.round(r-S/2),c+S),W=Math.min(Math.round(r+S/2),h-S);R.setProperties(P),R.setProperties({visible:V<W,cornerRadius:k,clipBBox:f(V,a+S,W-V,Math.max(0,o-S*2))});const F=Math.floor(a+o*(1-I.lengthRatio)/2),_=Math.ceil(a+o*(1+I.lengthRatio)/2);B[0].setProperties(g(l,F,_)),B[1].setProperties(g(d,F,_)),G[0].setProperties(p(Math.round(l+L.strokeWidth/2),c,Math.floor(a+o/2))),G[1].setProperties(p(h,Math.round(d-L.strokeWidth/2),Math.floor(a+o/2))),t7(O,x,n),O.setProperties({fill:x,fillOpacity:m,strokeWidth:S*2,strokeOpacity:0}),R.setProperties({fill:b,fillOpacity:M,strokeWidth:0});for(const z of[...G,...B])z.setProperties(L);w.setProperties({stroke:b,strokeWidth:S,strokeOpacity:M,lineDash:D,lineDashOffset:C,cornerRadius:k,fillOpacity:0})}distanceSquared(t,e){const i=n1.selectByClass(this,xg,bg);return T.nearestSquared(t,e,i).distanceSquared}get midPoint(){const t=this.datum;return t.midPoint===void 0?($.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):t.midPoint}},{BaseProperties:o1,FillGradientDefaults:i7,FillPatternDefaults:s7,AbstractBarSeriesProperties:n7,SeriesTooltip:o7,TempValidate:ie,COLOR_STRING:HA,FUNCTION:a7,LINE_DASH:a1,OBJECT:Sg,POSITIVE_NUMBER:vg,RATIO:Vx,STRING:Mn,mergeDefaults:r7,COLOR_GRADIENT:l7,COLOR_PATTERN:c7,OR:h7}=T,r1=class extends o1{constructor(){super(...arguments),this.lengthRatio=.5}};y([ie(Vx)],r1.prototype,"lengthRatio",2);var Xd=class extends o1{};y([ie(HA,{optional:!0})],Xd.prototype,"stroke",2),y([ie(vg)],Xd.prototype,"strokeWidth",2),y([ie(Vx)],Xd.prototype,"strokeOpacity",2),y([ie(a1,{optional:!0})],Xd.prototype,"lineDash",2),y([ie(vg)],Xd.prototype,"lineDashOffset",2);var xe=class extends n7{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new i7,this.fillPatternDefaults=new s7,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new r1,this.whisker=new Xd,this.tooltip=new o7}toJson(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:n}=this,o=super.toJson();return o.whisker=r7(o.whisker,{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:n}),o}};y([ie(Mn)],xe.prototype,"xKey",2),y([ie(Mn)],xe.prototype,"minKey",2),y([ie(Mn)],xe.prototype,"q1Key",2),y([ie(Mn)],xe.prototype,"medianKey",2),y([ie(Mn)],xe.prototype,"q3Key",2),y([ie(Mn)],xe.prototype,"maxKey",2),y([ie(Mn,{optional:!0})],xe.prototype,"xName",2),y([ie(Mn,{optional:!0})],xe.prototype,"yName",2),y([ie(Mn,{optional:!0})],xe.prototype,"minName",2),y([ie(Mn,{optional:!0})],xe.prototype,"q1Name",2),y([ie(Mn,{optional:!0})],xe.prototype,"medianName",2),y([ie(Mn,{optional:!0})],xe.prototype,"q3Name",2),y([ie(Mn,{optional:!0})],xe.prototype,"maxName",2),y([ie(h7(l7,c7,HA))],xe.prototype,"fill",2),y([ie(Sg)],xe.prototype,"fillGradientDefaults",2),y([ie(Sg)],xe.prototype,"fillPatternDefaults",2),y([ie(Vx)],xe.prototype,"fillOpacity",2),y([ie(HA)],xe.prototype,"stroke",2),y([ie(vg)],xe.prototype,"strokeWidth",2),y([ie(Vx)],xe.prototype,"strokeOpacity",2),y([ie(a1)],xe.prototype,"lineDash",2),y([ie(vg)],xe.prototype,"lineDashOffset",2),y([ie(vg)],xe.prototype,"cornerRadius",2),y([ie(a7,{optional:!0})],xe.prototype,"itemStyler",2),y([ie(Sg)],xe.prototype,"cap",2),y([ie(Sg)],xe.prototype,"whisker",2),y([ie(Sg)],xe.prototype,"tooltip",2);var{extractDecoratedProperties:l1,fixNumericExtent:d7,keyProperty:u7,mergeDefaults:UA,SeriesNodePickMode:c1,SMALLEST_KEY_INTERVAL:p7,valueProperty:Mg,diff:g7,animationValidation:f7,computeBarFocusBounds:y7,createDatumId:h1,ContinuousScale:m7,ChartAxisDirection:d1,motion:u1,isGradientFill:x7,getShapeStyle:Dg}=T,b7=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},jx=class extends T.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[c1.NEAREST_NODE,c1.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new xe,this.NodeEvent=b7}async processData(t){if(!this.properties.isValid()||!this.visible)return;const{xKey:e,minKey:i,q1Key:s,medianKey:n,q3Key:o,maxKey:a}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];r&&this.processedData&&p.push(g7(this.id,this.processedData)),r&&p.push(f7());const{processedData:g}=await this.requestDataModel(t,this.data,{props:[u7(e,d,{id:"xValue"}),Mg(i,u,{id:"minValue"}),Mg(s,u,{id:"q1Value"}),Mg(n,u,{id:"medianValue"}),Mg(o,u,{id:"q3Value"}),Mg(a,u,{id:"maxValue"}),...h?[p7]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[n];return o.type==="key"&&o.valueType==="category"?a:this.padBandExtent(a)}const s=this.domainForClippedRange(d1.Y,["minValue","maxValue"],"xValue",!0);return d7(s)}getSeriesRange(t,e){return this.domainForVisibleRange(d1.Y,["maxValue","minValue"],"xValue",e,!0)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&i&&s&&n))return;const{xKey:o,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,cap:p,whisker:g}=this.properties,f=[],x=e.resolveKeysById(this,"xValue",i),m=e.resolveColumnById(this,"minValue",i),b=e.resolveColumnById(this,"q1Value",i),S=e.resolveColumnById(this,"medianValue",i),M=e.resolveColumnById(this,"q3Value",i),D=e.resolveColumnById(this,"maxValue",i),{barWidth:C,groupIndex:k}=this.updateGroupScale(s),I=m7.is(s.scale)?C*-.5:0,{groupScale:L}=this,N=this.isVertical(),O={itemId:o,nodeData:f,labelData:[],scales:this.calculateScaling(),visible:this.visible};return t&&(i.dataSources.get(this.id)??[]).forEach((R,G)=>{const B=x[G];if(B==null)return;const P=m[G],V=b[G],W=S[G],F=M[G],_=D[G];if([P,V,W,F,_].some(X=>typeof X!="number")||P>V||V>W||W>F||F>_)return;const z={xValue:Math.round(s.scale.convert(B)),minValue:Math.round(n.scale.convert(P)),q1Value:Math.round(n.scale.convert(V)),medianValue:Math.round(n.scale.convert(W)),q3Value:Math.round(n.scale.convert(F)),maxValue:Math.round(n.scale.convert(_))};z.xValue+=Math.round(L.convert(String(k)))+I;const U=Math.round(C),Y=Math.abs(z.q3Value-z.q1Value),Z=z.xValue+U/2,q=Math.min(z.q3Value,z.q1Value)+Y/2,Q={x:N?Z:q,y:N?q:Z};let tt;N?tt={x:Q.x-U/2,y:z.minValue,width:U,height:z.maxValue-z.minValue}:tt={x:z.minValue,y:Q.y-U/2,width:z.maxValue-z.minValue,height:U},f.push({series:this,itemId:B,datum:R,datumIndex:G,xKey:o,bandwidth:U,scaledValues:z,cap:p,whisker:g,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,midPoint:Q,focusRect:tt})}),O}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:Dg({fill:t,fillOpacity:e,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a,legendItemName:r}=this.properties;return!n||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:e}),label:{text:r??o??e},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!a}]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:x,maxName:m,legendItemName:b,tooltip:S}=n,M=this.getCategoryAxis(),D=this.getValueAxis();if(!i||!s||!M||!D)return;const C=s.dataSources.get(this.id)?.[t],k=i.resolveKeysById(this,"xValue",s)[t],I=i.resolveColumnById(this,"minValue",s)[t],L=i.resolveColumnById(this,"q1Value",s)[t],N=i.resolveColumnById(this,"medianValue",s)[t],O=i.resolveColumnById(this,"q3Value",s)[t],w=i.resolveColumnById(this,"maxValue",s)[t];if(k==null)return;const R=this.getItemBaseStyle(!1);return Object.assign(R,this.getItemStyleOverrides(String(t),C,R,!1)),S.formatTooltip(this.properties,{heading:M.formatDatum(k),title:b??r,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:g,value:D.formatDatum(I)},{label:d,fallbackLabel:h,value:D.formatDatum(L)},{label:c,fallbackLabel:l,value:D.formatDatum(N)},{label:p,fallbackLabel:u,value:D.formatDatum(O)},{label:m,fallbackLabel:x,value:D.formatDatum(w)}]},{seriesId:e,datum:C,title:r,xKey:o,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:x,maxName:m,...R})}animateEmptyUpdateReady({datumSelection:t}){const e=this.isVertical(),{from:i,to:s}=Zq(e);u1.resetMotion([t],Qq(e)),u1.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[t],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,cap:s,whisker:n,fillGradientDefaults:o,fillPatternDefaults:a}=e,r=t?e.highlightStyle.item:void 0,l=this.getStrokeWidth(e.strokeWidth);return Dg({fill:r?.fill??e.fill,fillOpacity:r?.fillOpacity??e.fillOpacity,stroke:r?.stroke??e.stroke,strokeWidth:r?.strokeWidth??l,strokeOpacity:r?.strokeOpacity??e.strokeOpacity,lineDash:r?.lineDash??e.lineDash??[],lineDashOffset:r?.lineDashOffset??e.lineDashOffset,cornerRadius:i,cap:s,whisker:n},o,a)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:d,fillGradientDefaults:u,fillPatternDefaults:p,itemStyler:g}=o;if(g==null)return;const f=this.cachedDatumCallback(h1(t,s?"highlight":"node"),()=>this.callWithContext(g,{seriesId:n,datum:e,xKey:a,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:d,highlighted:s,...i}));return Dg(f,u,p)}updateDatumNodes({datumSelection:t,isHighlight:e}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed(),{highlightStyle:n}=this.properties;t.each((o,a)=>{let r=this.getFormattedStyles(a,e?"highlight":"node");e&&(r=UA(n.item,r));const{stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=r;r.whisker=UA(r.whisker,{stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u});const p=this.getShapeFillBBox();o.updateDatumStyles(a,r,i,s,p)})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new e7}getFormattedStyles(t,e){const{id:i,properties:s}=this,{xKey:n,minKey:o,q1Key:a,medianKey:r,q3Key:l,maxKey:c,itemStyler:h,cornerRadius:d,fillGradientDefaults:u,fillPatternDefaults:p}=s,{datum:g,stroke:f,strokeWidth:x,strokeOpacity:m,lineDash:b,lineDashOffset:S,cap:M,whisker:D}=t;let C,k=1;x7(t.fill)?C=t.fill:(C=t.fill,k=s.fillOpacity);let I=Dg({fill:C,fillOpacity:k,stroke:f,strokeWidth:x,strokeOpacity:m,lineDash:b,lineDashOffset:S,cornerRadius:d,cap:l1(M),whisker:l1(D)},u,p);if(h){const L=this.cachedDatumCallback(h1(g.index,e),()=>this.callWithContext(h,{datum:g,seriesId:i,highlighted:e==="highlight",...I,xKey:n,minKey:o,q1Key:a,medianKey:r,q3Key:l,maxKey:c}));L&&(I=Dg(UA(L,I),u,p))}return I}computeFocusBounds({datumIndex:t}){return y7(this,this.contextNodeData?.nodeData[t].focusRect)}};jx.className="BoxPlotSeries",jx.type="box-plot";var{commonSeriesOptionsDefs:S7,tooltipOptionsDefs:v7}=T,M7={type:K(Ct("box-plot")),xKey:K(E),minKey:K(E),q1Key:K(E),medianKey:K(E),q3Key:K(E),maxKey:K(E),xName:E,yName:E,minName:E,q1Name:E,medianName:E,q3Name:E,maxName:E,direction:st("horizontal","vertical"),grouped:j,legendItemName:E,showInMiniChart:j,cornerRadius:H,itemStyler:bt,whisker:{...rt,...Ot},cap:{lengthRatio:Tt},tooltip:v7,...S7,...St,...rt,...Ot},{CARTESIAN_AXIS_TYPE:p1}=T.ThemeConstants,D7={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fill"},{$mix:[T.SAFE_FILL_OPERATION,{$ref:"backgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,strokeWidth:2},axes:{[p1.NUMBER]:{crosshair:{snap:!1}},[p1.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},A7={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:t=>new jx(t),tooltipDefaults:{range:"exact"},defaultAxes:T.DIRECTION_SWAP_AXES,themeTemplate:D7,groupable:!0},g1={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:M7,create:t=>new jx(t)},{findMinMax:I7}=T,rs=0,Gs=1,en=2,sn=3,Dn=4;function Ag(t,e=1){let i=Math.ceil(Math.log2(t.length/e))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function Ig(t){return I7(t.map(e=>Number(e)))}function Wx(t,e,i){return(t.valueOf()-e)/(i-e)}function Hx(t,e){return Math.min(Math.floor(t*e),e-1)*Dn|0}function Tg(t,e,i,s,n,o){const a=new Int32Array(o*Dn).fill(-1),r=new Float64Array(o*Dn).fill(NaN);for(let l=0;l<t.length;l+=1){const c=t[l],h=e[l],d=i[l];if(c==null||h==null||d==null)continue;const u=Wx(c,s,n),p=h.valueOf(),g=d.valueOf(),f=Hx(u,o),x=a[f+rs]===-1;(x||u<r[f+rs])&&(a[f+rs]=l,r[f+rs]=u),(x||u>r[f+Gs])&&(a[f+Gs]=l,r[f+Gs]=u),(x||g<r[f+en])&&(a[f+en]=l,r[f+en]=g),(x||p>r[f+sn])&&(a[f+sn]=l,r[f+sn]=p)}return{indexData:a,valueData:r}}function kg(t,e,i,{inPlace:s=!1}={}){const n=i/2|0,o=s?t:new Int32Array(n*Dn),a=s?e:new Float64Array(n*Dn);for(let r=0;r<n;r+=1){const l=r*Dn|0,c=l*2|0,h=c+Dn|0,d=t[h+rs]===-1,u=d||e[c+rs]<e[h+rs]?c:h;o[l+rs]=t[u+rs],a[l+rs]=e[u+rs];const p=d||e[c+Gs]>e[h+Gs]?c:h;o[l+Gs]=t[p+Gs],a[l+Gs]=e[p+Gs];const g=d||e[c+en]<e[h+en]?c:h;o[l+en]=t[g+en],a[l+en]=e[g+en];const f=d||e[c+sn]>e[h+sn]?c:h;o[l+sn]=t[f+sn],a[l+sn]=e[f+sn]}return{maxRange:n,indexData:o,valueData:a}}var T7=1e3,f1=rs,k7=sn,C7=en,y1=Gs;function L7(t,e,i,s){if(t.length<T7)return;const[n,o]=Ig(s);let a=Ag(t),{indexData:r,valueData:l}=Tg(t,e,i,n,o,a);const c=[{maxRange:a,indexData:r}];for(;a>64;)({indexData:r,valueData:l,maxRange:a}=kg(r,l,a)),c.push({maxRange:a,indexData:r});return c.reverse(),c}var{fixNumericExtent:N7,keyProperty:w7,createDatumId:m1,SeriesNodePickMode:x1,ChartAxisDirection:YA,SMALLEST_KEY_INTERVAL:O7,valueProperty:Ux,diff:E7,animationValidation:R7,computeBarFocusBounds:P7,visibleRangeIndices:b1,ContinuousScale:B7,OrdinalTimeScale:z7,BandScale:F7,getShapeStyle:KA}=T,_7=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},S1=class extends T.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[x1.AXIS_ALIGNED,x1.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=_7,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid()||!this.visible)return;const{xKey:e,openKey:i,closeKey:s,highKey:n,lowKey:o}=this.properties,a=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];a&&(this.processedData&&u.push(E7(this.id,this.processedData)),u.push(R7())),i&&u.push(Ux(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[w7(e,h,{id:"xValue"}),Ux(s,d,{id:"closeValue"}),Ux(n,d,{id:"highValue"}),Ux(o,d,{id:"lowValue"}),...c?[O7]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[YA.X];if(i==null||!(B7.is(i.scale)||z7.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"highValue",e),o=t.resolveColumnById(this,"lowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return L7(s,n,o,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[n];return o.type==="key"&&o.valueType==="category"?a:this.padBandExtent(a)}const s=this.domainForClippedRange(YA.Y,["highValue","lowValue"],"xValue",!0);return N7(s)}getSeriesRange(t,e){return this.domainForVisibleRange(YA.Y,["highValue","lowValue"],"xValue",e,!0)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["highValue","lowValue"],t,e,i)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&i&&s&&n))return;const o=[],{xKey:a,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],h=e.resolveKeysById(this,"xValue",i),d=e.resolveColumnById(this,"openValue",i),u=e.resolveColumnById(this,"closeValue",i),p=e.resolveColumnById(this,"highValue",i),g=e.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:x,groupIndex:m}=this.updateGroupScale(s),b=f.convert(String(m)),S=x>=1?x:f.rawBandwidth,M=F7.is(s.scale),D={itemId:a,nodeData:o,labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!t)return D;const C=(G,B,P,V,W,F,_,z)=>{const U=c[G],Y=M?_/2:0,Z=s.scale.convert(B)+b+Y,q=n.scale.convert(P),Q=n.scale.convert(V),tt=n.scale.convert(W),X=n.scale.convert(F),it=V>P,nt=it?"up":"down",ht=Math.min(tt,X),lt=Math.max(tt,X)-ht,vt={x:Z,y:ht+lt/2};o.push({series:this,itemId:nt,datum:U,datumIndex:G,xKey:a,xValue:B,openValue:P,closeValue:V,highValue:W,lowValue:F,midPoint:vt,aggregatedValue:V,isRising:it,centerX:Z,width:_,y:ht,height:lt,yOpen:q,yClose:Q,crisp:z})},{dataAggregationFilters:k}=this,I=s.scale,[L,N]=I.range,O=N-L,w=G=>I.convert(h[G])+b,R=k?.find(G=>G.maxRange>O);if(R==null){let[G,B]=b1(c.length,s.range,P=>{const V=w(P);return[V,V+S]});i.input.count<1e3&&(G=0,B=i.input.count);for(let P=G;P<B;P+=1){const V=h[P];if(V==null)continue;const W=d[P],F=u[P],_=p[P],z=g[P],U=z!=null&&z<=W&&z<=F,Y=_!=null&&_>=W&&_>=F;if(!U){$.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!Y){$.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}C(P,V,W,F,_,z,S,!0)}}else{const{maxRange:G,indexData:B}=R,[P,V]=b1(G,s.range,W=>{const F=W*Dn,_=B[F+f1],z=B[F+y1];if(_!==-1)return[w(_),w(z)+S]});for(let W=P;W<V;W+=1){const F=W*Dn,_=B[F+f1],z=B[F+y1],U=B[F+k7],Y=B[F+C7];if(_===-1)continue;const Z=(_+z)/2|0,q=h[Z];if(q==null)continue;const Q=d[_],tt=u[z],X=p[U],it=g[Y],nt=Math.abs(w(z)-w(_))+S;C(Z,q,Q,tt,X,it,nt,!1)}}return D}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}updateLabelNodes(t){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}getItemBaseStyle(t,e){const{properties:i}=this,s=i.item[t],n=e?i.highlightStyle.item:void 0,o={fill:n?.fill??s.fill,fillOpacity:n?.fillOpacity??s.fillOpacity,stroke:n?.stroke??s.stroke,strokeWidth:n?.strokeWidth??s.strokeWidth,strokeOpacity:n?.strokeOpacity??s.strokeOpacity,lineDash:n?.lineDash??s.lineDash,lineDashOffset:n?.lineDashOffset??s.lineDashOffset};return s.fillGradientDefaults&&s.fillPatternDefaults?KA(o,s.fillGradientDefaults,s.fillPatternDefaults):o}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,r=a.item[i],{itemStyler:l}=a;if(l==null)return;const{xKey:c,openKey:h,closeKey:d,highKey:u,lowKey:p}=a,g=this.cachedDatumCallback(m1(t,n?"highlight":"node"),()=>this.callWithContext(l,{seriesId:o,datum:e,itemId:i,xKey:c,openKey:h,closeKey:d,highKey:u,lowKey:p,highlighted:n,...s}));return r.fillGradientDefaults&&r.fillPatternDefaults?KA(g,r.fillGradientDefaults,r.fillPatternDefaults):g}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:f,legendItemName:x,tooltip:m}=n,b=this.getCategoryAxis(),S=this.getValueAxis();if(!i||!s||!b||!S)return;const M=s.dataSources.get(this.id)?.[t],D=i.resolveKeysById(this,"xValue",s)[t],C=i.resolveColumnById(this,"openValue",s)[t],k=i.resolveColumnById(this,"highValue",s)[t],I=i.resolveColumnById(this,"lowValue",s)[t],L=i.resolveColumnById(this,"closeValue",s)[t];if(D==null)return;const N=L>=C?"up":"down",O=this.properties.item[N],w=this.getItemBaseStyle(N,!1);Object.assign(w,this.getItemStyleOverrides(String(t),M,N,w,!1));let R={fill:O.fill??O.stroke,fillOpacity:O.fillOpacity??O.strokeOpacity??1,stroke:O.stroke,strokeWidth:O.strokeWidth??1,strokeOpacity:O.strokeOpacity??1,lineDash:O.lineDash??[0],lineDashOffset:O.lineDashOffset??0};return O.fillGradientDefaults&&O.fillPatternDefaults&&(R=KA(R,O.fillGradientDefaults,O.fillPatternDefaults)),m.formatTooltip(this.properties,{heading:b.formatDatum(D),title:x,symbol:{marker:R},data:[{label:c,fallbackLabel:l,value:S.formatDatum(C)},{label:d,fallbackLabel:h,value:S.formatDatum(k)},{label:p,fallbackLabel:u,value:S.formatDatum(I)},{label:f,fallbackLabel:g,value:S.formatDatum(L)}]},{seriesId:e,datum:M,title:r,itemId:N,xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:f,...w})}getDatumId(t){return m1(t.xValue)}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(e==null)return;const{centerX:i,y:s,width:n,height:o}=e,a={x:i-n/2,y:s,width:n,height:o};return P7(this,a)}},{Path:G7,ScenePathChangeDetection:Nl,BBox:V7}=T,Da=class extends G7{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:t,y:e,width:i,height:s}=this;return new V7(t-i/2,e,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:t,width:e,height:i,crisp:s,strokeAlignment:n}=this;let{centerX:o,yOpen:a,yClose:r}=this,l=o-e/2,c=o+e/2,h=t,d=t+i;if(s&&e>1){o=this.align(o),a=this.align(a),r=this.align(r);const p=this.align(e/2);l=o-p,c=o+p,h=this.align(t),d=h+this.align(h,i)}const u=(h+d)/2;return o+=n,l+=n,c+=n,h-=n,d+=n,a+=a<u?n:-n,r+=r<u?n:-n,{centerX:o,x0:l,x1:c,y0:h,y1:d,yOpen:a,yClose:r}}executeStroke(t,e){const{width:i,strokeWidth:s}=this;i<s&&(t.lineWidth=i),super.executeStroke(t,e)}};y([Nl()],Da.prototype,"centerX",2),y([Nl()],Da.prototype,"y",2),y([Nl()],Da.prototype,"width",2),y([Nl()],Da.prototype,"height",2),y([Nl()],Da.prototype,"yOpen",2),y([Nl()],Da.prototype,"yClose",2),y([Nl()],Da.prototype,"crisp",2),y([Nl()],Da.prototype,"strokeAlignment",2);var j7=class extends Da{updatePath(){const{path:t}=this,{centerX:e,x0:i,x1:s,y0:n,y1:o,yOpen:a,yClose:r}=this.alignedCoordinates();t.clear(),t.moveTo(e,n),t.lineTo(e,o),Math.abs(s-i)>1&&(t.moveTo(i,a),t.lineTo(e,a),t.moveTo(e,r),t.lineTo(s,r))}},{ScenePathChangeDetection:Cg,ExtendedPath2D:W7,BBox:H7}=T,Zd=class extends Da{constructor(){super(...arguments),this.wickPath=new W7,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}computeDefaultGradientFillBBox(){const{width:t,centerX:e,yOpen:i,yClose:s}=this,n=Math.min(i,s),a=Math.max(i,s)-n,r=e-t/2,l=e+t/2;return new H7(r,n,l-r,a)}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,wickStroke:a,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d}=this,{centerX:u,x0:p,x1:g,y0:f,y1:x,yOpen:m,yClose:b}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const M=a!=null&&a!==e||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==o?this.wickPath:t;if(Math.abs(g-p)<=3){M.moveTo(u,f),M.lineTo(u,x);return}const D=Math.min(m,b),C=Math.max(m,b);M.moveTo(u,f),M.lineTo(u,D+i/2),M.moveTo(u,x),M.lineTo(u,C-i/2);const k=d+i/2,I=C-D-2*k;if(I>0)t.rect(p+k,D+k,g-p-2*k,I);else{const L=(D+C)/2;t.moveTo(p,L),t.lineTo(g,L)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=n,wickLineDash:h=o,wickLineDashOffset:d=a}=this;l!==0&&(t.globalAlpha*=c,typeof r=="string"&&(t.strokeStyle=r),t.lineWidth=l,h!=null&&t.setLineDash(h),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};y([Cg()],Zd.prototype,"wickStroke",2),y([Cg()],Zd.prototype,"wickStrokeWidth",2),y([Cg()],Zd.prototype,"wickStrokeOpacity",2),y([Cg()],Zd.prototype,"wickLineDash",2),y([Cg()],Zd.prototype,"wickLineDashOffset",2);var{BaseProperties:v1,TempValidate:di,AbstractBarSeriesProperties:U7,SeriesTooltip:Y7,STRING:Eo,COLOR_STRING:K7,FUNCTION:$7,LINE_DASH:X7,OBJECT:Yx,POSITIVE_NUMBER:M1,RATIO:Z7}=T,ah=class extends v1{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([di(K7)],ah.prototype,"stroke",2),y([di(M1)],ah.prototype,"strokeWidth",2),y([di(Z7)],ah.prototype,"strokeOpacity",2),y([di(X7)],ah.prototype,"lineDash",2),y([di(M1)],ah.prototype,"lineDashOffset",2);var $A=class extends v1{constructor(){super(...arguments),this.up=new ah,this.down=new ah}};y([di(Yx)],$A.prototype,"up",2),y([di(Yx)],$A.prototype,"down",2);var An=class extends U7{};y([di(Eo)],An.prototype,"xKey",2),y([di(Eo)],An.prototype,"openKey",2),y([di(Eo)],An.prototype,"closeKey",2),y([di(Eo)],An.prototype,"highKey",2),y([di(Eo)],An.prototype,"lowKey",2),y([di(Eo,{optional:!0})],An.prototype,"xName",2),y([di(Eo,{optional:!0})],An.prototype,"yName",2),y([di(Eo,{optional:!0})],An.prototype,"openName",2),y([di(Eo,{optional:!0})],An.prototype,"closeName",2),y([di(Eo,{optional:!0})],An.prototype,"highName",2),y([di(Eo,{optional:!0})],An.prototype,"lowName",2);var Kx=class extends An{constructor(){super(...arguments),this.tooltip=new Y7,this.item=new $A}};y([di(Yx)],Kx.prototype,"tooltip",2),y([di(Yx)],Kx.prototype,"item",2),y([di($7,{optional:!0})],Kx.prototype,"itemStyler",2);var{FillGradientDefaults:Q7,FillPatternDefaults:q7,BaseProperties:XA,SeriesTooltip:J7,TempValidate:ui,COLOR_STRING:ZA,FUNCTION:tJ,LINE_DASH:D1,OBJECT:rh,POSITIVE_NUMBER:Lg,RATIO:QA,COLOR_GRADIENT:eJ,COLOR_PATTERN:iJ,OR:sJ}=T,Qd=class extends XA{};y([ui(ZA,{optional:!0})],Qd.prototype,"stroke",2),y([ui(Lg)],Qd.prototype,"strokeWidth",2),y([ui(QA)],Qd.prototype,"strokeOpacity",2),y([ui(D1,{optional:!0})],Qd.prototype,"lineDash",2),y([ui(Lg)],Qd.prototype,"lineDashOffset",2);var In=class extends XA{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Q7,this.fillPatternDefaults=new q7,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Qd}};y([ui(sJ(eJ,iJ,ZA))],In.prototype,"fill",2),y([ui(rh)],In.prototype,"fillGradientDefaults",2),y([ui(rh)],In.prototype,"fillPatternDefaults",2),y([ui(QA)],In.prototype,"fillOpacity",2),y([ui(ZA)],In.prototype,"stroke",2),y([ui(Lg)],In.prototype,"strokeWidth",2),y([ui(QA)],In.prototype,"strokeOpacity",2),y([ui(D1)],In.prototype,"lineDash",2),y([ui(Lg)],In.prototype,"lineDashOffset",2),y([ui(Lg)],In.prototype,"cornerRadius",2),y([ui(rh)],In.prototype,"wick",2);var qA=class extends XA{constructor(){super(...arguments),this.up=new In,this.down=new In}};y([ui(rh)],qA.prototype,"up",2),y([ui(rh)],qA.prototype,"down",2);var $x=class extends An{constructor(){super(...arguments),this.item=new qA,this.tooltip=new J7}};y([ui(rh)],$x.prototype,"item",2),y([ui(rh)],$x.prototype,"tooltip",2),y([ui(tJ,{optional:!0})],$x.prototype,"itemStyler",2);var{createDatumId:nJ,isGradientFill:A1,isPatternFill:JA,applyShapeFillBBox:oJ,getShapeFill:I1,getShapeStyle:tI}=T,Xx=class extends S1{constructor(){super(...arguments),this.properties=new $x}nodeFactory(){return new Zd}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,item:c,itemStyler:h}=s,{up:d,down:u}=c,p=tI({fill:d.fill,fillOpacity:d.fillOpacity,stroke:d.stroke,strokeWidth:d.strokeWidth,strokeOpacity:d.strokeOpacity,lineDash:d.lineDash,lineDashOffset:d.lineDashOffset},d.fillGradientDefaults,d.fillPatternDefaults),g=tI({fill:u.fill,fillOpacity:u.fillOpacity,stroke:u.stroke,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,lineDash:u.lineDash,lineDashOffset:u.lineDashOffset},u.fillGradientDefaults,u.fillPatternDefaults),f=e?s.highlightStyle.item:void 0;t.each((x,m)=>{const{isRising:b,centerX:S,width:M,y:D,height:C,yOpen:k,yClose:I,crisp:L}=m;let N;if(h!=null){const{fill:B,fillOpacity:P,stroke:V,strokeWidth:W,strokeOpacity:F,lineDash:_,lineDashOffset:z}=b?p:g;N=tI(this.cachedDatumCallback(nJ(this.getDatumId(m),e?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:m.itemId,xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,datum:m.datum,fill:B,fillOpacity:P,strokeOpacity:F,stroke:V,strokeWidth:W,lineDash:_,lineDashOffset:z,highlighted:e})),b?d.fillGradientDefaults:u.fillGradientDefaults,b?d.fillPatternDefaults:u.fillPatternDefaults)}x.centerX=S,x.width=M,x.y=D,x.height=C,x.yOpen=k,x.yClose=I,x.crisp=L;const O=b?p:g,w=b?d.wick:u.wick,R=f?.fill??N?.fill??O.fill;oJ(x,R,this.getShapeFillBBox()),x.fill=f?.fill??N?.fill??O.fill,x.fillOpacity=f?.fillOpacity??N?.fillOpacity??O.fillOpacity,x.stroke=f?.stroke??N?.stroke??O.stroke,x.strokeWidth=f?.strokeWidth??N?.strokeWidth??O.strokeWidth,x.strokeOpacity=f?.strokeOpacity??N?.strokeOpacity??O.strokeOpacity,x.lineDash=f?.lineDash??N?.lineDash??O.lineDash,x.lineDashOffset=f?.lineDashOffset??N?.lineDashOffset??O.lineDashOffset;const G=N?.wick;x.wickStroke=f?.stroke??G?.stroke??w.stroke,x.wickStrokeWidth=f?.strokeWidth??G?.strokeWidth??w.strokeWidth,x.wickStrokeOpacity=f?.strokeOpacity??G?.strokeOpacity??w.strokeOpacity,x.wickLineDash=f?.lineDash??G?.lineDash??w.lineDash,x.wickLineDashOffset=f?.lineDashOffset??G?.lineDashOffset??w.lineDashOffset,x.strokeAlignment=(N?.strokeWidth??O.strokeWidth)/2})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=I1(t.fill,t.fillGradientDefaults,t.fillPatternDefaults),s=A1(i)?i.colorStops.map(l=>typeof l=="string"?l:{color:l.color,stop:l.stop!=null?l.stop*.5:void 0}):[{color:JA(i)?t.stroke:i,stop:0},{color:JA(i)?t.stroke:i,stop:.5}],n=I1(e.fill,e.fillGradientDefaults,e.fillPatternDefaults),o=A1(n)?n.colorStops.map(l=>typeof l=="string"?l:{color:l.color,stop:l.stop!=null?l.stop*.5:void 0}):[{color:JA(n)?e.stroke:n,stop:.5}],a={type:"gradient",gradient:"linear",rotation:90,colorStops:[...s,...o],reverse:!1},r={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:t.stroke,stop:0},{color:t.stroke,stop:.5},{color:e.stroke,stop:.5}],reverse:!1};return{marker:{fill:a,fillOpacity:t.fillOpacity,stroke:r,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:o,yName:a,showInLegend:r,legendItemName:l}=this.properties;return!i?.length||!o||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&n.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??a??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}};Xx.className="CandleStickSeries",Xx.type="candlestick";var{commonSeriesOptionsDefs:aJ,tooltipOptionsDefs:rJ}=T,T1={cornerRadius:H,wick:{...rt,...Ot},...St,...rt,...Ot},eI={type:K(Ct("candlestick")),xKey:K(E),openKey:K(E),highKey:K(E),lowKey:K(E),closeKey:K(E),xName:E,yName:E,openName:E,highName:E,lowName:E,closeName:E,item:{up:T1,down:T1},itemStyler:bt,showInMiniChart:j,tooltip:rJ,...aJ};eI.pickOutsideVisibleMinorAxis=j,eI.focusPriority=J;var{CARTESIAN_AXIS_TYPE:k1}=T.ThemeConstants;function C1(t){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},t==="up"?"transparent":{$palette:"fill"},{$palette:`${t}.fill`}]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${t}.stroke`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${t}.fill`}]},{$isPattern:[{$palette:`${t}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${t}.fill`}]}]},[{$mix:[{$palette:`${t}.fill`},"black",.15]},{$mix:[{$palette:`${t}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS}}var lJ={series:{item:{up:C1("up"),down:C1("down")},highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[k1.NUMBER]:{crosshair:{snap:!1}},[k1.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:L1,CARTESIAN_POSITION:N1}=T.ThemeConstants,cJ={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:t=>new Xx(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:L1.NUMBER,position:N1.LEFT},{type:L1.ORDINAL_TIME,position:N1.BOTTOM}],themeTemplate:lJ,groupable:!1},w1={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:eI,create:t=>new Xx(t)},{CachedTextMeasurerPool:O1,TextUtils:E1,TextWrapper:Zx}=T;function hJ(t,e){const{fontSize:i,minimumFontSize:s=i}=t,{fontSize:n,minimumFontSize:o=n}=e,a=i-s,r=n-o;let l=t.fontSize,c=e.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||c>o;){const d=a>0?(l-s)/a:-1,u=r>0?(c-o)/r:-1;d>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function qd(t,e){return t.lineHeight!=null&&t.fontSize!=null?t.lineHeight*e/t.fontSize:E1.getLineHeight(e)}function R1(t,e,i,s,{padding:n},o){const{spacing:a=0}=e,r=2*n,l=2*n+a,c=(e.minimumFontSize??e.fontSize)+(s.minimumFontSize??s.fontSize);if(c>o(c+l,!1).height-l)return;const h=hJ(e,s),d={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},u={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,g;return XT(0,h.length-1,f=>{const{labelFontSize:x,secondaryLabelFontSize:m}=h[f],b=f===0,S=qd(e,x),M=qd(s,m),D=o(S+M+l,b),C=D.width-r,k=D.height-l;if(S+M>k||((p==null||p.fontSize!==x)&&(d.fontSize=x,p=B1(e,t,C,k,d,e.wrapping,b?e.overflowStrategy:"hide")),p==null||p.width>C||p.height>k)||((g==null||g.fontSize!==m)&&(u.fontSize=m,g=B1(s,i,C,k,u,s.wrapping,b?s.overflowStrategy:"hide")),g==null))return;const I=p.height+g.height;if(!(g.width>C||I>k))return{width:Math.max(p.width,g.width),height:I+a,meta:D.meta,label:p,secondaryLabel:g}})}function Ng(t,e,{padding:i},s){const n=2*i,o=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),a={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return XT(o,e.fontSize,r=>{const l=qd(e,r),c=r===o,h=s(l+n,c),d=h.width-n,u=h.height-n;if(l>u)return;a.fontSize=r;const p=Zx.wrapLines(t,{maxWidth:d,maxHeight:u,font:a,textWrap:e.wrapping,overflow:(c?e.overflowStrategy:void 0)??"hide"});if(!p.length)return;const g=dJ(p,{lineHeight:l,font:a,maxWidth:d,maxHeight:u});if(g)return[{fontSize:r,lineHeight:l,...g},h.meta]})}function P1(t){return t?.minimumFontSize!=null&&t?.fontSize!=null&&t?.minimumFontSize>t?.fontSize}function iI(t,e,i,s,n,o){const a=e.enabled?t:void 0,r=s.enabled?i:void 0;(P1(e)||P1(s))&&$.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;a!=null&&r!=null&&(l=R1(a,e,r,s,n,o));let c;if(l==null&&a!=null&&(c=Ng(a,e,n,o)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let h;if(l==null&&a==null&&r!=null&&(h=Ng(r,s,n,o)),h!=null){const[d,u]=h;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function B1(t,e,i,s,n,o,a){const r=Zx.wrapLines(e,{maxWidth:i,maxHeight:s,font:n,textWrap:o,overflow:a});if(!r.length)return;const l=qd(t,n.fontSize),{width:c}=O1.measureLines(r,{font:n});return{width:c,lineHeight:l,text:r.join(`
`),height:r.length*l,fontSize:n.fontSize}}function dJ(t,{font:e,lineHeight:i=E1.defaultLineHeight,maxWidth:s,maxHeight:n=1/0}){let o=i*t.length;for(;o>n;){if(t.length===1)return;t.pop(),t[t.length-1]=Zx.appendEllipsis(t.at(-1)),o=i*t.length}const a=O1.measureLines(t,{font:e});let r,l;if(a.width>s){const c=[];l=0;for(const h of a.lineMetrics){if(h.width>s){if(!c.length)return;break}c.push(h.text),l=Math.max(l,h.width)}r=Zx.appendEllipsis(c.join(`
`))}else r=t.join(`
`),l=a.width;return{text:r,width:l,height:o}}var{TempValidate:wg,NUMBER:uJ,POSITIVE_NUMBER:z1,TEXT_WRAP:pJ,OVERFLOW_STRATEGY:gJ}=T,Jd=class extends T.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};y([wg(pJ)],Jd.prototype,"wrapping",2),y([wg(gJ)],Jd.prototype,"overflowStrategy",2),y([wg(z1,{optional:!0})],Jd.prototype,"lineHeight",2),y([wg(z1,{optional:!0})],Jd.prototype,"minimumFontSize",2);var Aa=class extends Jd{constructor(){super(...arguments),this.spacing=0}};y([wg(uJ)],Aa.prototype,"spacing",2);var Og=class extends Jd{},{CartesianSeriesProperties:fJ,SeriesTooltip:yJ,TempValidate:ls,AND:mJ,ARRAY:xJ,COLOR_STRING:bJ,COLOR_STRING_ARRAY:SJ,FUNCTION:vJ,OBJECT:F1,POSITIVE_NUMBER:_1,RATIO:MJ,STRING:lh,TEXT_ALIGN:DJ,VERTICAL_ALIGN:AJ}=T,Yi=class extends fJ{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new Aa,this.tooltip=new yJ}};y([ls(lh,{optional:!0})],Yi.prototype,"title",2),y([ls(lh)],Yi.prototype,"xKey",2),y([ls(lh)],Yi.prototype,"yKey",2),y([ls(lh,{optional:!0})],Yi.prototype,"colorKey",2),y([ls(lh,{optional:!0})],Yi.prototype,"xName",2),y([ls(lh,{optional:!0})],Yi.prototype,"yName",2),y([ls(lh,{optional:!0})],Yi.prototype,"colorName",2),y([ls(mJ(SJ,xJ.restrict({minLength:1})))],Yi.prototype,"colorRange",2),y([ls(bJ,{optional:!0})],Yi.prototype,"stroke",2),y([ls(MJ)],Yi.prototype,"strokeOpacity",2),y([ls(_1,{optional:!0})],Yi.prototype,"strokeWidth",2),y([ls(DJ)],Yi.prototype,"textAlign",2),y([ls(AJ)],Yi.prototype,"verticalAlign",2),y([ls(_1)],Yi.prototype,"itemPadding",2),y([ls(vJ,{optional:!0})],Yi.prototype,"itemStyler",2),y([ls(F1)],Yi.prototype,"label",2),y([ls(F1)],Yi.prototype,"tooltip",2);var{SeriesNodePickMode:G1,computeBarFocusBounds:IJ,getMissCount:TJ,valueProperty:sI,ChartAxisDirection:no,DEFAULT_CARTESIAN_DIRECTION_KEYS:kJ,DEFAULT_CARTESIAN_DIRECTION_NAMES:CJ,createDatumId:LJ,ColorScale:NJ,Rect:wJ,PointerEvents:OJ,applyShapeStyle:EJ}=T,RJ=class extends T.CartesianSeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.colorKey=s.properties.colorKey}},PJ={left:-.5,center:0,right:-.5},BJ={top:-.5,middle:0,bottom:-.5},Qx=class extends T.CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:kJ,directionNames:CJ,categoryKey:void 0,pickModes:[G1.NEAREST_NODE,G1.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new Yi,this.NodeEvent=RJ,this.colorScale=new NJ}async processData(t){const e=this.axes[no.X],i=this.axes[no.Y];if(!e||!i||!this.properties.isValid()||!this.data?.length)return;const{xKey:s,yKey:n,colorRange:o,colorKey:a}=this.properties,r=this.axes[no.X]?.scale,l=this.axes[no.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,this.data,{props:[sI(s,c,{id:"xValue"}),sI(n,h,{id:"yValue"}),...a?[sI(a,d,{id:"colorValue"})]:[]]});if(this.isColorScaleValid()){const g=u.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[g],this.colorScale.range=o,this.colorScale.update()}}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=TJ(this,i.defs.values[s].missing);return!(n===0||n===o)}xCoordinateRange(t,e){const i=this.axes[no.X].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t)+s,o=e*(i.bandwidth??10);return[n,n+o]}yCoordinateRange(t,e){const i=this.axes[no.Y].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t[0])+s,o=e*(i.bandwidth??10);return[n,n+o]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:t===no.X?e.getDomain(this,"xValue","value",i):e.getDomain(this,"yValue","value",i)}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,visible:e,axes:i,dataModel:s,processedData:n}=this,o=i[no.X],a=i[no.Y];if(!(t&&s&&n&&e&&o&&a))return;if(o.type!=="category"||a.type!=="category"){$.warnOnce(`Heatmap series expected axes to have "category" type, but received "${o.type}" and "${a.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,textAlign:p,verticalAlign:g,itemPadding:f,label:x}=this.properties,m=s.resolveColumnById(this,"xValue",n),b=s.resolveColumnById(this,"yValue",n),S=d?s.resolveColumnById(this,"colorValue",n):void 0,M=o.scale,D=a.scale,C=(M.bandwidth??0)/2,k=(D.bandwidth??0)/2,I=[],L=[],N=M.bandwidth??10,O=D.bandwidth??10,w=(N-2*f)*PJ[p],R=(O-2*f)*BJ[g],G=()=>({width:N,height:O,meta:null});return(n.dataSources.get(this.id)??[]).forEach((P,V)=>{const W=m[V],F=b[V],_=M.convert(W)+C,z=D.convert(F)+k,U=S?.[V],Y=U==null?void 0:this.getLabelText(x,{value:U,datum:P,colorKey:d,colorName:u,xKey:r,yKey:c,xName:l,yName:h}),Z=iI(Y,this.properties.label,void 0,this.properties.label,{padding:f},G),q={x:_,y:z,size:0};if(I.push({series:this,itemId:c,datumIndex:V,yKey:c,xKey:r,xValue:W,yValue:F,colorValue:U,datum:P,point:q,width:N,height:O,midPoint:{x:_,y:z},missing:S!=null&&U==null}),Z?.label!=null){const{text:Q,fontSize:tt,lineHeight:X,height:it}=Z.label,{fontStyle:nt,fontFamily:ht,fontWeight:lt,color:vt}=this.properties.label,At=q.x+w*(N-2*f),ut=q.y+R*(O-2*f)-(Z.height-it)*.5;L.push({series:this,itemId:c,datum:P,datumIndex:V,text:Q,fontSize:tt,lineHeight:X,fontStyle:nt,fontFamily:ht,fontWeight:lt,color:vt,textAlign:p,verticalAlign:g,x:At,y:ut})}}),{itemId:this.properties.yKey??this.id,nodeData:I,labelData:L,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new wJ}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{xKey:r,yKey:l,colorRange:c,itemStyler:h}=a,d=this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):c[0];let u=s.fill==null?{fill:d}:void 0;if(h!=null){u??(u={});const p=this.cachedDatumCallback(LJ(t,n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,datum:e,xKey:r,yKey:l,highlighted:n,...s,fill:d}));Object.assign(u,p)}return u}updateDatumNodes(t){const{isHighlight:e}=t,i=this.axes[no.X],[s,n]=i?.visibleRange??[],a=!(s!==0||n!==1),r=this.getItemBaseStyle(e);t.datumSelection.each((l,c)=>{const{datumIndex:h,colorValue:d,datum:u,point:p,width:g,height:f}=c,x=this.getItemStyleOverrides(String(h),u,d,r,e);l.crisp=a,l.x=Math.floor(p.x-g/2),l.y=Math.floor(p.y-f/2),l.width=Math.ceil(g),l.height=Math.ceil(f),EJ(l,r,x)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:s}=this.properties.label,n=s?e:[];return i.update(n)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{e.text=i.text,e.fontSize=i.fontSize,e.lineHeight=i.lineHeight,e.fontStyle=i.fontStyle,e.fontFamily=i.fontFamily,e.fontWeight=i.fontWeight,e.fill=i.color,e.textAlign=i.textAlign,e.textBaseline=i.verticalAlign,e.x=i.x,e.y=i.y,e.pointerEvents=OJ.None})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o,colorScale:a}=this,{xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,colorRange:p,title:g,legendItemName:f,tooltip:x}=o,m=n[no.X],b=n[no.Y];if(!i||!s||!m||!b)return;const S=s.dataSources.get(this.id)?.[t],M=i.resolveColumnById(this,"xValue",s)[t],D=i.resolveColumnById(this,"yValue",s)[t],C=d!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[t]:void 0;if(M==null)return;const k=[];let I;C==null?I=p[0]:(I=a.convert(C),k.push({label:u,fallbackLabel:d,value:String(C)})),k.push({label:l,fallbackLabel:r,value:m.formatDatum(M)},{label:h,fallbackLabel:c,value:b.formatDatum(D)});const L=this.getItemBaseStyle(!1);Object.assign(L,this.getItemStyleOverrides(String(t),S,C,L,!1)),L.fill!=null&&(I=L.fill);const N=I!=null?{marker:{shape:"square",fill:I,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return x.formatTooltip(this.properties,{title:g??f,symbol:N,data:k},{seriesId:e,datum:S,title:g,xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,...L})}getLegendData(t){return t!=="gradient"||!this.properties.isValid()||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t];if(e===void 0)return;const{width:i,height:s,midPoint:n}=e,o={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return IJ(this,o)}};Qx.className="HeatmapSeries",Qx.type="heatmap";var{commonSeriesOptionsDefs:zJ,autoSizedLabelOptionsDefs:FJ,tooltipOptionsDefs:_J}=T,GJ={type:K(Ct("heatmap")),xKey:K(E),yKey:K(E),colorKey:E,xName:E,yName:E,colorName:E,colorRange:mt(dt),title:E,textAlign:st("left","center","right"),verticalAlign:st("top","middle","bottom"),itemPadding:H,itemStyler:bt,showInMiniChart:j,label:FJ,tooltip:_J,...zJ,...rt},VJ={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$path:["./0",{$palette:"stroke"},{$palette:"strokes"}]}]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},T.SAFE_RANGE2_OPERATION]},label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:V1,CARTESIAN_POSITION:j1}}=T,jJ={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:t=>new Qx(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:V1.CATEGORY,position:j1.LEFT},{type:V1.CATEGORY,position:j1.BOTTOM}],themeTemplate:VJ},W1={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:GJ,create:t=>new Qx(t)},{createDatumId:WJ}=T,qx=class extends S1{constructor(){super(...arguments),this.properties=new Kx}nodeFactory(){return new j7}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,item:c,itemStyler:h}=s,{up:d,down:u}=c,{stroke:p,strokeWidth:g,strokeOpacity:f,lineDash:x,lineDashOffset:m}=d,{stroke:b,strokeWidth:S,strokeOpacity:M,lineDash:D,lineDashOffset:C}=u,k=e?s.highlightStyle.item:void 0;t.each((I,L)=>{const{isRising:N,centerX:O,width:w,y:R,height:G,yOpen:B,yClose:P,crisp:V}=L;let W;if(h!=null){const{stroke:F,strokeWidth:_,strokeOpacity:z,lineDash:U,lineDashOffset:Y}=N?d:u;W=this.cachedDatumCallback(WJ(this.getDatumId(L),e?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:L.itemId,xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,datum:L.datum,strokeOpacity:z,stroke:F,strokeWidth:_,lineDash:U,lineDashOffset:Y,highlighted:e}))}I.centerX=O,I.width=w,I.y=R,I.height=G,I.yOpen=B,I.yClose=P,I.crisp=V,I.stroke=k?.stroke??W?.stroke??(N?p:b),I.strokeWidth=k?.strokeWidth??W?.strokeWidth??(N?g:S),I.strokeOpacity=k?.strokeOpacity??W?.strokeOpacity??(N?f:M),I.lineDash=k?.lineDash??W?.lineDash??(N?x:D),I.lineDashOffset=k?.lineDashOffset??W?.lineDashOffset??(N?m:C),I.strokeAlignment=(W?.strokeWidth??(N?g:S))/2})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:o,yName:a,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!o||t!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:n&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:h??a??e},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}};qx.className="ohlc",qx.type="ohlc";var{commonSeriesOptionsDefs:HJ,tooltipOptionsDefs:UJ}=T,H1={...rt,...Ot},nI={type:K(Ct("ohlc")),xKey:K(E),openKey:K(E),highKey:K(E),lowKey:K(E),closeKey:K(E),xName:E,yName:E,openName:E,highName:E,lowName:E,closeName:E,showInMiniChart:j,itemStyler:bt,item:{up:H1,down:H1},tooltip:UJ,...HJ};nI.pickOutsideVisibleMinorAxis=j,nI.focusPriority=J;var{CARTESIAN_AXIS_TYPE:Jx,CARTESIAN_POSITION:U1}=T.ThemeConstants,YJ={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:t=>new qx(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Jx.NUMBER,position:U1.LEFT},{type:Jx.ORDINAL_TIME,position:U1.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}}},axes:{[Jx.NUMBER]:{crosshair:{snap:!1}},[Jx.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},Y1={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:nI,create:t=>new qx(t)},KJ=1e3;function K1(t,e,i,s,n,o){const a=t[o];if(a==null)return!1;const r=Wx(a,e,i),l=Hx(r,n);return o===s[l+sn]}function $1(t,e,i,s,n,o){const a=t[o];if(a==null)return!1;const r=Wx(a,e,i),l=Hx(r,n);return o===s[l+en]}function $J(t,e,i,s){if(t.length<KJ)return;const[n,o]=Ig(s);let a=Ag(t);const{indexData:r,valueData:l}=Tg(t,e,i,n,o,a);let c=[],h=[];for(let u=0;u<t.length;u+=1)K1(t,n,o,r,a,u)&&c.push(u),$1(t,n,o,r,a,u)&&h.push(u);const d=[{maxRange:a,topIndices:c,bottomIndices:h}];for(;a>64;)({maxRange:a}=kg(r,l,a,{inPlace:!0})),c=c.filter(K1.bind(null,t,n,o,r,a)),h=h.filter($1.bind(null,t,n,o,r,a)),d.push({maxRange:a,topIndices:c,bottomIndices:h});return d.reverse(),d}var{CartesianSeriesProperties:XJ,FillGradientDefaults:ZJ,FillPatternDefaults:QJ,InterpolationProperties:qJ,SeriesMarker:JJ,SeriesTooltip:ttt,TempValidate:Oe,BOOLEAN:ett,COLOR_STRING:X1,LINE_DASH:itt,OBJECT:ch,PLACEMENT:stt,POSITIVE_NUMBER:oI,COLOR_GRADIENT:ntt,COLOR_PATTERN:ott,OR:att,RATIO:Z1,STRING:hh,DropShadow:rtt,Label:ltt}=T,aI=class extends ltt{constructor(){super(...arguments),this.placement="outside",this.padding=6}};y([Oe(stt)],aI.prototype,"placement",2),y([Oe(oI)],aI.prototype,"padding",2);var Ue=class extends XJ{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new ZJ,this.fillPatternDefaults=new QJ,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new qJ,this.shadow=new rtt().set({enabled:!1}),this.marker=new JJ,this.label=new aI,this.tooltip=new ttt,this.connectMissingData=!1}};y([Oe(hh)],Ue.prototype,"xKey",2),y([Oe(hh)],Ue.prototype,"yLowKey",2),y([Oe(hh)],Ue.prototype,"yHighKey",2),y([Oe(hh,{optional:!0})],Ue.prototype,"xName",2),y([Oe(hh,{optional:!0})],Ue.prototype,"yName",2),y([Oe(hh,{optional:!0})],Ue.prototype,"yLowName",2),y([Oe(hh,{optional:!0})],Ue.prototype,"yHighName",2),y([Oe(att(ntt,ott,X1))],Ue.prototype,"fill",2),y([Oe(ch)],Ue.prototype,"fillGradientDefaults",2),y([Oe(ch)],Ue.prototype,"fillPatternDefaults",2),y([Oe(Z1)],Ue.prototype,"fillOpacity",2),y([Oe(X1)],Ue.prototype,"stroke",2),y([Oe(oI)],Ue.prototype,"strokeWidth",2),y([Oe(Z1)],Ue.prototype,"strokeOpacity",2),y([Oe(itt)],Ue.prototype,"lineDash",2),y([Oe(oI)],Ue.prototype,"lineDashOffset",2),y([Oe(ch)],Ue.prototype,"interpolation",2),y([Oe(ch)],Ue.prototype,"shadow",2),y([Oe(ch)],Ue.prototype,"marker",2),y([Oe(ch)],Ue.prototype,"label",2),y([Oe(ch)],Ue.prototype,"tooltip",2),y([Oe(ett)],Ue.prototype,"connectMissingData",2);var{CollapseMode:tb,isScaleValid:Q1,pairUpSpans:eb,prepareAreaFillAnimationFns:ctt,plotInterpolatedLinePathStroke:tu,prepareLinePathPropertyAnimation:htt,areScalingEqual:q1}=T;function dtt(t,e,i,s){const n=(l,c)=>{tu(l,c,e.removed),tu(l,c,i.removed)},o=(l,c)=>{tu(l,c,e.moved),tu(l,c,i.moved)},a=(l,c)=>{tu(l,c,e.added),tu(l,c,i.added)},r=htt(t,s);return{status:t,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function utt(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!Q1(t.scales.x)||!Q1(e.scales.x))return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const a=eb({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},tb.Split);if(a==null)return;const r=eb({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},tb.Split);if(r==null)return;const l=eb({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},tb.Split);if(l==null)return;const c=eb({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},tb.Split);if(c==null)return;const h="fade",d=ctt(o,a,r,h),u=dtt(o,l,c,h),p=(i?.changed??!0)||!q1(t.scales.x,e.scales.x)||!q1(t.scales.y,e.scales.y)||o!=="updated";return{status:o,fill:d,stroke:u,hasMotion:p}}var{valueProperty:J1,keyProperty:ptt,ChartAxisDirection:Is,mergeDefaults:gtt,updateLabelNode:ftt,fixNumericExtent:tP,buildResetPathFn:ytt,resetLabelFn:mtt,resetMarkerFn:xtt,resetMarkerPositionFn:eP,pathSwipeInAnimation:btt,resetMotion:Stt,markerSwipeScaleInAnimation:vtt,seriesLabelFadeInAnimation:rI,animationValidation:Mtt,diff:Dtt,updateClipPath:iP,computeMarkerFocusBounds:sP,plotAreaPathFill:Att,plotLinePathStroke:nP,interpolatePoints:oP,pathFadeInAnimation:aP,markerFadeInAnimation:rP,fromToMotion:lP,pathMotion:cP,extent:Itt,createDatumId:Ttt,applyShapeFillBBox:ktt,PointerEvents:lI,Group:Ctt,BBox:Ltt,ContinuousScale:Ntt,OrdinalTimeScale:wtt,findMinMax:Ott,getShapeStyle:Ett,getShapeFill:Rtt}=T,Ptt=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},ib=class extends T.CartesianSeries{constructor(t){super({moduleCtx:t,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[T.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[Is.X]:["xKey"],[Is.Y]:["yLowKey","yHighKey"]},directionNames:{[Is.X]:["xName"],[Is.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:ytt({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:mtt,marker:(e,i)=>({...xtt(e),...eP(e,i)})},clipFocusBox:!1}),this.properties=new Ue,this.NodeEvent=Ptt,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:s}=this.properties,n=this.axes[Is.X]?.scale,o=this.axes[Is.Y]?.scale,{xScaleType:a,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:o}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(Dtt(this.id,this.processedData)),c&&l.push(Mtt());const{dataModel:h,processedData:d}=await this.requestDataModel(t,this.data,{props:[ptt(e,a,{id:"xValue"}),J1(i,r,{id:"yLowValue"}),J1(s,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,d),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[Is.X];if(i==null||!(Ntt.is(i.scale)||wtt.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),o=t.resolveColumnById(this,"yLowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return $J(s,n,o,r)}xCoordinateRange(t){const e=this.axes[Is.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[Is.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];const{domain:{keys:[s]}}=e;if(t===Is.X){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n.def.valueType==="category"?s:tP(Itt(s))}else{const n=this.domainForClippedRange(Is.Y,["yHighValue","yLowValue"],"xValue",!0),o=Ott(n);return tP(o)}}getSeriesRange(t,e){return this.domainForVisibleRange(Is.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,processedData:i,axes:s}=this,n=s[Is.X],o=s[Is.Y];if(!(t&&n&&o&&e&&i))return;const a=n.scale,r=o.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:d,marker:u,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],f=(a.bandwidth??0)/2,x=e.resolveKeysById(this,"xValue",i),m=e.resolveColumnById(this,"yHighValue",i),b=e.resolveColumnById(this,"yLowValue",i),S=_=>a.convert(x[_])+f,M=[],D=[],C=[],k=(_,z,U)=>{const Y=g[_],Z=x[_];if(Z==null)return;const q=C[C.length-1];if(Number.isFinite(z)&&Number.isFinite(U)){const Q=(vt,At,ut)=>{D.push({index:_,series:this,itemId:vt,datum:Y,datumIndex:_,midPoint:{x:X,y:ut},yHighValue:z,yLowValue:U,xValue:Z,xKey:l,yLowKey:c,yHighKey:h,point:{x:X,y:ut,size:ht},enabled:!0});const Kt=this.createLabelData({datumIndex:_,point:{x:X,y:ut},value:At,yLowValue:U,yHighValue:z,itemId:vt,inverted:tt,datum:Y,series:this});M.push(Kt)},tt=U>z,X=S(_),it=r.convert(z),nt=r.convert(U),{size:ht}=u;Q("high",z,it),Q("low",U,nt);const lt={high:{point:{x:X,y:it},xDatum:Z,yDatum:z},low:{point:{x:X,y:nt},xDatum:Z,yDatum:U}};Array.isArray(q)?q.push(lt):q!=null?(q.skip+=1,C.push([lt])):C.push([lt])}else d||(Array.isArray(q)||q==null?C.push({skip:0}):q.skip+=1)},{dataAggregationFilters:I}=this,[L,N]=a.range,O=N-L,w=I?.find(_=>_.maxRange>O),R=w?.topIndices,G=w?.bottomIndices;let[B,P]=this.visibleRange("xValue",n.range,R);B=Math.max(B-1,0),P=Math.min(P+1,R?.length??x.length),i.input.count<1e3&&(B=0,P=i.input.count);for(let _=B;_<P;_+=1){const z=R?.[_]??_,U=G?.[_]??_;k(z,m[z],b[U])}const V=C.flatMap(_=>{if(!Array.isArray(_))return[];const z=_.map(U=>U.high);return oP(z,p)}),W=C.flatMap(_=>{if(!Array.isArray(_))return[];const z=_.map(U=>U.low);return oP(z,p)});return{itemId:`${c}-${h}`,labelData:M,nodeData:D,fillData:{itemId:"high",spans:V,phantomSpans:W},highStrokeData:{itemId:"high",spans:V},lowStrokeData:{itemId:"low",spans:W},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:t,point:e,value:i,itemId:s,inverted:n,datum:o,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:u,yHighName:p,label:g}=this.properties,{placement:f,padding:x=10}=g;let m=s;n&&(m=s==="low"?"high":"low");const b=f==="outside"&&m==="high"||f==="inside"&&m==="low"?-1:1;return{x:e.x,y:e.y+x*b,series:a,itemId:s,datum:o,datumIndex:t,text:this.getLabelText(g,{value:i,datum:o,itemId:s,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:p,yName:d}),textAlign:"center",textBaseline:b===-1?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,o]=t.paths,a=this.getStrokeWidth(this.properties.strokeWidth);o.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:lI.None,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const r=Rtt(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults),l=this.getShapeFillBBox();ktt(n,r,l),n.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:lI.None,fill:r,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,strokeWidth:a,opacity:e,visible:i||s}),iP(this,o),iP(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("RangeArea")}updateFillPath(t,e){const[i]=t;i.path.clear(),Att(i,e.fillData),i.markDirty("RangeArea")}updateStrokePath(t,e){const[,i]=t;i.path.clear(),nP(i,e.highStrokeData.spans),nP(i,e.lowStrokeData.spans),i.markDirty("RangeArea")}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,yHighKey:r,yLowKey:l,marker:c}=o,{itemStyler:h}=c;if(h!=null)return this.cachedDatumCallback(Ttt(t,s?"highlight":"node"),()=>this.callWithContext(h,{seriesId:n,datum:e,xKey:a,yHighKey:r,yLowKey:l,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yLowKey:n,yHighKey:o,marker:a,fill:r,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:d}=this.properties,u=gtt(i&&this.properties.highlightStyle.item,a.getStyle(),{fill:r,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:d}),p=this.getShapeFillBBox();e.each((g,f)=>{this.updateMarkerStyle(a,g,f.datum,f.point,{xKey:s,yHighKey:o,yLowKey:n},i,u,p)}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=lI.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{ftt(e,this.properties.label,i)})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}getHighlightData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}getTooltipContent(t,e){const{id:i,dataModel:s,processedData:n,axes:o,properties:a}=this,{xName:r,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,tooltip:g}=a,f=o[Is.X],x=o[Is.Y];if(!s||!n||!f||!x)return;const m=n.dataSources.get(this.id)?.[t],b=s.resolveKeysById(this,"xValue",n)[t],S=s.resolveColumnById(this,"yHighValue",n)[t],M=s.resolveColumnById(this,"yLowValue",n)[t];if(b==null)return;const D=this.getMarkerItemBaseStyle(!1);Object.assign(D,this.getMarkerItemStyleOverrides(String(t),t,D,!1));const C=`${x.formatDatum(M)} - ${x.formatDatum(S)}`;return g.formatTooltip(this.properties,{heading:f.formatDatum(b),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${h??c} - ${p??u}`,value:C}]},{seriesId:i,datum:m,title:l,itemId:e?.itemId??"unknown",xName:r,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,...D})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,marker:o}=this.properties;return{marker:Ett({shape:o.shape,fill:o.fill??t,stroke:o.stroke??e,fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},o.fillGradientDefaults,o.fillPatternDefaults),line:{stroke:e,strokeOpacity:s,strokeWidth:i,lineDash:n}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yLowKey:s,yHighKey:n,yName:o,yLowName:a,yHighName:r,showInLegend:l}=this.properties,c=o??`${a??s} - ${r??n}`,h=`${s}-${n}`;return[{legendType:"category",id:e,itemId:h,seriesId:e,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Ctt}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),btt(this,o,...n),Stt([e],eP),vtt(this,o,e),rI(this,"labels",o,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:o,previousContextData:a}=t,[r,l]=o;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(o,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||a==null){c(),rP(this,e,"added",i),aP(this,"fill_path_properties",e,"add",r),aP(this,"stroke_path_properties",e,"add",l),rI(this,"labels",e,s);return}const d=utt(n,a,this.processedData?.reduced?.diff?.[this.id]);if(d===void 0){h();return}else if(d.status==="no-op")return;lP(this.id,"fill_path_properties",e,[r],d.fill.pathProperties),lP(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateAreaPaths(o,n):d.status==="removed"?this.updateAreaPaths(o,a):(cP(this.id,"fill_path_update",e,[r],d.fill.path),cP(this.id,"stroke_path_update",e,[l],d.stroke.path)),d.hasMotion&&(rP(this,e,void 0,i),rI(this,"labels",e,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}getFormattedMarkerStyle(t){const{xKey:e,yLowKey:i,yHighKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{xKey:e,yLowKey:i,yHighKey:s},!0)}computeFocusBounds(t){const e=sP(this,t),i=sP(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return Ltt.merge([e,i])}isDatumEnabled(t,e){return e%2===0&&super.isDatumEnabled(t,e)}};ib.className="RangeAreaSeries",ib.type="range-area";var{commonSeriesOptionsDefs:Btt,interpolationValidator:ztt,markerOptionsDefs:Ftt,seriesLabelOptionsDefs:_tt,shadowOptionsDefs:Gtt,tooltipOptionsDefs:Vtt}=T,cI={type:K(Ct("range-area")),xKey:K(E),yLowKey:K(E),yHighKey:K(E),xName:E,yName:E,yLowName:E,yHighName:E,showInMiniChart:j,connectMissingData:j,interpolation:ztt,label:{..._tt,padding:H,placement:st("inside","outside")},marker:Ftt,tooltip:Vtt,shadow:Gtt,...Btt,...St,...rt,...Ot};cI.pickOutsideVisibleMinorAxis=j,cI.focusPriority=J;var jtt={series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,size:6,strokeWidth:2},label:{enabled:!1,placement:"outside",padding:10,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"}},axes:{[T.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:hP,CARTESIAN_POSITION:dP}}=T,Wtt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:t=>new ib(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:hP.NUMBER,position:dP.LEFT},{type:hP.CATEGORY,position:dP.BOTTOM}],themeTemplate:jtt},uP={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:cI,create:t=>new ib(t)},Htt=1e3,Utt=5;function Ytt(t,e,i,s){if(t.length<Htt)return;const[n,o]=Ig(s);let a=Ag(t,Utt),{indexData:r,valueData:l}=Tg(t,e,i,n,o,a);const c=[{maxRange:a,indexData:r}];for(;a>64;)({indexData:r,valueData:l,maxRange:a}=kg(r,l,a)),c.push({maxRange:a,indexData:r});return c.reverse(),c}var{AbstractBarSeriesProperties:Ktt,FillGradientDefaults:$tt,FillPatternDefaults:Xtt,SeriesTooltip:Ztt,TempValidate:Ee,COLOR_STRING:pP,FUNCTION:Qtt,LINE_DASH:qtt,OBJECT:Eg,PLACEMENT:Jtt,POSITIVE_NUMBER:sb,RATIO:gP,STRING:dh,BOOLEAN:tet,COLOR_GRADIENT:eet,COLOR_PATTERN:iet,OR:set,DropShadow:net,Label:oet}=T,hI=class extends oet{constructor(){super(...arguments),this.placement="inside",this.padding=6}};y([Ee(Jtt)],hI.prototype,"placement",2),y([Ee(sb)],hI.prototype,"padding",2);var Ye=class extends Ktt{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new $tt,this.fillPatternDefaults=new Xtt,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new net().set({enabled:!1}),this.label=new hI,this.tooltip=new Ztt,this.fastDataProcessing=!1}};y([Ee(dh)],Ye.prototype,"xKey",2),y([Ee(dh)],Ye.prototype,"yLowKey",2),y([Ee(dh)],Ye.prototype,"yHighKey",2),y([Ee(dh,{optional:!0})],Ye.prototype,"xName",2),y([Ee(dh,{optional:!0})],Ye.prototype,"yName",2),y([Ee(dh,{optional:!0})],Ye.prototype,"yLowName",2),y([Ee(dh,{optional:!0})],Ye.prototype,"yHighName",2),y([Ee(set(eet,iet,pP))],Ye.prototype,"fill",2),y([Ee(Eg)],Ye.prototype,"fillGradientDefaults",2),y([Ee(Eg)],Ye.prototype,"fillPatternDefaults",2),y([Ee(gP)],Ye.prototype,"fillOpacity",2),y([Ee(pP)],Ye.prototype,"stroke",2),y([Ee(sb)],Ye.prototype,"strokeWidth",2),y([Ee(gP)],Ye.prototype,"strokeOpacity",2),y([Ee(qtt)],Ye.prototype,"lineDash",2),y([Ee(sb)],Ye.prototype,"lineDashOffset",2),y([Ee(sb)],Ye.prototype,"cornerRadius",2),y([Ee(Qtt,{optional:!0})],Ye.prototype,"itemStyler",2),y([Ee(Eg)],Ye.prototype,"shadow",2),y([Ee(Eg)],Ye.prototype,"label",2),y([Ee(Eg)],Ye.prototype,"tooltip",2),y([Ee(tet)],Ye.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:fP,valueProperty:yP,keyProperty:aet,ChartAxisDirection:Rg,checkCrisp:ret,updateLabelNode:cet,SMALLEST_KEY_INTERVAL:het,LARGEST_KEY_INTERVAL:det,diff:uet,prepareBarAnimationFunctions:mP,midpointStartingBarPosition:xP,resetBarSelectionsFn:pet,fixNumericExtent:get,seriesLabelFadeInAnimation:bP,resetLabelFn:fet,animationValidation:yet,computeBarFocusBounds:met,visibleRangeIndices:SP,createDatumId:xet,ContinuousScale:vP,OrdinalTimeScale:bet,Rect:vet,PointerEvents:Met,motion:MP,applyShapeStyle:Det,findMinMax:Aet,getShapeStyle:dI}=T,Iet=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},nb=class extends T.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[fP.AXIS_ALIGNED,fP.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:pet,label:fet}}),this.properties=new Ye,this.dataAggregationFilters=void 0,this.NodeEvent=Iet}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:s,fastDataProcessing:n}=this.properties,o=!n,a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(uet(this.id,this.processedData)),d.push(yet()));const u=this.visible?{}:{forceValue:0},{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[aet(e,c,{id:"xValue"}),yP(i,h,{id:"yLowValue",invalidValue:null,...u}),yP(s,h,{id:"yHighValue",invalidValue:null,...u}),...l?[het,det]:[],...d],groupByKeys:o});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="grouped")return;const i=this.axes[Rg.X];if(i==null||!(vP.is(i.scale)||bet.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),o=t.resolveColumnById(this,"yLowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return Ytt(s,n,o,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s]}=e.domain;if(t===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n?.def.valueType==="category"?s:this.padBandExtent(s)}else{const n=this.domainForClippedRange(Rg.Y,["yHighValue","yLowValue"],"xValue",!0),o=Aet(n);return get(o)}}getSeriesRange(t,e){return this.domainForVisibleRange(Rg.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,groupScale:i,processedData:s,visible:n}=this,o=this.getCategoryAxis(),a=this.getValueAxis();if(!(t&&o&&a&&e&&s?.dataSources))return;const r=o.scale,l=a.scale,c=this.getBarDirection()===Rg.X,{xKey:h,yLowKey:d,yHighKey:u,strokeWidth:p}=this.properties,g=`${d}-${u}`,f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!n)return f;const x=s.dataSources.get(this.id)??[],m=e.resolveKeysById(this,"xValue",s),b=e.resolveColumnById(this,"yLowValue",s),S=e.resolveColumnById(this,"yHighValue",s),{barWidth:M,groupIndex:D}=this.updateGroupScale(o),C=vP.is(r)?M*-.5:0,k=i.convert(String(D)),I=ret(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval),L=P=>Math.round(r.convert(m[P]))+k+C,N=(P,V,W,F,_,z,U)=>{const Y=x[P],Z=m[P];if(Z==null)return;const q=b[P],Q=S[P];if(!Number.isFinite(q?.valueOf())||!Number.isFinite(Q?.valueOf()))return;const[tt,X]=q<Q?[q,Q]:[Q,q],it=Math.round(l.convert(z)),nt=Math.round(l.convert(_)),ht=Math.max(p,Math.abs(nt-it)),lt={x:c?Math.min(it,nt):W,y:c?W:Math.min(it,nt),width:c?ht:F,height:c?F:ht},vt={x:lt.x+lt.width/2,y:lt.y+lt.height/2},At=this.createLabelData({datumIndex:P,rect:lt,barAlongX:c,yLowValue:tt,yHighValue:X,datum:Y,series:this}),ut={index:V,valueIndex:P,series:this,itemId:g,datum:Y,datumIndex:P,xValue:Z,yLowValue:q,yHighValue:Q,yLowKey:d,yHighKey:u,xKey:h,x:lt.x,y:lt.y,width:lt.width,height:lt.height,midPoint:vt,crisp:U,labels:At};f.nodeData.push(ut),f.labelData.push(...At)},{dataAggregationFilters:O}=this,[w,R]=r.range,G=R-w,B=O?.find(P=>P.maxRange>G);if(B!=null){const{maxRange:P,indexData:V}=B,[W,F]=SP(P,o.range,_=>{const z=_*Dn,U=V[z+rs],Y=V[z+Gs];if(U===-1)return;const Z=(U+Y)/2|0;return[L(Z),L(Y)+M]});for(let _=W;_<F;_+=1){const z=_*Dn,U=V[z+rs],Y=V[z+Gs],Z=V[z+en],q=V[z+sn];if(U===-1)continue;const Q=(U+Y)/2|0;if(m[Q]==null)continue;const X=L(Q),it=Math.abs(L(U)-L(Y))+M,nt=b[Z],ht=S[q];N(Q,0,X,it,nt,ht,!1)}}else if(s.type==="ungrouped"){let[P,V]=SP(x.length,o.range,W=>[L(W),M]);s.input.count<1e3&&(P=0,V=s.input.count);for(let W=P;W<V;W+=1){const F=L(W),_=M,z=b[W],U=S[W];N(W,0,F,_,z,U,I)}}else for(const{datumIndex:P,groupIndex:V}of e.forEachGroupDatum(this,s)){const W=L(P),F=M,_=b[P],z=S[P];N(P,V,W,F,_,z,I)}return f}createLabelData({datumIndex:t,rect:e,barAlongX:i,yLowValue:s,yHighValue:n,datum:o,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p,label:g}=this.properties,f={datum:o,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p},{placement:x,padding:m}=g,S=m*(x==="outside"?1:-1),M={datumIndex:t,x:e.x+(i?-S:e.width/2),y:e.y+(i?e.height/2:e.height+S),textAlign:i?"left":"center",textBaseline:i?"middle":"bottom",text:this.getLabelText(g,{itemId:"low",value:s,...f}),itemId:"low",datum:o,series:a},D={datumIndex:t,x:e.x+(i?e.width+S:e.width/2),y:e.y+(i?e.height/2:-S),textAlign:i?"right":"center",textBaseline:i?"middle":"top",text:this.getLabelText(g,{itemId:"high",value:n,...f}),itemId:"high",datum:o,series:a};return x==="outside"&&(M.textAlign=i?"right":"center",M.textBaseline=i?"middle":"top",D.textAlign=i?"left":"center",D.textBaseline=i?"middle":"bottom"),[M,D]}nodeFactory(){return new vet}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,n=>this.getDatumId(n))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n}=e,o=t?e.highlightStyle.item:void 0;return dI({fill:o?.fill??e.fill,fillOpacity:o?.fillOpacity??e.fillOpacity,stroke:o?.stroke??e.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:o?.strokeOpacity??e.strokeOpacity,lineDash:o?.lineDash??e.lineDash??[],lineDashOffset:o?.lineDashOffset??e.lineDashOffset,cornerRadius:i},s,n)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,yHighKey:r,yLowKey:l,itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:d}=o;if(c==null)return;const u=this.cachedDatumCallback(xet(t,s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:n,datum:e,xKey:a,yHighKey:r,yLowKey:l,highlighted:s,...i}));return dI(u,h,d)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===Rg.X,n=this.getItemBaseStyle(i),o=this.getShapeFillBBox();e.each((a,r)=>{const l=this.getItemStyleOverrides(String(r.datumIndex),r.datum,n,i);Det(a,n,l,o),a.cornerRadius=l?.cornerRadius??n.cornerRadius,a.visible=s?r.width>0:r.height>0,a.crisp=r.crisp})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=Met.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{cet(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u}=n,p=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.[t],x=i.resolveKeysById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yHighValue",s)[t],b=i.resolveColumnById(this,"yLowValue",s)[t];if(x==null)return;const S=this.getItemBaseStyle(!1);Object.assign(S,this.getItemStyleOverrides(String(t),f,S,!1));const M=`${g.formatDatum(b)} - ${g.formatDatum(m)}`;return u.formatTooltip(this.properties,{heading:p.formatDatum(x),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${d??c}`,value:M}]},{seriesId:e,datum:f,title:r,xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,...S})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:dI({fill:t,stroke:e,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yName:s,yLowName:n,yHighName:o,yLowKey:a,yHighKey:r,showInLegend:l}=this.properties,c=s??`${n??a} - ${o??r}`,h=`${a}-${r}`;return[{legendType:"category",id:e,itemId:h,seriesId:e,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=mP(xP(this.isVertical(),"normal"));MP.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),bP(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,previousContextData:s}=t,{processedData:n}=this,o=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=s==null?"fade":"normal",r=mP(xP(this.isVertical(),a));MP.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],r,(l,c)=>this.getDatumId(c),o),bP(this,"labels",this.ctx.animationManager,i)}getDatumId(t){return`${t.xValue}-${t.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return met(this,this.contextNodeData?.nodeData[t])}};nb.className="RangeBarSeries",nb.type="range-bar";var{commonSeriesOptionsDefs:Tet,seriesLabelOptionsDefs:ket,shadowOptionsDefs:Cet,tooltipOptionsDefs:Let}=T,ob={type:K(Ct("range-bar")),xKey:K(E),yLowKey:K(E),yHighKey:K(E),xName:E,yName:E,yLowName:E,yHighName:E,direction:st("horizontal","vertical"),showInMiniChart:j,cornerRadius:H,itemStyler:bt,label:{...ket,padding:H,placement:st("inside","outside")},tooltip:Let,shadow:Cet,...Tet,...St,...rt,...Ot};ob.pickOutsideVisibleMinorAxis=j,ob.fastDataProcessing=j,ob.focusPriority=J;var Net={series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[T.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},wet={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:t=>new nb(t),tooltipDefaults:{range:"exact"},defaultAxes:T.DIRECTION_SWAP_AXES,themeTemplate:Net,groupable:!0},DP={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:ob,create:t=>new nb(t)},{AbstractBarSeriesProperties:Oet,BaseProperties:Pg,FillGradientDefaults:Eet,FillPatternDefaults:Ret,PropertiesArray:Pet,SeriesTooltip:Bet,TempValidate:Ut,BOOLEAN:zet,COLOR_STRING:uI,COLOR_PATTERN:Fet,FUNCTION:AP,LINE_DASH:IP,NUMBER:_et,OBJECT:Ro,OBJECT_ARRAY:Get,POSITIVE_NUMBER:eu,OR:Vet,COLOR_GRADIENT:jet,RATIO:pI,STRING:iu,UNION:TP,DropShadow:Wet,Label:Het}=T,ab=class extends Pg{};y([Ut(TP(["subtotal","total"],"a total type"))],ab.prototype,"totalType",2),y([Ut(_et)],ab.prototype,"index",2),y([Ut(iu)],ab.prototype,"axisLabel",2);var kP=class extends Pg{};y([Ut(AP,{optional:!0})],kP.prototype,"renderer",2);var gI=class extends Het{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};y([Ut(TP(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],gI.prototype,"placement",2),y([Ut(eu)],gI.prototype,"padding",2);var Ki=class extends Pg{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Eet,this.fillPatternDefaults=new Ret,this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new Wet().set({enabled:!1}),this.label=new gI,this.tooltip=new kP}};y([Ut(iu,{optional:!0})],Ki.prototype,"name",2),y([Ut(Vet(jet,uI,Fet))],Ki.prototype,"fill",2),y([Ut(Ro)],Ki.prototype,"fillGradientDefaults",2),y([Ut(Ro)],Ki.prototype,"fillPatternDefaults",2),y([Ut(uI)],Ki.prototype,"stroke",2),y([Ut(pI)],Ki.prototype,"fillOpacity",2),y([Ut(pI)],Ki.prototype,"strokeOpacity",2),y([Ut(IP)],Ki.prototype,"lineDash",2),y([Ut(eu)],Ki.prototype,"lineDashOffset",2),y([Ut(eu)],Ki.prototype,"strokeWidth",2),y([Ut(eu)],Ki.prototype,"cornerRadius",2),y([Ut(AP,{optional:!0})],Ki.prototype,"itemStyler",2),y([Ut(Ro)],Ki.prototype,"shadow",2),y([Ut(Ro)],Ki.prototype,"label",2),y([Ut(Ro)],Ki.prototype,"tooltip",2);var uh=class extends Pg{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};y([Ut(zet)],uh.prototype,"enabled",2),y([Ut(uI)],uh.prototype,"stroke",2),y([Ut(pI)],uh.prototype,"strokeOpacity",2),y([Ut(IP)],uh.prototype,"lineDash",2),y([Ut(eu)],uh.prototype,"lineDashOffset",2),y([Ut(eu)],uh.prototype,"strokeWidth",2);var rb=class extends Pg{constructor(){super(...arguments),this.positive=new Ki,this.negative=new Ki,this.total=new Ki}};y([Ut(Ro)],rb.prototype,"positive",2),y([Ut(Ro)],rb.prototype,"negative",2),y([Ut(Ro)],rb.prototype,"total",2);var Dr=class extends Oet{constructor(){super(...arguments),this.item=new rb,this.totals=new Pet(ab),this.line=new uh,this.tooltip=new Bet}};y([Ut(iu)],Dr.prototype,"xKey",2),y([Ut(iu)],Dr.prototype,"yKey",2),y([Ut(iu,{optional:!0})],Dr.prototype,"xName",2),y([Ut(iu,{optional:!0})],Dr.prototype,"yName",2),y([Ut(Ro)],Dr.prototype,"item",2),y([Ut(Get)],Dr.prototype,"totals",2),y([Ut(Ro)],Dr.prototype,"line",2),y([Ut(Ro)],Dr.prototype,"tooltip",2);var{adjustLabelPlacement:Uet,SeriesNodePickMode:CP,fixNumericExtent:Yet,valueProperty:LP,keyProperty:Ket,accumulativeValueProperty:lb,trailingAccumulatedValueProperty:$et,ChartAxisDirection:fI,createDatumId:Xet,checkCrisp:Zet,updateLabelNode:Qet,prepareBarAnimationFunctions:qet,collapsedStartingBarPosition:Jet,resetBarSelectionsFn:tit,seriesLabelFadeInAnimation:eit,resetLabelFn:iit,animationValidation:sit,DEFAULT_CARTESIAN_DIRECTION_KEYS:nit,DEFAULT_CARTESIAN_DIRECTION_NAMES:oit,computeBarFocusBounds:ait,isContinuous:NP,Rect:rit,motion:lit,applyShapeStyle:cit,getShapeStyle:yI}=T,cb=class extends T.AbstractBarSeries{constructor(t){super({moduleCtx:t,directionKeys:nit,directionNames:oit,categoryKey:void 0,pickModes:[CP.NEAREST_NODE,CP.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:tit,label:iit}}),this.properties=new Dr,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:s}=this.properties,{data:n=[]}=this;if(!this.properties.isValid()||!this.visible)return;const o=b=>NP(b)&&Number(b)>=0,a=b=>NP(b)&&Number(b)>=0,r=b=>b==="total"||b==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((b,S)=>{const M=b.get(S.index);return M?M.push(S):b.set(S.index,[S]),b},new Map);n.forEach((b,S)=>{c.push(b),h.get(S)?.forEach(M=>c.push({...M.toJson(),[e]:M.axisLabel}))});const d=[];this.ctx.animationManager.isSkipped()||d.push(sit());const u=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:f,yScaleType:x}=this.getScaleInformation({xScale:u,yScale:p}),{processedData:m}=await this.requestDataModel(t,c,{props:[Ket(e,f,{id:"xValue"}),lb(i,x,{...l,id:"yCurrent"}),lb(i,x,{...l,missingValue:0,id:"yCurrentTotal"}),lb(i,x,{...l,id:"yCurrentPositive",validation:o}),lb(i,x,{...l,id:"yCurrentNegative",validation:a}),$et(i,x,{...l,id:"yPrevious"}),LP(i,x,{id:"yRaw"}),LP("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:r}),...g?[T.SMALLEST_KEY_INTERVAL,T.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s],values:n}=e.domain;if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category")return s;const a=t===fI.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(s,r!==a)}else{const o=i.resolveProcessedDataIndexById(this,"yCurrent"),a=n[o],r=[Math.min(0,a[0]),Math.max(0,a[1])];return Yet(r)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!t||!s||!n||!e||!i)return;const{line:o}=this.properties,a=s.scale,r=n.scale,l=this.getBarDirection()===fI.X,c=this.getBandwidth(s)??10,h=s.isReversed(),d=n.isReversed();if(i.type!=="ungrouped")return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),visible:this.visible};if(!this.visible)return u;const p=[],g=e.resolveKeysById(this,"xValue",i),f=e.resolveColumnById(this,"yRaw",i),x=e.resolveColumnById(this,"totalTypeValue",i),m=e.resolveColumnById(this,"yCurrent",i),b=e.resolveColumnById(this,"yPrevious",i),S=e.resolveColumnById(this,"yCurrentTotal",i),M=Zet(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function D(G,B,P){return G||B?{cumulativeValue:S[P],trailingValue:B?k:0}:{cumulativeValue:m[P],trailingValue:b[P]}}function C(G,B,P,V,W){return G?V:B?(V??0)-(W??0):P}let k=0;const{xKey:I,yKey:L,xName:N,yName:O}=this.properties;(i.dataSources.get(this.id)??[]).forEach((G,B)=>{const P=x[B],V=this.isSubtotal(P),W=this.isTotal(P),F=W||V,_=g[B];if(_==null)return;const z=Math.round(a.convert(_)),U=f[B],{cumulativeValue:Y,trailingValue:Z}=D(W,V,B);F&&(k=Y??0);const q=Math.round(r.convert(Y)),Q=Math.round(r.convert(Z)),tt=C(W,V,U,Y,Z),X=(tt??0)>=0,it=this.getSeriesItemType(X,P),{strokeWidth:nt,label:ht}=this.getItemConfig(it),lt=X?q:Q,vt=X?Q:q,At=Math.max(nt,Math.abs(vt-lt)),ut={x:l?Math.min(lt,vt):z,y:l?z:Math.min(lt,vt),width:l?At:c,height:l?c:At},Kt={x:ut.x+ut.width/2,y:ut.y+ut.height/2},Xt=F?q:Q,Gt=Math.floor(o.strokeWidth)%2/2,Vt=h?q:Xt,Dt=h?Xt:q;let Bt,$t;l?(Bt={x:Vt+Gt,y:ut.y},$t={x:Dt+Gt,y:ut.y+ut.height}):(Bt={x:ut.x,y:Vt+Gt},$t={x:ut.x+ut.width,y:Dt+Gt});const Xi={x:h?$t.x:Bt.x,y:h?$t.y:Bt.y,x2:h?Bt.x:$t.x,y2:h?Bt.y:$t.y,size:0};p.push(Xi);const ps=it==="subtotal"?"total":it,Nn=this.getLabelText(ht,{itemId:ps,value:tt,datum:G,xKey:I,yKey:L,xName:N,yName:O}),Kl={index:B,series:this,itemId:it,datum:G,datumIndex:B,cumulativeValue:Y??0,xValue:_,yValue:tt,yKey:L,xKey:I,x:ut.x,y:ut.y,width:ut.width,height:ut.height,midPoint:Kt,crisp:M,label:{text:Nn,...Uet({isUpward:(tt??-1)>=0!==d,isVertical:!l,placement:ht.placement,padding:ht.padding,rect:ut})}};u.nodeData.push(Kl),u.labelData.push(Kl)});const R=this.properties.line.enabled;return m!=null&&R&&(u.pointData=p),u}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const s=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),o=t.resolveProcessedDataIndexById(this,"totalTypeValue"),a=i.domain.values[s]??[],r=i.domain.values[n]??[];a.length>0&&e.add("positive"),r.length>0&&e.add("negative");const l=i?.domain.values[o];l&&l.forEach(c=>{(c==="total"||c==="subtotal")&&e.add("total")})}isSubtotal(t){return t==="subtotal"}isTotal(t){return t==="total"}nodeFactory(){return new rit}getSeriesItemType(t,e){return e??(t?"positive":"negative")}getItemConfig(t){switch(t){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}getItemStyle(t,e,i,s){const{id:n,properties:o}=this,a=o.item[i==="subtotal"?"total":i],r=s?o.highlightStyle.item:void 0,{itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h}=a,{xKey:d,yKey:u}=o,p=yI({fill:r?.fill??a.fill,fillOpacity:r?.fillOpacity??a.fillOpacity,stroke:r?.stroke??a.stroke,strokeWidth:r?.strokeWidth??a.strokeWidth,strokeOpacity:r?.strokeOpacity??a.strokeOpacity,lineDash:r?.lineDash??a.lineDash??[],lineDashOffset:r?.lineDashOffset??a.lineDashOffset,cornerRadius:a.cornerRadius},c,h);if(l!=null){let g=this.cachedDatumCallback(Xet(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,itemId:i,datum:e,xKey:d,yKey:u,highlighted:s,...p}));g=yI(g,c,h),Object.assign(p,g)}return p}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===fI.X,n=this.getShapeFillBBox();e.each((o,a)=>{const r=a.itemId,l=this.getItemStyle(String(a.datumIndex),a.datum,r,i);cit(o,l,void 0,n),o.visible=s?a.width>0:a.height>0,o.crisp=a.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(e.length===0)return i.update([]);const s=e.filter(n=>{const{label:o}=this.getItemConfig(n.itemId);return o.enabled});return i.update(s)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{Qet(e,this.getItemConfig(i.itemId).label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,tooltip:c}=n,h=this.getCategoryAxis(),d=this.getValueAxis();if(!i||!s||!h||!d)return;const u=s.dataSources.get(this.id)?.[t],p=i.resolveKeysById(this,"xValue",s)[t],g=i.resolveColumnById(this,"yRaw",s)[t],f=i.resolveColumnById(this,"yCurrentTotal",s),x=i.resolveColumnById(this,"totalTypeValue",s);if(p==null)return;const m=x[t],b=(g??0)>=0,S=this.getSeriesItemType(b,m);let M;if(this.isTotal(m))M=f[t];else if(this.isSubtotal(m)){M=f[t];for(let C=t-1;C>=0;C-=1)if(this.isSubtotal(x[C])){M=M-f[C];break}}else M=g;const D=this.getItemStyle(String(t),u,S,!1);return c.formatTooltip(this.properties,{heading:h.formatDatum(p),symbol:this.legendItemSymbol(S),data:[{label:l,fallbackLabel:r,value:d.formatDatum(M)}]},{seriesId:e,datum:u,title:l,itemId:S,xKey:o,xName:a,yKey:r,yName:l,...D})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r,fillGradientDefaults:l,fillPatternDefaults:c}=this.getItemConfig(t);return{marker:yI({fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r},l,c)}}getLegendData(t){if(t!=="category")return[];const{id:e,seriesItemTypes:i}=this,s=[],n=a=>a.charAt(0).toUpperCase()+a.substring(1),{showInLegend:o}=this.properties;return i.forEach(a=>{const{name:r}=this.getItemConfig(a);s.push({legendType:"category",id:e,itemId:a,seriesId:e,enabled:!0,label:{text:r??n(a)},symbol:this.legendItemSymbol(a),hideInLegend:!o,isFixed:!0})}),s}toggleSeriesItem(){}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:s}=t,n=qet(Jet(this.isVertical(),this.axes,"normal"));lit.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n),eit(this,"labels",this.ctx.animationManager,i);const{pointData:o}=s;o&&(this.isVertical()?this.animateConnectorLinesVertical(t):this.animateConnectorLinesHorizontal(t))}animateConnectorLinesHorizontal(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h<d:(h,d)=>h>d,r=n?.scale.convert(0),l=e.reduce((h,d)=>(a(d.x,h)&&(h=d.x),h),o?1/0:0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:T.Motion.easeOut,collapsable:!1,onUpdate(h){s.clear(!0),e.forEach((d,u)=>{const p=c(h,r,l,r,d.x),g=c(h,r,l,r,d.x2);u!==0&&s.lineTo(p,d.y),s.moveTo(g,d.y2)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateConnectorLinesVertical(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h>d:(h,d)=>h<d,r=n?.scale.convert(0),l=e.reduce((h,d)=>(a(d.y,h)&&(h=d.y),h),o?0:1/0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:T.Motion.easeOut,collapsable:!1,onUpdate(h){s.clear(!0),e.forEach((d,u)=>{const p=c(h,r,l,r,d.y),g=c(h,r,l,r,d.y2);u!==0&&s.lineTo(d.x,p),s.moveTo(d.x2,g)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateReadyResize(t){super.animateReadyResize(t),this.resetConnectorLinesPath(t)}updatePaths(t){this.resetConnectorLinesPath({contextData:t.contextData,paths:t.paths})}resetConnectorLinesPath({contextData:t,paths:e}){if(e.length===0)return;const[i]=e;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:n}=t;n&&(n.forEach((o,a)=>{a!==0&&s.lineTo(o.x,o.y),s.moveTo(o.x2,o.y2)}),i.checkPathDirty())}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:this.getStrokeWidth(i),strokeOpacity:s,lineDash:n,lineDashOffset:o,lineJoin:"round",pointerEvents:T.PointerEvents.None})}isLabelEnabled(){const{positive:t,negative:e,total:i}=this.properties.item;return t.label.enabled||e.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return ait(this,this.contextNodeData?.nodeData[t])}};cb.className="WaterfallSeries",cb.type="waterfall";var{commonSeriesOptionsDefs:hit,seriesLabelOptionsDefs:dit,shadowOptionsDefs:uit,tooltipOptionsDefs:wP}=T,mI={name:E,cornerRadius:H,itemStyler:bt,label:{...dit,padding:H,placement:st("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:wP,shadow:uit,...St,...rt,...Ot},pit={type:K(Ct("waterfall")),xKey:K(E),yKey:K(E),xName:E,yName:E,direction:st("horizontal","vertical"),totals:gs({totalType:K(st("total","subtotal")),index:K(H),axisLabel:K(E)},"a total definition options array"),showInMiniChart:j,item:{positive:mI,negative:mI,total:mI},line:{enabled:j,...rt,...Ot},tooltip:wP,...hit};function xI(t,e){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`./${e}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${t}.fill`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${t}.fill`}]},{$isPattern:[{$palette:`${t}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${t}.fill`}]}]},[{$mix:[{$palette:`${t}.fill`},"black",.15]},{$mix:[{$palette:`${t}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,stroke:{$palette:`${t}.stroke`},strokeWidth:0,label:{enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end"}}}var git={series:{item:{positive:xI("altUp",0),negative:xI("altDown",1),total:xI("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},fit={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:t=>new cb(t),tooltipDefaults:{range:"exact"},defaultAxes:T.DIRECTION_SWAP_AXES,themeTemplate:git},OP={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:pit,create:t=>new cb(t)},{NewAreaSeriesModule:yit,NewBarSeriesModule:mit,NewBubbleSeriesModule:xit,NewHistogramSeriesModule:bit,NewLineSeriesModule:Sit,NewScatterSeriesModule:vit,numberFormatValidator:Mit,without:Tn}=T,EP={width:H,height:H,grip:j,fill:dt,stroke:dt,strokeWidth:H,cornerRadius:H},kn=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],Dit={enabled:j,height:H,spacing:H,cornerRadius:J,mask:{fill:dt,fillOpacity:Tt,stroke:dt,strokeWidth:H},minHandle:EP,maxHandle:EP,miniChart:{enabled:j,padding:{top:H,bottom:H},label:{enabled:j,avoidCollisions:j,spacing:H,format:Mit,formatter:bt,interval:{minSpacing:H,maxSpacing:H,values:On,step:J},...ge},series:mt(vu({area:Tn(yit.options,kn),bar:Tn(mit.options,[...kn,"errorBar","label","legendItemName","direction"]),"box-plot":Tn(g1.options,[...kn,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"]),bubble:Tn(xit.options,[...kn,"title","label","labelKey","labelName","sizeName"]),candlestick:Tn(w1.options,kn),heatmap:Tn(W1.options,[...kn,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"]),histogram:Tn(bit.options,[...kn,"label"]),line:Tn(Sit.options,[...kn,"errorBar","title","label"]),ohlc:Tn(Y1.options,kn),"range-area":Tn(uP.options,[...kn,"label","yLowName","yHighName"]),"range-bar":Tn(DP.options,[...kn,"direction","label","yLowName","yHighName"]),scatter:Tn(vit.options,[...kn,"errorBar","title","label","labelKey","labelName"]),waterfall:Tn(OP.options,[...kn,"direction"])}))}},Ait={type:"plugin",name:"annotations",chartType:"cartesian",options:yg,create(){return null}},Iit={type:"plugin",name:"navigator",chartType:"cartesian",options:Dit,create(){return null}},Tit={type:"plugin",name:"initialState",options:Xq,create(){return null}};function RP(t,e,i){i||(e=kit(e));const s=new Map;for(const o of t)s.set(o.id,{datum:o,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let n=0;return s.forEach((o,a)=>{n=Math.max(n,bI(s,e,o,a,-1,[])+bI(s,e,o,a,1,[])+1)}),{links:e,nodeGraph:s,maxPathLength:n}}function PP(t,e,i,s){const n=s.indexOf(e);if(n!==-1){for(let a=n;a<s.length;a+=1)i.add(s[a]);return}s.push(e);const{toNode:o}=e;for(const a of t)a.fromNode===o&&PP(t,a,i,s);s.pop()}function kit(t){const e=new Set;for(const i of t)PP(t,i,e,[]);return e.size!==0&&$.warnOnce("Some links formed circular references. These will be removed from the output."),e.size===0?t:t.filter(i=>!e.has(i))}function bI(t,e,i,s,n,o){if(o.includes(s))return 1/0;let a=n===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(a===-1){a=0;const r=n===-1?i.linksBefore:i.linksAfter;for(const l of e){const{fromNode:c,toNode:h}=l,d=n===-1?h.id:c.id,u=n===-1?c.id:h.id,p=s===d?t.get(u):void 0;p!=null&&(r.push({node:p,link:l}),o?.push(s),a=Math.max(a,bI(t,e,p,u,n,o)+1),o?.pop())}n===-1?i.maxPathLengthBefore=a:i.maxPathLengthAfter=a}return a}var{Series:Cit,DataController:Lit,keyProperty:Nit,valueProperty:hb,Selection:ph,Group:su,TransformableText:wit}=T,Oit=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s);const{datumIndex:n}=i,o=s.contextNodeData?.nodeData.find(a=>a.datumIndex.type===n.type&&a.datumIndex.index===n.index);this.size=o?.size,this.label=o?.type===1?o?.label:void 0}},BP=class extends Cit{constructor(){super(...arguments),this.NodeEvent=Oit,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new su({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new su({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new su({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new su({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new su({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new su({name:"nodeGroup"})),this.labelSelection=ph.select(this.labelGroup,wit),this.linkSelection=ph.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=ph.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=ph.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=ph.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=ph.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=ph.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(t){this._chartNodes=t,this.nodes===t&&(this.nodeDataRefresh=!0)}async processData(t){const{data:e,nodes:i}=this;if(e==null||!this.properties.isValid())return;const{fromKey:s,toKey:n,sizeKey:o,idKey:a,labelKey:r}=this.properties,l=new Lit("standalone",t.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[Nit(a,void 0,{id:"idValue",includeProperty:!1}),...r!=null?[hb(r,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=t.request(this.id,e,{props:[hb(s,void 0,{id:"fromValue",includeProperty:!1}),hb(n,void 0,{id:"toValue",includeProperty:!1}),...o!=null?[hb(o,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c,h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(d==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),x=m=>{const b=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:b},type:1,index:b,linksBefore:[],linksAfter:[],id:m,size:0,label:m}};u.processedData.dataSources.get(this.id)?.forEach((m,b)=>{const S=g[b],M=f[b];S==null||M==null||(p.has(S)||p.set(S,x(S)),p.has(M)||p.set(M,x(M)))})}else{const g=d.dataModel.resolveColumnById(this,"idValue",d.processedData),f=r!=null?d.dataModel.resolveColumnById(this,"labelValue",d.processedData):void 0;d.processedData.dataSources.get(this.id)?.forEach((x,m)=>{const b=g[m],S=f?.[m];p.set(b,{series:this,itemId:void 0,datum:x,datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:b,size:0,label:S})})}this.processedNodes=p}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(s==null||n==null){const{links:g,nodeGraph:f,maxPathLength:x}=RP(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:g,maxPathLength:x}}const{sizeKey:o}=this.properties,a=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=o!=null?s.resolveColumnById(this,"sizeValue",n):void 0,c=new Map;this.processedNodes.forEach(g=>{const f=t(g);c.set(g.id,f)});const h=[];n.dataSources.get(this.id)?.forEach((g,f)=>{const x=a[f],m=r[f],b=l!=null?l[f]:1,S=c.get(x),M=c.get(m);if(b<=0||S==null||M==null)return;const D=e({series:this,itemId:void 0,datum:g,datumIndex:{type:0,index:f},type:0,index:f,fromNode:S,toNode:M,size:b});h.push(D)});const{links:d,nodeGraph:u,maxPathLength:p}=RP(c.values(),h,i);return u.forEach(g=>{g.datum.linksBefore=g.linksBefore.map(f=>f.link),g.datum.linksAfter=g.linksAfter.map(f=>f.link)}),this.nodeCount=u.size,this.linkCount=d.length,{nodeGraph:u,links:d,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(t){const{seriesRect:e}=t,i={seriesRectWidth:e?.width??0,seriesRectHeight:e?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];let o=this.ctx.highlightManager?.getActiveHighlight();if(o?.series===this&&o.type==null){const{itemId:h}=o;o=h!=null?s.find(d=>d.type===1&&d.id===h):void 0}else o?.series!==this&&(o=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=o!=null?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let a,r,l,c;o?.type===1?(a=s.filter(h=>h.type===0&&(h.toNode===o||h.fromNode===o)),r=a.map(h=>h.fromNode===o?h.toNode:h.fromNode),r.push(o),l=[],c=[o]):o?.type===0?(a=[o],r=[o.fromNode,o.toNode],l=[o],c=[]):(a=[],r=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:a,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:r,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(t){}getSeriesDomain(t){return[]}getSeriesRange(t,e){return[NaN,NaN]}legendItemSymbol(t,e,i={}){const{fills:s,strokes:n}=this.properties,{fill:o=s[e%s.length],fillOpacity:a=1,stroke:r=n[e%n.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:o,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(t){if(t!=="category")return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},n)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,n),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.linkSelection.each((n,o)=>{const a=n.containsPoint(t,e)?0:1/0;a<i&&(i=a,s=o)}),this.nodeSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}getDatumAriaText(t,e){if(t.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:t.index+1,count:this.linkCount,from:t.fromNode.id,to:t.toNode.id,size:t.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(t.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:t.index+1,count:this.nodeCount,description:e})}pickFocus(t){const{datumIndexDelta:e,otherIndexDelta:i}=t,s=this.contextNodeData?.nodeData[t.datumIndex-t.datumIndexDelta];let n=s;if(i!==0||e===0)return;if(s?.type===0){const r=Array.from(this.linkSelection,h=>h.datum),c=r.indexOf(s)+e;if(c>=0&&c<r.length)n=r[c];else if(c>0)n=r[r.length-1];else{const h=Array.from(this.nodeSelection,d=>d.datum);n=h[h.length-1]}}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+e;c>=0&&c<r.length?n=r[c]:c<0?n=r[0]:n=Array.from(this.linkSelection,d=>d.datum)[0]}if(n==null)return;const o=n.type===1?Array.from(this.nodeSelection).find(r=>r.datum===n):Array.from(this.linkSelection).find(r=>r.datum===n);if(o==null)return;const a=this.computeFocusBounds(o.node);if(a!=null)return{datum:o.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(o.datum)??0,otherIndex:0,bounds:a,clipFocusBox:!0}}getCategoryValue(t){}datumIndexForCategoryValue(t){}},{BBox:Eit,Path:Rit,ScenePathChangeDetection:wl}=T;function db({radius:t,startAngle:e,endAngle:i,tension:s}){const n=t*Math.cos(e),o=t*Math.sin(e),a=t*Math.cos(i),r=t*Math.sin(i),l=n*s,c=o*s,h=a*s,d=r*s;return{x:[n,l,h,a],y:[o,c,d,r]}}var Ar=class extends Rit{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}computeBBox(){const{centerX:t,centerY:e,radius:i,startAngle1:s,endAngle1:n,startAngle2:o,endAngle2:a,tension:r}=this,l=db({radius:i,startAngle:s,endAngle:a,tension:r}),c=db({radius:i,startAngle:o,endAngle:n,tension:r}),h=Math.min(...l.x,...c.x),d=Math.max(...l.x,...c.x)-h,u=Math.min(...l.y,...c.y),p=Math.max(...l.y,...c.y)-u;return new Eit(t+h,e+u,d,p)}isPointInPath(t,e){return super.isPointInPath(t,e)&&this.getBBox().containsPoint(t,e)}tensionedCurveTo(t,e,i,s,n,o,a,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-t)*h+t,(s-e)*h+e,(n-a)*h+a,(o-r)*h+r,a,r)}updatePath(){const{path:t,centerX:e,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:o,startAngle2:a,endAngle2:r}=this;n>a&&([n,a]=[a,n],[o,r]=[r,o]),t.clear();const l=e+s*Math.cos(n),c=i+s*Math.sin(n);t.moveTo(l,c),this.tensionedCurveTo(l,c,e,i,e,i,e+s*Math.cos(r),i+s*Math.sin(r)),t.arc(e,i,s,r,a,!0),this.tensionedCurveTo(e+s*Math.cos(a),i+s*Math.sin(a),e,i,e,i,e+s*Math.cos(o),i+s*Math.sin(o)),t.arc(e,i,s,o,n,!0),t.closePath()}};y([wl()],Ar.prototype,"centerX",2),y([wl()],Ar.prototype,"centerY",2),y([wl()],Ar.prototype,"radius",2),y([wl()],Ar.prototype,"startAngle1",2),y([wl()],Ar.prototype,"endAngle1",2),y([wl()],Ar.prototype,"startAngle2",2),y([wl()],Ar.prototype,"endAngle2",2),y([wl()],Ar.prototype,"tension",2);var{FillGradientDefaults:Pit,FillPatternDefaults:Bit,BaseProperties:zP,SeriesTooltip:zit,SeriesProperties:Fit,ARRAY:_it,ARRAY_OF:Git,COLOR_STRING:Bg,COLOR_STRING_ARRAY:Vit,FUNCTION:FP,LINE_DASH:_P,OBJECT:nu,POSITIVE_NUMBER:Ol,RATIO:zg,STRING:El,OR:SI,COLOR_GRADIENT:vI,TempValidate:Yt,COLOR_PATTERN:MI,Label:jit}=T,DI=class extends jit{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};y([Yt(Ol)],DI.prototype,"spacing",2),y([Yt(Ol)],DI.prototype,"maxWidth",2);var Ia=class extends zP{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};y([Yt(SI(vI,Bg,MI),{optional:!0})],Ia.prototype,"fill",2),y([Yt(zg)],Ia.prototype,"fillOpacity",2),y([Yt(Bg,{optional:!0})],Ia.prototype,"stroke",2),y([Yt(zg)],Ia.prototype,"strokeOpacity",2),y([Yt(Ol)],Ia.prototype,"strokeWidth",2),y([Yt(_P)],Ia.prototype,"lineDash",2),y([Yt(Ol)],Ia.prototype,"lineDashOffset",2),y([Yt(zg)],Ia.prototype,"tension",2),y([Yt(FP,{optional:!0})],Ia.prototype,"itemStyler",2);var Po=class extends zP{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};y([Yt(Ol)],Po.prototype,"spacing",2),y([Yt(Ol)],Po.prototype,"width",2),y([Yt(SI(vI,Bg,MI),{optional:!0})],Po.prototype,"fill",2),y([Yt(zg)],Po.prototype,"fillOpacity",2),y([Yt(Bg,{optional:!0})],Po.prototype,"stroke",2),y([Yt(zg)],Po.prototype,"strokeOpacity",2),y([Yt(Ol)],Po.prototype,"strokeWidth",2),y([Yt(_P)],Po.prototype,"lineDash",2),y([Yt(Ol)],Po.prototype,"lineDashOffset",2),y([Yt(FP,{optional:!0})],Po.prototype,"itemStyler",2);var $i=class extends Fit{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new Pit,this.fillPatternDefaults=new Bit,this.fills=[],this.strokes=[],this.label=new DI,this.link=new Ia,this.node=new Po,this.tooltip=new zit}};y([Yt(El)],$i.prototype,"fromKey",2),y([Yt(El)],$i.prototype,"toKey",2),y([Yt(El)],$i.prototype,"idKey",2),y([Yt(El,{optional:!0})],$i.prototype,"idName",2),y([Yt(El,{optional:!0})],$i.prototype,"labelKey",2),y([Yt(El,{optional:!0})],$i.prototype,"labelName",2),y([Yt(El,{optional:!0})],$i.prototype,"sizeKey",2),y([Yt(El,{optional:!0})],$i.prototype,"sizeName",2),y([Yt(_it,{optional:!0})],$i.prototype,"nodes",2),y([Yt(nu)],$i.prototype,"fillGradientDefaults",2),y([Yt(nu)],$i.prototype,"fillPatternDefaults",2),y([Yt(Git(SI(vI,Bg,MI)))],$i.prototype,"fills",2),y([Yt(Vit)],$i.prototype,"strokes",2),y([Yt(nu)],$i.prototype,"label",2),y([Yt(nu)],$i.prototype,"link",2),y([Yt(nu)],$i.prototype,"node",2),y([Yt(nu)],$i.prototype,"tooltip",2);var{SeriesNodePickMode:GP,CachedTextMeasurerPool:Wit,TextWrapper:Hit,TextUtils:Uit,createDatumId:ub,angleBetween:pb,normalizeAngle360:Yit,isBetweenAngles:VP,Sector:Kit,evaluateBezier:gb,applyShapeStyle:jP,getShapeStyle:fb,BBox:$it}=T,yb=t=>t.startAngle+pb(t.startAngle,t.endAngle)/2,mb=class extends BP{constructor(t){super({moduleCtx:t,pickModes:[GP.NEAREST_NODE,GP.EXACT_SHAPE_MATCH]}),this.properties=new $i}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Ar}nodeFactory(){return new Kit}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,label:{spacing:a,maxWidth:r,fontSize:l},node:{width:c,spacing:h}}=this.properties,d=e/2,u=i/2;let p=[];const{nodeGraph:g,links:f}=this.getNodeGraph(R=>({...R,centerX:d,centerY:u,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),R=>({...R,centerX:d,centerY:u,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let x=0;g.forEach(({datum:R,linksBefore:G,linksAfter:B},P)=>{const V=G.reduce((W,{link:F})=>W+F.size,0)+B.reduce((W,{link:F})=>W+F.size,0);if(V===0)g.delete(P);else{R.size=V,x+=R.size;const W=this.getLabelText(this.properties.label,{datum:R.datum,value:R.label,fromKey:s,toKey:n,sizeKey:o,size:R.size});R.label=String(W)}});let m=0;if(this.isLabelEnabled()){const R=this.properties.label.getFont();let G=0;g.forEach(({datum:B})=>{const{id:P,label:V}=B;if(V==null)return;const W=Hit.wrapText(V,{maxWidth:r,font:this.properties.label,textWrap:"never"}),{width:F}=Wit.measureText(W,{font:R,textAlign:"left",textBaseline:"middle"});G=Math.max(F,G),p.push({id:P,text:W,centerX:d,centerY:u,angle:NaN,radius:NaN})}),m=G+a}const b=g.size;let S=Math.min(e,i)/2-c-m,M=h/S;if(m!==0&&(b*M>=1.5*Math.PI||S<=0)&&(p=[],S=Math.min(e,i)/2-c,M=h/S),b*M>=2*Math.PI||S<=0){$.warnOnce("There was insufficient space to display the Chord Series.");return}const D=S,C=S+c,k=Math.max((2*Math.PI-b*M)/x,0);let I=0;g.forEach(({datum:R})=>{R.innerRadius=D,R.outerRadius=C,R.startAngle=I,R.endAngle=I+R.size*k,I=R.endAngle+M;const G=(R.innerRadius+R.outerRadius)/2,B=yb(R);R.midPoint={x:R.centerX+G*Math.cos(B),y:R.centerY+G*Math.sin(B)}});const L=[];g.forEach(({datum:R,linksBefore:G,linksAfter:B})=>{const P=yb(R),V=[...G.map(F=>({link:F.link,distance:pb(yb(F.node.datum),P),after:!1})),...B.map(F=>({link:F.link,distance:pb(yb(F.node.datum),P),after:!0}))];let W=R.startAngle;V.toSorted((F,_)=>F.distance-_.distance).forEach(({link:F,after:_})=>{const z=F.size*k;_?(F.startAngle1=W,F.endAngle1=W+z):(F.startAngle2=W,F.endAngle2=W+z),W+=F.size*k}),L.push(R)});const{tension:N}=this.properties.link;f.forEach(R=>{R.radius=S;const G=db({radius:S,startAngle:R.startAngle1,endAngle:R.endAngle2,tension:N}),B=db({radius:S,startAngle:R.startAngle2,endAngle:R.endAngle1,tension:N}),P=gb(...G.x,.5),V=gb(...G.y,.5),W=gb(...B.x,.5),F=gb(...B.y,.5);R.midPoint={x:R.centerX+(P+W)/2,y:R.centerY+(V+F)/2},L.push(R)}),p.forEach(R=>{const G=g.get(R.id)?.datum;G!=null&&(R.radius=C+a,R.angle=Yit(G.startAngle+pb(G.startAngle,G.endAngle)/2))}),p.sort((R,G)=>R.angle-G.angle);let O=1/0,w=-1/0;return p=p.filter(R=>{const G=Uit.getLineHeight(l),B=Math.atan2(G/2,R.radius),P=R.angle-B,V=R.angle+B;return VP(O,P,V)||VP(w,P,V)?!1:(O=Math.min(P,O),w=Math.max(V,w),!0)}),{itemId:t,nodeData:L,labelData:p}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{text:l,centerX:c,centerY:h,radius:d,angle:u})=>{r.visible=!0,r.translationX=c+d*Math.cos(u),r.translationY=h+d*Math.sin(u),r.text=l,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,r.fontFamily=a,r.textBaseline="middle",Math.cos(u)>=0?(r.textAlign="left",r.rotation=u):(r.textAlign="right",r.rotation=u-Math.PI)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>ub([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return fb({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??o,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getNodeStyleOverrides(t,e,i,s,n,o,a){const{id:r,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:d}=l.node,u=o.fill??c[i%c.length],p=o.stroke??h[i%h.length];let g;if(a||(g??(g={}),g.fill=u,g.stroke=p),d!=null){const f=this.cachedDatumCallback(ub(t,"node",a?"highlight":"node"),()=>{const{fillOpacity:x=1,strokeOpacity:m=1,strokeWidth:b=0,lineDash:S=[],lineDashOffset:M=0}=o;return this.callWithContext(d,{seriesId:r,datum:e,highlighted:a,label:n,size:s,fill:u,fillOpacity:x,stroke:p,strokeOpacity:m,strokeWidth:b,lineDash:S,lineDashOffset:M})});g??(g={}),Object.assign(g,f)}return fb(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r,size:l,label:c}=a,h=this.getNodeStyleOverrides(String(r.index),a.datum,r.index,l,c,s,i);jP(o,s,h,n),o.centerX=a.centerX,o.centerY=a.centerY,o.innerRadius=a.innerRadius,o.outerRadius=a.outerRadius,o.startAngle=a.startAngle,o.endAngle=a.endAngle,o.inset=o.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>ub([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,tension:l}=e.link,c=t?e.highlightStyle.item:void 0;return fb({fill:c?.fill??i,fillOpacity:c?.fillOpacity??s,stroke:c?.stroke??n,strokeOpacity:c?.strokeOpacity??o,strokeWidth:c?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:c?.lineDash??a,lineDashOffset:c?.lineDashOffset??r,tension:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getLinkStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{fills:r,strokes:l}=a,{itemStyler:c}=a.link,h=s.fill??r[i%r.length],d=s.stroke??l[i%l.length];let u;if(n||(u??(u={}),u.fill=h,u.stroke=d),c!=null){const p=this.cachedDatumCallback(ub(t,"link",n?"highlight":"node"),()=>{const{fillOpacity:g=1,strokeOpacity:f=1,strokeWidth:x=0,lineDash:m=[],lineDashOffset:b=0,tension:S}=s;return this.callWithContext(c,{seriesId:o,datum:e,highlighted:n,tension:S,fill:h,fillOpacity:g,stroke:d,strokeOpacity:f,strokeWidth:x,lineDash:m,lineDashOffset:b})});u??(u={}),Object.assign(u,p)}return fb(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r}=a,l=a.fromNode.datumIndex,c=this.getLinkStyleOverrides(String(r.index),a.datum,l.index,s,i);o.centerX=a.centerX,o.centerY=a.centerY,o.radius=a.radius,o.startAngle1=a.startAngle1,o.endAngle1=a.endAngle1,o.startAngle2=a.startAngle2,o.endAngle2=a.endAngle2,jP(o,s,c,n),o.tension=c?.tension??s.tension})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(t,e),s=(t-i)/2,n=(e-i)/2,o=new $it(s,n,t,e);return{series:o,axis:o}}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:o,toKey:a,sizeKey:r,sizeName:l,tooltip:c}=n,h=this.contextNodeData?.nodeData.find(x=>x.datumIndex.type===t.type&&x.datumIndex.index===t.index);if(h==null)return;const d=h.type===0?h.fromNode.index:h.index,u=h.type===0?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=t.type===0?i?.dataSources.get(this.id)?.[t.index]:s?.dataSources.get(this.id)?.[t.index],g=h.size;let f;if(h.type===0){const x=h.fromNode.datumIndex,m=this.getBaseLinkStyle(!1);Object.assign(m,this.getLinkStyleOverrides(String(t.index),p,x.index,m,!1)),f=m}else{const x=h.label,m=this.getBaseNodeStyle(!1);Object.assign(m,this.getNodeStyleOverrides(String(t.index),p,t.index,g,x,m,!1)),f=m}return c.formatTooltip(this.properties,{title:u,symbol:this.legendItemSymbol(h.type,d,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:u,fromKey:o,toKey:a,sizeKey:r,sizeName:l,size:g,...f})}computeFocusBounds(t){return t}};mb.className="ChordSeries",mb.type="chord";var{commonSeriesOptionsDefs:Xit,seriesLabelOptionsDefs:Zit,tooltipOptionsDefs:Qit}=T,AI={type:K(Ct("chord")),fromKey:K(E),toKey:K(E),sizeKey:E,sizeName:E,fills:mt($o),strokes:mt(dt),label:{spacing:H,maxWidth:H,...Zit},link:{tension:Tt,itemStyler:bt,...St,...rt,...Ot},node:{width:H,spacing:H,itemStyler:bt,...St,...rt,...Ot},tooltip:Qit,...Xit};AI.fillGradientDefaults=yf,AI.fillPatternDefaults=mf;var qit={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:t=>new mb(t),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},Jit={type:"series",name:"chord",chartType:"flow-proportion",enterprise:!0,options:AI,create:t=>new mb(t)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:ou,CARTESIAN_POSITION:au},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:tst}}=T,WP={$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},[{type:ou.NUMBER,position:au.LEFT},{type:ou.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"before"]},au.TOP,au.BOTTOM]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}}],[{type:ou.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"after"]},au.RIGHT,au.LEFT]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}},{type:ou.NUMBER,position:au.BOTTOM}]]},est={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,fills:[{$palette:"fill"}],strokes:[{$palette:"stroke"}],fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:tst,xOffset:3,yOffset:3,blur:5}},axes:{[ou.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[ou.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:xb,BBox:ist,Path:sst,ScenePathChangeDetection:Rl}=T,HP=1e-6;function UP([t,e],[i,s]){return Math.abs(t-i)<=HP&&Math.abs(e-s)<=HP}var Ta=class extends sst{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:t,y0:e,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this;return{x:(t+i+n+a)/4,y:(e+s+o+r)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c}=this;return Math.min(xb(t,e,i,s,n,o,1/0),xb(t,e,n,o,a,r,1/0),xb(t,e,a,r,l,c,1/0),xb(t,e,l,c,i,s,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this,l=Math.min(t,i,n,a),c=Math.max(t,i,n,a)-l,h=Math.min(e,s,o,r),d=Math.max(e,s,o,r)-h;return new ist(l,h,c,d)}updatePath(){const{path:t,x0:e,y0:i,x1:s,y1:n,x2:o,y2:a,x3:r,y3:l}=this,c=[[e,i],[s,n],[o,a],[r,l]];t.clear();let h,d;c.forEach(u=>{if(h!=null&&UP(h,u)||d!=null&&UP(d,u))return;const[p,g]=u;h==null?t.moveTo(p,g):t.lineTo(p,g),h??(h=u),d=u}),t.closePath()}};y([Rl()],Ta.prototype,"x0",2),y([Rl()],Ta.prototype,"y0",2),y([Rl()],Ta.prototype,"x1",2),y([Rl()],Ta.prototype,"y1",2),y([Rl()],Ta.prototype,"x2",2),y([Rl()],Ta.prototype,"y2",2),y([Rl()],Ta.prototype,"x3",2),y([Rl()],Ta.prototype,"y3",2);var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:nst}=T;function YP(t,e,i,s){const{x0:n,y0:o,x1:a,y1:r,x2:l,y2:c,x3:h,y3:d,opacity:u}=t;return i?{x0:(n+h)/2,y0:(o+d)/2,x1:(a+l)/2,y1:(r+c)/2,x2:(a+l)/2,y2:(r+c)/2,x3:(n+h)/2,y3:(o+d)/2,opacity:u}:{x0:(n+a)/2,y0:(o+r)/2,x1:(n+a)/2,y1:(o+r)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function ost(t,e){const i=o=>o==null;return{fromFn:(o,a,r)=>{r==="updated"&&i(a)?r="removed":r==="updated"&&i(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&e==="fade"?l={...Fg(o,a),opacity:0}:r==="unknown"||r==="added"?l=YP(a,o.previousDatum,t,e):l={x0:o.x0,y0:o.y0,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,x3:o.x3,y3:o.y3,opacity:o.opacity};const c=nst[r];return{...l,phase:c}},toFn:(o,a,r)=>{let l;return r==="removed"&&o.datum==null&&e==="fade"?l={...Fg(o,a),opacity:0}:r==="removed"||i(a)?l=YP(a,o.previousDatum,t,e):l=Fg(o,a),l}}}function Fg(t,e){const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}=e;return{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:KP,SeriesZIndexMap:$P,valueProperty:ast,keyProperty:rst,ChartAxisDirection:XP,updateLabelNode:lst,SMALLEST_KEY_INTERVAL:cst,LARGEST_KEY_INTERVAL:hst,diff:dst,fixNumericExtent:ust,seriesLabelFadeInAnimation:ZP,resetMotion:pst,resetLabelFn:gst,animationValidation:fst,computeBarFocusBounds:yst,ContinuousScale:mst,Group:xst,Selection:bst,PointerEvents:QP,motion:Sst,checkCrisp:vst,createDatumId:Mst,applyShapeFillBBox:Dst,getShapeStyle:Ast,getShapeFill:Ist}=T,Tst=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},qP=class extends T.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[KP.AXIS_ALIGNED,KP.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:gst}}),this.NodeEvent=Tst,this.connectorNodeGroup=this.contentGroup.appendChild(new xst({name:`${this.id}-series-connectorNodes`,zIndex:$P.BACKGROUND})),this.connectorSelection=bst.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=QP.None}get pickModeAxis(){return"main-category"}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.connectorNodeGroup.zIndex=[$P.BACKGROUND,t],!0):!1}isVertical(){return!super.isVertical()}connectionFactory(){return new Ta}async processData(t){if(!this.properties.isValid())return;const{stageKey:e,valueKey:i}=this.properties,{visible:s,id:n}=this,o=(g,f,x)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:x}),a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(dst(this.id,this.processedData)),d.push(fst()));const u=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(t,this.data,{props:[rst(e,c,{id:"xValue"}),ast(i,h,{id:"yValue",...u,validation:o,invalidValue:0}),...l?[cst,hst]:[],...d],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!e||!i)return[];const{keys:[o]}=e.domain;if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");return a?.def.type==="key"&&a?.def.valueType==="category"?this.hasData?o.filter((r,l)=>n.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(o)}else{const a=this.domainForClippedRange(XP.Y,["yValue"],"xValue",!0),r=Math.max(...a),l=[-r,r];return ust(l)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,groupScale:s,processedData:n,id:o,ctx:{legendManager:a}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(t&&e&&r&&l&&i&&n?.type==="ungrouped"))return;const c=r.scale,h=l.scale,d=this.getBarDirection()===XP.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,x={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),visible:this.visible},m=this.visible;if(!m)return x;const b=i.resolveKeysById(this,"xValue",n),S=i.resolveColumnById(this,"yValue",n),{barWidth:M,groupIndex:D}=this.updateGroupScale(r),C=mst.is(c)?M*-.5:0,k=vst(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let I;return(n.dataSources.get(this.id)??[]).forEach((N,O)=>{const w=m&&a.getItemEnabled({seriesId:o,itemId:O}),R=b[O];if(R==null)return;const G=Math.round(c.convert(R))+s.convert(String(D))+C,B=S[O],P=Math.round(h.convert(-B)),V=Math.round(h.convert(B)),W=Math.max(g,Math.abs(V-P)),F={x:d?Math.min(V,P):G,y:d?G:Math.min(V,P),width:d?W:M,height:d?M:W},_={x:F.x+F.width/2,y:F.y+F.height/2},z=this.createLabelData({datumIndex:O,rect:F,barAlongX:d,yDatum:B,datum:N,visible:w}),U={index:O,series:this,itemId:f,datum:N,datumIndex:O,xValue:R,yValue:B,xKey:u,yKey:p,x:F.x,y:F.y,width:F.width,height:F.height,midPoint:_,strokeWidth:g,crisp:k,label:z,visible:w};if(x.nodeData.push(U),z!=null&&x.labelData.push(z),I!=null){const Y=I.rect,Z=I.nodeDatum,q=I.datumIndex;d?x.connectorData.push({datum:Z,datumIndex:q,x0:Y.x,y0:Y.y+Y.height,x1:Y.x+Y.width,y1:Y.y+Y.height,x2:F.x+F.width,y2:F.y,x3:F.x,y3:F.y,opacity:1}):x.connectorData.push({datum:Z,datumIndex:q,x0:Y.x+Y.width,y0:Y.y,x1:F.x,y1:F.y,x2:F.x,y2:F.y+F.height,x3:Y.x+Y.width,y3:Y.y+Y.height,opacity:1})}w&&(I={itemId:f,rect:F,nodeDatum:U,datumIndex:O})}),x}updateNodes(t,e,i){super.updateNodes(t,e,i);const{connectorSelection:s}=this,n=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:n}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,n=>this.getDatumId(n))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(t){const{fills:e,strokes:i,fillGradientDefaults:s,fillPatternDefaults:n}=this.properties,{fill:o,fillOpacity:a,stroke:r,strokeOpacity:l,strokeWidth:c,lineDash:h,lineDashOffset:d}=this.connectorStyle(),u=this.getShapeFillBBox();t.connectorSelection.each((p,g)=>{const{datumIndex:f}=g;p.setProperties(Fg(p,g));const x=Ist(o??e[f%e.length],s,n);p.fill=x,Dst(p,x,u),p.fillOpacity=a,p.stroke=r??i[f%i.length],p.strokeOpacity=l,p.strokeWidth=c,p.lineDash=h,p.lineDashOffset=d})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=QP.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{lst(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r}=n,l=this.getCategoryAxis(),c=this.getValueAxis();if(!i||!s||!l||!c)return;const h=s.dataSources.get(this.id)?.[t],d=i.resolveKeysById(this,"xValue",s)[t],u=i.resolveColumnById(this,"yValue",s)[t];if(d!=null)return r.formatTooltip(this.properties,{symbol:this.legendItemSymbol(t),data:[{label:l.formatDatum(d),value:c.formatDatum(u)}]},{seriesId:e,datum:h,title:o,stageKey:o,valueKey:a,...this.tooltipStyle(h,t)})}resetAllAnimation(t){super.resetAllAnimation(t),pst([this.connectorSelection],Fg)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=this.isVertical(),n=ost(i,"normal");Sst.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],n),ZP(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),ZP(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return Mst(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return yst(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:r}=this.barStyle(),{fills:l,strokes:c}=this.properties,h=l[t%l.length]??"black",d=c[t%c.length]??"black";return{marker:Ast({fill:h,fillOpacity:i,stroke:d,strokeWidth:e,strokeOpacity:s,lineDash:n,lineDashOffset:o},a,r)}}getLegendData(t){const{id:e,processedData:i,dataModel:s,ctx:{legendManager:n},visible:o}=this;if(!s||!i||t!=="category"||!this.properties.isValid())return[];const{showInLegend:a}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((l,c)=>{const h=r[c];if(h!=null)return{legendType:"category",id:e,datum:l,itemId:c,seriesId:e,enabled:o&&n.getItemEnabled({seriesId:e,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!a}}).filter(l=>l!=null)}},{FillGradientDefaults:kst,FillPatternDefaults:Cst,Label:Lst,AbstractBarSeriesProperties:Nst,SeriesTooltip:wst,AxisLabel:Ost,TempValidate:cs,UNION:JP,OR:Est,ARRAY_OF:Rst,COLOR_GRADIENT:Pst,COLOR_STRING:Bst,COLOR_STRING_ARRAY:zst,COLOR_PATTERN:Fst,LINE_DASH:_st,OBJECT:_g,POSITIVE_NUMBER:II,RATIO:tB,STRING:eB}=T,TI=class extends Lst{constructor(){super(...arguments),this.spacing=0}};y([cs(JP(["before","middle","after"],"a placement"))],TI.prototype,"placement",2),y([cs(II)],TI.prototype,"spacing",2);var iB=class extends Ost{};y([cs(JP(["before","after"],"a placement"))],iB.prototype,"placement",2);var Vs=class extends Nst{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new kst,this.fillPatternDefaults=new Cst,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new TI,this.stageLabel=new iB,this.tooltip=new wst}};y([cs(eB)],Vs.prototype,"stageKey",2),y([cs(eB)],Vs.prototype,"valueKey",2),y([cs(Rst(Est(Pst,Fst,Bst)))],Vs.prototype,"fills",2),y([cs(_g)],Vs.prototype,"fillGradientDefaults",2),y([cs(_g)],Vs.prototype,"fillPatternDefaults",2),y([cs(tB)],Vs.prototype,"fillOpacity",2),y([cs(zst)],Vs.prototype,"strokes",2),y([cs(II)],Vs.prototype,"strokeWidth",2),y([cs(tB)],Vs.prototype,"strokeOpacity",2),y([cs(_st)],Vs.prototype,"lineDash",2),y([cs(II)],Vs.prototype,"lineDashOffset",2),y([cs(_g)],Vs.prototype,"label",2),y([cs(_g)],Vs.prototype,"stageLabel",2),y([cs(_g)],Vs.prototype,"tooltip",2);function sB(t,{x:e,y:i,width:s,height:n,opacity:o}){return{x1:e,y1:i,x2:e+s,y2:i+n,opacity:o}}var{formatValue:Gst,Line:Vst}=T,bb=class extends qP{constructor(t){super({moduleCtx:t,animationResetFns:{datum:sB}}),this.properties=new Vs}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.reduce((s,n,o)=>s+(e.getItemEnabled({seriesId:t,itemId:o})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults}}connectorStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}}nodeFactory(){return new Vst}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:s,datum:n,visible:o}){const{stageKey:a,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;let d,u,p,g;if(i)switch(d=e.x+e.width/2,p="center",h){case"before":u=e.y-c,g="bottom";break;case"after":u=e.y+e.height+c,g="top";break;default:u=e.y+e.height/2,g="middle"}else switch(u=e.y+e.height/2,g="middle",h){case"before":d=e.x-c,p="right";break;case"after":d=e.x+e.width+c,p="left";break;default:d=e.x+e.width/2,p="center"}return{x:d,y:u,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:r,value:s,datum:n,stageKey:a,valueKey:r},f=>Gst(f,0)),itemId:r,datum:n,datumIndex:t,series:this,visible:o}}updateDatumNodes(t){const e=t.isHighlight?this.properties.highlightStyle.item:void 0;t.datumSelection.each((i,s)=>{i.setProperties(sB(i,s)),i.stroke=e?.stroke,i.strokeWidth=e?.strokeWidth??0,i.strokeOpacity=e?.strokeOpacity??1,i.lineDash=e?.lineDash,i.lineDashOffset=e?.lineDashOffset??0})}tooltipStyle(t,e){const{fills:i,strokes:s}=this.properties,n=i[e%i.length]??"black",o=s[e%s.length]??"black",{fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:n,fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}}};bb.className="ConeFunnelSeries",bb.type="cone-funnel";var{commonSeriesOptionsDefs:jst,seriesLabelOptionsDefs:nB,tooltipOptionsDefs:Wst,without:oB}=T,Hst={type:K(Ct("cone-funnel")),stageKey:K(E),valueKey:K(E),direction:st("horizontal","vertical"),fills:mt($o),strokes:mt(dt),showInMiniChart:j,label:{spacing:H,placement:st("before","middle","after"),...nB},stageLabel:{rotation:J,spacing:H,minSpacing:H,placement:st("before","after"),avoidCollisions:j,itemStyler:bt,format:E,...nB},tooltip:Wst,...jst,...oB(St,["fill"]),...oB(rt,["stroke"]),...Ot},{ThemeConstants:{CARTESIAN_AXIS_TYPE:aB}}=T,Ust={series:{direction:"vertical",fills:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},T.SAFE_RANGE2_OPERATION]},strokes:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},T.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[aB.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[aB.CATEGORY]:{line:{enabled:!1}}}},Yst={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:t=>new bb(t),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:WP,themeTemplate:Ust},Kst={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:Hst,create:t=>new bb(t)},{FillGradientDefaults:$st,FillPatternDefaults:Xst,Label:Zst,DropShadow:Qst,AbstractBarSeriesProperties:qst,BaseProperties:Jst,SeriesTooltip:tnt,AxisLabel:ent,TempValidate:be,UNION:int,BOOLEAN:snt,ARRAY_OF:nnt,OR:rB,COLOR_GRADIENT:lB,COLOR_STRING_ARRAY:ont,COLOR_PATTERN:cB,COLOR_STRING:kI,FUNCTION:ant,LINE_DASH:hB,OBJECT:gh,POSITIVE_NUMBER:Sb,RATIO:Gg,STRING:dB}=T,rnt=class extends Zst{},uB=class extends ent{};y([be(int(["before","after"],"a placement"))],uB.prototype,"placement",2);var Ir=class extends Jst{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([be(snt)],Ir.prototype,"enabled",2),y([be(rB(lB,kI,cB),{optional:!0})],Ir.prototype,"fill",2),y([be(Gg)],Ir.prototype,"fillOpacity",2),y([be(kI,{optional:!0})],Ir.prototype,"stroke",2),y([be(Sb)],Ir.prototype,"strokeWidth",2),y([be(Gg)],Ir.prototype,"strokeOpacity",2),y([be(hB)],Ir.prototype,"lineDash",2),y([be(Sb)],Ir.prototype,"lineDashOffset",2);var Pi=class extends qst{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new $st,this.fillPatternDefaults=new Xst,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Ir,this.shadow=new Qst().set({enabled:!1}),this.label=new rnt,this.stageLabel=new uB,this.tooltip=new tnt}};y([be(dB)],Pi.prototype,"stageKey",2),y([be(dB)],Pi.prototype,"valueKey",2),y([be(nnt(rB(lB,cB,kI)))],Pi.prototype,"fills",2),y([be(gh)],Pi.prototype,"fillGradientDefaults",2),y([be(gh)],Pi.prototype,"fillPatternDefaults",2),y([be(Gg)],Pi.prototype,"fillOpacity",2),y([be(ont)],Pi.prototype,"strokes",2),y([be(Sb)],Pi.prototype,"strokeWidth",2),y([be(Gg)],Pi.prototype,"strokeOpacity",2),y([be(hB)],Pi.prototype,"lineDash",2),y([be(Sb)],Pi.prototype,"lineDashOffset",2),y([be(Gg)],Pi.prototype,"spacingRatio",2),y([be(ant,{optional:!0})],Pi.prototype,"itemStyler",2),y([be(gh)],Pi.prototype,"dropOff",2),y([be(gh)],Pi.prototype,"shadow",2),y([be(gh)],Pi.prototype,"label",2),y([be(gh)],Pi.prototype,"stageLabel",2),y([be(gh)],Pi.prototype,"tooltip",2);var{ChartAxisDirection:lnt,resetBarSelectionsFn:cnt,prepareBarAnimationFunctions:pB,midpointStartingBarPosition:gB,createDatumId:hnt,formatValue:dnt,Rect:unt,motion:fB,applyShapeStyle:pnt,getShapeStyle:yB}=T,vb=class extends qP{constructor(t){super({moduleCtx:t,animationResetFns:{datum:cnt}}),this.properties=new Pi}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}}connectorStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=this.properties.dropOff;return{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults}}nodeFactory(){return new unt}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:s,visible:n}){const{valueKey:o,stageKey:a,label:r}=this.properties;return{x:e.x+e.width/2,y:e.y+e.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(r,{itemId:a,value:i,datum:s,valueKey:o,stageKey:a},l=>dnt(l,0)),itemId:a,datum:s,datumIndex:t,series:this,visible:n}}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return yB({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset},e.fillGradientDefaults,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{stageKey:r,valueKey:l,fills:c,strokes:h,itemStyler:d}=a,u=s.fill??c[i%c.length]??"black",p=s.stroke??h[i%h.length]??"black",g={};if(n||(g.fill=u,g.stroke=p),d!=null){const f=this.cachedDatumCallback(hnt(t,n?"highlight":"node"),()=>{const{fillOpacity:x,strokeOpacity:m,strokeWidth:b,lineDash:S,lineDashOffset:M}=s;return this.callWithContext(d,{seriesId:o,datum:e,highlighted:n,stageKey:r,valueKey:l,fill:u,fillOpacity:x,stroke:p,strokeOpacity:m,strokeWidth:b,lineDash:S,lineDashOffset:M})});Object.assign(g,f)}return yB(g,a.fillGradientDefaults,a.fillPatternDefaults)}updateDatumNodes(t){const{shadow:e}=this.properties,{datumSelection:i,isHighlight:s}=t,n=this.getCategoryDirection()===lnt.X,o=this.getItemBaseStyle(s),a=this.getShapeFillBBox();i.each((r,l)=>{const{datumIndex:c}=l,h=this.getItemStyleOverrides(String(l.datumIndex),l.datum,c,o,s);pnt(r,o,h,a),r.visible=n?l.width>0:l.height>0,r.crisp=l.crisp,r.fillShadow=e})}tooltipStyle(t,e){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(e),t,e,i,!1)),i}animateEmptyUpdateReady(t){super.animateEmptyUpdateReady(t);const{datumSelection:e}=t,i=this.isVertical(),n=pB(gB(i,"normal"));fB.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=pB(gB(this.isVertical(),"fade"));fB.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n,(o,a)=>a.xValue,s)}};vb.className="FunnelSeries",vb.type="funnel";var{commonSeriesOptionsDefs:gnt,seriesLabelOptionsDefs:mB,shadowOptionsDefs:fnt,tooltipOptionsDefs:ynt,without:xB}=T,mnt={type:K(Ct("funnel")),stageKey:K(E),valueKey:K(E),direction:st("horizontal","vertical"),fills:mt($o),strokes:mt(dt),showInMiniChart:j,itemStyler:bt,spacingRatio:Tt,crisp:j,dropOff:{enabled:j,...St,...rt,...Ot},stageLabel:{rotation:J,spacing:H,minSpacing:H,placement:st("before","after"),avoidCollisions:j,itemStyler:bt,format:E,...mB},label:mB,tooltip:ynt,shadow:fnt,...gnt,...xB(St,["fill"]),...xB(rt,["stroke"]),...Ot},xnt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:t=>new vb(t),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:WP,themeTemplate:est},bnt={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:mnt,create:t=>new vb(t)},bB=class{*[Symbol.iterator](){const{node:t,datum:e}=this;t&&e&&(yield{node:t,datum:e})}nodes(){return this.node?[this.node]:[]}update(t,e,i,s){const n=t.nodes();if(n.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,e.appendChild(this.node));const o=n[0],a=n.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??n[n.length-1];this.node.datum=this.datum=o.datum,s(this.node,o,a)}}},SB={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function vB(t,e){if(t==null)return"";const{min:i,max:s}=e,n=i!==0?Math.ceil(Math.log10(Math.abs(i))):0,o=s!==0?Math.ceil(Math.log10(Math.abs(s))):0,a=Math.max(2-Math.max(n,o),0);return t.toFixed(a)}function Vg(t,e,i){if(e.text!=null)return e.text;const s=i??e.value,n=e?.formatter?.({seriesId:t.id,datum:void 0,value:s});if(n!=null)return String(n)}function MB({path:t,x:e,y:i,size:s}){t.moveTo(e,i-s/2),t.lineTo(e,i+s/2)}function DB(t,e){const i=Pr(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function AB(t,e){const i=[{data:t.contextNodeData?.nodeData,selection:t.datumUnion},{data:t.contextNodeData?.targetData,selection:t.targetSelection}].filter(l=>l.data&&l.data.length>0),s=ft(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:n,selection:o}=i[s];if(n==null||n.length===0)return;const a=ft(0,e.datumIndex,n.length-1),r=n[a];for(const l of o)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:a,otherIndex:s}}var{MARKER_SHAPE:Snt,UNION:CI,OR:vnt}=T,Mb=CI(["continuous","discrete"],"a fill mode"),IB=vnt(Snt,CI(["line"],"a marker shape")),TB=CI(["container","item"],"a corner mode"),{BaseProperties:kB,TempValidate:ru,OBJECT:Mnt,BOOLEAN:Dnt,NUMBER:LI,NUMBER_ARRAY:Ant}=T,Db=class extends kB{getSegments(t,e){const{values:i,step:s,count:n}=this,o=Math.min(...t.domain),a=Math.max(...t.domain);let r;if(i!=null){const l=i.filter(c=>c>o&&c<a).sort((c,h)=>c-h);r=[o,...l,a]}else if(s!=null){const l=[];for(let c=o;c<a;c+=s)l.push(c);l.push(a),r=l}else if(n!=null){const l=n+1;r=Array.from({length:l+1},(c,h)=>h/l*(a-o)+o)}else{const l=t.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.filter(c=>c>o&&c<a);r=l!=null?[o,...l,a]:void 0}return r!=null&&r.length>e&&($.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[o,a]),r}};y([ru(Ant,{optional:!0})],Db.prototype,"values",2),y([ru(LI,{optional:!0})],Db.prototype,"step",2),y([ru(LI,{optional:!0})],Db.prototype,"count",2);var jg=class extends kB{constructor(){super(...arguments),this.enabled=!1,this.interval=new Db,this.spacing=0}};y([ru(Dnt)],jg.prototype,"enabled",2),y([ru(Mnt)],jg.prototype,"interval",2),y([ru(LI)],jg.prototype,"spacing",2);var{BaseProperties:Ab,SeriesTooltip:Int,SeriesProperties:Tnt,PropertiesArray:NI,TempValidate:yt,BOOLEAN:CB,COLOR_STRING:fh,COLOR_STRING_ARRAY:knt,FUNCTION:Cnt,LINE_DASH:wI,NUMBER:Bo,OBJECT_ARRAY:OI,OBJECT:ka,POSITIVE_NUMBER:Ca,RATIO:yh,STRING:LB,NUMBER_ARRAY:Lnt,UNION:Ib,AND:NB,LESS_THAN:Nnt,GREATER_THAN:wnt,Label:Ont,AxisLabel:Ent}=T,Rnt=Ib(["before","after","middle"],"a placement"),Pnt=Ib(["inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end"],"an placement"),Bnt=Ib(["horizontal","vertical"],"an orientation"),znt=Ib(["before","after"],"a placement"),wB=class extends Ont{};y([yt(Bo,{optional:!0})],wB.prototype,"spacing",2);var hs=class extends Ab{constructor(){super(...arguments),this.value=0,this.label=new wB}};y([yt(LB,{optional:!0})],hs.prototype,"text",2),y([yt(Bo)],hs.prototype,"value",2),y([yt(IB,{optional:!0})],hs.prototype,"shape",2),y([yt(Rnt,{optional:!0})],hs.prototype,"placement",2),y([yt(Bo,{optional:!0})],hs.prototype,"spacing",2),y([yt(Ca,{optional:!0})],hs.prototype,"size",2),y([yt(Bo,{optional:!0})],hs.prototype,"rotation",2),y([yt(fh,{optional:!0})],hs.prototype,"fill",2),y([yt(yh,{optional:!0})],hs.prototype,"fillOpacity",2),y([yt(fh,{optional:!0})],hs.prototype,"stroke",2),y([yt(Ca,{optional:!0})],hs.prototype,"strokeWidth",2),y([yt(yh,{optional:!0})],hs.prototype,"strokeOpacity",2),y([yt(wI,{optional:!0})],hs.prototype,"lineDash",2),y([yt(Ca,{optional:!0})],hs.prototype,"lineDashOffset",2),y([yt(ka)],hs.prototype,"label",2);var Cn=class extends Ab{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new NI(T.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([yt(CB)],Cn.prototype,"enabled",2),y([yt(Ca,{optional:!0})],Cn.prototype,"thickness",2),y([yt(yh)],Cn.prototype,"thicknessRatio",2),y([yt(OI)],Cn.prototype,"fills",2),y([yt(Mb)],Cn.prototype,"fillMode",2),y([yt(fh,{optional:!0})],Cn.prototype,"fill",2),y([yt(yh)],Cn.prototype,"fillOpacity",2),y([yt(fh)],Cn.prototype,"stroke",2),y([yt(Ca)],Cn.prototype,"strokeWidth",2),y([yt(yh)],Cn.prototype,"strokeOpacity",2),y([yt(wI)],Cn.prototype,"lineDash",2),y([yt(Ca)],Cn.prototype,"lineDashOffset",2);var Wg=class extends Ab{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};y([yt(Lnt,{optional:!0})],Wg.prototype,"values",2),y([yt(Bo,{optional:!0})],Wg.prototype,"step",2),y([yt(Bo)],Wg.prototype,"minSpacing",2),y([yt(Bo)],Wg.prototype,"maxSpacing",2);var OB=class extends Ent{constructor(){super(...arguments),this.placement=void 0}};y([yt(znt,{optional:!0})],OB.prototype,"placement",2);var Ts=class extends Ab{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new NI(T.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new Wg,this.label=new OB}};y([yt(NB(Bo,Nnt("max")))],Ts.prototype,"min",2),y([yt(NB(Bo,wnt("min")))],Ts.prototype,"max",2),y([yt(OI)],Ts.prototype,"fills",2),y([yt(Mb)],Ts.prototype,"fillMode",2),y([yt(fh,{optional:!0})],Ts.prototype,"fill",2),y([yt(yh)],Ts.prototype,"fillOpacity",2),y([yt(fh)],Ts.prototype,"stroke",2),y([yt(Ca)],Ts.prototype,"strokeWidth",2),y([yt(yh)],Ts.prototype,"strokeOpacity",2),y([yt(wI)],Ts.prototype,"lineDash",2),y([yt(Ca)],Ts.prototype,"lineDashOffset",2),y([yt(fh)],Ts.prototype,"defaultFill",2),y([yt(ka)],Ts.prototype,"interval",2),y([yt(ka)],Ts.prototype,"label",2);var Tb=class extends Aa{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};y([yt(LB,{optional:!0})],Tb.prototype,"text",2),y([yt(Pnt)],Tb.prototype,"placement",2),y([yt(CB)],Tb.prototype,"avoidCollisions",2);var ds=class extends Tnt{constructor(){super(...arguments),this.value=0,this.segmentation=new jg,this.defaultColorRange=[],this.targets=new NI(hs),this.defaultTarget=new hs,this.defaultScale=new Ts,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Ts,this.bar=new Cn,this.label=new Tb,this.tooltip=new Int}};y([yt(Bo)],ds.prototype,"value",2),y([yt(ka)],ds.prototype,"segmentation",2),y([yt(knt)],ds.prototype,"defaultColorRange",2),y([yt(OI)],ds.prototype,"targets",2),y([yt(ka)],ds.prototype,"defaultTarget",2),y([yt(ka)],ds.prototype,"defaultScale",2),y([yt(Bnt)],ds.prototype,"direction",2),y([yt(Ca)],ds.prototype,"thickness",2),y([yt(Ca)],ds.prototype,"cornerRadius",2),y([yt(TB)],ds.prototype,"cornerMode",2),y([yt(Bo)],ds.prototype,"margin",2),y([yt(ka)],ds.prototype,"scale",2),y([yt(ka)],ds.prototype,"bar",2),y([yt(Cnt,{optional:!0})],ds.prototype,"itemStyler",2),y([yt(ka)],ds.prototype,"label",2),y([yt(ka)],ds.prototype,"tooltip",2);var{CachedTextMeasurerPool:Fnt,BBox:_nt}=T;function EI(t){const{x0:e,y0:i,x1:s,y1:n,horizontalInset:o,verticalInset:a}=t,r=Math.min(e,s)+o,l=Math.min(i,n)+a,c=Math.max(Math.abs(s-e)-2*o,0),h=Math.max(Math.abs(n-i)-2*a,0);return{x:r,y:l,width:c,height:h}}function Gnt(t,e){if(e==null)return!0;const i=EI(t),s=1e-6,n=i.x+s,o=i.y+s,a=i.x+i.width-s,r=i.y+i.height-s,l=e.x,c=e.x+e.width,h=e.y,d=e.y+e.height;return Math.max(n,l)<=Math.min(a,c)&&Math.max(o,h)<=Math.min(r,d)}function RI(t){const{clipX0:e,clipX1:i,clipY0:s,clipY1:n}=t;return e!=null&&i!=null||s!=null&&n!=null}function Vnt(t){if(!RI(t))return;const{x0:e,y0:i,x1:s,y1:n}=t,{x:o,y:a,width:r,height:l}=EI(t);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=t;(c==null||h==null)&&(c=e,h=s),(d==null||u==null)&&(d=i,u=n);const p=Math.min(c,h),g=Math.min(d,u),f=Math.abs(h-c),x=Math.abs(u-d);return c=Math.max(o,p),d=Math.max(a,g),h=Math.min(o+r,p+f),u=Math.min(a+l,g+x),new _nt(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}function EB(t,e){const i=t?"initial":"update";return{node:{fromFn(n,o){const a=n.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=a??o;const{horizontalInset:f,verticalInset:x}=o,m=a!=null&&RI(a),b=RI(o);return m&&b||(!m&&b?({x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=o,t&&(e?p=o.clipX0:g=o.clipY0)):m&&!b?({x0:r,y0:l,x1:c,y1:h}=o,d=void 0,u=void 0,p=void 0,g=void 0):t&&(e?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g,horizontalInset:f,verticalInset:x,phase:i}},toFn(n,o){const{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}=o;return{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}},applyFn(n,o){n.setProperties(kb(n,o))}}}}function kb(t,e){const{x:i,y:s,width:n,height:o}=EI(e),a=Vnt(e),r=Gnt(e,a);return{x:i,y:s,width:n,height:o,clipBBox:a,visible:r}}var jnt={Before:"right",Center:"center",After:"left"},Wnt={Before:"top",Center:"middle",After:"bottom"},Hnt={Before:-1,Center:-.5,After:0},Unt={Before:0,Center:-.5,After:-1};function Ynt(t,e,i,s,n){const{seriesRect:o,gaugeRect:a,barRect:r}=s,{padding:l,horizontal:c}=i;e.each((h,d)=>{const u=Vg(t,d,n?.label);let p,g;d.placement==="outside-start"?c?(p=a.x,g=o.height):(p=o.width,g=o.height-(a.y+a.height)):d.placement==="outside-end"?c?(p=o.width-(a.x+a.width),g=o.height):(p=o.width,g=a.y):d.avoidCollisions&&(p=a.width,g=a.height);let f;if(u==null)return;if(p!=null&&g!=null)f=Ng(u,d,{padding:l},()=>({width:p,height:g,meta:null}))?.[0];else{const G={fontSize:d.fontSize,fontStyle:d.fontStyle,fontWeight:d.fontWeight,fontFamily:d.fontFamily,lineHeight:d.lineHeight},{width:B,height:P}=Fnt.measureText(u,{font:G});f={text:u,fontSize:d.fontSize,lineHeight:qd(d,d.fontSize),width:B,height:P}}if(f==null){h.visible=!1;return}const x=c?a.x:a.y+a.height,m=c?a.x+a.width:a.y,b=c?r.x:r.y+r.height,S=c?r.x+r.width:r.y,M=d.spacing*(c?1:-1);let D,C,k,I;switch(d.placement){case"outside-start":D=-1/0,C=1/0,k=x-M,I="Before";break;case"outside-end":D=-1/0,C=1/0,k=m+M,I="After";break;case"inside-start":D=x,C=S,k=x+M,I="After";break;case"inside-end":D=S,C=m,k=m-M,I="Before";break;case"inside-center":D=x,C=m,k=(x+m)/2,I="Center";break;case"bar-inside":D=b,C=S,k=(b+S)/2,I="Center";break;case"bar-inside-end":D=b,C=S,k=S-M,I="Before";break;case"bar-outside-end":D=S,C=m,k=S+M,I="After";break;case"bar-end":D=-1/0,C=1/0,k=S,I="Center";break}const L=c?k:a.x+a.width/2,N=c?a.y+a.height/2:k;let O,w;c?(O=L+Hnt[I]*f.width,w=O+f.width):(O=N+Unt[I]*f.height,w=O+f.height);const R=Math.min(O,w)>=Math.min(D,C)&&Math.max(O,w)<=Math.max(D,C);if(d.avoidCollisions&&!R){h.visible=!1;return}h.visible=!0,h.text=f.text,h.fontSize=f.fontSize,h.lineHeight=f.lineHeight,h.textAlign=c?jnt[I]:"center",h.textBaseline=c?"middle":Wnt[I],h.x=L,h.y=N})}var{fromToMotion:PI,resetMotion:Knt,SeriesNodePickMode:RB,StateMachine:$nt,createDatumId:PB,CachedTextMeasurerPool:Xnt,toRadians:BB,BBox:Pl,Group:mh,PointerEvents:zB,Selection:xh,Rect:Znt,Text:FB,TransformableText:Qnt,Marker:qnt,LinearScale:Jnt,AxisTickGenerator:tot,NiceMode:eot,easing:iot,getColorStops:sot,findRangeExtent:not}=T,oot={before:180,middle:0,after:0},aot={before:90,middle:0,after:-90},rot=class{constructor(t){this.gauge=t}get defaultTickMinSpacing(){return 0}get range(){return this.gauge.range}get reverse(){return!1}get scale(){return this.gauge.scale}get label(){return this.gauge.properties.scale.label}get interval(){return this.gauge.properties.scale.interval}formatTick(t,e,i,s,n){const{label:o}=this;return o.formatter?.({value:t,index:e,domain:i,boundSeries:void 0})??(o.format!=null?n?.(t):void 0)??this.gauge.formatLabel(t)}inRange(){return!0}},Cb=class extends T.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[RB.EXACT_SHAPE_MATCH,RB.NEAREST_NODE]}),this.properties=new ds,this.seriesRect=Pl.NaN,this.gaugeRect=Pl.NaN,this.scale=new Jnt,this.axis=new rot(this),this.tickGenerator=new tot(this.axis),this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new mh({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new mh({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new mh({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new mh({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new mh({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new mh({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new mh({name:"tickGroup"})),this.scaleSelection=xh.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=xh.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=xh.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=xh.select(this.itemTargetLabelGroup,FB),this.labelSelection=xh.select(this.itemLabelGroup,FB),this.highlightTargetSelection=xh.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=xh.select(this.tickGroup,Qnt),this.datumUnion=new bB,this.animationState=new $nt("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=zB.None,this.tickGroup.pointerEvents=zB.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const t=new Znt;return t.crisp=!0,t}markerFactory(){return new qnt}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return vB(t,this.properties.scale)}createLinearGradient(t,e,i){const{properties:s,horizontal:n}=this,{defaultColorRange:o}=s;return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:sot(e,o,t.domain,i),rotation:n?90:0}}getShapeFillBBox(){const{properties:t,originX:e,originY:i,horizontal:s,scale:n}=this,{thickness:o}=t,a=not(n.range);return new Pl(e,i,s?a:o,s?o:a)}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:s=e.text,value:n=e.value??0,shape:o=e.shape??"triangle",rotation:a=e.rotation??0,strokeWidth:r=e.strokeWidth??0,placement:l=e.placement??"middle",spacing:c=e.spacing??0,size:h=e.size??0,fill:d=e.fill??"black",fillOpacity:u=e.fillOpacity??1,stroke:p=e.stroke??"black",strokeOpacity:g=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:x=e.lineDashOffset??0}=i,{enabled:m=e.label.enabled,color:b=e.label.color??"black",fontStyle:S=e.label.fontStyle??"normal",fontWeight:M=e.label.fontWeight??"normal",fontSize:D=e.label.fontSize,fontFamily:C=e.label.fontFamily,spacing:k=e.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:l,spacing:c,size:h,rotation:a,fill:d,fillOpacity:u,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:x,label:{enabled:m,color:b,fontStyle:S,fontWeight:M,fontSize:D,fontFamily:C,spacing:k}}})}getTargetPoint(t){const{properties:e,originX:i,originY:s,horizontal:n,scale:o,gaugeRect:a}=this,{thickness:r}=e,{value:l,placement:c,spacing:h,size:d}=t,u=o.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=r+h+d/2;break;default:p=r/2;break}return{x:i+a.x+(n?u:p),y:s+a.y+(n?p:u)}}getTargetLabel(t){const{size:e,placement:i,label:s}=t,{spacing:n,color:o,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,d=e/2+n;let u,p,g=0,f=0;return this.horizontal?(u="center",i==="after"?(p="top",f=d):(p="bottom",f=-d)):(p="middle",i==="before"?(u="right",g=-d):(u="left",g=d)),{offsetX:g,offsetY:f,fill:o,textAlign:u,textBaseline:p,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(t,e){const{placement:i,avoidCollisions:s,spacing:n,text:o,color:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:f=x=>this.formatLabel(x.value)}=t;return{placement:i,avoidCollisions:s,spacing:n,text:o,value:e,fill:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:f}}verticalLabelInset(){const{properties:t}=this,{label:e}=t,i=e.text?.split(`
`),s=qd(e,e.fontSize)*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:t,properties:e}=this,{scale:i,label:s}=e,n=s.text?.split(`
`),o=s.getFont(),a=i.interval.values??t.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5}),l=(n??a.map(c=>Vg(this,this.labelDatum(s,c))??"")).reduce((c,h)=>{const{width:d}=Xnt.measureText(h,{font:o});return Math.max(c,d)},0);return s.spacing+l}createNodeData(){const{id:t,properties:e,horizontal:i,scale:s,seriesRect:n}=this;if(!e.isValid())return;const{value:o,segmentation:a,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u}=e;s.domain=[d.min,d.max],s.range=i?[0,n.width]:[n.height,0];let p,g;i?(g=1,p=Math.PI/2):d.label.placement==="before"?(g=1,p=0):(g=-1,p=0);const f=p-Math.PI/2;let x,m,b,S;i?(x=0,m=n.width,b=(n.height-r)/2,S=b+r,u.placement==="outside-start"?x+=this.horizontalLabelInset():u.placement==="outside-end"&&(m-=this.horizontalLabelInset())):(x=(n.width-r)/2,m=x+r,S=0,b=n.height,u.placement==="outside-start"?b-=this.verticalLabelInset():u.placement==="outside-end"&&(S+=this.verticalLabelInset())),this.gaugeRect=new Pl(Math.min(x,m),Math.min(b,S),Math.abs(m-x),Math.abs(S-b));const M=0,D=0;s.domain=[d.min,d.max],s.range=i?[x,m]:[b,S];const{ticks:C}=this.tickGenerator.generateTicks({domain:s.domain,primaryTickCount:void 0,visibleRange:[0,1],niceMode:eot.Off,labelX:0,parallelFlipRotation:p,regularFlipRotation:f,sideFlag:g}).tickData,k=!1,I=this.getTargets(),L=[],N=[],O=[],w=[],[R,G]=s.range,B=Math.abs(G-R),P=i?s.convert(o):m,V=i?S:s.convert(o),W=a.enabled?a.spacing/2:0,F=i?W:0,_=i?0:W,z=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),U=-(r-z)/2,Y=i?0:U,Z=i?U:0,q=c==="item",Q=Math.ceil(B);let tt=a.enabled?a.interval.getSegments(s,Q):void 0;const X=h.fill??this.createLinearGradient(s,h.fills,h.fillMode),it=d.fill??(h.enabled&&d.fills.length===0?d.defaultFill:void 0)??this.createLinearGradient(s,d.fills,d.fillMode);if(tt==null&&q){const ht=Math.min(...s.domain),lt=Math.max(...s.domain),vt={value:o,segmentStart:ht,segmentEnd:lt};if(h.enabled){const Vt=Math.min(l,z/2,B/2)*(k?-1:1),Dt=i?Vt:0,Bt=i?0:Vt;L.push({series:this,itemId:"value",datum:vt,datumIndex:{type:0},type:0,x0:M+x-Dt-Y,y0:D+b-Bt-Z,x1:M+P+Dt+Y,y1:D+V+Bt+Z,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:X,horizontalInset:F,verticalInset:_})}const ut=Math.min(l,r/2,B/2)*(k?-1:1),Kt=i?ut:0,Xt=i?0:ut;w.push({series:this,itemId:"scale",datum:vt,datumIndex:{type:0},type:0,x0:M+x-Kt,y0:D+b-Xt,x1:M+m+Kt,y1:D+S+Xt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:it,horizontalInset:F,verticalInset:_})}else{tt??(tt=s.domain);const ht=M+x-Y,lt=D+b-Z,vt=M+P+Y,At=D+V+Z;for(let ut=0;ut<tt.length-1;ut+=1){const Kt=tt[ut+0],Xt=tt[ut+1],Gt={value:o,segmentStart:Kt,segmentEnd:Xt},Vt=ut===0,Dt=ut===tt.length-2,Bt=s.convert(Kt),$t=s.convert(Xt),Xi=q||Vt?l:0,ps=q||Dt?l:0,Nn=i?Xi:ps,Kl=ps,Oa=i?ps:Xi,wr=Xi;h.enabled&&L.push({series:this,itemId:`value-${ut}`,datum:Gt,datumIndex:{type:0},type:0,x0:M+(i?Bt:x),y0:D+(i?b:Bt),x1:M+(i?$t:m),y1:D+(i?S:$t),clipX0:ht,clipY0:lt,clipX1:vt,clipY1:At,topLeftCornerRadius:Nn,topRightCornerRadius:Kl,bottomRightCornerRadius:Oa,bottomLeftCornerRadius:wr,fill:X,horizontalInset:F,verticalInset:_}),w.push({series:this,itemId:`scale-${ut}`,datum:Gt,datumIndex:{type:0},type:0,x0:M+(i?Bt:x),y0:D+(i?b:Bt),x1:M+(i?$t:m),y1:D+(i?S:$t),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:Nn,topRightCornerRadius:Kl,bottomRightCornerRadius:Oa,bottomLeftCornerRadius:wr,fill:it,horizontalInset:F,verticalInset:_})}}u.enabled&&O.push(this.labelDatum(u,o));const nt=i?oot:aot;for(let ht=0;ht<I.length;ht+=1){const lt=I[ht],{value:vt,text:At,shape:ut,size:Kt,fill:Xt,fillOpacity:Gt,stroke:Vt,strokeWidth:Dt,strokeOpacity:Bt,lineDash:$t,lineDashOffset:Xi}=lt,ps=this.getTargetPoint(lt),Nn=BB(lt.rotation+nt[lt.placement]);N.push({series:this,itemId:`target-${ht}`,midPoint:ps,datum:{value:vt},datumIndex:{type:1,index:ht},type:1,value:vt,text:At,x:ps.x,y:ps.y,shape:ut,size:Kt,rotation:Nn,fill:Xt,fillOpacity:Gt,stroke:Vt,strokeOpacity:Bt,strokeWidth:Dt,lineDash:$t,lineDashOffset:Xi,label:this.getTargetLabel(lt)})}return{itemId:t,nodeData:L,tickData:C,targetData:N,labelData:O,scaleData:w}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(t!=null&&t.series===this&&t.type===1)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,targetSelection:s,targetLabelSelection:n,scaleSelection:o,highlightTargetSelection:a,tickSelection:r}=this;this.seriesRect=t??Pl.NaN;const l=this.checkResize(t);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:n}),this.updateTargetLabelNodes({targetLabelSelection:n}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:g!=null?[g]:[],targetSelection:a}),this.updateTargetNodes({targetSelection:a,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>PB(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:s}=this,{bar:n}=s,{fillOpacity:o,stroke:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=n,h=this.getStrokeWidth(n.strokeWidth),d=i.animationManager.isSkipped(),u=this.getShapeFillBBox();e.each((p,g)=>{const{topLeftCornerRadius:f,topRightCornerRadius:x,bottomRightCornerRadius:m,bottomLeftCornerRadius:b,fill:S}=g;p.fill=S,p.fillBBox=u,p.fillOpacity=o,p.stroke=a,p.strokeOpacity=r,p.strokeWidth=h,p.lineDash=l,p.lineDashOffset=c,p.topLeftCornerRadius=f,p.topRightCornerRadius=x,p.bottomRightCornerRadius=m,p.bottomLeftCornerRadius=b,p.pointerEvents=this.properties.bar.enabled?T.PointerEvents.All:T.PointerEvents.None,(d||p.previousDatum==null)&&p.setProperties(kb(p,g))}),this.datumUnion.update(e,this.itemGroup,T.Rect,(p,g,f)=>{p.pointerEvents=T.PointerEvents.None,p.clipBBox??(p.clipBBox=new Pl(NaN,NaN,NaN,NaN)),p.x=g.x,p.y=g.y,p.clipBBox.x=g.clipBBox?.x??g.x,p.clipBBox.y=g.clipBBox?.y??g.y,this.horizontal?(p.height=p.clipBBox.height=f.height,p.width=f===g?f.width:f.x+f.width,p.clipBBox.width=p.width-(f.width-(f.clipBBox?.width??f.width)),p.topLeftCornerRadius=g.topLeftCornerRadius,p.bottomLeftCornerRadius=g.bottomLeftCornerRadius,p.topRightCornerRadius=f.topRightCornerRadius,p.bottomRightCornerRadius=f.bottomRightCornerRadius):(p.width=p.clipBBox.width=f.width,p.height=f===g?f.height:f.x+f.height,p.clipBBox.height=p.height-(f.height-(f.clipBBox?.height??f.height)),p.topLeftCornerRadius=g.topLeftCornerRadius,p.topRightCornerRadius=g.topRightCornerRadius,p.bottomLeftCornerRadius=f.bottomLeftCornerRadius,p.bottomRightCornerRadius=f.bottomRightCornerRadius)})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>PB(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i}=this.properties,{fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=i,c=this.getShapeFillBBox();e.each((h,d)=>{const{topLeftCornerRadius:u,topRightCornerRadius:p,bottomRightCornerRadius:g,bottomLeftCornerRadius:f,fill:x}=d;h.fill=x,h.fillBBox=c,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=o,h.strokeWidth=a,h.lineDash=r,h.lineDashOffset=l,h.topLeftCornerRadius=u,h.topRightCornerRadius=p,h.bottomRightCornerRadius=g,h.bottomLeftCornerRadius=f,h.setProperties(kb(h,d))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((n,o)=>{const{x:a,y:r,shape:l,size:c,rotation:h,fill:d,fillOpacity:u,stroke:p,strokeOpacity:g,strokeWidth:f,lineDash:x,lineDashOffset:m}=o;n.size=c,n.shape=l==="line"?MB:l,n.fill=s?.fill??d,n.fillOpacity=s?.fillOpacity??u,n.stroke=s?.stroke??p,n.strokeOpacity=s?.strokeOpacity??g,n.strokeWidth=s?.strokeWidth??f,n.lineDash=s?.lineDash??x,n.lineDashOffset=s?.lineDashOffset??m,n.translationX=a,n.translationY=r,n.rotation=h})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,s)=>{const{x:n,y:o,text:a}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:f}=s.label;i.visible=!0,i.x=n+r,i.y=o+l,i.text=a,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textAlign=g,i.textBaseline=f})}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.tickId)}updateTickNodes(t){const{gaugeRect:e,properties:i}=this,s=i.defaultScale,{enabled:n,color:o,fontFamily:a=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=BB(i.scale.label.rotation??0);let p,g,f,x;this.horizontal?(d??(d="after"),p="center",g=d==="before"?"bottom":"top",x=this.originY+e.y+(d==="before"?-h:e.height+h)):(d??(d="before"),p=d==="before"?"end":"start",g="middle",f=this.originX+e.x+(d==="before"?-h:e.width+h)),t.tickSelection.each((m,b)=>{if(!n){m.visible=!1;return}const S=f??b.translationY,M=x??b.translationY;m.visible=!0,m.text=b.tickLabel,m.fill=o,m.fontFamily=a,m.fontSize=r,m.fontStyle=l,m.fontWeight=c,m.textBaseline=g,m.textAlign=p,m.x=S,m.y=M,m.rotationCenterX=S,m.rotationCenterY=M,m.rotation=u})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>"primary")}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,horizontal:i,scale:s,seriesRect:n,gaugeRect:o}=this,{x:a,y:r,width:l,height:c}=o,h=t?.label??this.properties.value;let d;if(i){const g=s.convert(h);d=new Pl(a,r,g-a,c)}else{const g=s.convert(h);d=new Pl(a,g,l,c-g)}const u={seriesRect:n,gaugeRect:o,barRect:d},{margin:p}=this.properties;Ynt(this,e,{padding:p,horizontal:i},u,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Knt([this.datumSelection],kb),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i=0,s=0;if(this.labelSelection.each((n,o)=>{n.opacity=1,i=n.previousDatum?.value??t.from??o.value,s=o.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;e.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:t.phase??"update",ease:iot.easeOut,onUpdate:o=>this.formatLabelText(o)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=EB(!0,this.horizontal);PI(this.id,"node",t,[this.datumSelection],e,(i,s)=>s.itemId),PI(this.id,"label",t,[this.labelSelection],SB,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=EB(!1,this.horizontal);PI(this.id,"node",t,[this.datumSelection],e,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:s}=i;if(!i.isValid())return;let n,o;if(t.type===0?(n=i.value,o=i.label.text):{value:n,text:o}=i.targets[t.index],n!=null)return s.formatTooltip(this.properties,{data:[{label:o,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return DB(this,t)}pickFocus(t){return AB(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(t){}datumIndexForCategoryValue(t){}};Cb.className="LinearGaugeSeries",Cb.type="linear-gauge";var{commonSeriesOptionsDefs:lot,autoSizedLabelOptionsDefs:cot,seriesLabelOptionsDefs:hot,tooltipOptionsDefs:dot,numberFormatValidator:uot}=T,Lb={fills:ff,fillMode:st("continuous","discrete")},_B={value:K(J),text:E,shape:Qt(st("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),bt),placement:st("before","after","middle"),spacing:H,size:H,rotation:J,...St,...rt,...Ot},bh={type:K(Ct("linear-gauge")),value:K(J),direction:st("horizontal","vertical"),cornerMode:st("container","item"),cornerRadius:H,thickness:H,scale:{min:Ze(J,Zl("max")),max:Ze(J,Su("min")),label:{enabled:j,formatter:bt,rotation:J,spacing:H,minSpacing:H,placement:st("before","after"),avoidCollisions:j,format:uot,...ge},interval:{values:mt(J),step:J},...Lb,...St,...rt,...Ot},targets:gs(_B,"target options array"),segmentation:{enabled:j,spacing:H,interval:{values:mt(J),step:J,count:J}},bar:{enabled:j,thickness:H,thicknessRatio:Tt,...Lb,...St,...rt,...Ot},label:{...cot,text:E,spacing:H,avoidCollisions:j,placement:st("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:dot,...lot};bh.margin=J,bh.defaultColorRange=mt(dt),bh.defaultTarget={..._B,value:J,label:{...hot,spacing:J}},bh.defaultScale=bh.scale,bh.scale.defaultFill=dt;var pot={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:t=>new Cb(t),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},T.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",T.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{spacing:11}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4}}},got={type:"series",name:"linear-gauge",chartType:"gauge",enterprise:!0,options:bh,create:t=>new Cb(t)},Hg={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1}},fot=1e-9;function GB(t,e,i,s){const[n,o]=t,[a,r]=e,l=a-n,c=r-o,h=l*l+c*c;let d,u;if(Math.abs(h)<fot)d=n,u=o;else{let f=((i-n)*l+(s-o)*c)/h;f=Math.max(0,Math.min(1,f)),d=n+f*(a-n),u=o+f*(r-o)}const p=i-d,g=s-u;return p*p+g*g}function VB(t,e,i){let s=1/0,n=t[t.length-1];for(const o of t)s=Math.min(s,GB(n,o,e,i)),n=o;return Math.sqrt(s)}function BI(t){let[e,i]=t[0],s=0;for(let n=1;n<t.length;n+=1){const[o,a]=t[n],r=Math.hypot(o-e,a-i);s+=r,e=o,i=a}return s}function Nb(t){if(t.length===0)return;const e=BI(t)/2;let[i,s]=t[0],n=0;for(let o=1;o<t.length;o+=1){const[a,r]=t[o],l=Math.hypot(a-i,r-s),c=n+l;if(c>e){const h=(e-n)/l,d=[i+(a-i)*h,s+(r-s)*h],u=Math.atan2(r-s,a-i);return{point:d,angle:u}}n=c,i=a,s=r}}var{LonLatBBox:yot}=T;function Ug(t,e,i,s,n){return t==null?t=new yot(e,i,s,n):(t.lon0=Math.min(t.lon0,e),t.lat0=Math.min(t.lat0,i),t.lon1=Math.max(t.lon1,s),t.lat1=Math.max(t.lat1,n)),t}function Sh(t,e){return t.forEach(i=>{const[s,n]=i;e=Ug(e,s,n,s,n)}),e}function mot(t){if(t.length===0)return;let e=0,i=0,s=0,[n,o]=t[t.length-1];for(const[a,r]of t){const l=n*r-a*o;s+=l,e+=(n+a)*l,i+=(o+r)*l,n=a,o=r}return s*=3,[e/s,i/s]}function wb(t,e,i){let s=!1,n=1/0;for(const o of t){let a=o[o.length-1],[r,l]=a;for(const c of o){const[h,d]=c;d>i!=l>i&&e<(r-h)*(i-d)/(l-d)+h&&(s=!s),n=Math.min(n,GB(a,c,e,i)),a=c,r=h,l=d}}return(s?-1:1)*Math.sqrt(n)}var{Path:xot,ExtendedPath2D:bot,BBox:Sot,ScenePathChangeDetection:jB}=T,lu=class extends xot{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new bot}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:t}=this;this.strokePath.clear(),this.path.clear(),this.bbox=t!=null?this.drawGeometry(t,void 0):void 0}drawPath(t){super.drawPath(t),this.renderStroke(t,this.strokePath.getPath2D())}containsPoint(t,e){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(t,e)?!1:this.geometryDistance(i,t,e)<=0}distanceSquared(t,e){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,t,e);return s>0?s*s:0}geometryDistance(t,e,i){const{renderMode:s,strokeWidth:n}=this,o=(s&1)!==0,a=(s&2)!==0,r=Math.max(n/2,1)+1;switch(t.type){case"GeometryCollection":return t.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,e,i)),1/0);case"MultiPolygon":return o?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(wb(c,e,i),0)),1/0):1/0;case"Polygon":return o?Math.max(wb(t.coordinates,e,i),0):1/0;case"MultiLineString":return a?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(VB(c,e,i)-r,0)),1/0):1/0;case"LineString":return a?Math.max(VB(t.coordinates,e,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(t,e){const{renderMode:i,path:s,strokePath:n}=this,o=(i&1)!==0,a=(i&2)!==0;switch(t.type){case"GeometryCollection":t.geometries.forEach(r=>{e=this.drawGeometry(r,e)});break;case"MultiPolygon":o&&t.coordinates.forEach(r=>{e=this.drawPolygon(s,r,e)});break;case"Polygon":o&&(e=this.drawPolygon(s,t.coordinates,e));break;case"LineString":a&&(e=this.drawLineString(n,t.coordinates,e,!1));break;case"MultiLineString":a&&t.coordinates.forEach(r=>{e=this.drawLineString(n,r,e,!1)});break;case"Point":case"MultiPoint":break}return e}drawPolygon(t,e,i){if(e.length<1)return i;i=this.drawLineString(t,e[0],i,!0);for(let s=1;s<e.length;s+=1){const n=e[s];this.drawLineString(t,n,void 0,!0)}return i}drawLineString(t,e,i,s){if(e.length<2)return i;const n=s?e.length-1:e.length;for(let o=0;o<n;o+=1){const[a,r]=e[o];if(o===0?t.moveTo(a,r):t.lineTo(a,r),i==null)i=new Sot(a,r,0,0);else{const{x:l,y:c}=i,h=l+i.width,d=c+i.height;i.x=Math.min(l,a),i.y=Math.min(c,r),i.width=Math.max(h,a)-i.x,i.height=Math.max(d,r)-i.y}}return s&&t.closePath(),i}};y([jB()],lu.prototype,"projectedGeometry",2),y([jB()],lu.prototype,"renderMode",2);function cu(t,e){if(t.bbox!=null){const[i,s,n,o]=t.bbox;return e=Ug(e,i,s,n,o),e}switch(t.type){case"GeometryCollection":t.geometries.forEach(i=>{e=cu(i,e)});break;case"MultiPolygon":t.coordinates.forEach(i=>{i.length>0&&(e=Sh(i[0],e))});break;case"Polygon":t.coordinates.length>0&&(e=Sh(t.coordinates[0],e));break;case"MultiLineString":t.coordinates.forEach(i=>{e=Sh(i,e)});break;case"LineString":e=Sh(t.coordinates,e);break;case"MultiPoint":t.coordinates.forEach(i=>{const[s,n]=i;e=Ug(e,s,n,s,n)});break;case"Point":{const[i,s]=t.coordinates;e=Ug(e,i,s,i,s);break}}return e}function Ob(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(s=>{const n=Ob(s);if(n==null)return;const o=Sh(n[0],void 0);if(o==null)return;const a=Math.abs(o.lat1-o.lat0)*Math.abs(o.lon1-o.lon0);(e==null||a>e)&&(e=a,i=n)}),i}case"MultiPolygon":{let e,i;return t.coordinates.forEach(s=>{const n=Sh(s[0],void 0);if(n==null)return;const o=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(e==null||o>e)&&(e=o,i=s)}),i}case"Polygon":return t.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Eb(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(s=>{const n=Eb(s);if(n==null)return;const o=BI(n);o!=null&&(e==null||o>e)&&(e=o,i=n)}),i}case"MultiLineString":{let e=0,i;return t.coordinates.forEach(s=>{const n=BI(s);n>e&&(e=n,i=s)}),i}case"LineString":return t.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function zI(t,e){if(t==null)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(i=>zI(i,e));case"MultiPolygon":case"Polygon":return(e&1)!==0;case"MultiLineString":case"LineString":return(e&2)!==0;case"MultiPoint":case"Point":return(e&4)!==0}}function Bl(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(i=>Bl(i,e))};case"Polygon":return{type:"Polygon",coordinates:FI(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:vot(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:FI(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:_I(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:_I(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function vot(t,e){return t.map(i=>FI(i,e))}function FI(t,e){return t.map(i=>_I(i,e))}function _I(t,e){return t.map(i=>e.convert(i))}function Mot(){return{fromFn:(i,s,n)=>n==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,n)=>n==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function WB(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(i!==void 0){for(const s of t.datumSelection.nodes())if(s.datum===i)return s}}var gpt=class extends T.SeriesProperties{},Yg=class extends T.DataModelSeries{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)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}},{AND:Dot,ARRAY:Aot,COLOR_STRING:Iot,COLOR_STRING_ARRAY:Tot,FUNCTION:kot,LINE_DASH:Cot,NUMBER_ARRAY:Lot,OBJECT:HB,POSITIVE_NUMBER:GI,RATIO:Not,STRING:zo,TempValidate:Ke,SeriesProperties:wot,SeriesTooltip:Oot,Label:Eot}=T,Re=class extends wot{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new Eot,this.tooltip=new Oot}};y([Ke($d,{optional:!0})],Re.prototype,"topology",2),y([Ke(zo,{optional:!0})],Re.prototype,"title",2),y([Ke(zo,{optional:!0})],Re.prototype,"legendItemName",2),y([Ke(zo)],Re.prototype,"idKey",2),y([Ke(zo)],Re.prototype,"topologyIdKey",2),y([Ke(zo,{optional:!0})],Re.prototype,"idName",2),y([Ke(zo,{optional:!0})],Re.prototype,"labelKey",2),y([Ke(zo,{optional:!0})],Re.prototype,"labelName",2),y([Ke(zo,{optional:!0})],Re.prototype,"sizeKey",2),y([Ke(zo,{optional:!0})],Re.prototype,"sizeName",2),y([Ke(zo,{optional:!0})],Re.prototype,"colorKey",2),y([Ke(zo,{optional:!0})],Re.prototype,"colorName",2),y([Ke(Lot,{optional:!0})],Re.prototype,"sizeDomain",2),y([Ke(Dot(Tot,Aot.restrict({minLength:1})),{optional:!0})],Re.prototype,"colorRange",2),y([Ke(GI,{optional:!0})],Re.prototype,"maxStrokeWidth",2),y([Ke(Iot)],Re.prototype,"stroke",2),y([Ke(Not)],Re.prototype,"strokeOpacity",2),y([Ke(GI)],Re.prototype,"strokeWidth",2),y([Ke(Cot)],Re.prototype,"lineDash",2),y([Ke(GI)],Re.prototype,"lineDashOffset",2),y([Ke(kot,{optional:!0})],Re.prototype,"itemStyler",2),y([Ke(HB)],Re.prototype,"label",2),y([Ke(HB)],Re.prototype,"tooltip",2);var{getMissCount:Rot,createDatumId:UB,SeriesNodePickMode:YB,valueProperty:Kg,CachedTextMeasurerPool:Pot,ColorScale:Bot,LinearScale:zot,Selection:VI,Text:Fot,Transformable:_ot}=T,Rb=class extends Yg{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[YB.EXACT_SHAPE_MATCH,YB.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Re,this._chartTopology=void 0,this.colorScale=new Bot,this.sizeScale=new zot,this.datumSelection=VI.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=VI.select(this.labelGroup,Fot),this.highlightDatumSelection=VI.select(this.highlightNode,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0):!1}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new lu;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,u=new Map;i?.features.forEach(S=>{const M=S.properties?.[o];M==null||!zI(S.geometry,2)||u.set(M,S)});const p=this.sizeScale.type,g=this.colorScale.type,f=this.scale?.type,{dataModel:x,processedData:m}=await this.requestDataModel(t,e,{props:[Kg(a,f,{id:"idValue",includeProperty:!1}),Kg(a,f,{id:"featureValue",includeProperty:!1,processor:()=>S=>u.get(S)}),...c!=null?[Kg(c,"band",{id:"labelValue"})]:[],...r!=null?[Kg(r,p,{id:"sizeValue"})]:[],...l!=null?[Kg(l,g,{id:"colorValue"})]:[]]}),b=x.resolveColumnById(this,"featureValue",m);if(this.topologyBounds=b.reduce((S,M)=>{const D=M?.geometry;return D==null?S:cu(D,S)},void 0),r!=null){const S=x.resolveProcessedDataIndexById(this,"sizeValue"),M=m.domain.values[S]??[];s.domain=h??M}if(d!=null&&this.isColorScaleValid()){const S=x.resolveProcessedDataIndexById(this,"colorValue");n.domain=m.domain.values[S],n.range=d,n.update()}i==null&&$.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=Rot(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(t,e,i,s){if(e==null||i==null)return;const n=Eb(i);if(n==null)return;const{idKey:o,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u,label:p}=this.properties,g=this.getLabelText(p,{value:e,datum:t,idKey:o,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u});if(g==null)return;const f=Pot.measureText(String(g),{font:s}),x=Nb(n);if(x==null)return;const[m,b]=x.point,{width:S,height:M}=f;return{point:{x:m,y:b,size:0},label:{width:S,height:M,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,sizeKey:r,colorKey:l,labelKey:c,label:h}=n;if(e==null||i==null)return;const d=e.resolveColumnById(this,"idValue",i),u=e.resolveColumnById(this,"featureValue",i),p=c!=null?e.resolveColumnById(this,"labelValue",i):void 0,g=r!=null?e.resolveColumnById(this,"sizeValue",i):void 0,f=l!=null?e.resolveColumnById(this,"colorValue",i):void 0,x=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,x),x];const m=h.getFont(),b=new Map;i.dataSources.get(this.id)?.forEach((I,L)=>{const N=d[L],O=u[L]?.geometry??void 0,w=O!=null&&o!=null?Bl(O,o):void 0;N!=null&&w!=null&&b.set(N,w)});const S=[],M=[],D=[];(i.dataSources.get(this.id)??[]).forEach((I,L)=>{const N=d[L],O=f?.[L],w=g?.[L],R=p?.[L],G=b.get(N);G==null&&D.push(N);const B=this.getLabelDatum(I,R,G,m);B!=null&&M.push(B),S.push({series:this,itemId:a,datum:I,datumIndex:L,idValue:N,labelValue:R,colorValue:O,sizeValue:w,projectedGeometry:G})});const k=10;if(D.length>k){const I=D.length-k;D.length=k,D.push(`(+${I} more)`)}return D.length>0&&$.warnOnce("some data items do not have matches in the provided topology",D),{itemId:t,nodeData:S,labelData:M}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,highlightDatumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let i=this.ctx.highlightManager?.getActiveHighlight();i!=null&&(i.series!==this||i.datum==null)&&(i=void 0);const s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i!=null?[i]:[],datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>UB(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{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}}getItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:d}=r;let u;if(!o&&i!=null&&(u??(u={}),u.stroke=this.isColorScaleValid()?l.convert(i):h?.[0]??r.stroke),s!=null&&(u??(u={}),u.strokeWidth=c.convert(s,!0)),d!=null){const p=this.cachedDatumCallback(UB(t,o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,highlighted:o,...n,...u}));u??(u={}),Object.assign(u,p)}return u}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i);e.each((n,o)=>{const{datum:a,datumIndex:r,colorValue:l,sizeValue:c,projectedGeometry:h}=o;if(h==null){n.visible=!1,n.projectedGeometry=void 0;return}const d=this.getItemStyleOverrides(String(r),a,l,c,s,i);n.visible=!0,n.projectedGeometry=h,n.stroke=d?.stroke??s.stroke,n.strokeWidth=d?.strokeWidth??s.strokeWidth,n.strokeOpacity=d?.strokeOpacity??s.strokeOpacity,n.lineDash=d?.lineDash??s.lineDash,n.lineDashOffset=d?.lineDashOffset??s.lineDashOffset})}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=T.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:d,text:u})=>{r.visible=!0,r.x=l+h/2,r.y=c+d/2,r.text=u,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,r.fontFamily=a,r.textAlign="center",r.textBaseline="middle"})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}datumMidPoint(t){const{_previousDatumMidPoint:e}=this;if(e?.datum===t)return e.point;const i=t.projectedGeometry,s=i!=null?Eb(i):void 0,n=s!=null?Nb(s)?.point:void 0,o=n!=null?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:t,point:o},o}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{strokeWidth:n,strokeOpacity:o,lineDash:a}=s;let{stroke:r}=s;if(t!=null&&this.isColorScaleValid()){const c=e.resolveColumnById(this,"colorValue",i)[t];r=this.colorScale.convert(c)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{stroke:r,strokeWidth:n,strokeOpacity:o,lineDash:a}}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(e==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idKey:r,idName:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;if(t==="gradient"&&c!=null&&d!=null){const p=e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,colorName:h,colorRange:d,colorDomain:p}]}else return t==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??l??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:o,idName:a,colorKey:r,colorName:l,sizeKey:c,sizeName:h,labelKey:d,labelName:u,title:p,legendItemName:g,tooltip:f}=n;if(!i||!s)return;const x=s.dataSources.get(this.id)?.[t],m=i.resolveColumnById(this,"idValue",s),b=[],S=c!=null?i.resolveColumnById(this,"sizeValue",s)[t]:void 0,M=r!=null?i.resolveColumnById(this,"colorValue",s)[t]:void 0;if(c!=null&&b.push({label:h,fallbackLabel:c,value:String(S)}),r!=null&&b.push({label:l,fallbackLabel:r,value:String(M)}),d!=null&&d!==o){const C=i.resolveColumnById(this,"labelValue",s)[t];b.push({label:u,fallbackLabel:d,value:C})}const D=this.getItemBaseStyle(!1);return Object.assign(D,this.getItemStyleOverrides(String(t),t,M,S,D,!1)),f.formatTooltip(this.properties,{heading:m[t],title:p??g,symbol:this.legendItemSymbol(t),data:b},{seriesId:e,datum:x,title:p,idKey:o,idName:a,colorKey:r,colorName:l,sizeKey:c,sizeName:h,labelKey:d,labelName:u,...D})}computeFocusBounds(t){const e=WB(this,t);return e?_ot.toCanvas(this.contentGroup,e.getBBox()):void 0}};Rb.className="MapLineSeries",Rb.type="map-line";var{commonSeriesOptionsDefs:KB,seriesLabelOptionsDefs:Got,tooltipOptionsDefs:Vot}=T,$B={type:K(Ct("map-line")),idKey:K(E),sizeKey:E,colorKey:E,labelKey:E,idName:E,sizeName:E,colorName:E,labelName:E,topology:Ko,topologyIdKey:E,legendItemName:E,maxStrokeWidth:H,title:E,itemStyler:bt,sizeDomain:mt(H),label:Got,tooltip:Vot,...KB,...rt,...Ot,highlightStyle:{...KB.highlightStyle,...rt}};$B.colorRange=Ze(mt(dt),bu(1));var jot={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line",moduleFactory:t=>new Rb(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Hg,series:{stroke:T.SAFE_STROKE_FILL_OPERATION,colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},T.SAFE_RANGE2_OPERATION]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},Wot={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:$B,create:t=>new Rb(t)},{COLOR_STRING:Hot,LINE_DASH:Uot,OBJECT:Yot,POSITIVE_NUMBER:XB,RATIO:Kot,TempValidate:vh,SeriesProperties:$ot,SeriesTooltip:Xot}=T,zl=class extends $ot{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new Xot}};y([vh($d,{optional:!0})],zl.prototype,"topology",2),y([vh(Hot)],zl.prototype,"stroke",2),y([vh(Kot)],zl.prototype,"strokeOpacity",2),y([vh(XB)],zl.prototype,"strokeWidth",2),y([vh(Uot)],zl.prototype,"lineDash",2),y([vh(XB)],zl.prototype,"lineDashOffset",2),y([vh(Yot)],zl.prototype,"tooltip",2);var{createDatumId:Zot,SeriesNodePickMode:Qot,Group:qot,Selection:Jot,PointerEvents:tat}=T,Pb=class extends Yg{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[Qot.EXACT_SHAPE_MATCH]}),this.properties=new zl,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new qot({name:"itemGroup"})),this.datumSelection=Jot.select(this.itemGroup,()=>this.nodeFactory())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0):!1}nodeFactory(){const t=new lu;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=tat.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const s=i.geometry;return s==null?e:cu(s,e)},void 0),t==null&&$.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(e==null)return;const s=[],n=[];return e.features.forEach((o,a)=>{const{geometry:r}=o,l=r!=null&&i!=null?Bl(r,i):void 0;l!=null&&s.push({series:this,itemId:a,datum:o,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:t,nodeData:s,labelData:n}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Zot(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{stroke:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=e,r=this.getStrokeWidth(e.strokeWidth);i.each((l,c)=>{const{projectedGeometry:h}=c;if(h==null){l.visible=!1,l.projectedGeometry=void 0;return}l.visible=!0,l.projectedGeometry=h,l.stroke=s,l.strokeWidth=r,l.strokeOpacity=n,l.lineDash=o,l.lineDashOffset=a})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}};Pb.className="MapLineBackgroundSeries",Pb.type="map-line-background";var eat={type:K(Ct("map-line-background")),topology:Ko,...rt,...Ot},iat={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:t=>new Pb(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Hg,series:{stroke:{$path:["./1",{$palette:"stroke"},{$palette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},sat={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:eat,create:t=>new Pb(t)},nat=(t,e,i)=>{let s=t,n=s;for(const o of e)if(s==null||i(s.value,o)>0)s={value:o,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,o)<=0;)n=n.next;n.next={value:o,next:n.next}}return s};function ZB(t,e,i){const s=Sh(t[0],void 0);if(s==null)return;const n=(s.lon0+s.lon1)/2,o=(s.lat0+s.lat1)/2,a=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=mot(t[0]),[c,h]=l,d=-wb(t,c,h);let u;const p=(D,C)=>{const I=Math.max(C-d,0);return D-.5*I},g=(D,C,k)=>{const{distance:I,maxDistance:L}=i(t,D,C,k),N=Math.hypot(c-D,h-C),O=Math.min(Math.max(c,D-k/2),D+k/2),w=Math.min(Math.max(h,C-k/2),C+k/2),R=Math.hypot(c-O,h-w),G=p(I,N),B=p(L,R);return{distance:I,maxDistance:L,value:G,maxValue:B,x:D,y:C,stride:k}},f=(D,C,k,I)=>{const L=g(C,k,I);L.maxDistance>=0&&D.push(L)},x=Math.min(a,r)/2;let m={value:g(n,o,x),next:null};for(;m!=null;){const D=m.value,{distance:C,value:k,maxValue:I,x:L,y:N,stride:O}=D;if(m=m.next,C>0&&(u==null||k>u.value)&&(u=D),u!=null&&I-u.value<=e)continue;const w=O/2,R=[];f(R,L-w,N-w,w),f(R,L+w,N-w,w),f(R,L-w,N+w,w),f(R,L+w,N+w,w),R.sort(QB),m=nat(m,R,QB)}if(u==null)return;const{distance:b,x:S,y:M}=u;return{x:S,y:M,distance:b}}var QB=(t,e)=>e.maxValue-t.maxValue;function jI(t,e){const i=ZB(t,e,(o,a,r,l)=>{const c=-wb(o,a,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:n}=i;return[s,n]}function qB(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(s=>qB(s,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const s=Ob(t);i=s!=null?jI(s,e):void 0;break}case"Polygon":{const s=t.coordinates;i=s!=null?jI(s,e):void 0;break}case"MultiLineString":{const s=Eb(t);i=s!=null?Nb(s)?.point:void 0;break}case"LineString":{const s=t.coordinates;i=Nb(s)?.point;break}}return i!=null?[i]:[]}var{BBox:oat}=T;function JB(t){if(!t)return;const{range:e}=t,i=e[1][0]-e[0][0],s=e[1][1]-e[0][1],n=new oat(0,0,i,s);return{series:n,axis:n}}var{FillGradientDefaults:aat,FillPatternDefaults:rat,AND:lat,ARRAY:cat,COLOR_STRING:tz,COLOR_STRING_ARRAY:hat,FUNCTION:dat,NUMBER_ARRAY:uat,OBJECT:Bb,OR:pat,COLOR_GRADIENT:gat,COLOR_PATTERN:fat,POSITIVE_NUMBER:zb,RATIO:ez,STRING:ks,MARKER_SHAPE:yat,LINE_DASH:mat,TempValidate:Jt,SeriesProperties:xat,SeriesTooltip:bat,Label:Sat}=T,iz=class extends Sat{constructor(){super(...arguments),this.placement="bottom"}};y([Jt(ks)],iz.prototype,"placement",2);var te=class extends xat{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillGradientDefaults=new aat,this.fillPatternDefaults=new rat,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new iz,this.tooltip=new bat}};y([Jt($d,{optional:!0})],te.prototype,"topology",2),y([Jt(ks,{optional:!0})],te.prototype,"title",2),y([Jt(ks,{optional:!0})],te.prototype,"legendItemName",2),y([Jt(ks,{optional:!0})],te.prototype,"idKey",2),y([Jt(ks)],te.prototype,"topologyIdKey",2),y([Jt(ks,{optional:!0})],te.prototype,"idName",2),y([Jt(ks,{optional:!0})],te.prototype,"latitudeKey",2),y([Jt(ks,{optional:!0})],te.prototype,"latitudeName",2),y([Jt(ks,{optional:!0})],te.prototype,"longitudeKey",2),y([Jt(ks,{optional:!0})],te.prototype,"longitudeName",2),y([Jt(ks,{optional:!0})],te.prototype,"labelKey",2),y([Jt(ks,{optional:!0})],te.prototype,"labelName",2),y([Jt(ks,{optional:!0})],te.prototype,"sizeKey",2),y([Jt(ks,{optional:!0})],te.prototype,"sizeName",2),y([Jt(ks,{optional:!0})],te.prototype,"colorKey",2),y([Jt(ks,{optional:!0})],te.prototype,"colorName",2),y([Jt(lat(hat,cat.restrict({minLength:1})),{optional:!0})],te.prototype,"colorRange",2),y([Jt(yat)],te.prototype,"shape",2),y([Jt(zb)],te.prototype,"size",2),y([Jt(zb,{optional:!0})],te.prototype,"maxSize",2),y([Jt(uat,{optional:!0})],te.prototype,"sizeDomain",2),y([Jt(pat(gat,fat,tz))],te.prototype,"fill",2),y([Jt(Bb)],te.prototype,"fillGradientDefaults",2),y([Jt(Bb)],te.prototype,"fillPatternDefaults",2),y([Jt(ez)],te.prototype,"fillOpacity",2),y([Jt(tz)],te.prototype,"stroke",2),y([Jt(zb)],te.prototype,"strokeWidth",2),y([Jt(ez)],te.prototype,"strokeOpacity",2),y([Jt(mat)],te.prototype,"lineDash",2),y([Jt(zb)],te.prototype,"lineDashOffset",2),y([Jt(dat,{optional:!0})],te.prototype,"itemStyler",2),y([Jt(Bb)],te.prototype,"label",2),y([Jt(Bb)],te.prototype,"tooltip",2);var{CachedTextMeasurerPool:vat,fromToMotion:Mat,StateMachine:Dat,getMissCount:Aat,createDatumId:sz,SeriesNodePickMode:nz,valueProperty:Mh,computeMarkerFocusBounds:Iat,ColorScale:Tat,LinearScale:kat,Group:Cat,Selection:WI,Text:Lat,Marker:HI,applyShapeStyle:Nat,getShapeStyle:oz}=T,Fb=class extends Yg{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[nz.EXACT_SHAPE_MATCH,nz.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new te,this._chartTopology=void 0,this.colorScale=new Tat,this.sizeScale=new kat,this.markerGroup=this.contentGroup.appendChild(new Cat({name:"markerGroup"})),this.labelSelection=WI.select(this.labelGroup,Lat,!1),this.markerSelection=WI.select(this.markerGroup,HI,!1),this.highlightMarkerSelection=WI.select(this.highlightNode,HI),this.animationState=new Dat("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const t=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||t)}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[3,t],this.highlightGroup.zIndex=[4,t],!0):!1}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,sizeDomain:u,colorRange:p}=this.properties,g=new Map;i?.features.forEach(I=>{const L=I.properties?.[o];L!=null&&g.set(L,I)});const f=this.sizeScale.type,x=this.colorScale.type,m=this.scale?.type,b=r!=null&&l!=null,{dataModel:S,processedData:M}=await this.requestDataModel(t,e,{props:[...a!=null?[Mh(a,m,{id:"idValue",includeProperty:!1}),Mh(a,m,{id:"featureValue",includeProperty:!1,processor:()=>I=>g.get(I)})]:[],...b?[Mh(r,m,{id:"latValue"}),Mh(l,m,{id:"lonValue"})]:[],...d?[Mh(d,"band",{id:"labelValue"})]:[],...c?[Mh(c,f,{id:"sizeValue"})]:[],...h?[Mh(h,x,{id:"colorValue"})]:[]]}),D=a!=null?S.resolveColumnById(this,"featureValue",M):void 0,C=b?S.resolveColumnById(this,"latValue",M):void 0,k=b?S.resolveColumnById(this,"lonValue",M):void 0;if(this.topologyBounds=M.dataSources.get(this.id)?.reduce((I,L,N)=>{const w=D?.[N]?.geometry;if(w!=null&&(I=cu(w,I)),C!=null&&k!=null){const R=k[N],G=C[N];I=Ug(I,R,G,R,G)}return I},void 0),c!=null){const I=S.resolveProcessedDataIndexById(this,"sizeValue"),L=M.domain.values[I]??[];s.domain=u??L}if(p!=null&&this.isColorScaleValid()){const I=S.resolveProcessedDataIndexById(this,"colorValue");n.domain=M.domain.values[I],n.range=p,n.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=Aat(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(t,e,i,s,n,o){if(e==null)return;const{idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:f,labelKey:x,labelName:m,label:b,shape:S}=this.properties,{placement:M}=b,D=this.getLabelText(b,{value:e,datum:t,idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:f,labelKey:x,labelName:m});if(D==null)return;const{width:C,height:k}=vat.measureText(String(D),{font:o}),I=HI.anchor(S);return{point:{x:i,y:s,size:n},label:{width:C,height:k,text:D},anchor:I,placement:M}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,label:u}=n;if(e==null||i==null||o==null)return;const p=r!=null&&l!=null,g=a!=null?e.resolveColumnById(this,"idValue",i):void 0,f=a!=null?e.resolveColumnById(this,"featureValue",i):void 0,x=p?e.resolveColumnById(this,"latValue",i):void 0,m=p?e.resolveColumnById(this,"lonValue",i):void 0,b=d!=null?e.resolveColumnById(this,"labelValue",i):void 0,S=c!=null?e.resolveColumnById(this,"sizeValue",i):void 0,M=h!=null?e.resolveColumnById(this,"colorValue",i):void 0,D=n.maxSize??n.size;s.range=[Math.min(n.size,D),D];const C=u.getFont();let k;g!=null&&f!=null&&(k=new Map,i.dataSources.get(this.id)?.forEach((R,G)=>{const B=g[G],P=f[G]?.geometry??void 0,V=P!=null&&o!=null?Bl(P,o):void 0;B!=null&&V!=null&&k.set(B,V)}));const I=[],L=[],N=[];(i.dataSources.get(this.id)??[]).forEach((R,G)=>{const B=g?.[G],P=m?.[G],V=x?.[G],W=M?.[G],F=S?.[G],_=b?.[G],z=F!=null?s.convert(F,!0):n.size,U=B!=null?k?.get(B):void 0;if(B!=null&&Bl==null&&N.push(B),P!=null&&V!=null){const[Y,Z]=o.convert([P,V]),q=this.getLabelDatum(R,_,Y,Z,z,C);q&&L.push(q),I.push({series:this,itemId:r,datum:R,datumIndex:G,index:-1,idValue:B,lonValue:P,latValue:V,labelValue:_,sizeValue:F,colorValue:W,point:{x:Y,y:Z,size:z},midPoint:{x:Y,y:Z}})}else U!=null&&qB(U,1).forEach(([Y,Z],q)=>{const Q=this.getLabelDatum(R,_,Y,Z,z,C);Q&&L.push(Q),I.push({series:this,itemId:r,datum:R,datumIndex:G,index:q,idValue:B,lonValue:P,latValue:V,labelValue:_,sizeValue:F,colorValue:W,point:{x:Y,y:Z,size:z},midPoint:{x:Y,y:Z}})})});const w=10;if(N.length>w){const R=N.length-w;N.length=w,N.push(`(+${R} more)`)}return N.length>0&&$.warnOnce("some data items do not have matches in the provided topology",N),{itemId:t,nodeData:I,labelData:L}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:t}){const e=this.checkResize(t),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();o!=null&&(o.series!==this||o.datum==null)&&(o=void 0);const a=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:a,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:o}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:o!=null?[o]:[],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:o}),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=T.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:d,text:u})=>{r.visible=!0,r.x=l+h/2,r.y=c+d/2,r.text=u,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,r.fontFamily=a,r.textAlign="center",r.textBaseline="middle"})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,s=>sz([s.index,s.idValue,s.lonValue,s.latValue]))}getMarkerItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return oz({shape:e.shape,size:e.size,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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getMarkerItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:d}=r;let u;if(u??(u={}),!o&&i!=null&&(u.fill=this.isColorScaleValid()?l.convert(i):h?.[0]??r.fill),s!=null&&(u.size=c.convert(s,!0)),d!=null){const p=this.cachedDatumCallback(sz(t,o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,highlighted:o,...n,...u}));u??(u={}),Object.assign(u,p)}return u}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:s}=t,n=this.getMarkerItemBaseStyle(i),o=JB(this.scale);e.each((a,r)=>{const{datumIndex:l,datum:c,point:h,colorValue:d,sizeValue:u}=r,p=this.getMarkerItemStyleOverrides(String(l),c,d,u,n,i);a.shape=p?.shape??n.shape,a.size=p?.size??n.size,Nat(a,n,p,o),a.x=h.x,a.y=h.y,a.scalingCenterX=h.x,a.scalingCenterY=h.y,a.zIndex=!i&&s!=null&&c===s.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:t}=this.ctx,e=Mot();Mat(this.id,"markers",t,[this.markerSelection,this.highlightMarkerSelection],e)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(t){const{x:e,y:i}=t;let s=1/0,n;return this.contextNodeData?.nodeData.forEach(o=>{const{x:a,y:r,size:l}=o.point,c=Math.max(Math.abs(a-e)-l,0),h=Math.max(Math.abs(r-i)-l,0),d=c*c+h*h;d<s&&(s=d,n=o)}),n!=null?{datum:n,distance:Math.sqrt(s)}:void 0}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{shape:n,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s;let{fill:d}=s;if(t!=null&&this.isColorScaleValid()){const p=e.resolveColumnById(this,"colorValue",i)[t];d=this.colorScale.convert(p)}return{marker:oz({shape:n,fill:d,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(e==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idName:r,idKey:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;if(t==="gradient"&&c!=null&&d!=null){const p=e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,colorName:h,colorRange:d,colorDomain:p}]}else return t==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??r??l??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:o,idName:a,latitudeKey:r,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:f,labelName:x,title:m,legendItemName:b,tooltip:S}=n;if(!i||!s)return;const M=s.dataSources.get(this.id)?.[t],D=p!=null?i.resolveColumnById(this,"sizeValue",s)[t]:void 0,C=d!=null?i.resolveColumnById(this,"colorValue",s)[t]:void 0,k=[];if(D!=null&&k.push({label:g,fallbackLabel:p,value:String(D)}),C!=null&&k.push({label:u,fallbackLabel:d,value:String(C)}),f!=null&&f!==o){const N=i.resolveColumnById(this,"labelValue",s)[t];k.push({label:x,fallbackLabel:f,value:N})}let I;if(o!=null)I=i.resolveColumnById(this,"idValue",s)[t];else if(r!=null&&c!=null){const N=i.resolveColumnById(this,"latValue",s)[t],O=i.resolveColumnById(this,"lonValue",s)[t];I=`${Math.abs(N).toFixed(4)}\xB0 ${N>=0?"N":"S"}, ${Math.abs(O).toFixed(4)}\xB0 ${O>=0?"W":"E"}`}const L=this.getMarkerItemBaseStyle(!1);return Object.assign(L,this.getMarkerItemStyleOverrides(String(t),t,C,D,L,!1)),S.formatTooltip(this.properties,{heading:I,title:m??b,symbol:this.legendItemSymbol(t),data:k},{seriesId:e,datum:M,title:m,idKey:o,idName:a,latitudeKey:r,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:f,labelName:x,...L})}getFormattedMarkerStyle(t){const{datumIndex:e,colorValue:i,sizeValue:s}=t,n=this.getMarkerItemBaseStyle(!1);return Object.assign(n,this.getMarkerItemStyleOverrides(String(e),e,i,s,n,!1)),{size:n.size}}computeFocusBounds(t){return Iat(this,t)}};Fb.className="MapMarkerSeries",Fb.type="map-marker";var{commonSeriesOptionsDefs:az,markerOptionsDefs:wat,seriesLabelOptionsDefs:Oat,tooltipOptionsDefs:Eat,without:Rat}=T,Pat={type:K(Ct("map-marker")),idKey:E,latitudeKey:E,longitudeKey:E,sizeKey:E,colorKey:E,labelKey:E,idName:E,latitudeName:E,longitudeName:E,sizeName:E,colorName:E,labelName:E,topology:Ko,topologyIdKey:E,legendItemName:E,colorRange:mt(dt),title:E,maxSize:H,sizeDomain:mt(H),label:{placement:st("top","bottom","left","right"),...Oat},tooltip:Eat,...az,...Rat(wat,["enabled"]),highlightStyle:{...az.highlightStyle,...St,...rt}},Bat={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:t=>new Fb(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Hg,series:{shape:"circle",maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},T.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,fillOpacity:.5,label:{color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},zat={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:Pat,create:t=>new Fb(t),validate(t,e,i){const s=wn(t,e,i);if(s.valid?.idKey==null&&(s.valid?.latitudeKey==null||s.valid?.longitudeKey==null)){const n=a=>i?`${i}.${a}`:a,o=`Either \`${n("idKey")}\` or both \`${n("latitudeKey")}\` and \`${n("longitudeKey")}\` are required.`;s.errors.push(new uf(o,i,!0))}return s}};function Fat(t,{aspectRatio:e,precision:i}){const s=ZB(t,i,(l,c,h,d)=>{const u=Gat(l,c,h,e),p=u+2*d*e,g=u*Math.SQRT2,f=p*Math.SQRT2;return{distance:g,maxDistance:f}});if(s==null)return;const{x:n,y:o,distance:a}=s,r=a/Math.SQRT2;return{x:n,y:o,maxWidth:r}}function _at(t,e,i,s,n){const[o,a]=t,[r,l]=e,c=1/n,h=r-o,d=l-a,[u,p]=a<=l?t:e,[g,f]=o<=r?t:e,[x,m]=a<=l?e:t,[b,S]=o<=r?e:t;let M=1/0;if(h!==0){const N=d/h;for(let O=0;O<=1;O+=1){const w=O===0?c:-c,R=(N*o-a-w*i+s)/(N-w);if(R>=g&&R<=b){const G=Math.abs(i-R)*2;M=Math.min(M,G)}}}else for(let N=0;N<=1;N+=1){const w=(N===0?c:-c)*(o-i)+s;if(w>=p&&w<=m){const G=Math.abs(s-w)*2*n;M=Math.min(M,G)}}const D=n,C=Math.abs((u-i)/(p-s)),k=Math.abs((x-i)/(m-s));if(m<s&&k<D){const O=Math.abs(s-m)*2*n;M=Math.min(M,O)}else if(p>s&&C<D){const O=Math.abs(s-p)*2*n;M=Math.min(M,O)}const I=Math.abs((f-s)/(g-i)),L=Math.abs((S-s)/(b-i));if(b<i&&L<c){const N=Math.abs(i-b)*2;M=Math.min(M,N)}else if(g>i&&I<c){const N=Math.abs(i-g)*2;M=Math.min(M,N)}return M}function Gat(t,e,i,s){let n=!1,o=1/0;for(const a of t){let r=a[a.length-1],[l,c]=r;for(const h of a){const[d,u]=h;u>i!=c>i&&e<(l-d)*(i-u)/(c-u)+d&&(n=!n);const p=_at(r,h,e,i,s);o=Math.min(o,p),r=h,l=d,c=u}}return(n?1:-1)*o}function _b(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function Vat(t,e,i,s,n,o){const a=n-o/2,r=n+o/2,[l,c]=e,[h,d]=i,u=h-l,p=d-c,[g,f]=l<=h?e:i,[x,m]=l<=h?i:e;if(u!==0){const b=p/u;for(let S=0;S<=1;S+=1){const D=((S===0?a:r)-c)/b+l;D>=g&&D<=x&&_b(t,s,D)}}else Math.max(a,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&_b(t,s,l);return x<s&&m>=a&&m<=r?_b(t,s,x):g>s&&f>=a&&f<=r&&_b(t,s,g),t}function jat(t,e,i,s){const n={minX:-1/0,maxX:1/0};for(const r of t){let l=r[r.length-1];for(const c of r)Vat(n,l,c,e,i,s),l=c}const{minX:o,maxX:a}=n;return Number.isFinite(o)&&Number.isFinite(a)?{x:e+(o+a)/2,width:a-o}:{x:e,width:0}}var{AND:Wat,ARRAY:Hat,COLOR_STRING:rz,COLOR_STRING_ARRAY:Uat,COLOR_GRADIENT:Yat,COLOR_PATTERN:Kat,FUNCTION:$at,LINE_DASH:Xat,OR:Zat,OBJECT:Gb,POSITIVE_NUMBER:UI,RATIO:lz,STRING:Tr,TempValidate:Pe,SeriesProperties:Qat,SeriesTooltip:qat,FillGradientDefaults:Jat,FillPatternDefaults:trt}=T,Te=class extends Qat{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillGradientDefaults=new Jat,this.fillPatternDefaults=new trt,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new Og,this.tooltip=new qat}};y([Pe($d,{optional:!0})],Te.prototype,"topology",2),y([Pe(Tr,{optional:!0})],Te.prototype,"title",2),y([Pe(Tr,{optional:!0})],Te.prototype,"legendItemName",2),y([Pe(Tr)],Te.prototype,"idKey",2),y([Pe(Tr,{optional:!0})],Te.prototype,"idName",2),y([Pe(Tr)],Te.prototype,"topologyIdKey",2),y([Pe(Tr,{optional:!0})],Te.prototype,"labelKey",2),y([Pe(Tr,{optional:!0})],Te.prototype,"labelName",2),y([Pe(Tr,{optional:!0})],Te.prototype,"colorKey",2),y([Pe(Tr,{optional:!0})],Te.prototype,"colorName",2),y([Pe(Wat(Uat,Hat.restrict({minLength:1})),{optional:!0})],Te.prototype,"colorRange",2),y([Pe(Zat(Yat,Kat,rz))],Te.prototype,"fill",2),y([Pe(Gb)],Te.prototype,"fillGradientDefaults",2),y([Pe(Gb)],Te.prototype,"fillPatternDefaults",2),y([Pe(lz)],Te.prototype,"fillOpacity",2),y([Pe(rz)],Te.prototype,"stroke",2),y([Pe(lz)],Te.prototype,"strokeOpacity",2),y([Pe(UI)],Te.prototype,"strokeWidth",2),y([Pe(Xat)],Te.prototype,"lineDash",2),y([Pe(UI)],Te.prototype,"lineDashOffset",2),y([Pe(UI)],Te.prototype,"padding",2),y([Pe($at,{optional:!0})],Te.prototype,"itemStyler",2),y([Pe(Gb)],Te.prototype,"label",2),y([Pe(Gb)],Te.prototype,"tooltip",2);var{getMissCount:ert,createDatumId:cz,SeriesNodePickMode:hz,valueProperty:Vb,CachedTextMeasurerPool:irt,TextUtils:dz,ColorScale:srt,Group:uz,Selection:YI,Text:nrt,PointerEvents:ort,applyShapeStyle:art,getShapeStyle:KI}=T,pz=T.MercatorScale.fixedScale(),jb=class extends Yg{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[hz.EXACT_SHAPE_MATCH,hz.NEAREST_NODE]}),this.properties=new Te,this._chartTopology=void 0,this.colorScale=new srt,this.itemGroup=this.contentGroup.appendChild(new uz({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new uz({name:"itemLabelGroup"})),this.datumSelection=YI.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=YI.select(this.itemLabelGroup,nrt),this.highlightDatumSelection=YI.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=ort.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0):!1}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new lu;return t.renderMode=1,t.lineJoin="round",t}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,colorScale:s}=this,{topologyIdKey:n,idKey:o,colorKey:a,labelKey:r,colorRange:l}=this.properties,c=new Map;i?.features.forEach(f=>{const x=f.properties?.[n];x==null||!zI(f.geometry,1)||c.set(x,f)});const h=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,e,{props:[Vb(o,d,{id:"idValue",includeProperty:!1}),Vb(o,d,{id:"featureValue",includeProperty:!1,processor:()=>f=>c.get(f)}),...r?[Vb(r,"band",{id:"labelValue"})]:[],...a?[Vb(a,h,{id:"colorValue"})]:[]]}),g=u.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=g.reduce((f,x)=>{const m=x?.geometry;return m==null?f:cu(m,f)},void 0),l!=null&&this.isColorScaleValid()){const f=u.resolveProcessedDataIndexById(this,"colorValue");s.domain=p.domain.values[f],s.range=l,s.update()}i==null&&$.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=ert(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelLayout(t,e,i,s,n){if(e==null||s==null)return;const{idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties,p=this.getLabelText(u,{value:e,datum:t,idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h});if(p==null)return;const g=irt.measureText(String(p),{font:i}),f=p.split(`
`).length,x=(g.width+2*d)/(f*dz.getLineHeight(u.fontSize)+2*d);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===x)return n;const m=Bl(s,pz),b=Ob(m);if(b==null)return;const S=Fat(b,{aspectRatio:x,precision:.001});if(S==null)return;const{x:M,y:D,maxWidth:C}=S;return{geometry:s,labelText:p,aspectRatio:x,x:M,y:D,maxWidth:C,fixedPolygon:b}}getLabelDatum(t,e){const{scale:i}=this;if(i==null)return;const{padding:s,label:n}=this.properties,{labelText:o,aspectRatio:a,x:r,y:l,maxWidth:c,fixedPolygon:h}=t,d={width:Math.ceil(c*e),height:Math.ceil(c*e/a),meta:r},u=Ng(o,n,{padding:s},(M,D)=>{if(!D)return d;const C=jat(h,r,l,M/e);return{width:C.width*e,height:M,meta:C.x}});if(u==null)return;const[{text:p,fontSize:g,lineHeight:f,width:x},m]=u;if(p===dz.EllipsisChar)return;const b=x<d.width?r:m,S=this.scale.convert(pz.invert([b,l]));return{x:S[0],y:S[1],text:p,fontSize:g,lineHeight:f}}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,scale:n,previousLabelLayouts:o}=this,{idKey:a,colorKey:r,labelKey:l,label:c}=s;if(e==null||i==null)return;const h=n!=null?(n.range[1][0]-n.range[0][0])/n.bounds.width:NaN,d=e.resolveColumnById(this,"idValue",i),u=e.resolveColumnById(this,"featureValue",i),p=l!=null?e.resolveColumnById(this,"labelValue",i):void 0,g=r!=null?e.resolveColumnById(this,"colorValue",i):void 0,f=c.getFont(),x=new Map;this.previousLabelLayouts=x;const m=[],b=[],S=[];(i.dataSources.get(this.id)??[]).forEach((C,k)=>{const I=d[k],L=g?.[k],N=p?.[k],O=u[k]?.geometry??void 0;O==null&&S.push(I);const w=this.getLabelLayout(C,N,f,O,o?.get(I));w!=null&&x.set(I,w);const R=w!=null&&n!=null?this.getLabelDatum(w,h):void 0;R!=null&&b.push(R);const G=O!=null&&n!=null?Bl(O,n):void 0;m.push({series:this,itemId:a,datum:C,datumIndex:k,idValue:I,colorValue:L,labelValue:N,projectedGeometry:G})});const D=10;if(S.length>D){const C=S.length-D;S.length=D,S.push(`(+${C} more)`)}return S.length>0&&$.warnOnce("some data items do not have matches in the provided topology",S),{itemId:t,nodeData:m,labelData:b}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,labelSelection:e,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let s=this.ctx.highlightManager?.getActiveHighlight();s!=null&&(s.series!==this||s.datum==null)&&(s=void 0);const n=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:e}),this.updateLabelNodes({labelSelection:e}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s!=null?[s]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>cz(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return KI({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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a,colorScale:r}=this,{colorRange:l,itemStyler:c}=a;let h;if(!n&&i!=null&&(h??(h={}),h.fill=this.isColorScaleValid()?r.convert(i):l?.[0]??a.fill),c!=null){const d=this.cachedDatumCallback(cz(t,n?"highlight":"node"),()=>this.callWithContext(c,{seriesId:o,datum:e,highlighted:n,...s,...h}));h??(h={}),Object.assign(h,d)}return KI(h,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i),n=JB(this.scale);e.each((o,a)=>{const{datum:r,datumIndex:l,colorValue:c,projectedGeometry:h}=a;if(h==null){o.visible=!1,o.projectedGeometry=void 0;return}const d=this.getItemStyleOverrides(String(l),r,c,s,i);o.visible=!0,o.projectedGeometry=h,art(o,s,d,n)})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontFamily:o}=this.properties.label;e.each((a,{x:r,y:l,text:c,fontSize:h,lineHeight:d})=>{a.visible=!0,a.x=r,a.y=l,a.text=c,a.fill=i,a.fontStyle=s,a.fontWeight=n,a.fontSize=h,a.lineHeight=d,a.fontFamily=o,a.textAlign="center",a.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}datumMidPoint(t){const{_previousDatumMidPoint:e}=this;if(e?.datum===t)return e.point;const i=t.projectedGeometry,s=i!=null?Ob(i):void 0,n=s!=null?jI(s,2):void 0,o=n!=null?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:t,point:o},o}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=s;let{fill:h}=s;if(t!=null&&this.isColorScaleValid()){const u=e.resolveColumnById(this,"colorValue",i)[t];h=this.colorScale.convert(u)}return{marker:KI({fill:h,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(e==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idKey:r,idName:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;if(t==="gradient"&&c!=null&&d!=null){const p=e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,colorName:h,colorRange:d,colorDomain:p}]}else return t==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??l??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,legendItemName:d,title:u,tooltip:p}=n;if(!i||!s)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveColumnById(this,"idValue",s)[t],x=r!=null?i.resolveColumnById(this,"colorValue",s)[t]:void 0,m=[];if(x!=null&&m.push({label:l,fallbackLabel:r,value:String(x)}),c!=null&&c!==o){const S=i.resolveColumnById(this,"labelValue",s)[t];m.push({label:h,fallbackLabel:c,value:S})}const b=this.getItemBaseStyle(!1);return Object.assign(b,this.getItemStyleOverrides(String(t),t,x,b,!1)),p.formatTooltip(this.properties,{heading:f,title:u??d,symbol:this.legendItemSymbol(t),data:m},{seriesId:e,datum:g,title:u,idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,...b})}computeFocusBounds(t){return WB(this,t)}};jb.className="MapShapeSeries",jb.type="map-shape";var{commonSeriesOptionsDefs:gz,autoSizedLabelOptionsDefs:rrt,tooltipOptionsDefs:lrt}=T,crt={type:K(Ct("map-shape")),idKey:K(E),colorKey:E,labelKey:E,idName:E,colorName:E,labelName:E,topology:Ko,topologyIdKey:E,legendItemName:E,colorRange:mt(dt),padding:H,itemStyler:bt,title:E,label:rrt,tooltip:lrt,...gz,...St,...rt,...Ot,highlightStyle:{...gz.highlightStyle,...St,...rt}},hrt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape",moduleFactory:t=>new jb(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Hg,series:{fill:{$palette:"fill"},stroke:{$ref:"backgroundColor"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},T.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}},tooltip:{range:"exact"}}},drt={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:crt,create:t=>new jb(t)},{FillGradientDefaults:urt,FillPatternDefaults:prt,COLOR_STRING:fz,COLOR_GRADIENT:grt,COLOR_PATTERN:frt,OR:yrt,LINE_DASH:mrt,OBJECT:$I,POSITIVE_NUMBER:yz,RATIO:mz,TempValidate:Fo,SeriesProperties:xrt,SeriesTooltip:brt}=T,oo=class extends xrt{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillGradientDefaults=new urt,this.fillPatternDefaults=new prt,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new brt}};y([Fo($d,{optional:!0})],oo.prototype,"topology",2),y([Fo(yrt(grt,frt,fz))],oo.prototype,"fill",2),y([Fo($I)],oo.prototype,"fillGradientDefaults",2),y([Fo($I)],oo.prototype,"fillPatternDefaults",2),y([Fo(mz)],oo.prototype,"fillOpacity",2),y([Fo(fz)],oo.prototype,"stroke",2),y([Fo(mz)],oo.prototype,"strokeOpacity",2),y([Fo(yz)],oo.prototype,"strokeWidth",2),y([Fo(mrt)],oo.prototype,"lineDash",2),y([Fo(yz)],oo.prototype,"lineDashOffset",2),y([Fo($I)],oo.prototype,"tooltip",2);var{createDatumId:Srt,SeriesNodePickMode:vrt,Selection:Mrt,Group:Drt,PointerEvents:Art,getShapeStyle:Irt}=T,Wb=class extends Yg{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[vrt.EXACT_SHAPE_MATCH]}),this.properties=new oo,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Drt({name:"itemGroup"})),this.datumSelection=Mrt.select(this.itemGroup,()=>this.nodeFactory())}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0):!1}nodeFactory(){const t=new lu;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=Art.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const s=i.geometry;return s==null?e:cu(s,e)},void 0),t==null&&$.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(e==null)return;const s=[],n=[];return e.features.forEach((o,a)=>{const{geometry:r}=o,l=r!=null&&i!=null?Bl(r,i):void 0;l!=null&&s.push({series:this,itemId:a,datum:o,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:t,nodeData:s,labelData:n}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Srt(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{fill:s,fillOpacity:n,stroke:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=e,c=this.getStrokeWidth(e.strokeWidth);i.each((h,d)=>{const{projectedGeometry:u}=d;if(u==null){h.visible=!1,h.projectedGeometry=void 0;return}h.visible=!0,h.projectedGeometry=u;const p=Irt({fill:s,fillOpacity:n,stroke:o,strokeWidth:c,strokeOpacity:a,lineDash:r,lineDashOffset:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);h.setProperties(p)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}};Wb.className="MapShapeBackgroundSeries",Wb.type="map-shape-background";var{commonSeriesOptionsDefs:Trt}=T,krt={type:K(Ct("map-shape-background")),topology:Ko,...Trt,...St,...rt,...Ot},Crt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:t=>new Wb(t),tooltipDefaults:{range:"exact"},themeTemplate:{...Hg,series:{fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$ref:"backgroundColor"},strokeWidth:1,fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:[{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}],rotation:0,reverse:!1},fillPatternDefaults:{...T.FILL_PATTERN_DEFAULTS,fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]}}}}},Lrt={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:krt,create:t=>new Wb(t)},{ChartAxisDirection:kr,PolarAxis:Nrt,diff:wrt,fixNumericExtent:Ort,groupAccumulativeValueProperty:xz,keyProperty:Ert,normaliseGroupTo:Rrt,resetLabelFn:Prt,seriesLabelFadeInAnimation:Brt,seriesLabelFadeOutAnimation:zrt,valueProperty:Frt,animationValidation:_rt,createDatumId:bz,SeriesNodePickMode:Sz,normalizeAngle360:vz,CategoryScale:Grt,motion:Mz,applyShapeStyle:Vrt,isGradientFill:jrt,getShapeStyle:XI}=T,Wrt=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},Dz=class extends T.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,categoryKey:"angleValue",useLabelLayer:!0,canHaveAxes:!0,pickModes:[Sz.NEAREST_NODE,Sz.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:Prt}}),this.NodeEvent=Wrt,this.groupScale=new Grt,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===kr.X)return e.getDomain(this,"angleValue","key",i);{const s=e.getDomain(this,"radiusValue-end","value",i),n=Number.isFinite(s[1]-s[0])?[s[0]>0?0:s[0],s[1]<0?0:s[1]]:[];return Ort(n)}}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const o=this.getStackId(),a=`${o}-trailing`,r=[];$e(s)&&r.push(Rrt([o,a],Math.abs(s))),n&&this.processedData&&r.push(wrt(this.id,this.processedData)),n&&r.push(_rt());const l=this.visible?{}:{forceValue:0},c=this.axes[kr.Y]?.scale.type,h=this.axes[kr.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[Ert(e,h,{id:"angleValue"}),Frt(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...xz(i,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},c),...xz(i,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t!==s.r||e!==s.cx||i!==s.cy?(this.circleCache={r:t,cx:e,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[kr.Y]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[kr.Y];return t instanceof Nrt?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e,groupScale:i}=this;if(!e||!t||t.type!=="grouped"||!this.properties.isValid())return;const s=this.axes[kr.X],n=this.axes[kr.Y],o=s?.scale,a=n?.scale;if(!o||!a)return;const r=e.resolveKeysById(this,"angleValue",t),l=e.resolveColumnById(this,"radiusValue-start",t),c=e.resolveColumnById(this,"radiusValue-end",t),h=e.resolveColumnById(this,"radiusValue-raw",t),d=e.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,p=0;s instanceof ll&&(u=s.groupPaddingInner,p=s.paddingInner);const f=(o.bandwidth??0)*(1-p),{index:x,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:m}).map((P,V)=>String(V)),i.range=[-f/2,f/2],i.paddingInner=m>1?u:0;const b=this.isRadiusAxisReversed(),S=b?this.radius:this.getAxisInnerRadius(),M=b?this.getAxisInnerRadius():this.radius,D=M+S,{angleKey:C,radiusKey:k,angleName:I,radiusName:L,label:N}=this.properties,O=(P,V,W,F)=>{const _=this.getLabelText(N,{value:V,datum:P,angleKey:C,radiusKey:k,angleName:I,radiusName:L});if(_)return{x:W,y:F,text:_,textAlign:"center",textBaseline:"middle"}},w=[],R={itemId:k,nodeData:w,labelData:w};if(!this.visible)return R;const{dataSources:G}=t,B=G.get(this.id)??[];for(const{datumIndex:P,group:V}of e.forEachGroupDatum(this,t)){const W=B[P],F=r[P];if(F==null)return;const _=h[P],z=_>=0&&!Object.is(_,-0),U=l[P],Y=c[P],Z=V.aggregation[d][z?1:0]??0,q=z===b;if(U===void 0||Y===void 0)return;let Q,tt;if(B.length===1)Q=-.5*Math.PI,tt=1.5*Math.PI;else{const Gt=o.convert(F);Q=vz(Gt+i.convert(String(x))),tt=vz(Q+i.bandwidth)}const X=Q+i.bandwidth/2,it=D-a.convert(U),nt=D-a.convert(Y),ht=(it+nt)/2,lt=D-a.convert(0),vt=D-a.convert(Z),At=Math.cos(X)*ht,ut=Math.sin(X)*ht,Kt=this.properties.label.enabled?O(W,_,At,ut):void 0,Xt=this.getColumnWidth(Q,tt);w.push({series:this,datum:W,datumIndex:P,point:{x:At,y:ut,size:0},midPoint:{x:At,y:ut},label:Kt,angleValue:F,radiusValue:_,negative:q,innerRadius:it,outerRadius:nt,stackInnerRadius:lt,stackOuterRadius:vt,startAngle:Q,endAngle:tt,midAngle:X,axisInnerRadius:S,axisOuterRadius:M,columnWidth:Xt,index:P})}return{itemId:k,nodeData:w,labelData:w}}getColumnWidth(t,e){return NaN}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return XI({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)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{angleKey:a,radiusKey:r,itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h}=o;if(l==null)return;const d=this.cachedDatumCallback(bz(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:e,highlighted:s,angleKey:a,radiusKey:r,...i}));return XI(d,c,h)}updateSectorSelection(t,e){let i=[];if(e){const l=this.ctx.highlightManager?.getActiveHighlight();l?.datum&&l.series===this&&i.push(l)}else i=this.nodeData;const s=this.isRadiusAxisReversed(),n=s?this.radius:this.getAxisInnerRadius(),o=s?this.getAxisInnerRadius():this.radius,a=this.getShapeFillBBox(),r=this.getItemBaseStyle(e);t.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const{datum:h,datumIndex:d,midPoint:u}=c,p=this.getItemStyleOverrides(String(d),h,r,e),g=p?.fill??r.fill,x=jrt(g)&&g.bounds==="item"?{centerX:u?.x??0,centerY:u?.y??0}:{centerX:0,centerY:0,innerRadius:n,outerRadius:o};this.updateItemPath(l,c,e),Vrt(l,r,p,a,x),l.cornerRadius=p?.cornerRadius??r.cornerRadius,l.lineJoin="round"})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getColumnTransitionFunctions();Mz.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),Brt(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();Mz.fromToMotion(this.id,"datums",e,[t],i),zrt(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=o,d=n[kr.X],u=n[kr.Y];if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveKeysById(this,"angleValue",s)[t],f=i.resolveColumnById(this,"radiusValue-raw",s)[t];if(g==null)return;const x=this.getItemBaseStyle(!1);return Object.assign(x,this.getItemStyleOverrides(String(t),t,x,!1)),h.formatTooltip(this.properties,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(f)}]},{seriesId:e,datum:p,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...x})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties,c=XI({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a},r,l);return T.isGradientFill(c.fill)&&(c.fill={...c.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:c}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{radiusKey:s,radiusName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}getDatumId(t){return bz(t.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:Hrt,FillGradientDefaults:Urt,FillPatternDefaults:Yrt,SeriesTooltip:Krt,TempValidate:Mi,COLOR_STRING:Az,NUMBER:Iz,FUNCTION:$rt,LINE_DASH:Xrt,OBJECT:Hb,POSITIVE_NUMBER:ZI,RATIO:Tz,STRING:$g,Label:Zrt,OR:Qrt,COLOR_GRADIENT:qrt,COLOR_PATTERN:Jrt}=T,ii=class extends Hrt{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new Urt,this.fillPatternDefaults=new Yrt,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Zrt,this.tooltip=new Krt}};y([Mi($g)],ii.prototype,"angleKey",2),y([Mi($g,{optional:!0})],ii.prototype,"angleName",2),y([Mi($g)],ii.prototype,"radiusKey",2),y([Mi($g,{optional:!0})],ii.prototype,"radiusName",2),y([Mi(Qrt(qrt,Jrt,Az))],ii.prototype,"fill",2),y([Mi(Hb)],ii.prototype,"fillGradientDefaults",2),y([Mi(Hb)],ii.prototype,"fillPatternDefaults",2),y([Mi(Tz)],ii.prototype,"fillOpacity",2),y([Mi(Az)],ii.prototype,"stroke",2),y([Mi(ZI)],ii.prototype,"strokeWidth",2),y([Mi(Tz)],ii.prototype,"strokeOpacity",2),y([Mi(Xrt)],ii.prototype,"lineDash",2),y([Mi(ZI)],ii.prototype,"lineDashOffset",2),y([Mi(ZI)],ii.prototype,"cornerRadius",2),y([Mi($rt,{optional:!0})],ii.prototype,"itemStyler",2),y([Mi(Iz)],ii.prototype,"rotation",2),y([Mi($g,{optional:!0})],ii.prototype,"stackGroup",2),y([Mi(Iz,{optional:!0})],ii.prototype,"normalizedTo",2),y([Mi(Hb)],ii.prototype,"label",2),y([Mi(Hb)],ii.prototype,"tooltip",2);var{motion:tlt}=T;function kz(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(a,r,l)=>{e.forEach(c=>{const h=t[c];let d=(l==="removed"||l==="updated"?a:r)[c],u=(l==="removed"?a:r)[c];isNaN(u)&&(u=a.previousDatum?.[c]??NaN);const p=d-u;Math.abs(p)>Math.PI&&(d-=Math.sign(p)*2*Math.PI),h.set(r,{from:d,to:u})})},s=(a,r)=>({startAngle:t.startAngle.get(a)[r],endAngle:t.endAngle.get(a)[r]});return{calculate:i,from:a=>s(a,"from"),to:a=>s(a,"to")}}function Cz(t,e,i){if(i==="updated"){if(t.previousDatum==null||isNaN(t.previousDatum.startAngle)||isNaN(t.previousDatum.endAngle))return"added";if(isNaN(e.startAngle)||isNaN(e.endAngle))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function elt(t){const e=kz();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=e.to(o);let c,h,d,u,p;return a==="removed"?(c=n.innerRadius,h=n.innerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=isNaN(o.innerRadius)?t:o.innerRadius,h=isNaN(o.outerRadius)?t:o.outerRadius,d=isNaN(o.columnWidth)?n.columnWidth:o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l}},fromFn:(n,o,a)=>{a=Cz(n,o,a),e.calculate(n,o,a);const{startAngle:r,endAngle:l}=e.from(o);let c,h,d,u,p;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=t,h=t,d=o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius);const g=tlt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l,phase:g}}}}function ilt(t,{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}){return{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}}var{SectorBox:Ub,motion:slt}=T;function QI(t){const{negative:e,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:o}=t;return{innerRadius:e?o:n,outerRadius:e?n:o,clipInnerRadius:e?s:i,clipOuterRadius:e?i:s}}function nlt(t){const e=kz();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=e.to(o);let c,h,d;if(a==="removed")c=t,h=t,d=new Ub(r,l,c,h);else{let u,p;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:p}=QI(o)),isNaN(c)&&(c=t),isNaN(h)&&(h=t),isNaN(u)&&(u=t),isNaN(p)&&(p=t),d=new Ub(r,l,u,p)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d}},fromFn:(n,o,a)=>{a=Cz(n,o,a),e.calculate(n,o,a);const{startAngle:r,endAngle:l}=e.from(o);let c,h,d;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.clipSector):(c=t,h=t),d??(d=new Ub(r,l,c,h));const u=slt.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d,phase:u}}}}function olt(t,e){const{startAngle:i,endAngle:s}=e,{innerRadius:n,outerRadius:o,clipInnerRadius:a,clipOuterRadius:r}=QI(e),l=new Ub(i,s,a,r);return{innerRadius:n,outerRadius:o,startAngle:i,endAngle:s,clipSector:l}}var{Sector:alt,SectorBox:rlt,PolarZIndexMap:qI}=T,Yb=class extends Dz{constructor(t){super(t,{animationResetFns:{item:olt}}),this.properties=new ii}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,qI.FOREGROUND,t],this.highlightGroup.zIndex=[0,qI.HIGHLIGHT,t],this.labelGroup.zIndex=[0,qI.LABEL,t],!0):!1}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new alt}updateItemPath(t,e,i){const{negative:s}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=s?0:this.properties.cornerRadius,t.endOuterCornerRadius=s?0:this.properties.cornerRadius,t.startInnerCornerRadius=s?this.properties.cornerRadius:0,t.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:n,endAngle:o}=e,{innerRadius:a,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=QI(e);t.innerRadius=a,t.outerRadius=r,t.startAngle=n,t.endAngle=o,t.clipSector=new rlt(n,o,l,c)}}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return nlt(t)}};Yb.className="NightingaleSeries",Yb.type="nightingale";var{commonSeriesOptionsDefs:llt,seriesLabelOptionsDefs:clt,tooltipOptionsDefs:hlt}=T,dlt={type:K(Ct("nightingale")),angleKey:K(E),radiusKey:K(E),angleName:E,radiusName:E,grouped:j,stacked:j,stackGroup:E,normalizedTo:J,cornerRadius:H,itemStyler:bt,label:clt,tooltip:hlt,...llt,...St,...rt,...Ot},{ThemeConstants:{POLAR_AXIS_TYPE:Lz,POLAR_AXIS_SHAPE:ult}}=T,Nz={$path:["./shape",ult.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},plt={series:{fill:{$palette:"fill"},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$palette:"stroke"}]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[Lz.ANGLE_CATEGORY]:{shape:Nz,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[Lz.RADIUS_NUMBER]:{shape:Nz}}},{ThemeConstants:{POLAR_AXIS_TYPE:wz}}=T,glt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:t=>new Yb(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:wz.ANGLE_CATEGORY},{type:wz.RADIUS_NUMBER}],themeTemplate:plt,stackable:!0,groupable:!0,stackedByDefault:!0},flt={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:dlt,create:t=>new Yb(t)},{SeriesProperties:ylt,FillGradientDefaults:mlt,FillPatternDefaults:xlt,SeriesTooltip:blt,TempValidate:si,UNION:Slt,OR:vlt,ARRAY_OF:Mlt,COLOR_GRADIENT:Dlt,COLOR_STRING:Alt,COLOR_STRING_ARRAY:Ilt,FUNCTION:Tlt,DIRECTION:klt,BOOLEAN:Clt,LINE_DASH:Llt,OBJECT:hu,NUMBER:Nlt,POSITIVE_NUMBER:Kb,COLOR_PATTERN:wlt,RATIO:Oz,STRING:Ez,Label:Rz,DropShadow:Olt}=T,Elt=class extends Rz{},JI=class extends Rz{constructor(){super(...arguments),this.spacing=0}};y([si(Nlt)],JI.prototype,"spacing",2),y([si(Slt(["before","after"],"a placement"))],JI.prototype,"placement",2);var pi=class extends ylt{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new mlt,this.fillPatternDefaults=new xlt,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new Olt().set({enabled:!1}),this.label=new Elt,this.stageLabel=new JI,this.tooltip=new blt}};y([si(Ez)],pi.prototype,"stageKey",2),y([si(Ez)],pi.prototype,"valueKey",2),y([si(Mlt(vlt(Dlt,wlt,Alt)))],pi.prototype,"fills",2),y([si(hu)],pi.prototype,"fillGradientDefaults",2),y([si(hu)],pi.prototype,"fillPatternDefaults",2),y([si(Oz)],pi.prototype,"fillOpacity",2),y([si(Ilt)],pi.prototype,"strokes",2),y([si(Kb)],pi.prototype,"strokeWidth",2),y([si(Oz)],pi.prototype,"strokeOpacity",2),y([si(Llt)],pi.prototype,"lineDash",2),y([si(Kb)],pi.prototype,"lineDashOffset",2),y([si(klt)],pi.prototype,"direction",2),y([si(Clt,{optional:!0})],pi.prototype,"reverse",2),y([si(Kb)],pi.prototype,"spacing",2),y([si(Kb,{optional:!0})],pi.prototype,"aspectRatio",2),y([si(Tlt,{optional:!0})],pi.prototype,"itemStyler",2),y([si(hu)],pi.prototype,"shadow",2),y([si(hu)],pi.prototype,"label",2),y([si(hu)],pi.prototype,"stageLabel",2),y([si(hu)],pi.prototype,"tooltip",2);function Pz(t,{x:e,y:i,top:s,right:n,bottom:o,left:a}){t.x0=e-s/2,t.x1=e+s/2,t.x2=e+o/2,t.x3=e-o/2,t.y0=i-a/2,t.y1=i-n/2,t.y2=i+n/2,t.y3=i+a/2}function Rlt(t){return{fromFn:(n,o)=>{const{x:a,y:r}=o;let{top:l,right:c,bottom:h,left:d}=o;return t==="vertical"?(l=0,h=0):(d=0,c=0),{x:a,y:r,top:l,right:c,bottom:h,left:d}},toFn:(n,o)=>{const{x:a,y:r,top:l,right:c,bottom:h,left:d}=o;return{x:a,y:r,top:l,right:c,bottom:h,left:d}},applyFn:Pz}}var{StateMachine:Plt,valueProperty:Bz,SeriesNodePickMode:zz,CachedTextMeasurerPool:Blt,TextUtils:zlt,createDatumId:Flt,BBox:tT,Group:eT,Selection:$b,Text:Fz,PointerEvents:_z,applyShapeStyle:_lt,fromToMotion:Glt,seriesLabelFadeInAnimation:Vlt,getShapeStyle:iT}=T,Xb=class extends T.DataModelSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[zz.EXACT_SHAPE_MATCH,zz.NEAREST_NODE]}),this.properties=new pi,this.itemGroup=this.contentGroup.appendChild(new eT({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new eT({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new eT({name:"stageLabelGroup"})),this.datumSelection=$b.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=$b.select(this.itemLabelGroup,Fz),this.stageLabelSelection=$b.select(this.stageLabelGroup,Fz),this.highlightDatumSelection=$b.select(this.highlightNode,()=>this.nodeFactory()),this.animationState=new Plt("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=_z.None,this.stageLabelGroup.pointerEvents=_z.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new Ta}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}async processData(t){if(this.data==null||!this.properties.isValid())return;const{id:e,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:o}=this.properties,a="band",r="number",l=(h,d,u)=>i&&s.getItemEnabled({seriesId:e,itemId:u}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(t,this.data,{props:[Bz(n,a,{id:"xValue"}),Bz(o,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,visible:n,ctx:{legendManager:o}}=this,{stageKey:a,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:u,stageLabel:p}=s;if(e==null||i==null)return;const g=l==="horizontal",f=e.resolveColumnById(this,"xValue",i),x=e.resolveColumnById(this,"yValue",i),m=Blt.getMeasurer({font:p.getFont()});let b,S;g?(b="center",S=p.placement==="before"?"bottom":"top"):(b=p.placement==="after"?"left":"right",S="middle");const M=p.enabled?[]:void 0;let D=0,C=0,k=0;const I=i.dataSources.get(this.id)??[];I.forEach((_,z)=>{const U=f[z],Y=x[z],Z=n&&o.getItemEnabled({seriesId:t,itemId:z});if(k+=Y,M==null)return;const q=this.getLabelText(this.properties.stageLabel,{datum:_,value:U,stageKey:a,valueKey:r}),{width:Q}=m.measureText(q),tt=q.split(`
`).length*zlt.getLineHeight(u.fontSize);D=Math.max(D,Q),C=Math.max(C,tt),M.push({x:NaN,y:NaN,text:q,textAlign:b,textBaseline:S,visible:Z})});const L=this._nodeDataDependencies?.seriesRectWidth??0,N=this._nodeDataDependencies?.seriesRectHeight??0,O=h*(i.input.count-1);let w;if(g){const _=C+p.spacing;w=new tT(0,p.placement==="before"?_:0,L,N-_)}else{const _=D+p.spacing;w=new tT(p.placement==="after"?0:_,0,L-_,N)}if(d!=null&&d!==0){const _=l==="horizontal"?1/d:d,z=Math.min(w.width,w.height*_),U=z/_;w=new tT(w.x+(w.width-z)/2,w.y+(w.height-U)/2,z,U)}let R,G;g?G=p.placement==="before"?w.y-p.spacing:w.y+w.height+p.spacing:R=p.placement==="after"?w.x+w.width+p.spacing:w.x-p.spacing;const B=w.width-(g?O:0),P=w.height-(g?0:O);if(B<0||P<0)return;const V=[],W=[];let F=0;return I.forEach((_,z)=>{const U=f[z],Y=x[z],Z=n&&o.getItemEnabled({seriesId:t,itemId:z}),q=F+Y,Q=(F+q)/(2*k),tt=(q-F)/k,X=g?B*Q+h*z:B*.5,it=g?P*.5:P*Q+h*z,nt=w.x+X,ht=w.y+it;if(M!=null){const Gt=M[z];Gt.x=R??nt,Gt.y=G??ht}let lt,vt,At,ut;if(g){const Gt=B*tt;lt=Gt,At=Gt;const Vt=(X+Gt/2)*(P/w.width),Dt=(X-Gt/2)*(P/w.width);vt=c?w.height-Vt:Vt,ut=c?w.height-Dt:Dt}else{const Gt=P*tt;vt=Gt,ut=Gt;const Vt=(it-Gt/2)*(B/w.height),Dt=(it+Gt/2)*(B/w.height);lt=c?w.width-Vt:Vt,At=c?w.width-Dt:Dt}const Kt=this.getLabelText(u,{datum:_,value:Y,stageKey:a,valueKey:r}),Xt={x:nt,y:ht,text:Kt,textAlign:"center",textBaseline:"middle",visible:Z};W.push(Xt),V.push({series:this,itemId:r,datum:_,datumIndex:z,index:z,xValue:U,yValue:Y,x:nt,y:ht,top:lt,right:vt,bottom:At,left:ut,label:Xt,enabled:Z,midPoint:{x:nt,y:ht}}),F=q}),{itemId:t,nodeData:V,labelData:W,stageLabelData:M,bounds:w}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();o!=null&&(o.series!==this||o.datum==null)&&(o=void 0);const a=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o!=null?[o]:[],datumSelection:n}),this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return iT({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{fills:r,strokes:l,stageKey:c,valueKey:h,itemStyler:d}=a,u=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g={};if(n||(g.fill=u,g.stroke=p),d!=null){const f=this.cachedDatumCallback(Flt(t,n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:e,stageKey:c,valueKey:h,highlighted:n,fill:u,stroke:p,...s}));Object.assign(g,f)}return iT(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,{properties:s}=this,{shadow:n}=s,o=this.getItemBaseStyle(i),a=this.contextNodeData?.bounds,r=a?{series:a,axis:a}:void 0;e.each((l,c)=>{const{datumIndex:h,datum:d}=c,u=this.getItemStyleOverrides(String(h),d,h,o,i);_lt(l,o,u,r),Pz(l,c),l.fillShadow=n})}updateLabelSelection(t){return t.labelSelection.update(this.properties.label.enabled?t.labelData:[])}updateStageLabelSelection(t){return t.stageLabelSelection.update(t.stageLabelData)}updateLabelNodes(t){const{labelSelection:e,labelProperties:i}=t,{color:s,fontSize:n,fontStyle:o,fontWeight:a,fontFamily:r}=i;e.each((l,{visible:c,x:h,y:d,text:u,textAlign:p,textBaseline:g})=>{l.visible=c,l.x=h,l.y=d,l.text=u,l.fill=s,l.fontStyle=o,l.fontWeight=a,l.fontSize=n,l.fontFamily=r,l.textAlign=p,l.textBaseline=g})}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0){for(const i of this.datumSelection)if(i.datum===e)return i.node}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r}=n;if(!i||!s)return;const l=s.dataSources.get(this.id)?.[t],c=i.resolveColumnById(this,"xValue",s)[t],h=i.resolveColumnById(this,"yValue",s)[t];if(c==null)return;const d=this.getLabelText(this.properties.stageLabel,{datum:s.dataSources.get(this.id)?.[t],value:h,stageKey:o,valueKey:a}),u=this.getItemBaseStyle(!1);return Object.assign(u,this.getItemStyleOverrides(String(t),t,t,u,!1)),r.formatTooltip(this.properties,{symbol:this.legendItemSymbol(t),data:[{label:String(c),value:d}]},{seriesId:e,datum:l,title:void 0,stageKey:o,valueKey:a,...u})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}legendItemSymbol(t){const{fills:e,strokes:i,strokeWidth:s,fillOpacity:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this.properties,l=e[t%e.length]??"black",c=i[t%i.length]??"black";return{marker:iT({fill:l,fillOpacity:n,stroke:c,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}}getLegendData(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n},visible:o}=this;if(!i||!e||t!=="category"||!this.properties.isValid())return[];const{showInLegend:a}=this.properties,r=[],l=i.resolveColumnById(this,"xValue",e);return(e.dataSources.get(this.id)??[]).forEach((h,d)=>{const u=l[d];r.push({legendType:"category",id:s,itemId:d,seriesId:s,enabled:o&&n.getItemEnabled({seriesId:s,itemId:d}),label:{text:u},symbol:this.legendItemSymbol(d),hideInLegend:!a})}),r}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:t,labelSelection:e,properties:i}=this,s=Rlt(i.direction);Glt(this.id,"nodes",this.ctx.animationManager,[t],s),Vlt(this,"labels",this.ctx.animationManager,e)}};Xb.className="PyramidSeries",Xb.type="pyramid";var{commonSeriesOptionsDefs:jlt,seriesLabelOptionsDefs:Gz,shadowOptionsDefs:Wlt,tooltipOptionsDefs:Hlt,without:Vz}=T,Ult={type:K(Ct("pyramid")),stageKey:K(E),valueKey:K(E),direction:st("horizontal","vertical"),aspectRatio:H,spacing:H,reverse:j,itemStyler:bt,fills:mt($o),strokes:mt(dt),label:Gz,stageLabel:{spacing:H,placement:st("before","after"),...Gz},tooltip:Hlt,shadow:Wlt,...jlt,...Vz(St,["fill"]),...Vz(rt,["stroke"]),...Ot},{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:Ylt}}=T,Klt={series:{direction:"vertical",strokeWidth:0,spacing:2,fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},stageLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:Ylt,xOffset:3,yOffset:3,blur:5}}},$lt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:t=>new Xb(t),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:Klt},Xlt={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:Ult,create:t=>new Xb(t)},{ThemeConstants:{POLAR_AXIS_TYPE:Zlt}}=T,jz={series:{stroke:{$palette:"stroke"},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[Zlt.ANGLE_CATEGORY]:{label:{spacing:10}}}},Qlt=T.mergeDefaults({series:{stroke:T.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},jz),qlt=T.mergeDefaults({series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,fillOpacity:.8,strokeWidth:2,marker:{enabled:!1,fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS}}},jz),{Label:Jlt,SeriesMarker:tct,SeriesProperties:ect,SeriesTooltip:ict,TempValidate:nn,BOOLEAN:sct,COLOR_STRING:nct,NUMBER:oct,LINE_DASH:act,OBJECT:sT,POSITIVE_NUMBER:Wz,RATIO:rct,STRING:Zb}=T,Cs=class extends ect{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new tct,this.label=new Jlt,this.tooltip=new ict,this.connectMissingData=!1}};y([nn(Zb)],Cs.prototype,"angleKey",2),y([nn(Zb)],Cs.prototype,"radiusKey",2),y([nn(Zb,{optional:!0})],Cs.prototype,"angleName",2),y([nn(Zb,{optional:!0})],Cs.prototype,"radiusName",2),y([nn(nct)],Cs.prototype,"stroke",2),y([nn(Wz)],Cs.prototype,"strokeWidth",2),y([nn(rct)],Cs.prototype,"strokeOpacity",2),y([nn(act)],Cs.prototype,"lineDash",2),y([nn(Wz)],Cs.prototype,"lineDashOffset",2),y([nn(oct)],Cs.prototype,"rotation",2),y([nn(sT)],Cs.prototype,"marker",2),y([nn(sT)],Cs.prototype,"label",2),y([nn(sT)],Cs.prototype,"tooltip",2),y([nn(sct)],Cs.prototype,"connectMissingData",2);var{ChartAxisDirection:_o,PolarAxis:lct,SeriesNodePickMode:Hz,valueProperty:Uz,fixNumericExtent:cct,seriesLabelFadeInAnimation:hct,markerFadeInAnimation:dct,resetMarkerFn:uct,animationValidation:pct,computeMarkerFocusBounds:gct,extent:fct,BBox:yct,Group:mct,Path:xct,PointerEvents:bct,Selection:Yz,Text:Sct,Marker:vct,mergeDefaults:Mct,getShapeStyle:Dct}=T,Act=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},nT=class extends T.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"angleValue",useLabelLayer:!0,pickModes:[Hz.NEAREST_NODE,Hz.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:uct},clipFocusBox:!1}),this.properties=new Cs,this.NodeEvent=Act,this.lineGroup=this.contentGroup.appendChild(new mct({name:"radar-line"})),this.lineSelection=Yz.select(this.lineGroup,xct),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}nodeFactory(){return new vct}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===_o.X)return e.getDomain(this,"angleValue","value",i);{const s=e.getDomain(this,"radiusValue","value",i),n=fct(s.length===0?s:[0].concat(s));return cct(n)}}async processData(t){if(!this.properties.isValid())return;const{angleKey:e,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(pct());const n=this.axes[_o.Y]?.scale.type,o=this.axes[_o.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[Uz(e,o,{id:"angleValue"}),Uz(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t===s.r&&e===s.cx&&i===s.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[_o.Y];return t instanceof lct?this.radius*t.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}createNodeData(){const{processedData:t,dataModel:e}=this;if(!t||!e||!this.properties.isValid())return;const{angleKey:i,radiusKey:s,angleName:n,radiusName:o,marker:a,label:r}=this.properties,l=this.axes[_o.X]?.scale,c=this.axes[_o.Y]?.scale;if(!l||!c)return;const h=e.resolveColumnById(this,"angleValue",t),d=e.resolveColumnById(this,"radiusValue",t),u=this.getAxisInnerRadius(),g=(t.dataSources.get(this.id)??[]).map((f,x)=>{const m=h[x],b=d[x],S=l.convert(m),M=this.radius+u-c.convert(b),D=Math.cos(S),C=Math.sin(S),k=D*M,I=C*M;let L;if(r.enabled){const N=this.getLabelText(r,{value:b,datum:f,angleKey:i,radiusKey:s,angleName:n,radiusName:o});if(N){let O="right";de(D,0)?O="center":D>0&&(O="left");let w="bottom";de(C,0)?w="middle":C>0&&(w="top"),L={x:k+D*a.size,y:I+C*a.size,text:N,textAlign:O,textBaseline:w}}}return{series:this,datum:f,datumIndex:x,index:x,point:{x:k,y:I,size:a.size},midPoint:{x:k,y:I},label:L,angleValue:m,radiusValue:b,missing:!Pt(S)||!Pt(M)}});return{itemId:s,nodeData:g,labelData:g}}update({seriesRect:t}){const e=this.checkResize(t),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const t=this.visible?[!0]:[];this.lineSelection.update(t)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=Yz.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(t){return t?.fill??this.properties.marker.fill}getDatumStylerProperties(t){const{id:e,properties:i}=this,{angleKey:s,radiusKey:n}=i;return{seriesId:e,datum:t,angleKey:s,radiusKey:n}}updateMarkers(t,e){const{visible:i}=this,{marker:s,stroke:n,strokeWidth:o,strokeOpacity:a,highlightStyle:r}=this.properties;let l=[];if(i&&s.shape&&s.enabled)if(e){const d=this.ctx.highlightManager?.getActiveHighlight();d?.datum&&(l=[d])}else l=this.nodeData;const c=Mct(e&&r.item,s.getStyle(),{stroke:n,strokeWidth:o,strokeOpacity:a}),h=this.getShapeFillBBox();t.update(l).each((d,u)=>{this.updateMarkerStyle(s,d,u.datum,u.point,this.getDatumStylerProperties(u),e,c,h)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h,marker:d}=o,u=n[_o.X],p=n[_o.Y];if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveColumnById(this,"angleValue",s)[t],x=i.resolveColumnById(this,"radiusValue",s)[t];if(f==null)return;const m=this.getMarkerStyle(d,g,this.getDatumStylerProperties(g),!1);return h.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(x)}]},{seriesId:e,datum:g,title:r,angleKey:a,radiusKey:l,angleName:r,radiusName:c,...m})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,marker:n}=this.properties;return{marker:Dct({shape:n.shape,enabled:n.enabled||e<=0,fill:this.getMarkerFill()??n.stroke??t??"rgba(0, 0, 0, 0)",stroke:n.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},n.fillGradientDefaults,n.fillPatternDefaults),line:{stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:s}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??n},symbol:this.legendItemSymbol(),hideInLegend:!a}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:s}=this,{x:n,y:o}=t,a=this.radius;if(Math.sqrt((n-i)**2+(o-s)**2)>a+this.properties.marker.size)return;let l=1/0,c;for(const h of e){const{point:{x:d=NaN,y:u=NaN}={}}=h;if(isNaN(d)||isNaN(u))continue;const p=Math.sqrt((t.x-d-i)**2+(t.y-u-s)**2);p<l&&(l=p,c=h)}if(c){const h=Math.max(l-(c.point?.size??0),0);return{datum:c,distance:h}}}computeLabelsBBox(){const{label:t}=this.properties;this.maybeRefreshNodeData();const e=[],i=new Sct;return this.nodeData.forEach(s=>{if(!t.enabled||!s.label)return;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(t),i.setAlign(s.label);const n=i.getBBox();e.push(n)}),e.length===0?null:yct.merge(e)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){const t=this.getLineNode();t&&(t.fill=void 0,t.lineJoin="round",t.lineCap="round",t.pointerEvents=bct.None,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset)}getLinePoints(){const{nodeData:t,resetInvalidToZero:e}=this,{connectMissingData:i}=this.properties;if(t.length===0)return[];const s=this.axes[_o.Y],o=this.axes[_o.X]?.isReversed(),r=s?.isReversed()&&!o?[...t].reverse():t,l=[];let c=!1,h;return r.forEach((d,u)=>{let{x:p,y:g}=d.point;const f=isNaN(p)||isNaN(g);f||(h??(h=d)),f&&!i&&(p=0,g=0);const x=u===0||!e&&!i&&(f||c);l.push({x:p,y:g,moveTo:x}),c=f}),h!==void 0&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(t,e,i){const{path:s}=t;s.clear(!0);const n=this.getAxisInnerRadius(),o=this.axes[_o.Y],r=o?.isReversed()?this.radius+n-o?.scale.convert(0):n;e.forEach(l=>{const{x:c,y:h,arc:d,radius:u=0,startAngle:p=0,endAngle:g=0,moveTo:f}=l,x=Math.atan2(h,c),m=r*Math.cos(x),b=r*Math.sin(x),S=i,M=m*(1-S)+c*S,D=b*(1-S)+h*S;d?s.arc(c,h,u,p,g):f?s.moveTo(M,D):s.lineTo(M,D)}),t.checkPathDirty()}animatePaths(t){const e=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,e,t)}animateEmptyUpdateReady(){const{itemSelection:t,labelSelection:e}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:s=>this.animatePaths(s),onStop:()=>this.animatePaths(1)}),dct(this,i,"added",t),hct(this,"labels",i,e)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t),this.resetPaths()}animateReadyResize(t){super.animateReadyResize(t),this.resetPaths()}resetPaths(){const t=this.getLineNode();if(t){const{path:e}=t,i=this.getLinePoints();t.fill=void 0,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,e.clear(!0);for(const{x:s,y:n,moveTo:o}of i)o?e.moveTo(s,n):e.lineTo(s,n);t.checkPathDirty()}}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{angleKey:e,radiusKey:i},!0)}computeFocusBounds(t){return gct(this,t)}};nT.className="RadarSeries";var{FillGradientDefaults:Ict,FillPatternDefaults:Tct,RATIO:kct,COLOR_STRING:Cct,TempValidate:Qb,OR:Lct,COLOR_GRADIENT:Nct,COLOR_PATTERN:wct,OBJECT:Kz}=T,Xg=class extends Cs{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new Ict,this.fillPatternDefaults=new Tct,this.fillOpacity=1}};y([Qb(Lct(Nct,wct,Cct))],Xg.prototype,"fill",2),y([Qb(Kz)],Xg.prototype,"fillGradientDefaults",2),y([Qb(Kz)],Xg.prototype,"fillPatternDefaults",2),y([Qb(kct)],Xg.prototype,"fillOpacity",2);var{Group:Oct,Path:Ect,PointerEvents:Rct,Selection:Pct,ChartAxisDirection:$z,applyShapeStyle:Bct,getShapeFill:zct,getShapeStyle:Fct}=T,qb=class extends nT{constructor(t){super(t),this.properties=new Xg,this.areaGroup=this.contentGroup.appendChild(new Oct({name:"radar-area"})),this.areaSelection=Pct.select(this.areaGroup,Ect),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const t=this.visible?[!0]:[];this.areaSelection.update(t),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(t){return t?.fill??this.properties.marker.fill??this.properties.fill}beforePathAnimation(){super.beforePathAnimation();const t=this.getAreaNode(),{fillOpacity:e,fill:i}=this.properties,s=Fct({fill:i,fillOpacity:e},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);Bct(t,s,void 0,this.getShapeFillBBox()),t.pointerEvents=Rct.None,t.stroke=void 0}animatePaths(t){super.animatePaths(t),this.animateSinglePath(this.getAreaNode(),this.getAreaPoints(),t)}getAreaPoints(){const t=this.getLinePoints(),e=a=>{const r=this.axes[a];return r instanceof T.PolarAxis?r:void 0},i=e($z.Y),s=e($z.X);if(!i?.isReversed())return t;const o=s?.getAxisLinePoints()?.points??[];return t.concat(...o)}resetPaths(){super.resetPaths();const t=this.getAreaNode();if(t){const{path:e}=t,i=this.getAreaPoints();t.fill=zct(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults),t.fillOpacity=this.properties.fillOpacity,t.stroke=void 0,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.lineJoin=t.lineCap="round",e.clear(!0),i.forEach(({x:s,y:n,moveTo:o,arc:a,radius:r=0,startAngle:l=0,endAngle:c=0})=>{a?e.arc(s,n,r,l,c):o?e.moveTo(s,n):e.lineTo(s,n)}),e.closePath(),t.checkPathDirty()}}};qb.className="RadarAreaSeries",qb.type="radar-area";var{commonSeriesOptionsDefs:_ct,seriesLabelOptionsDefs:Gct,markerOptionsDefs:Vct,tooltipOptionsDefs:jct}=T,Wct={type:K(Ct("radar-area")),angleKey:K(E),radiusKey:K(E),angleName:E,radiusName:E,connectMissingData:j,marker:Vct,label:Gct,tooltip:jct,..._ct,...St,...rt,...Ot},{ThemeConstants:{POLAR_AXIS_TYPE:Xz}}=T,Hct={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:t=>new qb(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Xz.ANGLE_CATEGORY},{type:Xz.RADIUS_NUMBER}],themeTemplate:qlt},Uct={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:Wct,create:t=>new qb(t)},Jb=class extends nT{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};Jb.className="RadarLineSeries",Jb.type="radar-line";var{commonSeriesOptionsDefs:Yct,seriesLabelOptionsDefs:Kct,markerOptionsDefs:$ct,tooltipOptionsDefs:Xct}=T,Zct={type:K(Ct("radar-line")),angleKey:K(E),radiusKey:K(E),angleName:E,radiusName:E,connectMissingData:j,marker:$ct,label:Kct,tooltip:Xct,...Yct,...rt,...Ot},{POLAR_AXIS_TYPE:Zz}=T.ThemeConstants,Qct={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:t=>new Jb(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Zz.ANGLE_CATEGORY},{type:Zz.RADIUS_NUMBER}],themeTemplate:Qlt},qct={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:Zct,create:t=>new Jb(t)},{SeriesProperties:Jct,FillGradientDefaults:tht,FillPatternDefaults:eht,SeriesTooltip:iht,TempValidate:Di,COLOR_STRING:Qz,NUMBER:qz,FUNCTION:sht,LINE_DASH:nht,OBJECT:tS,POSITIVE_NUMBER:oT,RATIO:Jz,STRING:Zg,Label:oht,COLOR_GRADIENT:aht,COLOR_PATTERN:rht,OR:lht}=T,gi=class extends Jct{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new tht,this.fillPatternDefaults=new eht,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new oht,this.tooltip=new iht}};y([Di(Zg)],gi.prototype,"angleKey",2),y([Di(Zg)],gi.prototype,"radiusKey",2),y([Di(Zg,{optional:!0})],gi.prototype,"angleName",2),y([Di(Zg,{optional:!0})],gi.prototype,"radiusName",2),y([Di(lht(aht,rht,Qz))],gi.prototype,"fill",2),y([Di(tS)],gi.prototype,"fillGradientDefaults",2),y([Di(tS)],gi.prototype,"fillPatternDefaults",2),y([Di(Jz)],gi.prototype,"fillOpacity",2),y([Di(Qz)],gi.prototype,"stroke",2),y([Di(oT)],gi.prototype,"strokeWidth",2),y([Di(Jz)],gi.prototype,"strokeOpacity",2),y([Di(nht)],gi.prototype,"lineDash",2),y([Di(oT)],gi.prototype,"lineDashOffset",2),y([Di(oT)],gi.prototype,"cornerRadius",2),y([Di(sht,{optional:!0})],gi.prototype,"itemStyler",2),y([Di(qz)],gi.prototype,"rotation",2),y([Di(Zg,{optional:!0})],gi.prototype,"stackGroup",2),y([Di(qz,{optional:!0})],gi.prototype,"normalizedTo",2),y([Di(tS)],gi.prototype,"label",2),y([Di(tS)],gi.prototype,"tooltip",2);var{SectorBox:tF,motion:cht}=T;function hht(t,e,i){if(i==="updated"){if(t.previousDatum==null||isNaN(t.previousDatum.innerRadius)||isNaN(t.previousDatum.outerRadius))return"added";if(isNaN(e.innerRadius)||isNaN(e.outerRadius))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function eF(t){return{toFn:(s,n,o)=>{let a,r,l,c,h;return o==="removed"?(a=t,r=t,l=n.innerRadius,c=n.outerRadius,h=new tF(a,r,l,c)):(a=n.startAngle,r=n.endAngle,l=isNaN(n.innerRadius)?s.innerRadius:n.innerRadius,c=isNaN(n.outerRadius)?s.outerRadius:n.outerRadius,h=n.clipSector),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,n,o)=>{o=hht(s,n,o);let a,r,l,c,h;o==="removed"||o==="updated"?(a=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(a=t,r=t,l=n.innerRadius,c=n.outerRadius),h??(h=new tF(a,r,l,c));const d=cht.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function dht(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{ChartAxisDirection:La,PolarAxis:uht,diff:pht,groupAccumulativeValueProperty:iF,keyProperty:ght,normaliseGroupTo:fht,valueProperty:yht,fixNumericExtent:mht,resetLabelFn:xht,seriesLabelFadeInAnimation:bht,seriesLabelFadeOutAnimation:Sht,animationValidation:vht,angleBetween:Mht,createDatumId:sF,CategoryScale:Dht,Sector:Aht,SectorBox:Iht,motion:nF,isGradientFill:Tht,applyShapeStyle:kht,getShapeStyle:aT}=T,Cht=class extends T.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},eS=class extends T.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"radiusValue",useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:dht,label:xht}}),this.properties=new gi,this.NodeEvent=Cht,this.groupScale=new Dht,this.circleCache={r:0,cx:0,cy:0}}get defaultShapeStyle(){const t=this.axes[La.X]?.scale;return{...this.properties.fillGradientDefaults.toJson(),rotation:T.toDegrees(t.range[0])+90}}nodeFactory(){return new Aht}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===La.X){const s=e.getDomain(this,"angleValue-end","value",i),n=[s[0]>0?0:s[0],s[1]<0?0:s[1]];return mht(n)}else return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const o=this.getStackId(),a=`${o}-trailing`,r=[];$e(s)&&r.push(fht([o,a],Math.abs(s))),n&&(this.processedData&&r.push(pht(this.id,this.processedData)),r.push(vht()));const l=this.visible?{}:{forceValue:0},c=this.axes[La.Y]?.scale.type,h=this.axes[La.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[ght(i,c,{id:"radiusValue"}),yht(e,h,{id:"angleValue-raw",invalidValue:null,...l}),...iF(e,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},h),...iF(e,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t===s.r&&e===s.cx&&i===s.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[La.Y];return t instanceof uht?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e}=this;if(!e||!t||t.type!=="grouped"||!this.properties.isValid())return;const i=this.axes[La.X],s=this.axes[La.Y],n=i?.scale,o=s?.scale;if(!n||!o)return;const a=e.resolveKeysById(this,"radiusValue",t),r=e.resolveColumnById(this,"angleValue-start",t),l=e.resolveColumnById(this,"angleValue-end",t),c=e.resolveColumnById(this,"angleValue-raw",t),h=e.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof cl&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((B,P)=>String(P)),u.range=[0,Math.abs(o.bandwidth??0)],u.paddingInner=g>1?d:0;const f=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,x=i.isReversed(),m=s.isReversed(),b=m?this.radius:this.getAxisInnerRadius(),M=(m?this.getAxisInnerRadius():this.radius)+b,{angleKey:D,radiusKey:C,angleName:k,radiusName:I,label:L}=this.properties,N=(B,P,V,W)=>{const F=this.getLabelText(L,{value:P,datum:B,angleKey:D,radiusKey:C,angleName:k,radiusName:I});if(F)return{x:V,y:W,text:F,textAlign:"center",textBaseline:"middle"}},O=[],w={itemId:C,nodeData:O,labelData:O};if(!this.visible)return w;const{dataSources:R}=t,G=R.get(this.id)??[];for(const{datumIndex:B,group:P}of e.forEachGroupDatum(this,t)){const V=G[B],W=a[B];if(W==null)return;const F=c[B],_=r[B],z=l[B],U=F>=0&&!Object.is(F,-0),Y=P.aggregation[h][U?1:0],Z=U===x;let q=n.convert(_,!0),Q=n.convert(z,!0),tt=n.convert(0,!0),X=n.convert(Y,!0);Z&&([tt,X]=[X,tt],[q,Q]=[Q,q]);const nt=M-o.convert(W)+u.convert(String(p)),ht=nt+f,lt=(nt+ht)/2,vt=q+Mht(q,Q)/2,At=Math.cos(vt)*lt,ut=Math.sin(vt)*lt,Kt=this.properties.label.enabled?N(V,F,At,ut):void 0,Xt=new Iht(q,Q,nt,ht);O.push({series:this,datum:V,datumIndex:B,point:{x:At,y:ut,size:0},midPoint:{x:At,y:ut},label:Kt,angleValue:F,radiusValue:W,innerRadius:nt,outerRadius:ht,startAngle:tt,endAngle:X,clipSector:Xt,reversed:Z,index:B})}return w}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return aT({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},this.defaultShapeStyle,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{angleKey:a,radiusKey:r,itemStyler:l}=o;let c;return l!=null&&(c=this.cachedDatumCallback(sF(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:e,highlighted:s,angleKey:a,radiusKey:r,...i}))),aT(c,this.defaultShapeStyle,this.properties.fillPatternDefaults)}updateSectorSelection(t,e){let i=[];if(e){const o=this.ctx.highlightManager?.getActiveHighlight();o?.datum&&o.series===this&&i.push(o)}else i=this.nodeData;const s=this.getItemBaseStyle(e),n=this.getShapeFillBBox();t.update(i,void 0,o=>this.getDatumId(o)).each((o,a)=>{const{datum:r,datumIndex:l}=a,c=this.getItemStyleOverrides(String(l),r,s,e),h=c?.cornerRadius??s.cornerRadius,d=c?.fill??s.fill,u=T.isGradientFill(d)&&d.bounds!=="item"?{centerX:0,centerY:0}:void 0;kht(o,s,c,n,u),o.lineJoin="round",o.inset=o.stroke!=null?o.strokeWidth/2:0,o.startInnerCornerRadius=r.reversed?h:0,o.startOuterCornerRadius=r.reversed?h:0,o.endInnerCornerRadius=r.reversed?0:h,o.endOuterCornerRadius=r.reversed?0:h,e&&(o.startAngle=a.startAngle,o.endAngle=a.endAngle,o.clipSector=a.clipSector,o.innerRadius=a.innerRadius,o.outerRadius=a.outerRadius)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getBarTransitionFunctions(){const t=this.axes[La.X]?.scale;let e=0;if(!t)return eF(e);const i=Math.min(t.domain[0],t.domain[1]),s=Math.max(t.domain[0],t.domain[1]);return i<=0&&s>=0&&(e=t.convert(0)),eF(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();nF.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),bht(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();nF.fromToMotion(this.id,"datums",e,[t],i),Sht(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=o,d=n[La.X],u=n[La.Y];if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveKeysById(this,"radiusValue",s)[t],f=i.resolveColumnById(this,"angleValue-raw",s)[t];if(g==null)return;const x=this.getItemBaseStyle(!1);return Object.assign(x,this.getItemStyleOverrides(String(t),t,x,!1)),h.formatTooltip(this.properties,{heading:u.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:a,value:d.formatDatum(f)}]},{seriesId:e,datum:p,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...x})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillPatternDefaults:r}=this.properties,l=aT({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a},this.defaultShapeStyle,r);return Tht(l.fill)&&(l.fill={...l.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:l}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{angleKey:s,angleName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}getDatumId(t){return sF(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};eS.className="RadialBarSeries",eS.type="radial-bar";var{commonSeriesOptionsDefs:Lht,seriesLabelOptionsDefs:Nht,tooltipOptionsDefs:wht}=T,Oht={type:K(Ct("radial-bar")),angleKey:K(E),radiusKey:K(E),angleName:E,radiusName:E,grouped:j,stacked:j,stackGroup:E,normalizedTo:J,cornerRadius:H,itemStyler:bt,label:Nht,tooltip:wht,...Lht,...St,...rt,...Ot},{ThemeConstants:{POLAR_AXIS_TYPE:Eht}}=T,Rht={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[Eht.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:oF}=T.ThemeConstants,Pht={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:t=>new eS(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:oF.ANGLE_NUMBER},{type:oF.RADIUS_CATEGORY}],themeTemplate:Rht,stackable:!0,groupable:!0},Bht={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:Oht,create:t=>new eS(t)},{TempValidate:aF,RATIO:rF}=T,rT=class extends ii{};y([aF(rF,{optional:!0})],rT.prototype,"columnWidthRatio",2),y([aF(rF,{optional:!0})],rT.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:zht,PolarAxis:Fht,RadialColumnShape:_ht,getRadialColumnWidth:Ght}=T,iS=class extends Dz{constructor(t){super(t,{animationResetFns:{item:ilt}}),this.properties=new rT}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new _ht}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return elt(t)}isRadiusAxisCircle(){const t=this.axes[zht.Y];return t instanceof Fht?t.shape==="circle":!1}updateItemPath(t,e,i){t.isBeveled=this.isRadiusAxisCircle(),t.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.columnWidth=e.columnWidth,t.axisInnerRadius=e.axisInnerRadius,t.axisOuterRadius=e.axisOuterRadius)}getColumnWidth(t,e){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return Ght(t,e,this.radius,i,s)}};iS.className="RadialColumnSeries",iS.type="radial-column";var{commonSeriesOptionsDefs:Vht,seriesLabelOptionsDefs:jht,tooltipOptionsDefs:Wht}=T,Hht={type:K(Ct("radial-column")),angleKey:K(E),radiusKey:K(E),angleName:E,radiusName:E,grouped:j,stacked:j,stackGroup:E,normalizedTo:J,cornerRadius:H,columnWidthRatio:Tt,maxColumnWidthRatio:Tt,itemStyler:bt,label:jht,tooltip:Wht,...Vht,...St,...rt,...Ot},{ThemeConstants:{POLAR_AXIS_TYPE:lF,POLAR_AXIS_SHAPE:Uht}}=T,cF={$path:["./shape",Uht.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},Yht={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[lF.ANGLE_CATEGORY]:{shape:cF,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[lF.RADIUS_NUMBER]:{shape:cF,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:hF}=T.ThemeConstants,Kht={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:t=>new iS(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:hF.ANGLE_CATEGORY},{type:hF.RADIUS_NUMBER}],themeTemplate:Yht,stackable:!0,groupable:!0},$ht={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:Hht,create:t=>new iS(t)},{SvgPath:Xht,Rotatable:Zht,Translatable:Qht,Scalable:qht}=T,lT=class extends Zht(qht(Qht(Xht))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};lT.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{BaseProperties:Qg,SeriesTooltip:Jht,SeriesProperties:tdt,PropertiesArray:cT,AxisLabel:edt,TempValidate:ct,BOOLEAN:dF,COLOR_STRING:Cr,COLOR_STRING_ARRAY:idt,FUNCTION:sdt,LINE_DASH:sS,NUMBER:on,NUMBER_ARRAY:ndt,OBJECT_ARRAY:hT,OBJECT:Go,POSITIVE_NUMBER:ao,RATIO:Vo,STRING:dT,UNION:odt,AND:uF,LESS_THAN:adt,GREATER_THAN:rdt,Label:ldt}=T,cdt=odt(["inside","outside","middle"],"a placement"),pF=class extends ldt{};y([ct(on,{optional:!0})],pF.prototype,"spacing",2);var us=class extends Qg{constructor(){super(...arguments),this.label=new pF}};y([ct(dT,{optional:!0})],us.prototype,"text",2),y([ct(on,{optional:!0})],us.prototype,"value",2),y([ct(IB,{optional:!0})],us.prototype,"shape",2),y([ct(cdt,{optional:!0})],us.prototype,"placement",2),y([ct(on,{optional:!0})],us.prototype,"spacing",2),y([ct(ao,{optional:!0})],us.prototype,"size",2),y([ct(on,{optional:!0})],us.prototype,"rotation",2),y([ct(Cr,{optional:!0})],us.prototype,"fill",2),y([ct(Vo,{optional:!0})],us.prototype,"fillOpacity",2),y([ct(Cr,{optional:!0})],us.prototype,"stroke",2),y([ct(ao,{optional:!0})],us.prototype,"strokeWidth",2),y([ct(Vo,{optional:!0})],us.prototype,"strokeOpacity",2),y([ct(sS,{optional:!0})],us.prototype,"lineDash",2),y([ct(ao,{optional:!0})],us.prototype,"lineDashOffset",2),y([ct(Go)],us.prototype,"label",2);var jo=class extends Qg{constructor(){super(...arguments),this.enabled=!0,this.fills=new cT(T.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([ct(dF)],jo.prototype,"enabled",2),y([ct(hT)],jo.prototype,"fills",2),y([ct(Mb)],jo.prototype,"fillMode",2),y([ct(Cr,{optional:!0})],jo.prototype,"fill",2),y([ct(Vo)],jo.prototype,"fillOpacity",2),y([ct(Cr,{optional:!0})],jo.prototype,"stroke",2),y([ct(ao,{optional:!0})],jo.prototype,"strokeWidth",2),y([ct(Vo)],jo.prototype,"strokeOpacity",2),y([ct(sS)],jo.prototype,"lineDash",2),y([ct(ao)],jo.prototype,"lineDashOffset",2);var qg=class extends Qg{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};y([ct(ndt,{optional:!0})],qg.prototype,"values",2),y([ct(on,{optional:!0})],qg.prototype,"step",2),y([ct(on)],qg.prototype,"minSpacing",2),y([ct(on)],qg.prototype,"maxSpacing",2);var hdt=class extends edt{},js=class extends Qg{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new cT(T.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new qg,this.label=new hdt}};y([ct(uF(on,adt("max")))],js.prototype,"min",2),y([ct(uF(on,rdt("min")))],js.prototype,"max",2),y([ct(hT)],js.prototype,"fills",2),y([ct(Mb)],js.prototype,"fillMode",2),y([ct(Cr,{optional:!0})],js.prototype,"fill",2),y([ct(Vo)],js.prototype,"fillOpacity",2),y([ct(Cr)],js.prototype,"stroke",2),y([ct(ao)],js.prototype,"strokeWidth",2),y([ct(Vo)],js.prototype,"strokeOpacity",2),y([ct(sS)],js.prototype,"lineDash",2),y([ct(ao)],js.prototype,"lineDashOffset",2),y([ct(Cr)],js.prototype,"defaultFill",2),y([ct(Go)],js.prototype,"interval",2),y([ct(Go)],js.prototype,"label",2);var Wo=class extends Qg{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([ct(dF)],Wo.prototype,"enabled",2),y([ct(Vo,{optional:!0})],Wo.prototype,"radiusRatio",2),y([ct(on)],Wo.prototype,"spacing",2),y([ct(Cr)],Wo.prototype,"fill",2),y([ct(Vo)],Wo.prototype,"fillOpacity",2),y([ct(Cr)],Wo.prototype,"stroke",2),y([ct(ao)],Wo.prototype,"strokeWidth",2),y([ct(Vo)],Wo.prototype,"strokeOpacity",2),y([ct(sS)],Wo.prototype,"lineDash",2),y([ct(ao)],Wo.prototype,"lineDashOffset",2);var gF=class extends Aa{};y([ct(dT,{optional:!0})],gF.prototype,"text",2);var fF=class extends Og{};y([ct(dT,{optional:!0})],fF.prototype,"text",2);var ni=class extends tdt{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new jg,this.defaultColorRange=[],this.targets=new cT(us),this.defaultTarget=new us,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new js,this.bar=new jo,this.needle=new Wo,this.label=new gF,this.secondaryLabel=new fF,this.tooltip=new Jht}isValid(t){if(!super.isValid(t))return!1;const{outerRadius:e,innerRadius:i}=this;return e==null!=(i==null)?($.warnOnce("Either [innerRadius] and [outerRadius] must both be set, or neither can be set."),!1):!0}};y([ct(on)],ni.prototype,"value",2),y([ct(on)],ni.prototype,"startAngle",2),y([ct(on)],ni.prototype,"endAngle",2),y([ct(Go)],ni.prototype,"segmentation",2),y([ct(idt)],ni.prototype,"defaultColorRange",2),y([ct(hT)],ni.prototype,"targets",2),y([ct(Go)],ni.prototype,"defaultTarget",2),y([ct(Vo)],ni.prototype,"outerRadiusRatio",2),y([ct(Vo)],ni.prototype,"innerRadiusRatio",2),y([ct(ao,{optional:!0})],ni.prototype,"outerRadius",2),y([ct(ao,{optional:!0})],ni.prototype,"innerRadius",2),y([ct(ao)],ni.prototype,"cornerRadius",2),y([ct(TB)],ni.prototype,"cornerMode",2),y([ct(on)],ni.prototype,"spacing",2),y([ct(Go)],ni.prototype,"scale",2),y([ct(Go)],ni.prototype,"bar",2),y([ct(Go)],ni.prototype,"needle",2),y([ct(sdt,{optional:!0})],ni.prototype,"itemStyler",2),y([ct(Go)],ni.prototype,"label",2),y([ct(Go)],ni.prototype,"secondaryLabel",2),y([ct(Go)],ni.prototype,"tooltip",2);var{SectorBox:uT}=T;function ddt(t){const{startAngle:e,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:o,outerRadius:a}=t;if(!(s==null||n==null))return new uT(Math.max(s,e),Math.min(n,i),o,a)}function yF(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function pT(t){return t.clipStartAngle!=null&&t.clipEndAngle!=null}function gT(t,e){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:o}=t;return new uT(i,e?i:s,n,o)}function mF(t,e){const i=t?"initial":"update";return{node:{fromFn(o,a){const r=o.previousDatum;let{startAngle:l,endAngle:c}=r??a;const h=r!=null&&pT(r)?gT(r,t):void 0,d=pT(a)?gT(a,t):void 0;let u;return h!=null&&d!=null?u=h:h==null&&d!=null?(u=d,l=a.startAngle,c=a.endAngle):h!=null&&d==null?(u=void 0,l=a.startAngle,c=a.endAngle):t&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(o,a){const{startAngle:r,endAngle:l}=a;let c;return pT(a)&&(c=gT(a,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(o,a){const{startAngle:r,endAngle:l}=a;let{clipSector:c}=a;c!=null&&(c=new uT(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||yF(r,l,c);o.startAngle=r,o.endAngle=l,o.clipSector=c,o.visible=h}},needle:{fromFn(o){let{angle:a}=o.previousDatum??o.datum;return t&&(a=e),{rotation:a,phase:i}},toFn(o,a){const{angle:r}=a;return{rotation:r}}}}}function fT(t,e){const{startAngle:i,endAngle:s}=e,n=ddt(e),o=n==null||yF(i,s,n);return{startAngle:i,endAngle:s,clipSector:n,visible:o}}function xF(t,e){const{angle:i}=e;return{rotation:i}}var udt={top:0,middle:.5,bottom:1};function pdt(t,e,i,s,n){const{padding:o,textAlign:a,verticalAlign:r}=i;let l,c;if(e.each((M,D)=>{D.label==="primary"?l=D:D.label==="secondary"&&(c=D)}),l==null)return;const h=Vg(t,l,n?.label);if(h==null)return;const d=c!=null?Vg(t,c,n?.secondaryLabel):void 0,u={padding:o},p=a==="center"?2:1,g=r==="middle"?2:1,f=M=>({width:Math.sqrt(Math.max(s**2-(M/g)**2,0))*p,height:Math.min(M,g*s),meta:null});let x,m,b;if(c!=null&&d!=null){const M=R1(h,l,d,c,u,f);x=M?.label,m=M?.secondaryLabel,b=M?.height??0}else{const M=Ng(h,l,u,f);x=M?.[0],m=void 0,b=M?.[0].height??0}const S=b*udt[r];e.each((M,D)=>{let C;if(D.label==="primary"?C=x:D.label==="secondary"&&(C=m),C==null){M.visible=!1;return}M.visible=!0,M.text=C.text,M.fontSize=C.fontSize,M.lineHeight=C.lineHeight,M.textAlign=a,M.textBaseline="middle";const k=D.label==="primary"?C.height/2:b-C.height/2;M.y=D.centerY+k-S,M.x=D.centerX})}var{fromToMotion:Jg,resetMotion:bF,CachedTextMeasurerPool:gdt,SeriesNodePickMode:SF,StateMachine:fdt,createDatumId:yT,normalizeAngle360:vF,normalizeAngle360Inclusive:mT,isBetweenAngles:nS,sectorBox:ydt,toDegrees:mdt,toRadians:oS,BBox:xdt,Group:Fl,PointerEvents:aS,Selection:_l,Sector:bdt,SectorBox:Sdt,Text:MF,Marker:vdt,getColorStops:Mdt}=T,Ddt={inside:90,middle:0,outside:-90},Adt=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],Idt=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],rS=class extends T.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[SF.EXACT_SHAPE_MATCH,SF.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new ni,this.scale=new HO,this.scaleGroup=this.contentGroup.appendChild(new Fl({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Fl({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Fl({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Fl({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Fl({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Fl({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Fl({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Fl({name:"tickGroup"})),this.scaleSelection=_l.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=_l.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=_l.select(this.itemNeedleGroup,lT),this.targetSelection=_l.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=_l.select(this.itemTargetLabelGroup,MF),this.labelSelection=_l.select(this.itemLabelGroup,MF),this.highlightTargetSelection=_l.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=_l.select(this.tickGroup,T.TransformableText),this.datumUnion=new bB,this.animationState=new fdt("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=aS.None,this.tickGroup.pointerEvents=aS.None,this.itemNeedleGroup.pointerEvents=aS.None,this.itemLabelGroup.pointerEvents=aS.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new bdt}markerFactory(){const t=new vdt;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{min:e,max:i}=this.properties.scale;return vB(t,{min:e,max:i})}layoutScale(){const{scale:t,properties:e}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:n,outerRadius:o}=this.properties,{min:a,max:r,label:l,interval:c}=n,h=oS(e.startAngle-90),d=oS(e.endAngle-90),p=mT(d-h)>Math.PI,g=p||nS(1.5*Math.PI,h,d),f=p||nS(0*Math.PI,h,d),x=p||nS(.5*Math.PI,h,d),m=p||nS(1*Math.PI,h,d);let b;m&&!f?b="right":!m&&f?b="left":b="center";let S;g&&!x?S="bottom":!g&&x?S="top":S="middle";const M=ydt({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),D=-(M.x+M.width/2)*2,C=-(M.y+M.height/2)*2,k=Math.min(i/M.width,s/M.height);t.domain=[a,r],t.range=[h,d],t.arcLength=k/2;const{maxSpacing:I,minSpacing:L}=c,{arcLength:N}=t,O=I?Math.floor(N/I):1,w=L?Math.floor(N/L):1/0,R=Math.floor(4/Math.PI*Math.abs(t.range[0]-t.range[1])),G=Math.max(O,Math.min(w,R)),B=c.values??t.ticks({nice:!1,interval:c.step,minTickCount:O,maxTickCount:w,tickCount:G}),P=B.reduce((q,Q)=>Math.max(q,typeof Q=="number"?Au(Q):0),0),V=t.tickFormatter({domain:t.domain,ticks:B,fractionDigits:P,specifier:l.format}),W=l.getFont(),F=B.map((q,Q)=>{const tt=l.formatter?.({value:q,index:Q,domain:t.domain,boundSeries:void 0})??V(q),{width:X,height:it}=gdt.measureText(tt,{font:W});return{index:Q,value:q,text:tt,width:X,height:it}}),_=F.reduce((q,Q)=>Math.max(q,Q.width),0),z=F.reduce((q,Q)=>Math.max(q,Q.height),0),U=l.enabled?Math.max(_,z)+l.spacing:0,Y=Math.max(.5*k-U,0),Z=o??Y;return this.centerX=i/2+D*Z,this.centerY=s/2+C*Z,this.radius=Z,this.textAlign=b,this.verticalAlign=S,F}createConicGradient(t,e){const{scale:i}=this,{domain:s,range:n}=i,[o,a]=n,{defaultColorRange:r}=this.properties,l=vF((o+a)/2+Math.PI),c=mT(a-o);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:Mdt(t,r,s,e).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(o+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),rotation:mdt(l)+90}}getShapeFillBBox(){const{centerX:t,centerY:e,radius:i}=this;return new xdt(t-i,e-i,2*i,2*i)}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:s=e.text,value:n=e.value??0,shape:o=e.shape??"triangle",rotation:a=e.rotation??0,strokeWidth:r=e.strokeWidth??0,placement:l=e.placement??"middle",spacing:c=e.spacing??0,size:h=e.size??0,fill:d=e.fill??"black",fillOpacity:u=e.fillOpacity??1,stroke:p=e.stroke??"black",strokeOpacity:g=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:x=e.lineDashOffset??0}=i,{enabled:m=e.label.enabled,color:b=e.label.color??"black",fontStyle:S=e.label.fontStyle??"normal",fontWeight:M=e.label.fontWeight??"normal",fontSize:D=e.label.fontSize,fontFamily:C=e.label.fontFamily,spacing:k=e.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:l,spacing:c,size:h,rotation:a,fill:d,fillOpacity:u,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:x,label:{enabled:m,color:b,fontStyle:S,fontWeight:M,fontSize:D,fontFamily:C,spacing:k}}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:o,spacing:a,size:r}=t,l=e*n,c=e*s;switch(o){case"inside":return Math.max(c-a-r/2,0);case"outside":return l+a+r/2;default:return(c+l)/2}}getTargetLabel(t){const{scale:e}=this,{value:i,size:s,placement:n,label:o}=t,{spacing:a,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=o,u=void 0,p=e.convert(i),g=vF(p)/(Math.PI/2)|0,f=s/2+a;let x,m,b,S;switch(n){case"outside":({textAlign:x,textBaseline:m}=Adt[g]),b=f*Math.cos(p),S=f*Math.sin(p);break;case"inside":({textAlign:x,textBaseline:m}=Idt[g]),b=-f*Math.cos(p),S=-f*Math.sin(p);break;default:x="center",m="bottom",b=0,S=-f;break}return{offsetX:b,offsetY:S,fill:r,textAlign:x,textBaseline:m,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:u}}createNodeData(){if(!this.properties.isValid())return;const t=this.layoutScale(),{id:e,scale:i,properties:s,radius:n,centerX:o,centerY:a}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:g,scale:f,label:x,secondaryLabel:m}=s,{outerRadius:b=n*c,innerRadius:S=n*l}=s,M=this.getTargets(),D=[],C=[],k=[],I=[],L=[],N=u==="item",O=i.convert(i.domain[0]),w=i.convert(r),R=Math.ceil(mT(w-O)*n);let G=h.enabled?h.interval.getSegments(i,R):void 0;const B=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",P=f.fill??(g.enabled&&f.fills.length===0?f.defaultFill:void 0)??this.createConicGradient(f.fills,f.fillMode);if(G==null&&N){const V=Math.min(...i.domain),W=Math.max(...i.domain),F={value:r,segmentStart:V,segmentEnd:W},z=Math.min(d,(b-S)/2)/((S+b)/2);D.push({series:this,itemId:"value",datum:F,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:S,startAngle:O-z,endAngle:w+z,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:B}),L.push({series:this,itemId:"scale",datum:F,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:S,startAngle:i.range[0]-z,endAngle:i.range[1]+z,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:P})}else{G??(G=i.domain);for(let V=0;V<G.length-1;V++){const W=G[V],F=G[V+1],_={value:r,segmentStart:W,segmentEnd:F},z=V===0,U=V===G.length-2,Y=i.convert(W),Z=i.convert(F);D.push({series:this,itemId:`value-${V}`,datum:_,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:S,startAngle:Y,endAngle:Z,clipStartAngle:O,clipEndAngle:w,startCornerRadius:N||z?d:0,endCornerRadius:N||U?d:0,fill:B}),L.push({series:this,itemId:`scale-${V}`,datum:_,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:S,startAngle:Y,endAngle:Z,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:N||z?d:0,endCornerRadius:N||U?d:0,fill:P})}}if(!p.enabled&&x.enabled){const{text:V,color:W,fontSize:F,minimumFontSize:_,fontStyle:z,fontWeight:U,fontFamily:Y,lineHeight:Z,formatter:q=Q=>this.formatLabel(Q.value)}=x;I.push({label:"primary",centerX:o,centerY:a,text:V,value:r,fill:W,fontSize:F,minimumFontSize:_,fontStyle:z,fontWeight:U,fontFamily:Y,lineHeight:Z,formatter:q})}if(!p.enabled&&m.enabled){const{text:V,color:W,fontSize:F,minimumFontSize:_,fontStyle:z,fontWeight:U,fontFamily:Y,lineHeight:Z,formatter:q}=m;I.push({label:"secondary",centerX:o,centerY:a,text:V,value:r,fill:W,fontSize:F,minimumFontSize:_,fontStyle:z,fontWeight:U,fontFamily:Y,lineHeight:Z,formatter:q})}if(p.enabled){let V=p.radiusRatio!=null?n*p.radiusRatio:S;V=Math.max(V-p.spacing,0);const W=i.convert(r);k.push({centerX:o,centerY:a,radius:V,angle:W,series:this})}for(let V=0;V<M.length;V+=1){const W=M[V],{value:F,text:_,size:z,shape:U,fill:Y,fillOpacity:Z,stroke:q,strokeWidth:Q,strokeOpacity:tt,lineDash:X,lineDashOffset:it}=W;if(F<Math.min(...i.domain)||F>Math.max(...i.domain))continue;const nt=this.getTargetRadius(W),ht=i.convert(F),lt=oS(W.rotation+Ddt[W.placement]);C.push({series:this,itemId:`target-${V}`,midPoint:{x:nt*Math.cos(ht)+o,y:nt*Math.sin(ht)+a},datum:{value:F},datumIndex:{type:1,index:V},type:1,value:F,text:_,centerX:o,centerY:a,shape:U,radius:nt,angle:ht,rotation:lt,size:z,fill:Y,fillOpacity:Z,stroke:q,strokeOpacity:tt,strokeWidth:Q,lineDash:X,lineDashOffset:it,label:this.getTargetLabel(W)})}return{itemId:e,nodeData:D,needleData:k,targetData:C,labelData:I,scaleData:L,tickData:t}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(t!=null&&t.series===this&&t.type===1)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,needleSelection:s,targetSelection:n,targetLabelSelection:o,scaleSelection:a,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(t);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],f=this.contextNodeData?.tickData??[],x=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:o}),this.updateTargetLabelNodes({targetLabelSelection:o}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:x!=null?[x]:[],targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:f,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>yT(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:s}=this,{bar:n,segmentation:o}=s,a=o.spacing??0,{fillOpacity:r,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=n,u=this.getStrokeWidth(n.strokeWidth),p=i.animationManager.isSkipped(),g=this.getShapeFillBBox();e.each((f,x)=>{const{centerX:m,centerY:b,innerRadius:S,outerRadius:M,startCornerRadius:D,endCornerRadius:C,fill:k}=x;f.centerX=m,f.centerY=b,f.innerRadius=S,f.outerRadius=M,f.pointerEvents=this.properties.bar.enabled?T.PointerEvents.All:T.PointerEvents.None,f.fill=k,f.fillBBox=g,f.fillOpacity=r,f.stroke=l,f.strokeOpacity=c,f.strokeWidth=u,f.lineDash=h,f.lineDashOffset=d,f.startOuterCornerRadius=D,f.startInnerCornerRadius=D,f.endOuterCornerRadius=C,f.endInnerCornerRadius=C,f.radialEdgeInset=(a+f.strokeWidth)/2,f.concentricEdgeInset=f.strokeWidth/2,(p||f.previousDatum==null)&&f.setProperties(fT(f,x))}),this.datumUnion.update(e,this.itemGroup,T.Sector,(f,x,m)=>{f.clipSector??(f.clipSector=new Sdt(NaN,NaN,NaN,NaN)),f.centerX=x.centerX,f.centerY=x.centerY,f.outerRadius=f.clipSector.outerRadius=x.outerRadius,f.innerRadius=f.clipSector.innerRadius=x.innerRadius,f.startAngle=f.clipSector.startAngle=x.startAngle,f.startInnerCornerRadius=x.startInnerCornerRadius,f.startOuterCornerRadius=x.startOuterCornerRadius,f.endAngle=m.endAngle,f.clipSector.endAngle=m.clipSector?.endAngle??m.endAngle,f.endInnerCornerRadius=m.endInnerCornerRadius,f.endOuterCornerRadius=m.endOuterCornerRadius,f.pointerEvents=T.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>yT(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i,segmentation:s}=this.properties,n=s.spacing??0,{fillOpacity:o,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=i,d=this.getShapeFillBBox();e.each((u,p)=>{const{centerX:g,centerY:f,innerRadius:x,outerRadius:m,startCornerRadius:b,endCornerRadius:S,fill:M}=p;u.centerX=g,u.centerY=f,u.innerRadius=x,u.outerRadius=m,u.fill=M,u.fillBBox=d,u.fillOpacity=o,u.stroke=a,u.strokeOpacity=r,u.strokeWidth=l,u.lineDash=c,u.lineDashOffset=h,u.startOuterCornerRadius=b,u.startInnerCornerRadius=b,u.endOuterCornerRadius=S,u.endInnerCornerRadius=S,u.radialEdgeInset=(n+u.strokeWidth)/2,u.concentricEdgeInset=u.strokeWidth/2,u.setProperties(fT(u,p))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>yT([]))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();e.each((h,d)=>{const{centerX:u,centerY:p,radius:g}=d,f=g*2;h.d=lT.defaultPathData,h.fill=i,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=o,h.strokeWidth=a/f,h.lineDash=r.map(x=>x/f),h.lineDashOffset=l/f,h.translationX=u,h.translationY=p,h.scalingX=f,h.scalingY=f,c&&h.setProperties(xF(h,d))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((n,o)=>{const{centerX:a,centerY:r,angle:l,radius:c,shape:h,size:d,rotation:u,fill:p,fillOpacity:g,stroke:f,strokeOpacity:x,strokeWidth:m,lineDash:b,lineDashOffset:S}=o;n.shape=h==="line"?MB:h,n.size=d,n.fill=s?.fill??p,n.fillOpacity=s?.fillOpacity??g,n.stroke=s?.stroke??f,n.strokeOpacity=s?.strokeOpacity??x,n.strokeWidth=s?.strokeWidth??m,n.lineDash=s?.lineDash??b,n.lineDashOffset=s?.lineDashOffset??S,n.translationX=a+c*Math.cos(l),n.translationY=r+c*Math.sin(l),n.rotation=l+u})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,s)=>{const{centerX:n,centerY:o,radius:a,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,textAlign:x,textBaseline:m}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=n+a*Math.cos(r)+c,i.y=o+a*Math.sin(r)+h,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=p,i.fontSize=g,i.fontFamily=f,i.textAlign=x,i.textBaseline=m})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>e.label)}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.index)}updateTickNodes(t){const{scale:e,radius:i,centerX:s,centerY:n,properties:o}=this,{enabled:a,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=o.scale.label,p=oS(o.scale.label.rotation??0);t.tickSelection.each((g,f)=>{if(!a){g.visible=!1;return}g.visible=!0,g.text=f.text,g.fill=r,g.fontFamily=l,g.fontSize=c,g.fontStyle=h,g.fontWeight=d,g.textAlign="center",g.textBaseline="middle";const x=e.convert(f.value),{width:m,height:b}=f,S=Math.abs(i*Math.cos(x)),M=Math.abs(i*Math.sin(x)),D=Math.min(Math.max(Math.abs(i/Math.tan(x)),S-m/2),S+m/2),C=Math.min(Math.max(Math.abs(i*Math.tan(x)),M-b/2),M+b/2),k=Math.hypot(D,C),I=s+(k+u)*Math.cos(x),L=n+(k+u)*Math.sin(x);g.x=I,g.y=L,g.rotationCenterX=I,g.rotationCenterY=L,g.rotation=p})}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,radius:i,textAlign:s,verticalAlign:n}=this,{spacing:o,innerRadiusRatio:a}=this.properties;pdt(this,e,{padding:o,textAlign:s,verticalAlign:n},i*a,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),bF([this.datumSelection],fT),bF([this.needleSelection],xF),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i,s,n,o;if(this.labelSelection.each((a,r)=>{a.opacity=1,r.label==="primary"?(i=a.previousDatum?.value??t.from??r.value,s=r.value):r.label==="secondary"&&(n=a.previousDatum?.value??t.from??r.value,o=r.value)}),!this.labelsHaveExplicitText())if(s==null||o==null)this.formatLabelText();else if(i===s&&n===o)this.formatLabelText({label:s,secondaryLabel:o});else{const a=`${this.id}_labels`;e.animate({id:a,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:o},phase:t.phase??"update",onUpdate:r=>this.formatLabelText(r)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=mF(!0,this.scale.range[0]);Jg(this.id,"node",t,[this.datumSelection],e,(s,n)=>n.itemId),Jg(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),Jg(this.id,"label",t,[this.labelSelection],SB,(s,n)=>n.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=mF(!1,this.scale.range[0]);Jg(this.id,"node",t,[this.datumSelection],e,(s,n)=>n.itemId),Jg(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:s}=i;if(!i.isValid())return;let n,o;if(t.type===0?(n=i.value,o=i.label.text):{value:n,text:o}=i.targets[t.index],n!=null)return s.formatTooltip(this.properties,{data:[{label:o,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return DB(this,t)}pickFocus(t){return AB(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((i,s)=>{const n=Vg(this,s);n!=null&&e.push(n)}),e.join(". ")}getCategoryValue(t){}datumIndexForCategoryValue(t){}};rS.className="RadialGaugeSeries",rS.type="radial-gauge";var{commonSeriesOptionsDefs:Tdt,autoSizedLabelOptionsDefs:DF,seriesLabelOptionsDefs:AF,tooltipOptionsDefs:kdt,numberFormatValidator:Cdt}=T,IF={value:K(J),text:E,shape:Qt(st("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),bt),placement:st("inside","outside","middle"),spacing:H,size:H,rotation:J,label:{...AF,spacing:H},...St,...rt,...Ot},lS={type:K(Ct("radial-gauge")),value:K(J),outerRadius:H,innerRadius:H,outerRadiusRatio:Tt,innerRadiusRatio:Tt,startAngle:J,endAngle:J,spacing:H,cornerMode:st("container","item"),cornerRadius:H,scale:{min:Ze(J,Zl("max")),max:Ze(J,Su("min")),label:{enabled:j,formatter:bt,rotation:J,spacing:H,minSpacing:H,avoidCollisions:j,format:Cdt,...ge},interval:{values:mt(J),step:J},...Lb,...St,...rt,...Ot},targets:gs(IF,"target options array"),segmentation:{enabled:j,spacing:H,interval:{values:mt(J),step:J,count:J}},bar:{enabled:j,...Lb,...St,...rt,...Ot},needle:{enabled:j,spacing:H,radiusRatio:Tt,...St,...rt,...Ot},label:{text:E,spacing:H,...DF},secondaryLabel:{text:E,...DF},tooltip:kdt,...Tdt};lS.defaultColorRange=mt(dt),lS.defaultTarget={...IF,value:J,label:{...AF,spacing:J}},lS.scale.defaultFill=dt;var{FONT_SIZE_RATIO:Ldt}=T,Ndt={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:t=>new rS(t),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},T.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",T.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[Ldt.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}}}},wdt={type:"series",name:"radial-gauge",chartType:"gauge",enterprise:!0,options:lS,create:t=>new rS(t)};function TF(t){t.nodes.sort((e,i)=>Math.round((e.datum.y-i.datum.y)*100)/100||-(e.datum.size-i.datum.size))}function Odt({nodes:t,size:e},{seriesRectHeight:i,nodeSpacing:s,sizeScale:n}){const o=i*e*n;let a=(i-(o+s*(t.length-1)))/2;t.forEach(({datum:r})=>{const l=i*r.size*n;r.y=a,r.height=l,a+=l+s})}function Edt(t,e){const{nodes:i}=t,{seriesRectHeight:s,nodeSpacing:n}=e;TF(t);let o=0,a=0;for(const{datum:c}of i){const h=Math.max(a-c.y,0);c.y+=h,o+=h,a=c.y+c.height+n}if(a-n<s)return o>0;let l=s;for(let c=i.length-1;c>=0;c-=1){const{datum:h}=i[c],d=h.y+h.height,u=Math.min(l-d,0);h.y+=u,o+=u,l=h.y-n}return!0}function xT(t,e,i,s,n,o,a,r){const l=(i-t)/(s-e),c=(a-n)/(r-o),h=((o-e)*(l*c)+t*c-n*l)/(c-l);return t<i?h>t&&h<Math.min(i,a):h<t&&h>Math.max(i,a)}function kF(t,e){let i=!1;const s=t.nodes.filter(o=>e(o).length===1);let n=!0;for(let o=0;n&&o<s.length;o+=1){n=!1;for(let a=0;a<s.length-1;a+=1){const{datum:r}=s[a],l=e(s[a])[0].node.datum,{datum:c}=s[a+1],h=e(s[a+1])[0].node.datum;if(!(xT(r.x,r.y,l.x,l.y,c.x,c.y,h.x,h.y)||xT(r.x,r.y+r.height/2,l.x,l.y+l.height/2,c.x,c.y+c.height/2,h.x,h.y+h.height/2)||xT(r.x,r.y+r.height,l.x,l.y+l.height,c.x,c.y+c.height,h.x,h.y+h.height)))continue;const u=s[a];s[a]=s[a+1],s[a+1]=u;const p=r.y;r.y=c.y+c.height-r.height,c.y=p,i=!0,n=!0}}return i}function Rdt(t){let e=!1;return TF(t),e=kF(t,i=>i.linksBefore)||e,e=kF(t,i=>i.linksAfter)||e,e}function Pdt(t){if(t.length===0)return;let e=0,i=0;for(const{node:{datum:s}}of t)e+=s.y*s.size,i+=s.size;return e/i}function CF(t,e,i,s){return t.nodes.forEach(({datum:n,linksBefore:o,linksAfter:a})=>{const r=s===1?o:a,l=s===1?a:o,c=Pdt(r);if(c!=null){const h=l.length!==0?i:1;n.y=n.y+(c-n.y)*h}}),Edt(t,e)}function LF(t,e,i){let s=!1;for(const n of t)s=CF(n,e,i,1)||s;return s}function Bdt(t,e,i){let s=!1;for(let n=t.length-1;n>=0;n-=1)s=CF(t[n],e,i,-1)||s;return s}function NF(t){let e=!1;for(let i=t.length-1;i>=0;i-=1)e=Rdt(t[i])||e;return e}function zdt(t,e){t.forEach(s=>{Odt(s,e)});let i=!1;for(let s=0;s<6;s+=1){const n=LF(t,e,1);i=Bdt(t,e,.5);const o=NF(t);if(!n&&!i&&!o)break}i&&(LF(t,e,1),NF(t))}var{BBox:Fdt,Path:_dt,ScenePathChangeDetection:du,splitBezier:Gdt}=T;function cS(t,e,i,s,n,o,a,r,l,c){let h,d;if(n!==i&&l!==a){const C=-(s-e)/(n-i),k=-(r-o)/(l-a);h=(a-i+C*e-k*o)/(C-k),d=C*(h-e)+i}else if(n===i&&l!==a)h=e,d=-(r-o)/(l-a)*(h-r)+l;else if(n!==i&&l===a)h=r,d=-(s-e)/(n-i)*(h-e)+i;else throw new Error("Offsetting flat bezier curve");const u=Math.hypot(i-d,e-h),p=(u+c)/u,g=Math.hypot(l-d,r-h),f=(g+c)/g,x=h+(s-h)*p,m=d+(n-d)*p,b=h+(o-h)*f,S=d+(a-d)*f,M=h+(r-h)*f,D=d+(l-d)*f;t.cubicCurveTo(x,m,b,S,M,D)}var Dh=class extends _dt{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const t=Math.min(this.x1,this.x2),e=Math.max(this.x1,this.x2)-t,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new Fdt(t,i,e,s)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.x1+e,s=this.x2-e,n=this.y1+e,o=this.y2+e,a=this.height-2*e;if(a<0||i>s)return;const r=i,l=n+a/2,c=(i+s)/2,h=n+a/2,d=(i+s)/2,u=o+a/2,p=s,g=o+a/2;if(t.moveTo(r,l-a/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1<this.height*Math.SQRT2)t.cubicCurveTo(c,h-a/2,d,u-a/2,p,g-a/2),t.lineTo(p,g+a/2),t.cubicCurveTo(d,u+a/2,c,h+a/2,r,l+a/2);else{const[f,x]=Gdt(r,l,c,h,d,u,p,g,.5),m=(o>n?1:-1)*a/2;cS(t,f[0].x,f[0].y,f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y,m),cS(t,x[0].x,x[0].y,x[1].x,x[1].y,x[2].x,x[2].y,x[3].x,x[3].y,-m),t.lineTo(p,g+a/2),cS(t,x[3].x,x[3].y,x[2].x,x[2].y,x[1].x,x[1].y,x[0].x,x[0].y,m),cS(t,f[3].x,f[3].y,f[2].x,f[2].y,f[1].x,f[1].y,f[0].x,f[0].y,-m)}t.closePath()}};y([du()],Dh.prototype,"x1",2),y([du()],Dh.prototype,"x2",2),y([du()],Dh.prototype,"y1",2),y([du()],Dh.prototype,"y2",2),y([du()],Dh.prototype,"height",2),y([du()],Dh.prototype,"inset",2);var{BaseProperties:wF,FillGradientDefaults:Vdt,FillPatternDefaults:jdt,SeriesTooltip:Wdt,SeriesProperties:Hdt,ARRAY:Udt,ARRAY_OF:bT,COLOR_STRING:uu,COLOR_STRING_ARRAY:OF,FUNCTION:EF,LINE_DASH:RF,OBJECT:pu,POSITIVE_NUMBER:Ah,OR:ST,COLOR_GRADIENT:vT,COLOR_PATTERN:Ydt,RATIO:hS,STRING:Gl,UNION:Kdt,TempValidate:_t,Label:$dt}=T,Xdt=Kdt(["left","right","center","justify"],"a justification value"),PF=class extends $dt{constructor(){super(...arguments),this.spacing=1}};y([_t(Ah)],PF.prototype,"spacing",2);var Lr=class extends wF{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};y([_t(ST(vT,uu),{optional:!0})],Lr.prototype,"fill",2),y([_t(hS)],Lr.prototype,"fillOpacity",2),y([_t(uu,{optional:!0})],Lr.prototype,"stroke",2),y([_t(hS)],Lr.prototype,"strokeOpacity",2),y([_t(Ah)],Lr.prototype,"strokeWidth",2),y([_t(RF)],Lr.prototype,"lineDash",2),y([_t(Ah)],Lr.prototype,"lineDashOffset",2),y([_t(EF,{optional:!0})],Lr.prototype,"itemStyler",2);var ro=class extends wF{constructor(){super(...arguments),this.spacing=1,this.width=1,this.alignment="justify",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};y([_t(Ah)],ro.prototype,"spacing",2),y([_t(Ah)],ro.prototype,"width",2),y([_t(Xdt)],ro.prototype,"alignment",2),y([_t(ST(vT,uu),{optional:!0})],ro.prototype,"fill",2),y([_t(hS)],ro.prototype,"fillOpacity",2),y([_t(uu,{optional:!0})],ro.prototype,"stroke",2),y([_t(hS)],ro.prototype,"strokeOpacity",2),y([_t(Ah)],ro.prototype,"strokeWidth",2),y([_t(RF)],ro.prototype,"lineDash",2),y([_t(Ah)],ro.prototype,"lineDashOffset",2),y([_t(EF,{optional:!0})],ro.prototype,"itemStyler",2);var Ai=class extends Hdt{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new Vdt,this.fillPatternDefaults=new jdt,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new PF,this.link=new Lr,this.node=new ro,this.tooltip=new Wdt}};y([_t(Udt,{optional:!0})],Ai.prototype,"nodes",2),y([_t(Gl)],Ai.prototype,"fromKey",2),y([_t(Gl)],Ai.prototype,"toKey",2),y([_t(Gl)],Ai.prototype,"idKey",2),y([_t(Gl,{optional:!0})],Ai.prototype,"idName",2),y([_t(Gl,{optional:!0})],Ai.prototype,"labelKey",2),y([_t(Gl,{optional:!0})],Ai.prototype,"labelName",2),y([_t(Gl,{optional:!0})],Ai.prototype,"sizeKey",2),y([_t(Gl,{optional:!0})],Ai.prototype,"sizeName",2),y([_t(pu)],Ai.prototype,"fillGradientDefaults",2),y([_t(pu)],Ai.prototype,"fillPatternDefaults",2),y([_t(bT(OF))],Ai.prototype,"defaultColorRange",2),y([_t(bT(uu))],Ai.prototype,"defaultPatternFills",2),y([_t(bT(ST(vT,uu,Ydt)))],Ai.prototype,"fills",2),y([_t(OF)],Ai.prototype,"strokes",2),y([_t(pu)],Ai.prototype,"label",2),y([_t(pu)],Ai.prototype,"link",2),y([_t(pu)],Ai.prototype,"node",2),y([_t(pu)],Ai.prototype,"tooltip",2);var{Transformable:Zdt,applyShapeStyle:BF,SeriesNodePickMode:zF,CachedTextMeasurerPool:Qdt,TextWrapper:FF,TextUtils:_F,createDatumId:dS,getShapeStyle:uS,Rect:GF,BBox:VF}=T,pS=class extends BP{constructor(t){super({moduleCtx:t,pickModes:[zF.NEAREST_NODE,zF.EXACT_SHAPE_MATCH]}),this.properties=new Ai}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Dh}nodeFactory(){return new GF}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,label:{spacing:a},node:{spacing:r,width:l,alignment:c}}=this.properties,{nodeGraph:h,links:d,maxPathLength:u}=this.getNodeGraph(k=>({...k,x:NaN,y:NaN,width:l,height:NaN}),k=>({...k,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),p=h,g=this.isLabelEnabled()?(e-l)*(1-u/(u+1)):0,f=(e-l-2*g)/(u-1),x=[];for(let k=0;k<u;k+=1){const I=g+k*f;x.push({index:k,size:0,nodes:[],x:I})}p.forEach(k=>{const{datum:I,linksBefore:L,linksAfter:N,maxPathLengthBefore:O,maxPathLengthAfter:w}=k,R=Math.max(L.reduce((P,{link:V})=>P+V.size,0),N.reduce((P,{link:V})=>P+V.size,0));if(L.length===0&&N.length===0||R===0){k.columnIndex=-1;return}let G;switch(c){case"left":G=x[O];break;case"right":G=x[u-1-w];break;case"center":{if(L.length!==0)G=x[O];else if(N.length!==0){const P=N.reduce((V,W)=>Math.min(V,W.node.maxPathLengthBefore),u)-1;G=x[P]}else G=x[0];break}case"justify":{G=N.length===0?x[u-1]:x[O];break}}I.x=G.x,I.size=R;const B=this.getLabelText(this.properties.label,{datum:I.datum,value:I.label,fromKey:s,toKey:n,sizeKey:o,size:R});I.label=String(B),G.nodes.push(k),G.size+=R,k.columnIndex=G.index}),p.forEach(k=>{let I=1/0,L=0;k.linksAfter.forEach(N=>{const O=N.node,{columnIndex:w}=O;w<I?(I=w,L=O.datum.size):w===I&&(L=Math.max(L,O.datum.size))}),k.closestColumnIndex=I,k.maxSizeOfClosestNodesAfter=L});const m=x.reduce((k,{size:I,nodes:L})=>{const N=(1-(L.length-1)*(r/i))/I;return Math.min(k,N)},1/0);for(let k=x.length-1;k>=0;k-=1)x[k].nodes.sort((L,N)=>L.closestColumnIndex-N.closestColumnIndex||L.maxSizeOfClosestNodesAfter-N.maxSizeOfClosestNodesAfter||L.datum.size-N.datum.size);zdt(x,{seriesRectHeight:i,nodeSpacing:r,sizeScale:m});let b=!1;if(p.forEach(({datum:k,linksBefore:I,linksAfter:L})=>{b||(b=k.height<0);const N=k.y+k.height,O=G=>G.sort((B,P)=>{const V=B.node.datum,W=P.node.datum,F=V.y+V.height,_=W.y+W.height,z=Math.atan2(V.y-k.y,Math.abs(V.x-k.x))-Math.atan2(W.y-k.y,Math.abs(W.x-k.x)),U=Math.atan2(F-N,Math.abs(V.x-k.x))-Math.atan2(_-N,Math.abs(W.x-k.x));return z+U});let w=k.y;O(I).forEach(({link:G})=>{G.y2=w,w+=G.size*i*m});let R=k.y;O(L).forEach(({link:G})=>{G.y1=R,R+=G.size*i*m})}),b){$.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");return}const S=[],M=[],{fontSize:D}=this.properties.label,C=this.properties.label.getFont();return x.forEach((k,I)=>{const L=I===0,N=I===x.length-1;let O=-1/0;k.nodes.sort((w,R)=>w.datum.y-R.datum.y),k.nodes.forEach(({datum:w})=>{if(w.midPoint={x:w.x+w.width/2,y:w.y+w.height/2},S.push(w),w.label==null)return;const R=L?w.x-a:w.x+w.width+a,G=w.y+w.height/2;let B;if(!L&&!N){const F=G-_F.getLineHeight(D),_=G+_F.getLineHeight(D);let z=e;p.forEach(({datum:Y})=>{Y.x>w.x&&Math.max(Y.y,F)<=Math.min(Y.y+Y.height,_)&&(z=Math.min(z,Y.x-a))});const U=z-w.x-2*a;B=FF.wrapText(w.label,{maxWidth:U,maxHeight:w.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(B==null||B===""){const F=L||N?a:a*2;B=FF.wrapText(w.label,{maxWidth:f-F,maxHeight:w.height,font:this.properties.label,textWrap:"never"})}if(B==="")return;const{height:P}=Qdt.measureText(B,{font:C,textAlign:"left",textBaseline:"middle"}),V=G-P/2,W=G+P/2;V>=O&&(M.push({x:R,y:G,leading:L,text:B}),O=W)})}),d.forEach(k=>{const{fromNode:I,toNode:L,size:N}=k;k.height=i*N*m,k.x1=I.x+l,k.x2=L.x,k.midPoint={x:(k.x1+k.x2)/2,y:(k.y1+k.y2)/2+k.height/2},S.push(k)}),{itemId:t,nodeData:S,labelData:M}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,leading:h,text:d})=>{r.visible=!0,r.x=l,r.y=c,r.text=d,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,r.fontFamily=a,r.textAlign=h?"right":"left",r.textBaseline="middle"})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>dS([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return uS({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??o,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r},e.fillGradientDefaults,e.fillPatternDefaults)}getNodeStyleOverrides(t,e,i,s,n,o,a){const{id:r,properties:l}=this,{fills:c,strokes:h,defaultColorRange:d,defaultPatternFills:u}=l,{itemStyler:p}=l.node,g=o.fill??c[i%c.length],f=o.stroke??h[i%h.length],x=d[i%d.length].map(S=>({color:S})),m=u[i%u.length];let b;if(a||(b??(b={}),b.fill=g,b.stroke=f),p!=null){const S=this.cachedDatumCallback(dS(t,"node",a?"highlight":"node"),()=>{const{fillOpacity:M=1,strokeOpacity:D=1,strokeWidth:C=0,lineDash:k=[],lineDashOffset:I=0}=o;return this.callWithContext(p,{seriesId:r,datum:e,highlighted:a,label:n,size:s,fill:g,fillOpacity:M,stroke:f,strokeOpacity:D,strokeWidth:C,lineDash:k,lineDashOffset:I})});b??(b={}),Object.assign(b,S)}return uS(b,{...this.properties.fillGradientDefaults.toJson(),colorStops:x},{...this.properties.fillPatternDefaults.toJson(),fill:m,stroke:m})}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r,size:l,label:c}=a,h=this.getNodeStyleOverrides(String(r.index),a.datum,r.index,l,c,s,i);o.x=a.x,o.y=a.y,o.width=Math.max(a.width,0),o.height=Math.max(a.height,0),BF(o,s,h,n)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=new VF(0,0,t,e);return{series:i,axis:i}}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>dS([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=e.link,l=t?e.highlightStyle.item:void 0;return uS({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??o,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r},e.fillGradientDefaults,e.fillPatternDefaults)}getLinkStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{fills:r,strokes:l,defaultColorRange:c,defaultPatternFills:h}=a,{itemStyler:d}=a.link,u=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g=c[i%c.length].map(m=>({color:m})),f=h[i%h.length];let x;if(n||(x??(x={}),x.fill=u,x.stroke=p),d!=null){const m=this.cachedDatumCallback(dS(t,"link",n?"highlight":"node"),()=>{const{fillOpacity:b=1,strokeOpacity:S=1,strokeWidth:M=0,lineDash:D=[],lineDashOffset:C=0}=s;return this.callWithContext(d,{seriesId:o,datum:e,highlighted:n,fill:u,fillOpacity:b,stroke:p,strokeOpacity:S,strokeWidth:M,lineDash:D,lineDashOffset:C})});x??(x={}),Object.assign(x,m)}return uS(x,{...this.properties.fillGradientDefaults.toJson(),colorStops:g},{...this.properties.fillPatternDefaults.toJson(),fill:f,stroke:f})}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r}=a,l=a.fromNode.datumIndex,c=this.getLinkStyleOverrides(String(r.index),a.datum,l.index,s,i);o.x1=a.x1,o.y1=a.y1,o.x2=a.x2,o.y2=a.y2,o.height=a.height,BF(o,s,c,n),o.inset=o.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:o,toKey:a,sizeKey:r,sizeName:l,tooltip:c}=n,h=this.contextNodeData?.nodeData.find(x=>x.datumIndex.type===t.type&&x.datumIndex.index===t.index);if(h==null)return;const d=h.type===0?h.fromNode.index:h.index,u=h.type===0?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=t.type===0?i?.dataSources.get(this.id)?.[t.index]:s?.dataSources.get(this.id)?.[t.index],g=h.size;let f;if(h.type===0){const x=h.fromNode.datumIndex,m=this.getBaseLinkStyle(!1);Object.assign(m,this.getLinkStyleOverrides(String(t.index),p,x.index,m,!1)),f=m}else{const x=h.label,m=this.getBaseNodeStyle(!1);Object.assign(m,this.getNodeStyleOverrides(String(t.index),p,t.index,g,x,m,!1)),f=m}return c.formatTooltip(this.properties,{title:u,symbol:this.legendItemSymbol(h.type,d,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:u,fromKey:o,toKey:a,sizeKey:r,sizeName:l,size:g,...f})}computeFocusBounds(t){if(t instanceof GF){const{x:e,y:i,width:s,height:n}=t,o=new VF(e,i,s,n);return Zdt.toCanvas(this.contentGroup,o)}return t}};pS.className="SankeySeries",pS.type="sankey";var{commonSeriesOptionsDefs:qdt,seriesLabelOptionsDefs:Jdt,tooltipOptionsDefs:tut}=T,tf={type:K(Ct("sankey")),fromKey:K(E),toKey:K(E),sizeKey:E,sizeName:E,fills:mt($o),strokes:mt(dt),label:{...Jdt,spacing:H},link:{itemStyler:bt,...St,...rt,...Ot},node:{width:H,spacing:H,alignment:st("left","center","right","justify"),itemStyler:bt,...St,...rt,...Ot},tooltip:tut,...qdt};tf.fillGradientDefaults=yf,tf.fillPatternDefaults=mf,tf.defaultColorRange=mt(mt(dt)),tf.defaultPatternFills=mt(dt);var eut={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:t=>new pS(t),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:T.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0}},legend:{enabled:!1,toggleSeries:!1}}},iut={type:"series",name:"sankey",chartType:"flow-proportion",enterprise:!0,options:tf,create:t=>new pS(t)},{HierarchySeriesProperties:sut,HighlightStyle:nut,SeriesTooltip:out,TempValidate:fi,COLOR_STRING:aut,FUNCTION:rut,NUMBER:jF,OBJECT:gu,POSITIVE_NUMBER:MT,RATIO:gS,STRING:fS}=T,Vl=class extends nut{constructor(){super(...arguments),this.label=new Aa,this.secondaryLabel=new Aa}};y([fi(fS,{optional:!0})],Vl.prototype,"fill",2),y([fi(gS,{optional:!0})],Vl.prototype,"fillOpacity",2),y([fi(aut,{optional:!0})],Vl.prototype,"stroke",2),y([fi(MT,{optional:!0})],Vl.prototype,"strokeWidth",2),y([fi(gS,{optional:!0})],Vl.prototype,"strokeOpacity",2),y([fi(gu)],Vl.prototype,"label",2),y([fi(gu)],Vl.prototype,"secondaryLabel",2);var Ws=class extends sut{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new Vl,this.label=new Aa,this.secondaryLabel=new Og,this.tooltip=new out}};y([fi(fS,{optional:!0})],Ws.prototype,"sizeName",2),y([fi(fS,{optional:!0})],Ws.prototype,"labelKey",2),y([fi(fS,{optional:!0})],Ws.prototype,"secondaryLabelKey",2),y([fi(gS)],Ws.prototype,"fillOpacity",2),y([fi(MT)],Ws.prototype,"strokeWidth",2),y([fi(gS)],Ws.prototype,"strokeOpacity",2),y([fi(MT)],Ws.prototype,"cornerRadius",2),y([fi(jF,{optional:!0})],Ws.prototype,"sectorSpacing",2),y([fi(jF,{optional:!0})],Ws.prototype,"padding",2),y([fi(rut,{optional:!0})],Ws.prototype,"itemStyler",2),y([fi(gu)],Ws.prototype,"highlightStyle",2),y([fi(gu)],Ws.prototype,"label",2),y([fi(gu)],Ws.prototype,"secondaryLabel",2),y([fi(gu)],Ws.prototype,"tooltip",2);var{fromToMotion:lut,normalizeAngle360:cut,createDatumId:hut,Sector:DT,Group:yS,ScalableGroup:dut,Selection:AT,TransformableText:IT,BBox:WF,applyShapeStyle:uut,getShapeStyle:TT}=T,put=class extends T.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function HF(t,e=0,i=2*Math.PI/t.sumSize){for(const s of t.children){const n=e+s.sumSize*i;s.startAngle=e,s.endAngle=n,HF(s,e,i),e=n}}var mS=class extends T.HierarchySeries{constructor(){super(...arguments),this.NodeClass=put,this.properties=new Ws,this.scalingGroup=this.contentGroup.appendChild(new dut),this.sectorGroup=this.scalingGroup.appendChild(new yS),this.sectorLabelGroup=this.scalingGroup.appendChild(new yS),this.highlightSectorGroup=this.scalingGroup.appendChild(new yS),this.datumSelection=AT.select(this.sectorGroup,DT),this.labelSelection=AT.select(this.sectorLabelGroup,yS),this.highlightSelection=AT.select(this.highlightSectorGroup,DT)}processData(){super.processData(),HF(this.rootNode)}updateSelections(){const t=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(t!=null?[t]:[],void 0,o=>this.getDatumId(o)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(e==null||e.seriesRect==null)return;const s=Array.from(this.rootNode),n=o=>{o.append([new IT({tag:0}),new IT({tag:1})])};this.datumSelection.update(s,void 0,o=>this.getDatumId(o)),this.labelSelection.update(s,n,o=>this.getDatumId(o))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle:void 0;return TT({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity},e.fillGradientDefaults,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:d}=r,u=t[0],p=n.fill??c[u%c.length],g=n.stroke??h[u%h.length],f={};if(o||(f.fill=s!=null?l.convert(s):p,f.stroke=g),d!=null){const x=this.cachedDatumCallback(hut(t.join(":"),o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,depth:i,highlighted:o,fill:p,stroke:g,...n}));Object.assign(f,x)}return TT(f,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(t==null||e==null)return;const{width:s,height:n}=t.seriesRect,{sectorSpacing:o=0,padding:a=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=n/2;const f=o*.5,x=Math.min(s,n)/2,m=x/(i+1),b=-Math.PI/2,S={series:new WF(-x,-x,2*x,2*x),axis:new WF(-x,-x,2*x,2*x)};this.rootNode?.walk(L=>{const{startAngle:N,endAngle:O}=L;if(L.depth!=null){const w=(N+O)/2+b,R=(L.depth+.5)*m;L.midPoint.x=Math.cos(w)*R,L.midPoint.y=Math.sin(w)*R}}),this.rootNode?.walk(L=>{const{datum:N,depth:O,startAngle:w,endAngle:R,parent:G,sumSize:B}=L;L.label=void 0,L.secondaryLabel=void 0,L.contentHeight=0;let P;if(N!=null&&O!=null&&d!=null){const Dt=N[d];P=this.getLabelText(this.properties.label,{depth:O,datum:N,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:Dt})}P===""&&(P=void 0);let V;if(N!=null&&O!=null&&u!=null){const Dt=N[u];V=this.getLabelText(this.properties.secondaryLabel,{depth:O,datum:N,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:Dt})}if(V===""&&(V=void 0),O==null)return;const W=O*m+f,F=(O+1)*m-f,_=W>f?f/W:f,z=F>f?f/F:f,U=w+_,Z=R+_-U,q=w+z,tt=R+z-q,X=Dt=>{if(O===0&&G?.sumSize===B)return{width:2*Math.sqrt(F**2-(Dt*.5)**2),height:Dt,meta:0};const $t=Dt,Xi=2*Math.sqrt(F**2-(W+$t)**2),ps=Z<Math.PI?2*W*Math.tan(Z*.5):1/0,Nn=Math.min(Xi,ps),Kl=Math.PI/4;let Oa,wr;return O===0?(Oa=Dt,wr=Math.sqrt(F**2-(Oa/2)**2)-Dt/(2*Math.tan(tt*.5))):cut(Z)<Kl?(Oa=2*W*Math.tan(Z*.5),wr=Math.sqrt(F**2-(Oa/2)**2)-W):(wr=0,Oa=0),Nn>=wr?{width:Nn,height:$t,meta:1}:{width:wr,height:Oa,meta:2}},it=iI(P,this.properties.label,V,this.properties.secondaryLabel,{padding:a},X);if(it==null)return;const{width:nt,height:ht,meta:lt,label:vt,secondaryLabel:At}=it,ut=b+(w+R)/2,Kt=Math.sin(ut)>=0,Xt=Math.cos(ut)>=0,Gt=(Kt?3:12)&(Xt?6:9);let Vt;switch(lt){case 0:Vt=0;break;case 1:{const Bt=F-(m-ht)*.58,$t=Math.sqrt((F-a)**2-(nt/2)**2);Vt=Math.min(Bt,$t);break}case 2:if(O===0){const Dt=ht/(2*Math.tan(Z*.5))+nt*.5,Bt=Math.sqrt(F**2-(ht*.5)**2)-nt*.5;Vt=(Dt+Bt)*.5}else Vt=(W+F)*.5;break}if(vt!=null){const{fontStyle:Dt="normal",fontFamily:Bt,fontWeight:$t="normal",color:Xi="black"}=this.properties.label;L.label={...vt,fontStyle:Dt,fontFamily:Bt,fontWeight:$t,color:Xi,labelPlacement:lt,circleQuarter:Gt,radius:Vt,theta:ut}}if(At!=null){const{fontStyle:Dt="normal",fontFamily:Bt,fontWeight:$t="normal",color:Xi="black"}=this.properties.secondaryLabel;L.secondaryLabel={...At,fontStyle:Dt,fontFamily:Bt,fontWeight:$t,color:Xi,labelPlacement:lt,circleQuarter:Gt,radius:Vt,theta:ut}}L.contentHeight=it.height});const M=(L,N,O,w)=>{const{datum:R,datumIndex:G,depth:B,colorValue:P,startAngle:V,endAngle:W}=L;if(B==null){N.visible=!1;return}N.visible=!0;const F=this.getItemStyleOverrides(G,R,B,P,O,w),_=F.fill??O.fill,z=F.strokeWidth??O.strokeWidth,U=T.isGradientFill(_)&&_.bounds!=="item"?S:void 0;uut(N,O,F,U),N.centerX=0,N.centerY=0,N.innerRadius=B*m,N.outerRadius=(B+1)*m,N.startAngle=V+b,N.endAngle=W+b,N.inset=f+z*.5,N.cornerRadius=r},D=this.getItemBaseStyle(!1);this.datumSelection.each((L,N)=>{M(N,L,D,!1)});const C=this.getItemBaseStyle(!0);this.highlightSelection.each((L,N)=>{M(N,L,C,!0)});const k=(L,N,O,w)=>{const{depth:R,contentHeight:G}=L,B=O===0,P=B?L.label:L.secondaryLabel;if(R==null||P==null){N.visible=!1;return}const{labelPlacement:V,circleQuarter:W,radius:F,theta:_}=P;let z;switch(w&&(z=(B?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),N.text=P.text,N.fontSize=P.fontSize,N.lineHeight=P.lineHeight,N.fontStyle=P.fontStyle,N.fontFamily=P.fontFamily,N.fontWeight=P.fontWeight,N.fill=z??P.color,V){case 0:N.textAlign="center",N.textBaseline="top",N.translationX=0,N.translationY=(B?0:G-P.height)-G*.5,N.rotation=0;break;case 1:{const U=(W&3)!==0,Y=B===!U?F:F-(G-P.height);N.textAlign="center",N.textBaseline=U?"bottom":"top",N.translationX=Math.cos(_)*Y,N.translationY=Math.sin(_)*Y,N.rotation=U?_-Math.PI*.5:_+Math.PI*.5;break}case 2:{const U=(W&6)!==0,Y=B===!U?(G-P.height)*.5:(P.height-G)*.5;N.textAlign="center",N.textBaseline="middle",N.translationX=Math.cos(_)*F+Math.cos(_+Math.PI/2)*Y,N.translationY=Math.sin(_)*F+Math.sin(_+Math.PI/2)*Y,N.rotation=U?_:_+Math.PI;break}}N.visible=!0},I=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(IT).forEach(L=>{const N=L.closestDatum();k(N,L,L.tag,N===I)})}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,d=t.reduce((M,D)=>M?.children[D],this.rootNode);if(d==null)return;const{datum:u,depth:p}=d;if(u==null||p==null)return;const g=[],f=a!=null?u[a]:void 0;f!=null&&g.push({label:r,fallbackLabel:a,value:f});const x=l!=null?u[l]:void 0;x!=null&&g.push({label:c,fallbackLabel:l,value:x});const m=this.getItemBaseStyle(!1);Object.assign(m,this.getItemStyleOverrides(t,u,p,x,m,!1));const b=m.fill,S=TT({shape:"square",fill:b,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},i.fillGradientDefaults,i.fillPatternDefaults);return T.isGradientFill(S.fill)&&(S.fill={...S.fill,gradient:"linear",rotation:0,reverse:!1}),h.formatTooltip(i,{title:s!=null?u[s]:void 0,symbol:{marker:S},data:g},{seriesId:e,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...m})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.selectByClass(DT))}animateEmptyUpdateReady(){lut(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(t){return t}};mS.className="SunburstSeries",mS.type="sunburst";var{commonSeriesOptionsDefs:gut,autoSizedLabelOptionsDefs:UF,tooltipOptionsDefs:fut,without:YF}=T,yut={type:K(Ct("sunburst")),labelKey:E,secondaryLabelKey:E,childrenKey:E,sizeKey:E,colorKey:E,sizeName:E,colorName:E,fills:mt($o),strokes:mt(dt),colorRange:mt(dt),sectorSpacing:H,cornerRadius:H,padding:H,itemStyler:bt,label:{spacing:H,...UF},secondaryLabel:UF,tooltip:fut,...gut,...YF(St,["fill"]),...YF(rt,["stroke"]),highlightStyle:{label:{color:dt},secondaryLabel:{color:dt},...St,...rt}},{FONT_SIZE_RATIO:KF}=T,mut={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:t=>new mS(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[KF.LARGE]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},9/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[KF.SMALLEST]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},7/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0}}},xut={type:"series",name:"sunburst",chartType:"hierarchy",enterprise:!0,options:yut,create:t=>new mS(t)},{BaseProperties:xS,HierarchySeriesProperties:but,HighlightStyle:Sut,SeriesTooltip:vut,TempValidate:Nt,BOOLEAN:Mut,COLOR_STRING:fu,FUNCTION:Dut,NUMBER:Aut,OBJECT:lo,POSITIVE_NUMBER:Na,RATIO:jl,STRING:ef,STRING_ARRAY:$F,TEXT_ALIGN:XF,VERTICAL_ALIGN:Iut,COLOR_GRADIENT:ZF,COLOR_PATTERN:QF,OR:qF,Label:Tut}=T,JF=class extends Tut{constructor(){super(...arguments),this.spacing=0}};y([Nt(Aut)],JF.prototype,"spacing",2);var co=class extends xS{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new JF}};y([Nt(qF(ZF,fu,QF),{optional:!0})],co.prototype,"fill",2),y([Nt(jl)],co.prototype,"fillOpacity",2),y([Nt(fu,{optional:!0})],co.prototype,"stroke",2),y([Nt(Na)],co.prototype,"strokeWidth",2),y([Nt(jl)],co.prototype,"strokeOpacity",2),y([Nt(Na)],co.prototype,"cornerRadius",2),y([Nt(XF)],co.prototype,"textAlign",2),y([Nt(Na)],co.prototype,"gap",2),y([Nt(Na)],co.prototype,"padding",2),y([Nt(Mut)],co.prototype,"interactive",2),y([Nt(lo)],co.prototype,"label",2);var Ln=class extends xS{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new Aa,this.secondaryLabel=new Og}};y([Nt(qF(ZF,fu,QF),{optional:!0})],Ln.prototype,"fill",2),y([Nt(jl)],Ln.prototype,"fillOpacity",2),y([Nt(fu,{optional:!0})],Ln.prototype,"stroke",2),y([Nt(Na,{optional:!0})],Ln.prototype,"strokeWidth",2),y([Nt(jl)],Ln.prototype,"strokeOpacity",2),y([Nt(Na)],Ln.prototype,"cornerRadius",2),y([Nt(XF)],Ln.prototype,"textAlign",2),y([Nt(Iut)],Ln.prototype,"verticalAlign",2),y([Nt(Na)],Ln.prototype,"gap",2),y([Nt(Na)],Ln.prototype,"padding",2),y([Nt(lo)],Ln.prototype,"label",2),y([Nt(lo)],Ln.prototype,"secondaryLabel",2);var Ih=class extends xS{constructor(){super(...arguments),this.label=new Aa}};y([Nt(ef,{optional:!0})],Ih.prototype,"fill",2),y([Nt(jl,{optional:!0})],Ih.prototype,"fillOpacity",2),y([Nt(fu,{optional:!0})],Ih.prototype,"stroke",2),y([Nt(Na,{optional:!0})],Ih.prototype,"strokeWidth",2),y([Nt(jl,{optional:!0})],Ih.prototype,"strokeOpacity",2),y([Nt(lo)],Ih.prototype,"label",2);var Wl=class extends xS{constructor(){super(...arguments),this.label=new Aa,this.secondaryLabel=new Og}};y([Nt(ef,{optional:!0})],Wl.prototype,"fill",2),y([Nt(jl,{optional:!0})],Wl.prototype,"fillOpacity",2),y([Nt(fu,{optional:!0})],Wl.prototype,"stroke",2),y([Nt(Na,{optional:!0})],Wl.prototype,"strokeWidth",2),y([Nt(jl,{optional:!0})],Wl.prototype,"strokeOpacity",2),y([Nt(lo)],Wl.prototype,"label",2),y([Nt(lo)],Wl.prototype,"secondaryLabel",2);var kT=class extends Sut{constructor(){super(...arguments),this.group=new Ih,this.tile=new Wl}};y([Nt(lo)],kT.prototype,"group",2),y([Nt(lo)],kT.prototype,"tile",2);var Ho=class extends but{constructor(){super(...arguments),this.highlightStyle=new kT,this.tooltip=new vut,this.group=new co,this.tile=new Ln,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};y([Nt(ef,{optional:!0})],Ho.prototype,"sizeName",2),y([Nt(ef,{optional:!0})],Ho.prototype,"labelKey",2),y([Nt(ef,{optional:!0})],Ho.prototype,"secondaryLabelKey",2),y([Nt(Dut,{optional:!0})],Ho.prototype,"itemStyler",2),y([Nt(lo)],Ho.prototype,"highlightStyle",2),y([Nt(lo)],Ho.prototype,"tooltip",2),y([Nt(lo)],Ho.prototype,"group",2),y([Nt(lo)],Ho.prototype,"tile",2),y([Nt($F)],Ho.prototype,"undocumentedGroupFills",2),y([Nt($F)],Ho.prototype,"undocumentedGroupStrokes",2);var{TextUtils:kut,TextWrapper:Cut,createDatumId:t_,Rect:e_,Group:i_,BBox:yu,Selection:CT,Text:bS,Transformable:Lut,applyShapeStyle:Nut,getShapeStyle:sf}=T,wut=class extends T.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}},s_=new bS;function Out(t,e){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o}=e;s_.setProperties({text:t,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o,textAlign:"left",textBaseline:"top"});const{width:a,height:r}=s_.getBBox();return{width:a,height:r}}function Hl(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var n_={left:0,center:.5,right:1},Eut={top:0,middle:.5,bottom:1},fpt=class extends T.Group{distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}},SS=class extends T.HierarchySeries{constructor(){super(...arguments),this.NodeClass=wut,this.properties=new Ho,this.rectGroup=this.contentGroup.appendChild(new i_),this.datumSelection=CT.select(this.rectGroup,e_),this.labelSelection=CT.select(this.labelGroup,i_),this.highlightSelection=CT.select(this.rectGroup,e_)}groupTitleHeight(t,e){const{labelValue:i}=t,{label:s}=this.properties.group,n=3;if(i!=null){if(s.fontSize>e.width/n||s.fontSize>e.height/n)return;{const{height:o}=Out(i,s);return Math.max(o,s.fontSize)}}}getNodePadding(t,e){if(t.parent==null)return{top:0,right:0,bottom:0,left:0};if(t.children.length===0){const{padding:a}=this.properties.tile;return{top:a,right:a,bottom:a,left:a}}const{label:{spacing:i},padding:s}=this.properties.group,n=this.groupTitleHeight(t,e),o=n!=null?n+i:0;return{top:s+o,right:s,bottom:s,left:s}}sortChildren({children:t}){const e=Array.from(t,(s,n)=>n).filter(s=>Hl(t[s])>0).sort((s,n)=>Hl(t[n])-Hl(t[s]));return{sortedChildrenIndices:e,childAt:s=>{const n=e[s];return t[n]}}}squarify(t,e){const{datum:i,children:s}=t;if(e.width<=0||e.height<=0){t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN;return}const n=i!=null?this.getNodePadding(t,e):{top:0,right:0,bottom:0,left:0};t.parent==null?(t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN):(t.bbox=e,t.padding=n,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:o,childAt:a}=this.sortChildren(t),r=o.every(D=>s[D].children.length===0),l=1,c=e.width-n.left-n.right,h=e.height-n.top-n.bottom;if(c<=0||h<=0)return;const d=o.length;let u=0,p=0,g=1/0,f=o.reduce((D,C)=>D+Hl(s[C]),0);const x=new yu(e.x+n.left,e.y+n.top,c,h),m=x.clone();let b=0;for(;b<d;){const D=Hl(a(b)),C=Hl(a(p)),k=m.width<m.height;u+=D;const I=k?m.height:m.width,L=k?m.width:m.height,N=L*C/u;let O=I*u/f;const w=Math.max(N,O)/Math.min(N,O),R=Math.abs(l-w);if(R<g){g=R,b++;continue}u-=D,O=I*u/f;let G=k?m.x:m.y;for(let B=p;B<b;B++){const P=a(B),V=Hl(P),W=k?G:m.x,F=k?m.y:G,_=L*V/u,z=k?_:O,U=k?O:_,Y=new yu(W,F,z,U);this.applyGap(x,Y,r),this.squarify(P,Y),f-=V,G+=_}k?(m.y+=O,m.height-=O):(m.x+=O,m.width-=O),p=b,u=0,g=1/0}const S=m.width<m.height;let M=S?m.x:m.y;for(let D=p;D<d;D++){const C=a(D),k=S?M:m.x,I=S?m.y:M,L=Hl(C)/f,N=m.width*(S?L:1),O=m.height*(S?1:L),w=new yu(k,I,N,O);this.applyGap(x,w,r),this.squarify(C,w),M+=S?N:O}}applyGap(t,e,i){const s=i?this.properties.tile.gap*.5:this.properties.group.gap*.5,n=l=>({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),o=n(t),a=n(e);["top","right","bottom","left"].forEach(l=>{de(o[l],a[l])||e.shrink(s,l)})}createNodeData(){}getGroupBaseStyle(t){const{properties:e}=this,{group:i}=e,s=t?e.highlightStyle.group:void 0;return sf({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},e.fillGradientDefaults,e.fillPatternDefaults)}getGroupStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{undocumentedGroupFills:r,undocumentedGroupStrokes:l,itemStyler:c}=a,h=s.fill??r[Math.min(i??0,r.length)],d=s.stroke??l[Math.min(i??0,l.length)],u={};if(n||(u.fill=h,u.stroke=d),c!=null){const p=this.cachedDatumCallback(t_(t.join(":"),n?"highlight":"node"),()=>this.callWithContext(c,{seriesId:o,datum:e,depth:i,highlighted:n,fill:h,stroke:d,...s}));Object.assign(u,p)}return sf(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getTileBaseStyle(t){const{properties:e}=this,{tile:i}=e,s=t?e.highlightStyle.tile:void 0;return sf({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},e.fillGradientDefaults,e.fillPatternDefaults)}getTileStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:d}=r,u=t[0],p=n.fill??c[u%c.length],g=n.stroke??h[u%h.length],f={};if(o||(f.fill=s!=null?l.convert(s):p,f.stroke=g),d!=null){const x=this.cachedDatumCallback(t_(t.join(":"),o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,depth:i,highlighted:o,fill:p,stroke:g,...n}));Object.assign(f,x)}return sf(f,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateSelections(){let t=this.ctx.highlightManager?.getActiveHighlight();if(t!=null&&!this.properties.group.interactive&&t.children.length!==0&&(t=void 0),this.highlightSelection.update(t!=null?[t]:[],void 0,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode),s=n=>{n.append([new bS({tag:0}),new bS({tag:1})])};this.datumSelection.update(i,void 0,n=>this.getDatumId(n)),this.labelSelection.update(i,s,n=>this.getDatumId(n))}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,highlightStyle:c,tile:h,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!e)return;this.rootNode?.walk(k=>{const{datum:I,depth:L,children:N}=k,O=N.length===0,w=O?h.label:d.label;let R;if(I!=null&&L!=null&&o!=null){const B=I[o];R=this.getLabelText(w,{depth:L,datum:I,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:B})}R===""&&(R=void 0);let G;if(O&&I!=null&&L!=null&&a!=null){const B=I[a];G=this.getLabelText(h.secondaryLabel,{depth:L,datum:I,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:B})}G===""&&(G=void 0),k.labelValue=R,k.secondaryLabelValue=G});const{width:p,height:g}=u;this.squarify(t,new yu(0,0,p,g)),this.rootNode?.walk(k=>{const{bbox:I,children:L,labelValue:N,secondaryLabelValue:O}=k;if(k.label=void 0,k.secondaryLabel=void 0,I!=null)if(L.length===0){const w={width:I.width,height:I.height,meta:null},R=iI(N,this.properties.tile.label,O,this.properties.tile.secondaryLabel,{padding:h.padding},()=>w);if(R==null)return;const{height:G,label:B,secondaryLabel:P}=R,{textAlign:V,verticalAlign:W,padding:F}=h,_=n_[V]??.5,z=I.x+F+(I.width-2*F)*_,U=Eut[W]??.5,Y=I.y+F+G*.5+(I.height-2*F-G)*U;if(B!=null){const{fontStyle:Z="normal",fontFamily:q,fontWeight:Q="normal",color:tt="black"}=this.properties.tile.label;k.label={text:B.text,fontSize:B.fontSize,lineHeight:B.lineHeight,fontStyle:Z,fontFamily:q,fontWeight:Q,color:tt,textAlign:V,verticalAlign:"middle",x:z,y:Y-(G-B.height)*.5}}if(P!=null){const{fontStyle:Z="normal",fontFamily:q,fontWeight:Q="normal",color:tt="black"}=this.properties.tile.secondaryLabel;k.secondaryLabel={text:P.text,fontSize:P.fontSize,lineHeight:P.fontSize,fontStyle:Z,fontFamily:q,fontWeight:Q,color:tt,textAlign:V,verticalAlign:"middle",x:z,y:Y+(G-P.height)*.5}}}else{if(N==null)return;{const{padding:w,textAlign:R}=d,G=this.groupTitleHeight(k,I);if(G==null)return;const B=I.width-2*w,P=Cut.wrapText(N,{maxWidth:I.width-2*w,font:d.label,textWrap:"never"}),V=n_[R]??.5,{fontStyle:W="normal",fontFamily:F,fontWeight:_="normal",color:z="black"}=this.properties.group.label;k.label={text:P,fontSize:d.label.fontSize,lineHeight:kut.getLineHeight(d.label.fontSize),fontStyle:W,fontFamily:F,fontWeight:_,color:z,textAlign:R,verticalAlign:"middle",x:I.x+w+B*V,y:I.y+w+G*.5}}}});const f={series:new yu(0,0,p,g),axis:new yu(0,0,p,g)},x=(k,I,L,N,O)=>{const{bbox:w}=k;if(w==null){I.visible=!1;return}const{datum:R,depth:G=-1,datumIndex:B,colorValue:P}=k,V=k.children.length===0,W=V?N:L,F=V?this.getTileStyleOverrides(B,R,G,P,W,O):this.getGroupStyleOverrides(B,R,G,W,O);I.crisp=!0,Nut(I,W,F,f),I.cornerRadius=V?h.cornerRadius:d.cornerRadius,I.zIndex=[0,G,O?1:0];const _=k.parent?.children.every(Y=>Y.children.length===0),z=k.parent!=null?k.parent.bbox:void 0,U=k.parent!=null?k.parent.padding:void 0;_===!0&&z!=null&&U!=null?(I.clipBBox=w,I.x=z.x+U.left,I.y=z.y+U.top,I.width=z.width-(U.left+U.right),I.height=z.height-(U.top+U.bottom)):(I.clipBBox=void 0,I.x=w.x,I.y=w.y,I.width=w.width,I.height=w.height),I.visible=!0},m=this.getGroupBaseStyle(!1),b=this.getTileBaseStyle(!1);this.datumSelection.each((k,I)=>x(I,k,m,b,!1));const S=this.getGroupBaseStyle(!0),M=this.getTileBaseStyle(!0);this.highlightSelection.each((k,I)=>{x(I,k,S,M,!0)});const D=(k,I,L,N)=>{const O=k.children.length===0,w=L===0?k.label:k.secondaryLabel;if(w==null){I.visible=!1;return}let R;if(N){const{tile:G,group:B}=c;R=G.secondaryLabel.color,O?L===0&&(R=G.label.color):R=B.label.color}I.text=w.text,I.fontSize=w.fontSize,I.lineHeight=w.lineHeight,I.fontStyle=w.fontStyle,I.fontFamily=w.fontFamily,I.fontWeight=w.fontWeight,I.fill=R??w.color,I.textAlign=w.textAlign,I.textBaseline=w.verticalAlign,I.x=w.x,I.y=w.y,I.visible=!0,I.zIndex=1},C=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(bS).forEach(k=>{const I=k.closestDatum();D(I,k,k.tag,I===C)})}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),e}pickNodeClosestDatum(t){const e=this.pickNodesExactShape(t);return e.length!==0?{datum:e[0],distance:0}:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,d=t.reduce((k,I)=>k?.children[I],this.rootNode);if(d==null)return;const{datum:u,depth:p,children:g}=d;if(u==null||p==null)return;const f=g.length===0,x=[],m=a!=null?u[a]:void 0;m!=null&&x.push({label:r,fallbackLabel:a,value:m});const b=l!=null?u[l]:void 0;b!=null&&x.push({label:c,fallbackLabel:l,value:b});let S;f?(S=this.getTileBaseStyle(!1),Object.assign(S,this.getTileStyleOverrides(t,u,p,b,S,!1))):(S=this.getGroupBaseStyle(!1),Object.assign(S,this.getGroupStyleOverrides(t,u,p,S,!1)));const M=S.fill,D=sf({shape:"square",fill:M,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);T.isGradientFill(D.fill)&&(D.fill={...D.fill,gradient:"linear",rotation:0,reverse:!1});const C=f?{marker:D}:void 0;return h.formatTooltip(this.properties,{title:s!=null?u[s]:void 0,symbol:C,data:x},{seriesId:e,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...S})}computeFocusBounds(t){return Lut.toCanvas(this.contentGroup,t.getBBox())}};SS.className="TreemapSeries",SS.type="treemap";var{commonSeriesOptionsDefs:Rut,seriesLabelOptionsDefs:LT,tooltipOptionsDefs:Put}=T,nf={type:K(Ct("treemap")),labelKey:E,secondaryLabelKey:E,childrenKey:E,sizeKey:E,colorKey:E,sizeName:E,colorName:E,fills:mt($o),strokes:mt(dt),colorRange:mt(dt),itemStyler:bt,group:{gap:H,padding:H,cornerRadius:H,textAlign:st("left","center","right"),interactive:j,label:{...LT,spacing:H},...St,...rt},tile:{gap:H,padding:H,cornerRadius:H,textAlign:st("left","center","right"),verticalAlign:st("top","middle","bottom"),label:{...LT,spacing:H,lineHeight:H,minimumFontSize:H,wrapping:st("never","always","hyphenate","on-space"),overflowStrategy:st("ellipsis","hide")},secondaryLabel:{...LT,lineHeight:H,minimumFontSize:H,wrapping:st("never","always","hyphenate","on-space"),overflowStrategy:st("ellipsis","hide")},...St,...rt},tooltip:Put,...Rut,highlightStyle:{group:{label:{color:dt},...St,...rt},tile:{label:{color:dt},secondaryLabel:{color:dt},...St,...rt}}};nf.fillGradientDefaults=yf,nf.fillPatternDefaults=mf,nf.undocumentedGroupFills=mt(dt),nf.undocumentedGroupStrokes=mt(dt);var{FONT_SIZE_RATIO:o_}=T,But={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:t=>new SS(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:T.FILL_PATTERN_DEFAULTS,undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.5]},minimumFontSize:{$rem:[o_.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:[o_.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:0,padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0}}},zut={type:"series",name:"treemap",chartType:"hierarchy",enterprise:!0,options:nf,create:t=>new SS(t)},ypt=T.ModuleRegistry,Fut=[yq,g1,w1,Kst,bnt,W1,Y1,uP,DP,OP],_ut=[mq,xq,bq,Sq,flt,Uct,qct,Bht,$ht],Gut=[kq,Jit,iut],Vut=[wq,got,wdt],jut=[Pq,xut,zut],Wut=[_q,Xlt],Hut=[Kq,Wot,sat,zat,drt,Lrt],Uut=[...Fut,..._ut,...Gut,...Vut,...jut,...Wut,...Hut,Ait,Iit,Tit],a_={xMin:rs,xMax:Gs,yMin:en,yMax:sn,span:Dn},Yut=1e3,Kut=5;function r_(t,e){return Array.from({length:t},(i,s)=>{const n=s*Dn,o=e[n+rs],a=e[n+Gs];return(o+a)/2|0})}function $ut(t,e,i){if(t.length<Yut)return;const[s,n]=Ig(i);let o=Ag(t,Kut),{indexData:a,valueData:r}=Tg(t,e,e,s,n,o),l=r_(o,a);const c=[{maxRange:o,indexData:a,indices:l,indexes:a_}];for(;o>64;)({indexData:a,valueData:r,maxRange:o}=kg(a,r,o)),l=r_(o,a),c.push({maxRange:o,indexData:a,indices:l,indexes:a_});return c.reverse(),c}var{ChartAxisDirection:Xut,ContinuousScale:Zut,OrdinalTimeScale:Qut}=T,qut=class extends T.BarSeries{aggregateData(t,e){if(e?.type!=="ungrouped")return;const i=this.axes[Xut.X];if(i==null||!(Zut.is(i.scale)||Qut.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yValue-raw",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[o];return $ut(s,n,a)}},{BarSeriesModule:Jut}=T,tpt={...Jut,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new qut(t)},ept=1e3,l_=10;function c_(t,e,i,s,n,o){const a=t[o];if(a==null)return!1;const r=Wx(a,e,i),l=Hx(r,n);return o===s[l+rs]||o===s[l+Gs]||o===s[l+en]||o===s[l+sn]}function ipt(t,e,i){if(t.length<ept)return;const[s,n]=Ig(i);let o=Ag(t,l_);const{indexData:a,valueData:r}=Tg(t,e,e,s,n,o);let l=[];for(let h=0;h<t.length;h+=1)c_(t,s,n,a,o,h)&&l.push(h);const c=[{maxRange:o,indices:l}];for(;l.length>l_&&o>64;)({maxRange:o}=kg(a,r,o,{inPlace:!0})),l=l.filter(c_.bind(null,t,s,n,a,o)),c.push({maxRange:o,indices:l});return c.reverse(),c}var{ChartAxisDirection:spt,ContinuousScale:npt,OrdinalTimeScale:opt}=T,apt=class extends T.LineSeries{aggregateData(t,e){const i=this.axes[spt.X];if(i==null||!(npt.is(i.scale)||opt.is(i.scale)))return;const s=t.resolveColumnById(this,"xValue",e),n=t.resolveColumnById(this,"yValueRaw",e),o=t.getDomain(this,"xValue","value",e);return ipt(s,n,o)}},{LineSeriesModule:rpt}=T,lpt={...rpt,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new apt(t)},cpt=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-chrome-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-chrome-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red)}.ag-charts-color-picker{width:190px;padding:8px;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{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);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:calc(var(--ag-charts-chrome-font-size) * (13 / 12));font-weight:var(--ag-charts-chrome-font-weight);transition:transform .1s ease;white-space:nowrap;z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{display:flex;flex-direction:column;padding:.5em 0}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;padding:.5em 1em;text-align:left;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;opacity:.5;text-align:left}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{margin:5px 0;background:#babfc7;height:1px}.ag-charts-context-menu__divider.ag-charts-dark-context-menu{background:#2196f31a}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}
`;T.ModuleRegistry.registerMany(Uut);function h_(){T.moduleRegistry.register(WK,QK,N$,d9,S9,tpt,p8,A7,cJ,qit,Yst,xnt,YJ,T9,N9,W9,Y9,r8,pot,lpt,jot,iat,Bat,hrt,Crt,O8,aQ,oq,jJ,glt,JK,Hct,Qct,Pht,Kht,M$,Ndt,k$,wet,Wtt,U8,$lt,eut,K8,mut,dQ,But,fit,YQ),T.enterpriseModule.isEnterprise=!0,T.enterpriseModule.styles=cpt,T.enterpriseModule.licenseManager=t=>new Dd(t.container?.ownerDocument??(typeof document>"u"?void 0:document)),T.enterpriseModule.injectWatermark=aq}h_();var hpt={setLicenseKey(t){Dd.setLicenseKey(t)}};function d_(){h_(),pm()}var dpt={VERSION:nc,_Scene:Sm,_Theme:vm,_Util:Mm,create:Yn.create.bind(Yn),createSparkline:Yn.__createSparkline.bind(Yn),setup:d_,setGridContext:Dd.setGridContext.bind(Dd),setLicenseKey:Dd.setLicenseKey.bind(Dd),isEnterprise:!0};export{DC as AG_CHARTS_LOCALE_EN_US,Yn as AgCharts,lK as AgChartsCommunityModule,dpt as AgChartsEnterpriseModule,fm as AgErrorBarSupportedSeriesTypes,DM as AgTooltipAnchorToType,AM as AgTooltipPlacementType,IM as AgTooltipPositionType,hpt as LicenseManager,nc as VERSION,T as _ModuleSupport,Sm as _Scene,vm as _Theme,Mm as _Util,UM as _Widget,pm as setupCommunityModules,d_ as setupEnterpriseModules,tL as time};