ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
31 lines • 1.26 MB
JavaScript
(function(ac,Qn){typeof exports=="object"&&typeof module=="object"?module.exports=Qn():typeof define=="function"&&define.amd?define("agCharts",[],Qn):typeof exports=="object"?exports.agCharts=Qn():ac.agCharts=Qn()})(this,()=>{var ac={},Qn={exports:ac};if(typeof RG>"u")var RG=function(e){throw new Error("Unknown module: "+e)};var nu=Object.defineProperty,Zv=Object.getOwnPropertyDescriptor,fT=Object.getOwnPropertyNames,mT=Object.prototype.hasOwnProperty,Ri=(t,e)=>{for(var i in e)nu(t,i,{get:e[i],enumerable:!0})},yT=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of fT(e))!mT.call(t,s)&&s!==i&&nu(t,s,{get:()=>e[s],enumerable:!(n=Zv(e,s))||n.enumerable});return t},bT=t=>yT(nu({},"__esModule",{value:!0}),t),x=(t,e,i,n)=>{for(var s=n>1?void 0:n?Zv(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=(n?o(e,i,s):o(s))||s);return n&&s&&nu(e,i,s),s},Xv={};Ri(Xv,{AG_CHARTS_LOCALE_EN_US:()=>nC,AgCharts:()=>so,AgChartsCommunityModule:()=>OG,AgTooltipAnchorToType:()=>Tx,AgTooltipPlacementType:()=>Lx,AllCartesianAxesModule:()=>PC,AllCartesianModule:()=>jA,AllCartesianSeriesModule:()=>GA,AllCommunityModule:()=>lv,AllPolarModule:()=>sw,AreaSeriesModule:()=>mA,BarSeriesModule:()=>SA,BubbleSeriesModule:()=>NA,CartesianChartModule:()=>gn,CategoryAxisModule:()=>IC,CrossLinesModule:()=>pI,DonutSeriesModule:()=>iw,GroupedCategoryAxisModule:()=>TC,HistogramSeriesModule:()=>PA,LegendModule:()=>sy,LineSeriesModule:()=>VA,LocaleModule:()=>ry,LogAxisModule:()=>LC,ModuleRegistry:()=>ee,NumberAxisModule:()=>NC,PieSeriesModule:()=>nw,PolarChartModule:()=>Jg,ScatterSeriesModule:()=>zA,SparklinePresetModule:()=>RM,TimeAxisModule:()=>OC,UnitTimeAxisModule:()=>RC,VERSION:()=>Qe,_ModuleSupport:()=>Mk,_Scene:()=>_v,_Theme:()=>zv,_Util:()=>Gv,_Widget:()=>Uk,time:()=>QB}),Qn.exports=bT(Xv);var qv=(t=>(t.Chart="chart",t.Axis="axis",t.Series="series",t.Plugin="plugin",t.AxisPlugin="axis:plugin",t.SeriesPlugin="series:plugin",t.Preset="preset",t))(qv||{});function lc(t){return t.domain}var Jv=(t=>(t[t.Leading=0]="Leading",t[t.Trailing=1]="Trailing",t[t.Interpolate=2]="Interpolate",t))(Jv||{}),vT=class{constructor(t){this.length=t,this.buffer=new Uint32Array(Math.ceil(t/32))}clear(){this.buffer.fill(0)}getBit(t){return this.buffer[t>>>5]>>>(t&31)&1}setBit(t){this.buffer[t>>>5]|=1<<(t&31)}unsetBit(t){this.buffer[t>>>5]&=~(1<<(t&31))}toggleBit(t){this.buffer[t>>>5]^=1<<(t&31)}fill(t,e,i){if(e>=i)return;const n=e>>>5,s=e&31,r=i>>>5,o=i&31;if(n===r){const c=(1<<o-s)-1<<s;t?this.buffer[n]|=c:this.buffer[n]&=~c;return}const a=4294967295<<s;t?this.buffer[n]|=a:this.buffer[n]&=~a,this.buffer.fill(4294967295*t,n+1,r);const l=(1<<o)-1;t?this.buffer[r]|=l:this.buffer[r]&=~l}},Os=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){const i=this.events.get(t);if(i)for(const n of i)n(e)}clear(t){t?this.events.delete(t):this.events.clear()}},cc=class{constructor(t){if(this.maxCacheSize=t,this.store=new Map,t<=0)throw new Error("LRUCache size must be greater than 0")}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().next();i.done||this.store.delete(i.value)}return e}clear(){this.store.clear()}},re={};Ri(re,{Time:()=>kT,check:()=>Aa,create:()=>gx,inDevelopmentMode:()=>px});function hc(t){return t===void 0?[]:Array.isArray(t)?t:[t]}function Mp(t){return Array.from(new Set(t))}function uc(t,e){return t.reduce((i,n)=>{const s=e(n);return i[s]??(i[s]=[]),i[s].push(n),i},{})}function es(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!es(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function Ln(t,e,i=0){if(t.length===0)return[];const n=[];for(let s=0;s<e;s++)n.push(t.at((s+i)%t.length));return n}function Qv(t,e){const i=new Map;for(const[n,s]of e.entries())i.set(s,n);return t.sort((n,s)=>{const r=i.get(n)??1/0,o=i.get(s)??1/0;return r-o})}function ex(t,e){let i=0;for(;i<t.length&&e(t[i]);)i+=1;const n=i;n!==0&&t.splice(0,n)}function tx(t,e){let i=t.length-1;for(;i>=0&&e(t[i]);)i-=1;const n=t.length-1-i;n!==0&&t.splice(t.length-n,n)}function ix(t,e,i){const n=[t],s=Math.round((e-t)/(i-1));if(s>0)for(let r=t+s;r<e&&!(n.push(r)>=i-1);r+=s);return n.push(e),n}function xT(t,e){for(let i=e.length-1;i>=0;i--)t.push(e[i]);return t}var Pi={};typeof globalThis.window<"u"&&(Pi.window=globalThis.window),typeof document<"u"?Pi.document=document:typeof globalThis.global<"u"&&(Pi.document=globalThis.document);function rr(t){return t?Pi.document?.[t]:Pi.document}function ts(t){return t?Pi.window?.[t]:Pi.window}function nx(t){Pi.document=t}function sx(t){Pi.window=t}function su(){return Pi.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function dc(){return Pi.window?.Path2D??globalThis.Path2D}function Ip(){return Pi.window?.DOMMatrix??globalThis.DOMMatrix}function rx(){return Pi.window?.Image??globalThis.Image}function ox(){return Pi.window?.ResizeObserver??globalThis.ResizeObserver}var ax=1,ST=11;function ru(t){return t!=null&&typeof t.nodeType=="number"}function Dp(t){return t!=null&&t.nodeType===ax}function lx(t){return t!=null&&t.nodeType===ST}function Da(t){return t!=null&&t.nodeType===ax&&"style"in t}var B={};Ri(B,{error:()=>cx,errorOnce:()=>IT,log:()=>ou,logGroup:()=>ux,reset:()=>DT,table:()=>MT,warn:()=>Ca,warnOnce:()=>Fi});var Cp=new Set;function ou(...t){console.log(...t)}function Ca(t,...e){console.warn(`AG Charts - ${t}`,...e)}function cx(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function MT(...t){console.table(...t)}function hx(t,e,i){let n;t instanceof Error?n=t.message:typeof t=="string"?n=t:typeof t=="object"?n=JSON.stringify(t):n=String(t);const s=`${e}: ${n}`;Cp.has(s)||(i(t),Cp.add(s))}function Fi(t,...e){hx(t,"Logger.warn",i=>Ca(i,...e))}function IT(t,...e){hx(t,"Logger.error",i=>cx(i,...e))}function DT(){Cp.clear()}function CT(t){return typeof t=="object"&&t!==null&&"then"in t}function ux(t,e){console.groupCollapsed(t);let i=!0;try{const n=e();return CT(n)?(i=!1,n.finally(()=>{console.groupEnd()})):n}finally{i&&console.groupEnd()}}var AT=2e3,dx=Date.now();function wT(){const t=Date.now()-dx;if(t>AT){const e=(Math.floor(t/100)/10).toFixed(1);ou(`**** ${e}s since last log message ****`)}dx=Date.now()}function gx(...t){return Object.assign((...i)=>{Aa(...t)&&(typeof i[0]=="function"&&(i=hc(i[0]())),wT(),ou(...i))},{check:()=>Aa(...t),group:(i,n)=>Aa(...t)?ux(i,n):n()})}function Aa(...t){return t.length===0&&t.push(!0),hc(ts("agChartsDebug")).some(i=>t.includes(i))}function px(t){if(Aa("dev"))return t()}function kT(t,e={}){const{logResult:i=!0,logStack:n=!1,logArgs:s=!1,logData:r}=e;return function(o,a,l){const c=l.value;l.value=function(...h){const u=performance.now(),d=c.apply(this,h),p={duration:performance.now()-u};return i&&(p.result=d),s&&(p.args=h),n&&(p.stack=new Error("Stack trace for timing debug").stack),r&&(p.logData=r(this)),ou(t,p),d}}}var or={};Ri(or,{flush:()=>mx,record:()=>fx});var Ap=new Map;function fx(t,e){Aa("scene:stats:verbose")&&Ap.set(t,e)}function mx(){const t=Object.fromEntries(Ap);return Ap.clear(),t}var ar={},ee={};Ri(ee,{RegistryMode:()=>yx,getAxisModule:()=>_T,getChartModule:()=>zT,getPresetModule:()=>GT,getSeriesModule:()=>jT,hasModule:()=>FT,ifRegistryChanged:()=>ET,isEnterprise:()=>bx,isIntegrated:()=>NT,isModuleType:()=>wa,isUmd:()=>OT,listModules:()=>VT,listModulesByType:()=>BT,register:()=>wp,registerModules:()=>RT,reset:()=>PT,setRegistryMode:()=>TT});var yx=(t=>(t.Enterprise="enterprise",t.Integrated="integrated",t.UMD="umd",t))(yx||{}),gc=new Set;function TT(t){gc.add(t)}function LT(){gc.clear()}function bx(){return gc.has("enterprise")}function NT(){return gc.has("integrated")}function OT(){return gc.has("umd")}var is=new Map,au=0;function vx(t){if(is.set(t.name,t),au++,t.dependencies)for(const e of t.dependencies)wp(e)}function ET(t,e){return au!==t&&e(),au}function wp(t){const e=is.get(t.name);if(!e){vx(t);return}if(e.version===t.version){!e.enterprise&&t.enterprise&&vx(t);return}throw new Error([`AG Charts - Module '${t.name}' already registered with different version:`,`${e.version} vs ${t.version}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(`
`))}function RT(t){for(const e of t.flat())wp(e)}function PT(){LT(),is.clear(),au++}function FT(t){return is.has(t)}function*VT(){for(const t of is.values())yield t}function*BT(t){for(const e of is.values())wa(t,e)&&(yield e)}function _T(t){const e=is.get(t);if(wa("axis",e))return e}function zT(t){const e=is.get(t);if(wa("chart",e))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function GT(t){const e=is.get(t);if(wa("preset",e))return e}function jT(t){const e=is.get(t);if(wa("series",e))return e}function wa(t,e){return e?.type===t}var it=class{constructor(){this.callbacks=new Set}flush(){for(const t of this.callbacks)t();this.callbacks.clear()}merge(t){for(const e of t.callbacks)this.callbacks.add(e)}register(...t){for(const e of t)e&&this.callbacks.add(e)}},pc=class{constructor(){this.cleanup=new it}destroy(){this.cleanup.flush()}};function PG(t){return t}var xx=new WeakMap;function ns(t){const e=xx.get(t);if(!e)throw new Error("AG Charts - DynamicContext: missing internal state.");return e}var HT=class Kk{constructor(e){const i={cleanup:new it,self:this,resolving:new Set,children:new Set,refs:new Set,parent:e,destroyed:!1};xx.set(this,i),e&&ns(e).children.add(this)}get cleanup(){return ns(this).cleanup}constant(e,i){return this.assertNotDestroyed(),Object.defineProperty(this,e,{value:i,configurable:!0,enumerable:!0}),ns(this).self}ref(e,i){this.assertNotDestroyed();const n=ns(this);return n.refs.add(e),Object.defineProperty(this,e,{value:i,configurable:!0,enumerable:!0}),n.self}service(e,i){return this.assertNotDestroyed(),Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>{const n=this.resolve(e,i);return Object.defineProperty(this,e,{value:n,configurable:!0,enumerable:!0}),n}}),ns(this).self}factory(e,i){return this.assertNotDestroyed(),Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>this.resolve(e,i)}),ns(this).self}has(e){return e in this}child(){const e=new Kk(this);return Object.setPrototypeOf(e,this),e}destroy(){const e=ns(this);if(e.destroyed)return;e.destroyed=!0;for(const n of e.children)n.destroy();e.children.clear();const i=Object.keys(this);for(let n=i.length-1;n>=0;n--){const s=i[n];if(e.refs.has(s))continue;const r=Object.getOwnPropertyDescriptor(this,s);r?.value!=null&&typeof r.value=="object"&&r.value.destroy?.()}e.cleanup.flush(),e.parent&&ns(e.parent).children.delete(this)}resolve(e,i){const n=ns(this);if(n.destroyed)throw new Error(`AG Charts - DynamicContext: cannot resolve '${e}' on a destroyed context.`);if(n.resolving.has(e))throw new Error(`AG Charts - DynamicContext: circular dependency detected while resolving '${e}'.`);n.resolving.add(e);try{return i(n.self)}finally{n.resolving.delete(e)}}assertNotDestroyed(){if(ns(this).destroyed)throw new Error("AG Charts - DynamicContext: cannot register on a destroyed context.")}};function kp(){return new HT}function J(t,e,i){return Math.min(i,Math.max(t,e))}function Ze(t){if(typeof t=="number")return t;const e=Number(t);return Number.isFinite(e)||Fi(`the value ${t} exceeds the representable Number range and cannot be rendered.`),e}function ka(t){return typeof t=="bigint"?Ze(t):Number(t)}function lu(t){return t==null?void 0:Number(t)}function Sx(t,e){return(typeof t=="bigint"||Number.isInteger(t))&&(typeof e=="bigint"||Number.isInteger(e))}function cu(t,e){return typeof t=="bigint"||typeof e=="bigint"?Sx(t,e)?BigInt(t)+BigInt(e):Number(t)+Number(e):t+e}function fc(t,e){return typeof t=="bigint"||typeof e=="bigint"?Sx(t,e)?BigInt(t)-BigInt(e):Number(t)-Number(e):t-e}function Es(t,e){return typeof t=="number"&&typeof e=="number"?Math.min(t,e):typeof t=="number"&&Number.isNaN(t)?t:typeof e=="number"&&Number.isNaN(e)?e:t<e?t:e}function ss(t,e){return typeof t=="number"&&typeof e=="number"?Math.max(t,e):typeof t=="number"&&Number.isNaN(t)?t:typeof e=="number"&&Number.isNaN(e)?e:t>e?t:e}function hu(t){return typeof t=="bigint"?t<0n?-t:t:Math.abs(t)}function co(t){return typeof t=="bigint"?0n:0}function Mx(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function Vi(t,e,i=1e-10){return t===e||Math.abs(t-e)<i}function Ta(t){return typeof t=="bigint"?t<0n:Math.sign(t)===-1||Object.is(t,-0)}function Ix(t){return t%1===0}function uu(t,e=2){const i=10**e;return Math.round(t*i)/i}function $T(t,e=2){const i=10**e;return Math.ceil(t*i)/i}function Dx(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function du(t){if(Math.floor(t)===t)return 0;let e=String(t),i=0;if(t<1e-6||t>=1e21){let s;[e,s]=e.split("e"),s!=null&&(i=Number(s))}const n=e.split(".")[1]?.length??0;return Math.max(n-i,0)}function WT(t,e){for(let i=e+1;i<t.length;i++)if(t[i]?.stop!=null)return i;return t.length-1}function Tp(t,e,i,n){const s=new Array(t.length);let r=0,o=-1;for(let a=0;a<t.length;a++){a>=o&&(o=WT(t,a));const l=lu(t[a]?.stop);if(l==null){const c=lu(t[r]?.stop),h=lu(t[o]?.stop),u=c??e,d=h??i,g=n&&c==null?1:0;s[a]=u+(d-u)*(a-r+g)/(o-r+g)}else s[a]=l,r=a}return s}function Cx(t,e,i,n){if(t.name!=null)return t.name;const s=e===i.length-1;return Number.isInteger(t.start)&&Number.isInteger(t.end)&&!s&&t.end-t.start>=1?`${n(t.start,0)}\u2013${n(t.end-1,0)}`:`${n(t.start)}\u2013${n(t.end)}`}function Ax(t,e,i){if(t.length===0)return{domain:[],range:[],bins:[]};const n=Ze(e[0]),s=Ze(e[1]),r=i==="discrete",o=Tp(t,n,s,r),a=t.map(l=>l.color);return r?UT(o,a,t,n,s):{domain:o,range:a,bins:[]}}function UT(t,e,i,n,s){const r=[],o=[],a=[];for(let l=0;l<i.length;l++){const c=l===0?n:t[l-1],h=t[l],u=J(n,c,s),d=Math.max(u,J(n,h,s));r.push(u),o.push(e[l]),a.push({start:u,end:d,color:e[l],name:i[l].name})}return r.push(a.at(-1).end),{domain:r,range:o,bins:a}}function wx(t){const{domain:e,range:i,mode:n,displayDomain:s}=t;if(i.length===0)return[];const[r,o]=s?[Ze(s[0]),Ze(s[1])]:[e[0],e.at(-1)],a=o-r||1;if(n==="discrete"){const l=[];for(let c=0;c<i.length;c++){const h=J(0,(e[c]-r)/a,1),u=J(0,(e[c+1]-r)/a,1);u<h||(l.push({stop:h,color:i[c]}),u>h&&l.push({stop:u,color:i[c]}))}return l}if(e.length<i.length){const l=Math.max(i.length-1,1);return i.map((c,h)=>({stop:h/l,color:c}))}return e.map((l,c)=>({stop:(l-r)/a,color:i[c]}))}function Lp(t,e,i,n,s){return Cx({start:t,end:e,color:""},i,{length:n},s)}function kx(t,e,i,n){const{domain:s,range:r,mode:o}=t;if(o!=="discrete"||r.length===0)return;let a=0;for(;a<r.length-1&&i>=s[a+1];)a++;return e[a]?.name??Lp(s[a],s[a+1],a,r.length,n)}function Np(t){return t.flatMap((e,i)=>{const{stop:n}=e,s=t.at(i+1)?.color;return s==null?[e]:[e,{stop:n,color:s}]})}var KT=void 0,YT=void 0;YT=KT;var ZT=void 0,XT=void 0;XT=ZT;var Tx=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(Tx||{}),Lx=(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))(Lx||{}),qT=void 0,JT=void 0;JT=qT;var QT=void 0,e1=void 0;e1=QT;var La="\u2026",lr=/\r?\n/g,mc="\u200B",Nx=/[\s.,;:-]{1,5}$/,yc;function Ox(t){if(yc==null){const i=ts("Option");yc=new i().style}yc.color=t;const e=yc.color||null;return yc.color="",e}function Na(t){return t?.ownerDocument.defaultView?.getComputedStyle(t).direction==="rtl"}function gu(t,e){if(!t)return;const{x:i,y:n,width:s,height:r}=i1(e);pu(t.style,"width",s),pu(t.style,"height",r),pu(t.style,"left",i),pu(t.style,"top",n)}function Ex(t){const e=Number.parseFloat(t.style.width),i=Number.parseFloat(t.style.height),n=Number.parseFloat(t.style.left),s=Number.parseFloat(t.style.top),r=Number.isFinite(e)?e:t.offsetWidth,o=Number.isFinite(i)?i:t.offsetHeight,a=Number.isFinite(n)?n:t.offsetLeft,l=Number.isFinite(s)?s:t.offsetTop;return{x:a,y:l,width:r,height:o}}function t1(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const{ownerDocument:e}=t,i=e.createRange();i.setStart(t.lastChild,t.lastChild.textContent.length),i.setEnd(t.lastChild,t.lastChild.textContent.length);const n=e.defaultView?.getSelection();n?.removeAllRanges(),n?.addRange(i)}function Rx(){const t=ts("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function bc(t){return`ag-charts-icon ag-charts-icon-${t}`}function i1(t){let{x:e,y:i,width:n,height:s}=t;return(n==null||n>0)&&(s==null||s>0)?t:(e!=null&&n!=null&&n<0&&(n=-n,e=e-n),i!=null&&s!=null&&s<0&&(s=-s,i=i-s),{x:e,y:i,width:n,height:s})}function pu(t,e,i){i==null?t.removeProperty(e):t.setProperty(e,`${i}px`)}function rs(t){return t!=null}function ue(t){return Array.isArray(t)}function Px(t){return typeof t=="boolean"}function pn(t){return t instanceof Date}function vc(t){return pn(t)&&!Number.isNaN(Number(t))}function Fx(t){return t instanceof RegExp}function os(t){return typeof t=="function"}function ce(t){return typeof t=="object"&&t!==null&&!ue(t)}function Oa(t){return ue(t)||Le(t)}function Le(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function xc(t){if(typeof t!="object"||t===null)return!1;for(const e in t)return!1;return!0}function nt(t){return typeof t=="string"}function Nn(t){return typeof t=="number"}function Be(t){return Number.isFinite(t)}function Ea(t){return typeof t=="bigint"}function Zi(t){return typeof t=="number"||typeof t=="bigint"}function On(t){return typeof t=="bigint"||Number.isFinite(t)}function Vx(t){return t!=null&&t.nodeType===1&&"style"in t}function n1(t,e){return nt(e)&&Object.keys(t).includes(e)}function s1(t,e){return Object.values(t).includes(e)}function Ra(t){return typeof t=="symbol"}function Bx(t){return nt(t)&&(t==="none"||Ox(t)!=null)}function Sc(t,e){return t in e}var Op=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function r1(t){return t?t.split(",").map(e=>{const i=e.trim();return!i||i.startsWith('"')||i.startsWith("'")||Op.has(i)?i:/\s/.test(i)?`"${i}"`:i}).join(", "):""}function fu({fontSize:t,fontStyle:e,fontWeight:i,fontFamily:n}){let s="";return e&&e!=="normal"&&(s+=`${e} `),i&&i!=="normal"&&i!==400&&(s+=`${i===700?"bold":i} `),s+=`${t}px`,s+=` ${r1(n)}`,s}function Ep(t,e=1.15){return Math.round(t*e)}function $e(t){return String(t??"")}function _x(t){return Nn(t)||pn(t)?$e(t):t}function Rp(t){return Pp(t.replace(Nx,""))+La}var o1=new Set([1575,1577,1583,1584,1585,1586,1608]);function a1(t){return t>=1568&&t<=1610&&!o1.has(t)}function Pp(t){if(!t)return t;const e=t.codePointAt(t.length-1);return a1(e)?t+"\u200D":t}function zx(t){return mc+t+mc}function Gx(t){return t.replaceAll(mc,"")}function jx(t){return ue(t)?Mc(t.at(-1)):as($e(t))}function as(t){return t.endsWith(La)}function Mc(t){return!t||t.type==="image"?!1:$e(t.text).endsWith(La)}var Hx=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function Rs(t){return Hx?Array.from(Hx.segment(t),e=>e.segment):Array.from(t)}function cr(t,e="and",i=String,n=1/0){if(t.length===0)return"";if(t.length===1)return i(t[0]);t=t.map(i);const s=t.pop();if(t.length>=n){const r=t.length-(n-1);return`${t.slice(0,n-1).join(", ")}, and ${r} more ${e} ${s}`}return`${t.join(", ")} ${e} ${s}`}function Ic(t,e=1/0){if(typeof t=="number"){if(Number.isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}else if(typeof t=="bigint")return`${t}`;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.codePointAt(i)===10&&e++;return e}function Wx(t,e){if(t===e)return 0;const[i,n]=t.length<e.length?[t,e]:[e,t],s=i.length,r=n.length;let o=new Array(s+1).fill(0).map((l,c)=>c),a=new Array(s+1);for(let l=1;l<=r;l++){a[0]=l;for(let c=1;c<=s;c++){const h=n[l-1]===i[c-1]?0:1;a[c]=Math.min(o[c]+1,a[c-1]+1,o[c-1]+h)}[o,a]=[a,o]}return o[s]}function Ux(t){return t.replaceAll(l1,(e,i)=>(i>0?"-":"")+e.toLowerCase())}var l1=/[A-Z]+(?![a-z])|[A-Z]/g;function je(t,e=""){return t==null?e:ue(t)?t.map(i=>i.type==="image"?i.alt??"":$e(i.text)).join(""):nt(t)?t:String(t)}function c1(t,e=0,i){const{leading:n=!1,trailing:s=!0,maxWait:r=1/0}=i??{};let o,a;if(r<e)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(n&&!a){a=Date.now(),o=setTimeout(()=>a=null,e),t(...c);return}let h=e;if(r!==1/0&&a){const u=Date.now()-a;e>r-u&&(h=r-u)}clearTimeout(o),a??(a=Date.now()),o=setTimeout(()=>{a=null,s&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(o),a=null}})}function Fp(t,e,i){const{leading:n=!0,trailing:s=!0}=i??{};let r,o,a=!1;function l(){s&&o?(r=setTimeout(l,e),t(...o)):a=!1,o=null}function c(...h){a?o=h:(a=!0,r=setTimeout(l,e),n?t(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(r),a=!1,o=null}})}function Vp(t,e,i=""){try{return t(...e)}catch(n){const s=i?` \`${i}\``:"";Fi(`Uncaught exception in user callback${s}`,n)}}var Bi=Symbol("description"),Bp=Symbol("required"),mu=Symbol("marked"),yu=Symbol("undocumented"),Kx=Symbol("enterprise"),Dc=Symbol("union"),Yx=new WeakMap,h1=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"],["show","visible","enabled"],["value","range"]].reduce((t,e)=>{for(const i of e)t.set(i.toLowerCase(),new Set(e.filter(n=>n!==i)));return t},new Map),Zx=(t=>(t.Enterprise="enterprise",t.Invalid="invalid",t.Required="required",t.Unknown="unknown",t))(Zx||{});function Cc(t,e){return Be(e)?`${t}[${e}]`:t?`${t}.${e}`:e}var Ps=class{constructor(t,e,i,n,s){this.type=t,this.description=e,this.value=i,this.path=n,this.key=s}setUnionType(t,e){if(this.path.startsWith(e)){const i=this.path.slice(e.length);this.altPath=`${e}[type=${t}]${i}`}}getPrefix(){const{altPath:t=this.path,key:e}=this;return!t&&!e?"Value":`Option \`${e?Cc(t,e):t}\``}toString(){const{description:t="unknown",type:e,value:i}=this;return e==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${t}, ignoring.`:e==="enterprise"?`${this.getPrefix()} is an AG Charts Enterprise feature; ignoring.`:`${this.getPrefix()} cannot be set to \`${Ic(i,50)}\`; expecting ${t}, ignoring.`}},bu=class extends Ps{constructor(t,e,i,n){super("unknown",void 0,e,i,n),this.suggestions=t,this.key=n}getPrefix(){return`Unknown option \`${Cc(this.altPath??this.path,this.key)}\``}getPostfix(){const t=cr(u1(this.key,this.suggestions),"or",e=>`\`${e}\``);return t?`; Did you mean ${t}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function $t(t,e,i="",n={}){if(!ce(t))return{cleared:null,invalid:[new Ps("required","an object",t,i)]};const s={},r=[],o=new Set(Object.keys(t)),a=[],l=n.skipDisabledNodeValidation===!0&&t.enabled===!1;let c=Yx.get(e);c===void 0&&(c=Object.keys(e),Yx.set(e,c));const h=e;if(Dc in e){const u=c,d=e[Dc];if(t.type!=null&&u.includes(t.type)||t.type==null&&d!=null){const{type:g=d,...p}=t,f=$t(p,h[g],i,n);Object.assign(s,{type:g},f.cleared);for(const m of f.invalid)m.setUnionType(g,i);r.push(...f.invalid)}else if(l)Object.assign(s,{enabled:!1});else{const g=cr(u,"or",p=>`'${p}'`);r.push(new Ps("required",`a keyword such as ${g}`,t.type,i,"type"))}return{cleared:s,invalid:r}}for(const u of c){const d=e[u],g=d[Bp],p=t[u];if(o.delete(u),p===void 0&&(d[yu]||a.push(u),!g||l))continue;const f=Cc(i,u);if(os(d)){const y=d(p,{options:t,path:f,params:n});if(typeof y=="object"){if(r.push(...y.invalid),y.valid){s[u]=y.cleared;continue}else if(uo(y.invalid,f))continue}else if(y){s[u]=p;continue}r.push(new Ps(g?"required":"invalid",d[Bi],p,i,u))}else{const m=$t(p,d,f,n);m.cleared!=null&&(s[u]=m.cleared),r.push(...m.invalid)}}for(const u of o){const d=t[u];d!==void 0&&r.push(new bu(a,d,i,u))}return{cleared:s,invalid:r}}function u1(t,e,i=2){const n=t.toLowerCase(),s=h1.get(n);return e.filter(r=>{const o=r.toLowerCase();return s?.has(r)===!0||o.includes(n)||Wx(n,o)<=i})}function be(t,e){if(os(t)){let n=function(s,r){return t(s,r)};var i=n;return n[Bi]=e,n}else return{...t,[Bi]:e}}function Z(t){if(t[Kx])throw new Error("`required()` cannot wrap an `enterprise()` validator; enterprise options must remain optional.");return Object.assign(os(t)?(e,i)=>t(e,i):Re(t),{[Bp]:!0,[Bi]:t[Bi]})}function Q(t){return Object.assign(os(t)?(e,i)=>t(e,i):Re(t),{[yu]:!0,[Bi]:t[Bi]})}function ho(t){if(t[Bp])throw new Error("`enterprise()` cannot wrap a `required()` validator; enterprise options must remain optional.");const e=os(t)?t:Re(t),i=t[Bi];return Object.assign((s,r)=>s!==void 0&&!bx()?(Fi(new Ps("enterprise",i,s,r.path).toString()),{valid:!0,cleared:null,invalid:[]}):e(s,r),{[Kx]:!0,[Bi]:i})}var Re=(t,e="an object",i=!1)=>be((n,s)=>{const r=$t(n,t,s.path),o=!uo(r.invalid,s.path);return{valid:o,cleared:o||!i?r.cleared:null,invalid:r.invalid}},e),Pa=(t,e,i)=>({...t,[Bi]:e,[Dc]:i}),Se=(...t)=>be((e,i)=>{const n=[];for(const s of t){const r=s(e,i);if(typeof r=="object"){if(n.push(...r.invalid),!r.valid)return{valid:!1,cleared:e,invalid:n};e=r.cleared}else if(!r)return!1}return{valid:!0,cleared:e,invalid:n}},cr(t.filter(e=>!e[yu]).map(e=>e[Bi]).filter(rs),"and")),te=(...t)=>be((e,i)=>{for(const n of t){const s=n(e,i);if(typeof s=="object"?s.valid:s)return s}return!1},cr(t.filter(e=>!e[yu]).map(e=>e[Bi]).filter(rs),"or")),Fa=t=>On(t)||vc(t),d1=t=>pn(t)||(Be(t)||nt(t))&&vc(new Date(t)),ls=be(ue,"an array"),L=be(Px,"a boolean"),Pe=be(os,"a function"),Wt=be(Bx,"a color string"),Ct=be(d1,"a date"),he=be(rs,"a defined value"),G=be(Be,"a number"),Ne=be(On,"a number or bigint"),hr=be(ce,"an object"),O=be(nt,"a string"),_p=be(Vx,"an html element"),En=(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`,be(n=>ue(n)&&n.length>=t&&n.length<=e,i)},zp=(t,e=1/0)=>{let i;return e===1/0?i=`a string of at least ${t} characters`:t===e?i=`an string of exactly ${t} characters`:t===0?i=`an string of no more than ${e} characters`:i=`an string of at least ${t} and no more than ${e} characters`,be(n=>nt(n)&&n.length>=t&&n.length<=e,i)},Gp=(t,e=!0)=>be(i=>Be(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),Xx=(t,e)=>be(i=>Be(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),w=Gp(0),Fs=Gp(0,!1),jp=be(t=>On(t)&&t>=0,"a number or bigint greater than or equal to 0"),qx=be(t=>On(t)&&t>0,"a number or bigint greater than 0"),X=Xx(0,1),Si=t=>be((e,{options:i})=>!Fa(e)||!Fa(i[t])||e<i[t],`the value to be less than \`${t}\``),Jx=t=>be((e,{options:i})=>!Fa(e)||!Fa(i[t])||e<=i[t],`the value to be less than or equal to \`${t}\``),Mi=t=>be((e,{options:i})=>!Fa(e)||!Fa(i[t])||e>i[t],`the value to be greater than \`${t}\``);function V(...t){ce(t[0])&&(t=Object.values(t[0]));const e=cr(t,"or",i=>`'${i}'`);return be(i=>t.includes(i),`a keyword such as ${e}`)}function vu(){return V}var _e=t=>be(e=>t===e,`the value ${JSON.stringify(t)}`),g1=(t,e)=>be(i=>i instanceof t,e??`an instance of ${t.name}`),ne=(t,e,i=!0)=>be((n,s)=>{if(!ue(n))return!1;let r=i;const o=[],a=[],l=c=>{r=i?r&&c:r||c};if(n.length===0)return{valid:!0,cleared:o,invalid:a};for(let c=0;c<n.length;c++){const h=n[c],u=t(h,{options:h,path:`${s.path}[${c}]`,params:s.params});typeof u=="object"?(l(u.valid),a.push(...u.invalid),u.cleared!=null&&o.push(u.cleared)):(l(u),u&&o.push(h))}return{valid:r,cleared:r||!i?o:null,invalid:a}},e??`${t[Bi]} array`),ct=(t,e="an object array")=>be((i,n)=>{if(!ue(i))return!1;const s=[],r=[];for(let o=0;o<i.length;o++){const a=`${n.path}[${o}]`,l=$t(i[o],t,a,n.params);uo(l.invalid,a)||s.push(l.cleared),r.push(...l.invalid)}return{valid:!0,cleared:s,invalid:r}},e),ti=(t,e)=>be((i,n)=>{if(!os(i))return!1;if(mu in i)return!0;const s=e??t[Bi];return{valid:!0,cleared:Object.assign((...o)=>{const a=Vp(i,o);if(a==null)return;const l=t(a,{options:a,path:""});if(typeof l=="object"){if(Qx(l,n,s),l.valid)return l.cleared}else{if(l)return a;Fi(`Callback \`${n.path}\` returned an invalid value \`${Ic(a,50)}\`; expecting ${s}, ignoring.`)}},{[mu]:!0}),invalid:[]}},"a function"),Ae=(t,e="an object")=>be((i,n)=>{if(!os(i))return!1;if(mu in i)return!0;const s=e;return{valid:!0,cleared:Object.assign((...o)=>{const a=Vp(i,o,n.path);if(a==null)return;const l=$t(a,t);return Qx(l,n,s),l.cleared},{[mu]:!0}),invalid:[]}},"a function");function uo(t,e){return t.some(i=>i.type==="required"&&i.path===e)}function Qx(t,e,i){if(t.invalid.length!==0)for(const n of t.invalid){if(n instanceof bu)return Fi(`Callback \`${e.path}\` returned an unknown property \`${Cc(n.path,n.key)}\`${n.getPostfix()}`);const s=Ic(n.value,50);Fi(n.key?`Callback \`${e.path}\` returned an invalid property \`${Cc(n.path,n.key)}\`: \`${s}\`; expecting ${n.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${s}\`; expecting ${i??n.description}, ignoring.`)}}var e0=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,t0=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function i0(t){if(!nt(t))return!1;const e=t0.exec(t);return e0.test(e?e[2]:t)}function xu(t){let e,i;const n=t0.exec(t);n&&([,e,t,i]=n);const s=e0.exec(t);if(!s){Fi(`The number formatter is invalid: ${t}`);return}const[,r,o,a,l,c,h,u,d,g,p]=s;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:Number.parseInt(h),comma:u,precision:Number.parseInt(d),trim:!!g,type:p,prefix:e,suffix:i}}function Hp(t){const e=typeof t=="string"?xu(t):t;if(e==null)return;const{fill:i,align:n,sign:s="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=e;let{trim:g}=e;const p=d==null||Number.isNaN(d);let f;if(!c)f=fn.g,g=!0;else if(c in fn&&c in Va)f=p?Va[c]:fn[c];else if(c in fn)f=fn[c];else if(c in Va)f=Va[c];else throw new Error(`The number formatter type is invalid: ${c}`);const m=c?6:12;let y;p||(y=d);let b=n,v=i;return o&&(v??(v="0"),b??(b="=")),(S,M)=>{if(typeof S=="bigint")return`${h}${S.toLocaleString("en-US")}${u}`;let D;y!=null?D=y:c==="f"||c==="%"?D=M??m:c?D=m:D=M??m;let I=f(S,D);g&&(I=m1(I)),l&&(I=y1(I,l));const A=S1(r,c),k=A?.length??0;A&&(I=`${A}${I}`),c==="s"&&(I=`${I}${b1(S)}`),(c==="%"||c==="p")&&(I=`${I}%`);const{value:T,prefixLength:R}=v1(S,I,s),E=R+k;let F=T;return a!=null&&!Number.isNaN(a)&&(F=x1(F,a,v??" ",b,E)),F=`${h}${F}${u}`,F}}var Va={b:t=>Su(t).toString(2),c:t=>String.fromCodePoint(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>Su(t).toString(8),x:t=>Su(t).toString(16),X:t=>Va.x(t).toUpperCase(),n:t=>Va.d(t),"%":t=>`${Su(t*100).toFixed(0)}`},fn={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>fn.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>fn.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i));return n>=-4&&n<e?i.toFixed(e-1-n):i.toExponential(e-1)},G:(t,e)=>fn.g(t,e).toUpperCase(),n:(t,e)=>fn.g(t,e),p:(t,e)=>fn.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i))-(e-1);if(s<=0)return i.toFixed(-s);const r=10**s;return(Math.round(i/r)*r).toFixed()},s:(t,e)=>{const i=r0(t);return fn.r(t/10**i,e)},"%":(t,e)=>fn.f(t*100,e)},n0=-24,s0=24,p1={[n0]:"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",[s0]:"Y"},f1="\u2212";function Su(t){return Math.floor(Math.abs(t))}function m1(t){if(!t.endsWith("0")||!t.includes("."))return t;let e=t.length-1;for(;e>0;)if(t[e]=="0")e-=1;else if(t[e]=="."){e-=1;break}else break;return t.substring(0,e+1)}function y1(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const n=t.substring(0,i).split(""),s=t.substring(i);for(let r=n.length-3;r>0;r-=3)n.splice(r,0,e);return`${n.join("")}${s}`}function b1(t){return p1[r0(t)]}function r0(t){return J(n0,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,s0)}function v1(t,e,i=""){if(i==="(")return t>=0?{value:e,prefixLength:0}:{value:`(${e})`,prefixLength:1};let n="";return t<0?n=f1:i==="+"?n="+":i===" "&&(n=" "),{value:`${n}${e}`,prefixLength:n.length}}function x1(t,e,i=" ",n=">",s=0){const r=e-t.length;if(r<=0)return t;const o=i.repeat(r);if(n==="="){const a=Math.min(Math.max(s,0),t.length),l=t.slice(0,a),c=t.slice(a);return`${l}${o}${c}`}if(n===">"||!n)return o+t;if(n==="<")return`${t}${o}`;if(n==="^"){const a=Math.ceil(r/2),l=Math.floor(r/2);return`${i.repeat(a)}${t}${i.repeat(l)}`}return o+t}function S1(t,e){if(t==="#")switch(e){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return t??""}var Vs=t=>{if(!ce(t))return!1;const e=Object.keys(t);return e.length===1&&e[0].startsWith("$")},M1=["accentColor","axisLineColor","backgroundColor","borderColor","borderRadius","chartBackgroundColor","chartPadding","focusShadow","foregroundColor","fontFamily","fontSize","fontWeight","gridLineColor","popupShadow","subtleTextColor","textColor","chromeBackgroundColor","chromeFontFamily","chromeFontSize","chromeFontWeight","chromeTextColor","chromeSubtleTextColor","buttonBackgroundColor","buttonBorder","buttonFontWeight","buttonTextColor","inputBackgroundColor","inputBorder","inputTextColor","menuBackgroundColor","menuBorder","menuTextColor","panelBackgroundColor","panelSubtleTextColor","tooltipBackgroundColor","tooltipBorder","tooltipTextColor","tooltipSubtleTextColor","crosshairLabelBackgroundColor","crosshairLabelTextColor","groupedCategoryLineColor"],o0=V(...M1),I1=be(Re({ref:o0,mix:w,onto:o0}),"a color ref"),D1=be(t=>!ce(t)||!("onto"in t)||"mix"in t,"where a color ref with [onto] must also have [mix]"),a0=Se(I1,D1),K=te(Wt,Vs,a0),C1=Re({color:K,stop:X},""),Mu=be(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},"colour stops to be defined in ascending order"),Iu=Se(En(2),ne(C1),Mu),A1=Re({color:Z(K),stop:Ne,name:O},"a color scale color stop"),Bs=Re({fills:Se(En(2),ne(A1),Mu),domain:Se(En(2),ne(Ne),be(t=>t[0]<=t[1],"domain to be in ascending order")),mode:V("continuous","discrete"),missingDataFill:K},"a colour scale configuration"),$p=V("axis","item","series"),w1={type:Z(_e("gradient")),colorStops:Z(Iu),rotation:G,gradient:Q(V("linear","radial","conic")),bounds:Q($p),reverse:Q(L),colorSpace:Q(V("rgb","oklch"))},Du=Re(w1,"a gradient object with colour stops"),_={stroke:K,strokeWidth:w,strokeOpacity:X},l0=Re({type:Z(_e("gradient")),gradient:Z(V("linear","radial","conic")),bounds:Z($p),colorStops:Z(te(Iu,Se(En(2),ne(K)))),rotation:Z(G),reverse:Z(L),colorSpace:Z(V("rgb","oklch"))}),c0=Re({type:Z(_e("pattern")),pattern:Z(V("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:zp(2),width:Z(w),height:Z(w),fill:Z(K),fillOpacity:Z(X),backgroundFill:Z(K),backgroundFillOpacity:Z(X),padding:Z(w),rotation:Z(G),scale:Z(w),stroke:Z(K),strokeWidth:Z(w),strokeOpacity:Z(X)}),h0=Re({type:Z(_e("image")),url:O,width:w,height:w,rotation:Z(G),backgroundFill:Z(K),backgroundFillOpacity:X,fit:Z(V("stretch","contain","cover")),repeat:Z(V("repeat","repeat-x","repeat-y","no-repeat"))}),k1={gradient:{colorStops:Iu,rotation:G,gradient:Q(V("linear","radial","conic")),bounds:Q($p),reverse:Q(L),colorSpace:Q(V("rgb","oklch"))},pattern:{pattern:V("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:zp(2),width:w,height:w,rotation:G,scale:w,fill:K,fillOpacity:X,backgroundFill:K,backgroundFillOpacity:X,..._,padding:Q(w)},image:{url:Z(O),backgroundFill:K,backgroundFillOpacity:X,width:w,height:w,fit:V("stretch","contain","cover","none"),repeat:V("repeat","repeat-x","repeat-y","no-repeat"),rotation:G}},u0=Pa(k1,"a color object"),Xi=te(Wt,Re(u0,"a color object"),Vs,a0),d0=te(Wt,Re(u0,"a color object")),W={fill:Xi,fillOpacity:X};W.fillGradientDefaults=Q(l0),W.fillPatternDefaults=Q(c0),W.fillImageDefaults=Q(h0);var qi={fill:K,fillOpacity:X},U={lineDash:ne(w),lineDashOffset:G},Rn={...W,..._,...U,opacity:X,cornerRadius:w},ur={..._,...U,opacity:X},We={...W,..._,...U,opacity:X},g0=We,p0=vu()("any","all");function Wp(t){return{enabled:L,range:V("tooltip","node"),highlightedItem:t,unhighlightedItem:t}}function Cu(t){return{enabled:L,containment:p0,selectedItem:t,unselectedItem:t,unselectedSeries:t}}function ht(t,e){return{enabled:L,range:V("tooltip","node"),highlightedItem:t,unhighlightedItem:t,highlightedSeries:e,unhighlightedSeries:e,bringToFront:L}}var f0={start:he,stop:he,..._,...W,...U},m0={start:he,stop:he,..._,...U},Ba=Re({enabled:L,key:Z(V("x","y")),segments:ct(f0,"path segments array")},"a segmentation object",!0),y0=Re({enabled:L,key:Z(V("x","y")),segments:ct(m0,"path segments array")},"a segmentation object",!0),Up=Re({googleFont:O},"google font"),Au=te(O,Vs,Up,ne(te(O,Up))),Ac=te(w,V("normal","bold","bolder","lighter")),we={color:K,fontFamily:Au,fontSize:w,fontStyle:V("normal","italic","oblique"),fontWeight:Ac},go=V("never","always","hyphenate","on-space"),T1=V("left","center","right"),wu=V("ellipsis","hide"),b0=Re({top:G,right:G,bottom:G,left:G},"padding object"),Ut=te(G,b0),po={enabled:L,stroke:K,strokeWidth:w,strokeOpacity:X},mn={border:po,cornerRadius:G,padding:Ut,...W},Kp=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],L1={floating:L,placement:V(...Kp),xOffset:G,yOffset:G},ku=be((t,e)=>{let i;if(typeof t=="string")Kp.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Ps("invalid",`a legend placement string: ["${Kp.join('", "')}"]`,t,e.path)));else{const{cleared:n,invalid:s}=$t(t,L1);i={valid:s.length===0,cleared:n,invalid:s}}return i},"a legend position object or placement string"),dr=te(V("circle","cross","diamond","heart","plus","pin","square","star","triangle"),Pe),Tu=V("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Lu=te(w,V("exact","nearest","area")),v0=te(w,V("exact","nearest")),x0=V("baseline","top","middle","bottom"),N1=Re({type:_e("text"),text:Z(O),verticalAlign:x0,lineHeight:w,...we}),O1=Re({type:Z(_e("image")),url:Z(O),width:Z(w),height:Z(w),alt:O,verticalAlign:x0,overflowStrategy:V("keep","hide"),padding:Ut,cornerRadius:w,backgroundFill:Wt,block:L}),E1=te(N1,O1),yn=te(O,Ne,Ct,ne(E1,"text or image segments array",!1)),wc={enabled:L,text:yn,textAlign:V("left","center","right"),wrapping:go,spacing:w,maxWidth:w,maxHeight:w,...we,tooltip:{visible:V("auto","always","never"),text:O,renderer:ti(te(O,G,Ct))}};wc.padding=Q(w),wc.truncate=Q(L);var Nu={enabled:L,text:yn,renderer:ti(te(O,G,Ct,_p))},Yp=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],S0={type:V("action","separator"),showOn:V("always","series-area","series-node","legend-item"),label:Z(O),enabled:L,action:Pe,items:(t,e)=>M0(t,e)};S0.iconUrl=Q(O);var R1=Re(S0),P1=be((t,e)=>{let i;return typeof t=="string"?Yp.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Ps("invalid",`a context menu item string alias: ["${Yp.join('", "')}"]`,t,e.path))):i=R1(t,e),i},`a context menu item object or string alias: [${Yp.join(", ")}]`),M0=ne(P1,"a menu items array",!1),_a={label:O,ariaLabel:O,tooltip:O,iconPosition:V("before","after"),icon:V("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","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")},Pn=te(O,ti(yn)),I0=Re({x:Pn,y:Pn,angle:Pn,radius:Pn,size:Pn,color:Pn,label:Pn,secondaryLabel:Pn,sectorLabel:Pn,calloutLabel:Pn,legendItem:Pn}),Fn=be(i0,"a valid number format string"),za=V("millisecond","second","minute","hour","day","month","year"),D0={unit:Z(za),step:Fs,epoch:Ct,utc:L};D0.every=Pe;var kc=Re(D0,"a time interval object"),oe={width:w,height:w,minWidth:w,minHeight:w,suppressFieldDotNotation:L,title:wc,subtitle:wc,footnote:wc,padding:te(Vs,Ut),seriesArea:{border:po,clip:L,cornerRadius:G,padding:te(Vs,Ut)},legend:{enabled:L,position:ku,orientation:V("horizontal","vertical"),maxWidth:w,maxHeight:w,spacing:w,border:po,cornerRadius:G,padding:Ut,fill:Xi,fillOpacity:X,preventHidingAll:L,reverseOrder:L,toggleSeries:L,item:{marker:{size:w,shape:dr,padding:Ut,strokeWidth:w},line:{length:w,strokeWidth:w},label:{maxLength:w,formatter:Pe,...we},tooltip:{visible:V("auto","always","never"),text:O,renderer:Pe},maxWidth:w,padding:Ut,showSeriesStroke:L},pagination:{marker:{size:w,shape:dr,padding:w},activeStyle:{...W,..._},inactiveStyle:{...W,..._},highlightStyle:{...W,..._},label:we},listeners:{legendItemClick:Pe,legendItemDoubleClick:Pe}},gradientLegend:{enabled:L,position:ku,spacing:w,reverseOrder:L,border:po,cornerRadius:G,padding:Ut,fill:Xi,fillOpacity:X,gradient:{preferredLength:w,thickness:w},scale:{label:{...we,minSpacing:w,format:Fn,formatter:Pe},padding:w,interval:{step:G,values:ls,minSpacing:Se(w,Si("maxSpacing")),maxSpacing:Se(w,Mi("minSpacing"))}}},listeners:{seriesNodeClick:Pe,seriesNodeDoubleClick:Pe,seriesVisibilityChange:Pe,activeChange:Pe,selectionChange:Pe,click:Pe,doubleClick:Pe,annotations:Pe,zoom:Pe},loadGoogleFonts:L,highlight:{enabled:L,drawingMode:V("overlay","cutout"),range:V("tooltip","node")},overlays:{loading:Nu,noData:Nu,noVisibleSeries:Nu,unsupportedBrowser:Nu},tooltip:{enabled:L,showArrow:L,pagination:L,delay:w,range:Lu,wrapping:go,mode:V("single","shared","compact"),position:{anchorTo:V("pointer","node","chart"),placement:te(Tu,ne(Tu)),xOffset:G,yOffset:G,offset:w}},animation:he,flashOnUpdate:he,contextMenu:he,context:()=>!0,dataSource:{getData:Pe},keyboard:{enabled:L,tabIndex:G,initialFocus:vu()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:V("none","drag","hover")},selection:he,ranges:{enabled:L,enableOutOfRange:L,position:V("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:w,button:{...qi,..._,textColor:K,...we,cornerRadius:w,padding:Ut,active:{...qi,stroke:_.stroke,textColor:K},disabled:{...qi,stroke:_.stroke,textColor:K},hover:{...qi,stroke:_.stroke,textColor:K}},dropdown:{visible:V("auto","always","never"),...qi,..._,textColor:K,...we,cornerRadius:w,padding:Ut,active:{...qi,stroke:_.stroke,textColor:K},disabled:{...qi,stroke:_.stroke,textColor:K},hover:{...qi,stroke:_.stroke,textColor:K}},gap:w,...qi,..._,textColor:K,...we,cornerRadius:w,padding:Ut,active:{...qi,stroke:_.stroke,textColor:K},disabled:{...qi,stroke:_.stroke,textColor:K},hover:{...qi,stroke:_.stroke,textColor:K},buttons:ct({..._a,enabled:L,value:te(G,Se(ne(te(G,Ct)),En(2,2)),kc,za,Pe)},"range button options array")},locale:{localeText:hr,getLocaleText:ti(O)},background:{visible:L,fill:K,image:{url:Z(O),top:G,right:G,bottom:G,left:G,width:w,height:w,opacity:X}},styleNonce:O,sync:he,zoom:he,scrollbar:he,formatter:te(ti(yn),I0),enableRtl:L};oe.dataSource.requestThrottle=Q(w),oe.dataSource.updateThrottle=Q(w),oe.dataSource.updateDuringInteraction=Q(L),oe.statusBar=Q(he),oe.ranges.minSize=Q(w),oe.foreground=Q({visible:L,text:O,image:{url:O,top:G,right:G,bottom:G,left:G,width:w,height:w,opacity:X},...W}),oe.overrideDevicePixelRatio=Q(G),oe.sync.domainMode=Q(V("direction","position","key")),oe.displayNullData=Q(L);var Ie={cursor:O,context:()=>!0,showInLegend:L,nodeClickRange:Lu,listeners:{seriesNodeClick:Pe,seriesNodeDoubleClick:Pe},highlight:Wp(We),selection:Cu(g0)};Ie.allowNullKeys=Q(L);var Vn={...Ie,id:O,visible:L,context:()=>!0,data:ls};Vn.seriesGrouping=Q(he);var gr={shape:dr,size:w,...W,..._,...U},Bn={enabled:L,itemStyler:Ae({...W,..._,...U,shape:dr,size:w}),...gr},ze={enabled:L,formatter:ti(yn),format:Fn,itemStyler:Ae({enabled:L,...mn,...we}),...mn,...we},pr={...ze,lineHeight:w,minimumFontSize:w,wrapping:go,overflowStrategy:wu},Tc={visible:L,cap:{visible:L,length:w,lengthRatio:X,..._,...U},..._,...U},Ou={...Tc,xLowerKey:O,xUpperKey:O,yLowerKey:O,yUpperKey:O,xLowerName:O,xUpperName:O,yLowerName:O,yUpperName:O,itemStyler:Ae({visible:L,..._,...U,cap:{visible:L,length:w,lengthRatio:X,..._,...U}})},ke={enabled:L,showArrow:L,range:v0,renderer:ti(te(O,G,Ct,Re({heading:O,title:O,symbol:{marker:{enabled:L,shape:dr,...W,stroke:K,strokeOpacity:X,strokeWidth:w,...U},line:{enabled:L,stroke:K,strokeWidth:w,strokeOpacity:X,...U}},data:ct({label:Z(O),value:Z(te(O,G,Ct))})},"tooltip renderer result object"))),position:{anchorTo:V("node","pointer","chart"),placement:te(Tu,ne(Tu)),xOffset:G,yOffset:G,offset:w},interaction:{enabled:L}},C0={...ke,range:Lu},cs={enabled:L,xOffset:G,yOffset:G,blur:w,color:K},Eu=Pa({linear:{},smooth:{tension:X},step:{position:V("start","middle","end")}},"interpolation line options"),Ru=Symbol("BREAK"),Lc="__decorator_config",Pu="__decorator_accessors";function C(t,e){Zp(t,e).optional=!0}function Zp(t,e){if(Object.getOwnPropertyDescriptor(t,Lc)==null&&Object.defineProperty(t,Lc,{value:{}}),Object.getOwnPropertyDescriptor(t,Pu)==null){const u=Object.getPrototypeOf(t)?.[Pu]?.slice()??[];Object.defineProperty(t,Pu,{value:u})}const i=t[Lc],n=e.toString();if(i[n]!=null)return i[n];i[n]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(t,e);let r=s?.get,o=s?.set;if(r==null||o==null){const h=t[Pu];let u=h.indexOf(e);u===-1&&(u=h.push(e)-1),r??(r=function(){let d=this.__accessors;return d==null&&(d=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[u]}),o??(o=function(d){let g=this.__accessors;g==null&&(g=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:g})),g[u]=d})}const a=i[n];return Object.defineProperty(t,e,{set:function(h){const u=a.setters,d=a.observers;let g;for(let p=0,f=u.length;p<f;p++)if(u[p].length>2){g=r.call(this);break}for(let p=0,f=u.length;p<f;p++)if(h=u[p](this,e,h,g),h===Ru)return;o.call(this,h);for(let p=0,f=d.length;p<f;p++)d[p](this,h,g)},get:function(){const h=r.call(this),u=a.getters;if(u.length===0)return h;let d=h;for(let g=0,p=u.length;g<p;g++)if(d=u[g](this,e,d),d===Ru)return;return d},enumerable:!0,configurable:!1}),i[n]}function fr(t,e,i){return(n,s)=>{const r=Zp(n,s);r.setters.push(t),e&&r.getters.unshift(e),i&&Object.assign(r,i)}}function Xp(t){return(e,i)=>{Zp(e,i).observers.push(t)}}function Fu(t){return t!==void 0&&Lc in t}function mr(t){const e=new Set;for(;Fu(t);)e.add(t?.[Lc]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function A0(t){return mr(t).reduce((e,i)=>(e[String(i)]=t[i]??null,e),{})}function*fo(...t){for(const e of t)e!=null&&(e[Symbol.iterator]?yield*e:yield e)}function w0(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function Ii(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*ut(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}function hs(t){return Object.keys(t)}function st(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,n)=>st(i,e[n])):Le(t)?Le(e)?qp(t,e,st):!1:t===e}function qp(t,e,i){if(Object.is(t,e))return!0;for(const n of Object.keys(e))if(!(n in t))return!1;for(const n of Object.keys(t))if(!(n in e)||!i(t[n],e[n]))return!1;return!0}function de(...t){const e={};for(const i of t){if(!ce(i))continue;const n=Fu(i)?mr(i):Object.keys(i);for(const s of n)Le(e[s])&&Le(i[s])?e[s]=de(e[s],i[s]):e[s]??(e[s]=i[s])}return e}function Nc(...t){const e={};for(const i of t){if(!ce(i))continue;const n=Fu(i)?mr(i):Object.keys(i);for(const s of n)Le(e[s])&&Le(i[s])?e[s]=Nc(e[s],i[s]):s in e||(e[s]??(e[s]=i[s]))}return e}function F1(t,...e){return e&&ue(t)?t.map(i=>de(i,...e)):t}function Jp(t,e){const i={};for(const[n,s]of ut(t))i[n]=e(s,n,t);return i}function q(t,e){const i={...t};for(const n of e)delete i[n];return i}function Vu(t,e){if(t==null)return;const i={};for(const n of e)Object.hasOwn(t,n)&&(i[n]=t[n]);return i}function k0(t,e){if(t==null)return!0;for(const[i,n]of ut(t))if(!e(i,n))return!1;return!0}function T0(t){const e={};if(t==null)return e;for(const[i,n]of t)e[i]=n;return e}function Qp(t,e){return(ue(e)?e:e.split(".")).reduce((n,s)=>n[s],t)}var L0=new Set(["__proto__","constructor","prototype"]);function ef(t,e,i){const n=ue(e)?e.slice():e.split("."),s=n.pop();if(n.some(o=>L0.has(o)))return;const r=n.reduce((o,a)=>o[a],t);return r[s]=i,r[s]}function tf(t,e,i){if(i===void 0)return e;for(const n of t){const s=i[n];s!==void 0&&(e[n]=s)}return e}function V1(t,e,i){const n=i??Object.keys(e);for(let s=0,r=n.length;s<r;s++){const o=n[s],a=e[o];t[o]!==a&&(t[o]=a)}return t}function Ji(t){if(t==null||typeof t!="object"||!Le(t))return t;Object.freeze(t);for(const e of Object.getOwnPropertyNames(t)){const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Ji(i)}return t}function N0(t,e){return Le(t)&&e in t}function B1(t,e){return N0(t,e)&&typeof t[e]=="string"}var Bu={fills:Se(En(2),ne(Re({color:K,stop:Ne},"")),Mu),fillMode:V("continuous","discrete")},_u={value:Z(Ne),text:O,shape:te(V("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Pe),placement:V("before","after","middle"),spacing:w,size:w,rotation:G,...W,..._,...U},zu={value:Z(Ne),text:O,shape:te(V("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Pe),placement:V("inside","outside","middle"),spacing:w,size:w,rotation:G,label:{...ze,spacing:w},...W,..._,...U},Gu={...q(Ie,["listeners"]),direction:V("horizontal","vertical"),cornerMode:V("container","item"),cornerRadius:w,thickness:w,segmentation:{enabled:L,spacing:w,interval:{values:ne(Ne),step:Ne,count:G}},bar:{enabled:L,thickness:w,thicknessRatio:X,...Bu,...W,..._,...U},label:{...pr,text:O,spacing:w,avoidCollisions:L,placement:V("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:ke},mo={...q(Vn,["listeners"]),...Gu,type:Z(_e("linear-gauge")),value:Z(Ne),scale:{min:Se(Ne,Si("max")),max:Se(Ne,Mi("min")),label:{enabled:L,formatter:Pe,rotation:G,spacing:w,minSpacing:w,placement:V("before","after"),avoidCollisions:L,format:Fn,...we},interval:{values:ne(Ne),step:Ne},...Bu,...W,..._,...U},targets:ct(_u,"target options array")};mo.margin=Q(G),mo.defaultColorRange=Q(ne(Wt)),mo.defaultTarget=Q({..._u,value:G,label:{...ze,spacing:G}}),mo.defaultScale=Q(mo.scale),mo.scale.defaultFill=Q(Wt);var ju={...q(Ie,["listeners"]),outerRadius:w,innerRadius:w,outerRadiusRatio:X,innerRadiusRatio:X,startAngle:G,endAngle:G,spacing:w,cornerMode:V("container","item"),cornerRadius:w,scale:{min:Se(Ne,Si("max")),max:Se(Ne,Mi("min")),label:{enabled:L,formatter:Pe,rotation:G,spacing:w,minSpacing:w,avoidCollisions:L,format:Fn,...we},interval:{values:ne(Ne),step:Ne},...Bu,...W,..._,...U},segmentation:{enabled:L,spacing:w,interval:{values:ne(Ne),step:Ne,count:G}},bar:{enabled:L,...Bu,...W,..._,...U},needle:{enabled:L,spacing:w,radiusRatio:X,...W,..._,...U},label:{text:O,spacing:w,...pr},secondaryLabel:{text:O,...pr},tooltip:ke},Hu={...q(Vn,["listeners"]),...ju,type:Z(_e("radial-gauge")),value:Z(Ne),targets:ct(zu,"target options array")};Hu.defaultColorRange=Q(ne(Wt)),Hu.defaultTarget=Q({...zu,value:G,label:{...ze,spacing:G}}),Hu.scale.defaultFill=Q(Wt);var O0=(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))(O0||{}),yr=12,br={SMALLEST:8/yr,SMALLER:10/yr,SMALL:12/yr,MEDIUM:13/yr,LARGE:14/yr,LARGEST:17/yr},E0=(t=>(t.TOP="top",t.TOP_RIGHT="top-right",t.TOP_LEFT="top-left",t.RIGHT="right",t.RIGHT_TOP="right-top",t.RIGHT_BOTTOM="right-bottom",t.BOTTOM="bottom",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.LEFT="left",t.LEFT_TOP="left-top",t.LEFT_BOTTOM="left-bottom",t))(E0||{}),R0=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.UNIT_TIME="unit-time",t.TIME="time",t.NUMBER="number",t.LOG="log",t))(R0||{}),P0=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(P0||{}),F0=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(F0||{}),yo=(t,e,i)=>t*(1-i)+e*i,nf=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},sf=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},V0=class ve{constructor(e,i,n,s=1){this.r=J(0,e||0,1),this.g=J(0,i||0,1),this.b=J(0,n||0,1),this.a=J(0,s||0,1)}static validColorString(e){return e.includes("#")?!!ve.parseHex(e):e.includes("hsl")?!!ve.stringToHsla(e):e.includes("rgb")?!!ve.stringToRgba(e):ve.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.includes("#"))return ve.fromHexString(e);const i=ve.nameToHex.get(e.toLowerCase());if(i)return ve.fromHexString(i);if(e.includes("hsl"))return ve.fromHSLString(e);if(e.includes("rgb"))return ve.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replaceAll(" ","").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let n=0;n<e.length;n+=2)i.push(Number.parseInt(`${e[n]}${e[n+1]}`,16));break;case 3:case 4:i=e.split("").map(n=>Number.parseInt(n,16)).map(n=>n+n*16);break}if(i?.length>=3&&i.every(n=>n>=0))return i.length===3&&i.push(255),i}static fromHexString(e){const i=ve.parseHex(e);if(i){const[n,s,r,o]=i;return new ve(n/255,s/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,n=-1;for(let a=0;a<e.length;a++){const l=e[a];if(i===-1&&l==="(")i=a;else if(l===")"){n=a;break}}if(i===-1||n===-1)return;const r=e.substring(i+1,n).split(","),o=[];for(let a=0;a<r.length;a++){const l=r[a];let c=Number.parseFloat(l);if(!Number.isFinite(c))return;l.includes("%")?(c=J(0,c,100),c/=100):a===3?c=J(0,c,1):(c=J(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(e){const i=ve.stringToRgba(e);if(i){if(i.length===3)return new ve(i[0],i[1],i[2]);if(i.length===4)return new ve(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static parseHueDegrees(e){const i=Number.parseFloat(e);if(Number.isFinite(i))return e.includes("turn")?i*360:e.includes("grad")?i*.9:e.includes("rad")?i*180/Math.PI:i}static parsePercentage(e){const i=Number.parseFloat(e);if(Number.isFinite(i))return J(0,i/100,1)}static parseAlpha(e){const i=Number.parseFloat(e);if(Number.isFinite(i))return J(0,e.includes("%")?i/100:i,1)}static stringToHsla(e){const i=e.indexOf("("),n=e.indexOf(")");if(i===-1||n===-1||n<i)return;const s=e.substring(i+1,n),r=s.indexOf("/"),a=(r===-1?s:s.substring(0,r)).trim().split(/[\s,]+/);if(r!==-1&&a.push(s.substring(r+1).trim()),a.length<3||a.length>4)return;const l=ve.parseHueDegrees(a[0]),c=ve.parsePercentage(a[1]),h=ve.parsePercentage(a[2]);if(l===void 0||c===void 0||h===void 0)return;const u=[l,c,h];if(a.length===4){const d=ve.parseAlpha(a[3]);if(d===void 0)return;u.push(d)}return u}static fromHSLString(e){const i=ve.stringToHsla(e);if(i){const[n,s,r,o]=i;return ve.fromHSL(n,s,r,o??1)}throw new Error(`Malformed hsl/hsla color string: '${e}'`)}static fromArray(e){if(e.length===4)return new ve(e[0],e[1],e[2],e[3]);if(e.length===3)return new ve(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(e,i,n,s=1){const r=ve.HSBtoRGB(e,i,n);return new ve(r[0],r[1],r[2],s)}static fromHSL(e,i,n,s=1){const r=ve.HSLtoRGB(e,i,n);return new ve(r[0],r[1],r[2],s)}static fromOKLCH(e,i,n,s=1){const r=ve.OKLCHtoRGB(e,i,n);return new ve(r[0],r[1],r[2],s)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+ve.padHex(Math.round(this.r*255).toString(16))+ve.padHex(Math.round(this.g*255).toString(16))+ve.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=ve.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)],n=Math.pow(10,e);return this.a!==1?(i.push(Math.round(this.a*n)/n),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return ve.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,n){const s=nf(e),r=nf(i),o=nf(n),a=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*o),l=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*o),c=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*o),h=.2104542553*a+.793617785*l-.0040720468*c,u=1.9779984951*a-2.428592205*l+.4505937099*c,d=.0259040371*a+.7827717662*l-.808675766*c,g=Math.atan2(d,u)*180/Math.PI,p=h,f=Math.hypot(u,d),m=g>=0?g:g+360;return[p,f,m]}static OKLCHtoRGB(e,i,n){const s=e,r=i*Math.cos(n*Math.PI/180),o=i*Math.sin(n*Math.PI/180),a=(s+.3963377774*r+.2158037573*o)**3,l=(s-.1055613458*r-.0638541728*o)**3,c=(s-.0894841775*r-1.291485548*o)**3,h=4.0767416621*a-3.3077115913*l+.2309699292*c,u=-1.2684380046*a+2.6097574011*l-.3413193965*c,d=-.0041960863*a-.7034186147*l+1.707614701*c,g=sf(h),p=sf(u),f=sf(d);return[g,p,f]}static RGBtoHSL(e,i,n){const s=Math.min(e,i,n),r=Math.max(e,i,n),o=(r+s)/2;let a,l;if(r===s)a=0,l=0;else{const c=r-s;l=o>.5?c/(2-r-s):c/(r+s),r===e?a=(i-n)/c+(i<n?6:0):r===i?a=(n-e)/c+2:a=(e-i)/c+4,a*=360/6}return[a,l,o]}static HSLtoRGB(e,i,n){if(e=(e%360+360)%360,i===0)return[n,n,n];const s=n<.5?n*(1+i):n+i-n*i,r=2*n-s;function o(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?r+(s-r)*6*h:h<1/2?s:h<2/3?r+(s-r)*(2/3-h)*6:r}const a=o(e/360+1/3),l=o(e/360),c=o(e/360-1/3);return[a,l,c]}static RGBtoHSB(e,i,n){const s=Math.min(e,i,n),r=Math.max(e,i,n),o=r===0?0:(r-s)/r;let a=0;if(s!==r){const l=r-s,c=(r-e)/l,h=(r-i)/l,u=(r-n)/l;e===r?a=u-h:i===r?a=2+c-u:a=4+h-c,a/=6,a<0&&(a=a+1)}return[a*360,o,r]}static HSBtoRGB(e,i,n){e=(e%360+360)%360/360;let s=0,r=0,o=0;if(i===0)s=r=o=n;else{const a=(e-Math.floor(e))*6,l=a-Math.floor(a),c=n*(1-i),h=n*(1-i*l),u=n*(1-i*(1-l));switch(Math.trunc(a)){case 0:s=n,r=u,o=c;break;case 1:s=h,r=n,o=c;break;case 2:s=c,r=n,o=u;break;case 3:s=c,r=h,o=n;break;case 4:s=u,r=c,o=n;break;case 5:s=n,r=c,o=h;break}}return[s,r,o]}static mix(e,i,n){return new ve(yo(e.r,i.r,n),yo(e.g,i.g,n),yo(e.b,i.b,n),yo(e.a,i.a,n))}static lighten(e,i){const n=ve.RGBtoOKLCH(e.r,e.g,e.b);return ve.fromOKLCH(J(0,n[0]+i,1),n[1],n[2])}static darken(e,i){const n=ve.RGBtoOKLCH(e.r,e.g,e.b);return ve.fromOKLCH(J(0,n[0]-i,1),n[1],n[2])}static interpolate(e,i){const n=1/(e.length-1),s=e.map(r=>ve.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,o)=>{const a=o/(i-1),l=e.length<=2?0:Math.min(Math.floor(a*(e.length-1)),e.length-2),c=(a-l*n)/n,h=s[l],u=s[l+1];return ve.fromOKLCH(yo(h[0],u[0],c),yo(h[1],u[1],c),yo(h[2],u[2],c))})}};V0.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 De=V0,B0={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},_1={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},z1={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},rf={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},G1={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},of={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},vr={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},j1={...vr,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},H1={...vr,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},$1=t=>({...vr,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${t}.fill`}},{$isPattern:{$palette:`${t}.fill`}},{$isImage:{$palette:`${t}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${t}.fill`}]},[{color:{$mix:[{$palette:`${t}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${t}.fill`},"white",.15]}}]]}}}),$u={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Oc={...$u,reverse:!0},W1={...$u,bounds:"series"},_0={...$u,bounds:"series",reverse:!0},U1={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},Qi={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},10]},padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:rf,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},K1={...Qi,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},af={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:1,rotation:0,scale:1},Y1={...Qi,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},Z1=t=>({...Qi,stroke:{$if:[{$isGradient:{$palette:`${t}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${t}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${t}.fill`}]},{$palette:`${t}.fill`}]}]}}),_s={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},lf={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function en(t){return Jp(t,e=>{const i=De.fromString(e);return[De.darken(i,.15).toString(),e,De.lighten(i,.15).toString()]})}var us={padding:8,cornerRadius:4,fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]},border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}}},Ec={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},cf={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedSeries:{opacity:.2}},hf={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},X1={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2}},xr={enabled:{$path:["/selection/enabled",!1]},containment:{$path:"/selection/containment"},selectedItem:{strokeWidth:2},unselectedItem:{opacity:.6},unselectedSeries:{opacity:.2}},z0={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},Wu={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",vr],["image",_s],["pattern",Qi]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},uf=class jv{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const n of Object.values(e))i[n.mementoOriginatorKey]=this.encode(n,n.createMemento());return i}restore(e,...i){if(!ce(e)){Fi(`Could not restore data of type [${e===null?"null":typeof e}], expecting an object, ignoring.`);return}if(!("version"in e)||typeof e.version!="string"){Fi("Could not restore data, missing [version] string in object, ignoring.");return}for(const n of i){const s=this.decode(n,e[n.mementoOriginatorKey]),r=[];if(!n.guardMemento(s,r)){let o=`Could not restore [${n.mementoOriginatorKey}] data, value was invalid, ignoring.`;r.length>0&&(o+=`
${r.join(`
`)}
`),Fi(o,s);return}n.restoreMemento(this.version,e.version,s)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,jv.encodeTypes))}catch(n){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${n}].`,{cause:n})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),jv.decodeTypes)}catch(n){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${n}].`,{cause:n})}}static encodeTypes(e,i){return pn(this[e])?{__type:"date",value:this[e].toISOString()}:typeof this[e]=="bigint"?{__type:"bigint",value:this[e].toString()}:i}static decodeTypes(e,i){if(ce(this[e])&&"__type"in this[e]){if(this[e].__type==="date")return new Date(this[e].value);if(this[e].__type==="bigint"){const n=this[e].value;if(typeof n=="string"&&/^-?\d+$/.test(n))return BigInt(n)}}return i}};function Uu(t,e){let i=t;for(const n of e){if(i==null||typeof i!="object")return;i=i[n]}return i}var G0=class{constructor(){this.dirtyKeys=new Set,this.stateMap=new Map,this.isFlushing=!1}getState(t){let e=this.stateMap.get(t);return e||(e={value:void 0,flushedValue:void 0,observers:new Map},this.stateMap.set(t,e)),e}observe(t){const e=new Map;t((n,s)=>{const r=s??"";let o=e.get(n);return o==null&&(o=new Set,e.set(n,o)),o.add(r),r.length===0?this.getValue(n):Uu(this.stateMap.get(n)?.value,r.split("."))});for(const[n,s]of e)this.getState(n).observers.set(t,s);return()=>{for(const n of e.keys())this.stateMap.get(n)?.observers.delete(t)}}getValue(t,e=""){const i=this.stateMap.get(t)?.value;return e.length===0?i:Uu(i,e.split("."))}setValue(t,e){this.getState(t).value=e,this.dirtyKeys.add(t)}flushChanges(t){if(!this.isFlushing){this.isFlushing=!0;try{const e=this.getValue.bind(this);let i;t==null?(i=new Set(this.dirtyKeys),this.dirtyKeys.clear()):(i=new Set(this.dirtyKeys.has(t)?[t]:[]),this.dirtyKeys.delete(t));for(const n of this.collectObservers(i))n(e)}finally{this.isFlushing=!1}}}destroy(){for(const{observers:t}of this.stateMap.values())t.clear();this.dirtyKeys.clear(),this.stateMap.clear()}collectObservers(t){const e=new Set;for(const i of t){const n=this.getState(i),{flushedValue:s,value:r}=n;if(s!==r){n.flushedValue=r;for(const[o,a]of n.observers){if(a.size===0||a.has("")){e.add(o);continue}for(const l of a){const c=l.split(".");if(Uu(s,c)!==Uu(r,c)){e.add(o);break}}}}}return e}},df=(t=>(t.X="x",t.Y="y",t.Angle="angle",t.Radius="radius",t))(df||{}),_n=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",t[t.PROCESS_RANGE=4]="PROCESS_RANGE",t[t.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",t[t.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",t[t.SERIES_UPDATE=7]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=9]="SCENE_RENDER",t[t.NONE=10]="NONE",t))(_n||{}),j0=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",t[t.AXIS_GRID=2]="AXIS_GRID",t[t.AXIS=3]="AXIS",t[t.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",t[t.ZOOM_SELECTION=5]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=7]="SERIES_LAYER",t[t.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=12]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=14]="STATUS_BAR",t[t.SERIES_LABEL=15]="SERIES_LABEL",t[t.LEGEND=16]="LEGEND",t[t.NAVIGATOR=17]="NAVIGATOR",t[t.FOREGROUND=18]="FOREGROUND",t))(j0||{}),H0=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(H0||{}),$0=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))($0||{}),W0=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(W0||{});function Ku(t){const{placement:e="bottom",floating:i=!1,xOffset:n=0,yOffset:s=0}=typeof t=="string"?{placement:t,floating:!1}:t;return{placement:e,floating:i,xOffset:n,yOffset:s}}var Fe=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(t==null)return this.clear(),this;if(typeof t!="object")return Ca(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const n of mr(this))if(i.has(n)){const s=t[n],r=this;if(Yu(r[n]))if(r[n]instanceof Ga){const o=r[n].reset(s);o==null?Ca(`unable to set [${String(n)}] - expecting a properties array`):r[n]=o}else r[n].set(s);else Le(s)?r[n]=Nc(s,r[n]??{}):r[n]=s;i.delete(n)}this.handleUnknownProperties(i,t);for(const n of i)Ca(`unable to set [${String(n)}] in ${e} - property is unknown`);return this}clear(){for(const t of mr(this)){const e=this[t];Yu(e)?e.clear():this[t]=void 0}return this}toJson(){return mr(this).reduce((t,e)=>{const i=this[e];return t[String(e)]=Yu(i)?i.toJson():i,t},{})}},Ga=class Yk extends Array{constructor(e,...i){super(i.length);const s=(r=>!!r?.prototype?.constructor?.name)(e)?r=>new e().set(r):e;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(ue(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 Yk(this.itemFactory,...e)}clear(){return this.length=0,this}toJson(){return this.map(e=>e?.toJson?.()??e)}};function Yu(t){return t instanceof Fe||t instanceof Ga}var ja=class extends Fe{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};x([C],ja.prototype,"type",2),x([C],ja.prototype,"tension",2),x([C],ja.prototype,"position",2);function Ha(t,e){const[i,n]=Ot(e);return J(i,t,n)}function Ot(t){if(t.length===0)return[];let e=1/0,i=-1/0;for(const n of t)n<e&&(e=n),n>i&&(i=n);return[e,i]}function bo(t){const[e,i]=Ot(t);return i-e}function $a(t){return t=Math.trunc(t),t<=0?1:t===1?2:1<<32-Math.clz32(t-1)}function gf(t){return t=Math.trunc(t),t<=0?0:t===1?1:1<<31-Math.clz32(t)}var Wa=1e3,Sr=Wa*60,vo=Sr*60,xo=vo*24,U0=xo*7,pf=xo*30,Rc=xo*365,Ua=new Date().getTimezoneOffset()*Sr,Ka={millisecond:{milliseconds:1,hierarchy:"day",encode(t){return t.getTime()},decode(t){return new Date(t)}},second:{milliseconds:Wa,hierarchy:"day",encode(t,e){const i=e?0:Ua;return Math.floor((t.getTime()-i)/Wa)},decode(t,e){const i=e?0:Ua;return new Date(i+t*Wa)}},minute:{milliseconds:Sr,hierarchy:"day",encode(t,e){const i=e?0:Ua;return Math.floor((t.getTime()-i)/Sr)},decode(t,e){const i=e?0:Ua;return new Date(i+t*Sr)}},hour:{milliseconds:vo,hierarchy:"day",encode(t,e){const i=e?0:Ua;return Math.floor((t.getTime()-i)/vo)},decode(t,e){const i=e?0:Ua;return new Date(i+t*vo)}},day:{milliseconds:xo,hierarchy:"month",encode(t,e){const i=e?0:t.getTimezoneOffset()*Sr;return Math.floor((t.getTime()-i)/xo)},decode(t,e){let i;return e?(i=new Date(0),i.setUTCDate(i.getUTCDate()+t),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+t)),i}},month:{milliseconds:pf,hierarchy:"year",encode(t,e){return e?t.getUTCFullYear()*12+t.getUTCMonth():t.getFullYear()*12+t.getMonth()},decode(t,e){if(e){const i=Math.floor(t/12),n=t-i*12;return new Date(Date.UTC(i,n,1))}else{const i=Math.floor(t/12),n=t-i*12;return new Date(i,n,1)}}},year:{milliseconds:Rc,hierarchy:void 0,encode(t,e){return e?t.getUTCFullYear():t.getFullYear()},decode(t,e){let i;return e?(i=new Date,i.setUTCFullYear(t),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(t,0,1,0,0,0,0),i}}};function Ya(t){return typeof t=="string"?{unit:t,step:1,epoch:void 0,utc:!1}:{unit:t.unit,step:t.step??1,epoch:t.epoch,utc:t.utc??!1}}function Pc(t,e,i,n){if(i==null)return 0;const s=Ka[t];return Math.floor(s.encode(new Date(i),n))%e}function Za(t,e,i,n,s){const r=Ka[e];return Math.floor((r.encode(new Date(t),n)-s)/i)}function Xa(t,e,i,n,s){return Ka[e].decode(t*i+s,n)}function Zu(t,e,i,n,s){const r=new Date(t),o=Za(r,e,i,n,s);return Xa(o,e,i,n,s)}function Xu(t,e,i,n,s){const r=new Date(Number(t)-1),o=Za(r,e,i,n,s);return Xa(o+1,e,i,n,s)}function _i(t,e){const{unit:i,step:n,epoch:s,utc:r}=Ya(t),o=Pc(i,n,s,r);return Zu(e,i,n,r,o)}function K0(t,e){const{unit:i,step:n,epoch:s,utc:r}=Ya(t),o=Pc(i,n,s,r);return Xu(e,i,n,r,o)}function Y0(t,e){const{unit:i,step:n,epoch:s,utc:r}=Ya(t),o=Pc(i,n,s,r);return Xa(Za(Xu(e,i,n,r,o),i,n,r,o)-1,i,n,r,o)}function ff(t,e){const{unit:i,step:n,epoch:s,utc:r}=Ya(t),o=Pc(i,n,s,r);return Xa(Za(Zu(e,i,n,r,o),i,n,r,o)+1,i,n,r,o)}function mf(t,e,i){if(t.valueOf()>e.valueOf()&&([t,e]=[e,t],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const n=e.valueOf()-t.valueOf(),s=t.valueOf();t=new Date(s+i[0]*n),e=new Date(s+i[1]*n)}return[new Date(t),new Date(e)]}function Fc(t,e,i,{extend:n=!1,visibleRange:s=[0,1],limit:r,defaultAlignment:o="start"}={}){const a=Ya(t),{unit:l,step:c,utc:h}=a;let u;a.epoch!=null?u=a.epoch:o==="interval"?u=void 0:e.valueOf()>i.valueOf()?u=i:u=e;const d=Pc(a.unit,a.step,u,a.utc);let[g,p]=mf(e,i,s);g=n?Zu(g,l,c,h,d):Xu(g,l,c,h,d),p=n?Xu(p,l,c,h,d):Zu(p,l,c,h,d);const f=Za(g,l,c,h,d);let m=Za(p,l,c,h,d);return r!=null&&m-f>r&&(m=f+r),{range:[f,m],unit:l,step:c,utc:h,offset:d}}function yf(t,e,i,n){const{range:[s,r]}=Fc(t,e,i,n);return Math.abs(r-s)}function zn(t,e,i,n){const{range:[s,r],unit:o,step:a,utc:l,offset:c}=Fc(t,e,i,n),h=[];for(let u=s;u<=r;u+=1){const d=Xa(u,o,a,l,c);h.push(d)}return h}function Z0(t,e,i,n){const{range:[s,r],unit:o,step:a,utc:l,offset:c}=Fc(t,e,i,n),h=Math.max(0,r-s+1),u=new Array(h);for(let d=0;d<h;d++)u[d]=s+d;return{encodedValues:u,encodingParams:{unit:o,step:a,utc:l,offset:c}}}function X0(t,e){return Xa(t,e.unit,e.step,e.utc,e.offset)}var bf=new Date().getTimezoneOffset()*6e4,q1=1e3,J1=6e4,Q1=36e5;function Mr(t,e){const{unit:i,step:n,utc:s,offset:r}=e,o=t*n+r;switch(i){case"millisecond":return o;case"second":return(s?0:bf)+o*q1;case"minute":return(s?0:bf)+o*J1;case"hour":return(s?0:bf)+o*Q1;default:return Ka[i].decode(o,s).valueOf()}}function q0(t,e,i,{extend:n,visibleRange:s,limit:r,defaultAlignment:o}={}){const{range:[a]}=Fc(t,e,i,{extend:n,visibleRange:s,limit:r,defaultAlignment:o}),{range:[l]}=Fc(t,e,i,{extend:n,limit:r,defaultAlignment:o});return a-l}var eL={millisecond:{adjust(t,e,i){const n=new Date;return n.setTime(t.getTime()+e),n}},second:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCSeconds(t.getUTCSeconds()+e):n.setSeconds(t.getSeconds()+e),n}},minute:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCMinutes(t.getUTCMinutes()+e):n.setMinutes(t.getMinutes()+e),n}},hour:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCHours(t.getUTCHours()+e):n.setHours(t.getHours()+e),n}},day:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCDate(t.getUTCDate()+e):n.setDate(t.getDate()+e),n}},month:{adjust(t,e,i){const n=new Date(t.getTime());if(i){if(n.setUTCMonth(t.getUTCMonth()+e),e!==0)for(;n.getUTCMonth()===t.getUTCMonth();)n.setUTCDate(n.getUTCDate()+(e>0?1:-1))}else if(n.setMonth(t.getMonth()+e),e!==0)for(;n.getMonth()===t.getMonth();)n.setDate(n.getDate()+(e>0?1:-1));return n}},year:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCFullYear(t.getUTCFullYear()+e):n.setFullYear(t.getFullYear()+e),n}}};function tL(t,e){const{unit:i,step:n,utc:s}=Ya(t);return eL[i].adjust(e,-n,s)}function zs(t){return typeof t=="string"?t:t.unit}function Ir(t){return typeof t=="string"?1:t.step??1}function Vc(t){return typeof t=="string"?void 0:t.epoch}function Bc(t){return Ka[zs(t)].hierarchy}function zi(t){return Ir(t)*Ka[zs(t)].milliseconds}function vf(t){return typeof t=="string"?{unit:t}:t}var J0=["millisecond","second","minute","hour","day","month","year"];function iL(t){return Le(t)?"unit"in t&&J0.includes(t.unit):!1}function nL(t){return nt(t)&&J0.includes(t)}function ii(t){return t instanceof Date?t.getTime():t}var sL=864e13;function Q0(t){return Math.abs(t)>sL?Number.NaN:t}function ds(t){return typeof t=="number"?Q0(t):typeof t=="bigint"?Q0(Number(t)):typeof t=="string"?Date.parse(t):t instanceof Date?t.getTime():t}function _c(t){return t<Wa?"millisecond":t<Sr?"second":t<vo?"minute":t<vo*23?"hour":t<28*xo?"day":t<Rc?"month":"year"}function xf(t){if(t.length===0)return"millisecond";if(t.length===1)return qu(t[0]);let e=1/0;for(let i=1;i<t.length;i++)e=Math.min(e,Math.abs(t[i].valueOf()-t[i-1].valueOf()));return _c(e)}function qu(t){return _i("second",t)<t?"millisecond":_i("minute",t)<t?"second":_i("hour",t)<t?"minute":_i("day",t)<t?"hour":_i("month",t)<t?"day":_i("year",t)<t?"month":"year"}function Sf(t){const[e,i]=t.length===0?[0,0]:Ot([t[0].valueOf(),t.at(-1).valueOf()]),n=new Date(e).getFullYear(),s=new Date(i).getFullYear();if(n!==s)return;const r=new Date(e).getMonth(),o=new Date(i).getMonth();if(r!==o)return"year";const a=new Date(e).getDate(),l=new Date(i).getDate();return a!==l?"month":"day"}var qa=new WeakMap;function rL(t){return typeof t=="string"?ds(t):t}function Ju(t){const e=qa.get(t);if(e!==void 0)return e;const n=t.some(s=>typeof s=="string")?t.map(rL):t;return qa.set(t,n),n}function Mf(t){qa.has(t)||qa.set(t,t)}function If(t){return qa.get(t)}function eS(t){qa.delete(t)}var dt=0,St=1,Et=2,gt=3,Kt=4,Di=5,Gs=1e3,oL=10,Dr=64,zc=4294967295,aL=3,lL=20,Df=100,cL=new Set(["time","unit-time","ordinal-time"]);function Cr(t,e,i){const n=i||!cL.has(t)?e:Ju(e);return{values:n,needsValueOf:n===e?i:!1}}var Qu=new WeakMap;function Ar(t){const e=Qu.get(t);if(e!==void 0)return e;let i=!1;for(let s=0;s<t.length;s++)if(typeof t[s]=="bigint"){i=!0;break}const n=i?t.map(s=>typeof s=="bigint"?Number(s):s):t;return Qu.set(t,n),n}var ed=new WeakMap;function Gc(t){const e=ed.get(t);if(e!==void 0)return e;let i;for(let s=0;s<t.length;s++){const r=t[s];typeof r=="bigint"&&(i===void 0||r<i)&&(i=r)}let n;if(i===void 0)n=t;else{const s=i,r=Number(s);n=t.map(o=>typeof o=="bigint"?Number(o-s):typeof o=="number"?o-r:o)}return ed.set(t,n),n}function tS(t){Qu.has(t)||Qu.set(t,t),ed.has(t)||ed.set(t,t)}var iS=new WeakMap;function nS(t,e){const i=iS.get(t);if(i?.offset===e)return i.result;const n=Number(e),s=t.map(r=>typeof r=="bigint"?Number(r-e):typeof r=="number"?r-n:r);return iS.set(t,{offset:e,result:s}),s}function sS(t,e){if(t!=="number")return;const{domain:i,sortMetadata:n}=e;if(i.length===0)return;const s=i[0],r=i.at(-1);if(n?.sortOrder===1)return typeof s=="bigint"&&typeof r=="bigint"?{min:s,max:r}:void 0;if(n?.sortOrder===-1)return typeof s=="bigint"&&typeof r=="bigint"?{min:r,max:s}:void 0;let o,a;for(const l of i){if(typeof l!="bigint")return;(o===void 0||l<o)&&(o=l),(a===void 0||l>a)&&(a=l)}if(!(o===void 0||a===void 0))return{min:o,max:a}}function wr(t,e,i){const n=sS(t,i);return n!==void 0?{xValues:nS(e,n.min),domain:[0,Number(n.max-n.min)]}:{xValues:Ar(e),domain:td(t,i)}}function Cf(t,e,i,n,s,r,o,a){let l=0;for(;l<Df&&t[n]==null&&n<s;)n+=1,l+=1;for(;l<Df&&t[s]==null&&s>n;)s-=1,l+=1;if(l>=Df||n>=s)return r;const c=Number.isFinite(e)?bn(t[s],e,i,a)-bn(t[n],e,i,a):Ja(s,t.length)-Ja(n,t.length);if(c===0||!Number.isFinite(c))return r;const h=Math.abs(c)/(s-n);let u;if(o<aL?u=!0:o>lL?u=!1:u=h<=r,r=Math.min(r,h),!u)return r;const d=Math.floor((n+s)/2),g=Cf(t,e,i,n,d,r,o+1,a),p=Cf(t,e,i,d+1,s,r,o+1,a);return Math.min(g,p,r)}function hL(t,e,i,n){return Cf(t,e,i,0,t.length-1,1/(t.length-1),0,n)}function js(t,e,i,n){if(Number.isFinite(e)){const s=n?.smallestKeyInterval,r=n?.xNeedsValueOf??!0,o=s==null?hL(t,e,i,r):Number(s)/(i-e);return $a(Math.trunc(1/o))>>3}else{let s=Math.ceil(Math.log2(t.length))-1;return s=Math.min(Math.max(s,0),24),Math.trunc(2**s)}}function td(t,e){const{domain:i,sortMetadata:n}=e;switch(t){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(i.length===0)return[1/0,-1/0];if(n?.sortOrder===1)return[Number(i[0]),Number(i.at(-1))];if(n?.sortOrder===-1)return[Number(i.at(-1)),Number(i[0])];let s=1/0,r=-1/0;for(const o of i){const a=Number(o);s=Math.min(s,a),r=Math.max(r,a)}return[s,r]}case"color":case"log":case"mercator":return[0,0]}}function Ja(t,e){return t/e}function bn(t,e,i,n){return n?(t.valueOf()-e)/(i-e):(t-e)/(i-e)}function id(t,e){return Math.trunc(Math.min(Math.floor(t*e),e-1)*Di)}function jc(t,e,i,n,s,{xNeedsValueOf:r=!0,xValuesLength:o}={}){const a=t[s];if(a==null)return-1;const l=o??t.length,c=Number.isFinite(e)?bn(a,e,i,r):Ja(s,l);return id(c,n)}function Af(t,e,i,n){for(const s of n)if(i===t[e+s])return!0;return!1}function Hs(t,e,i,n,s,r,{positive:o,split:a=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:h,reuseValueData:u,reuseNegativeIndexData:d,reuseNegativeValueData:g}={}){const p=Number.NaN,f=r*Di,m=h?.length===f?h:new Uint32Array(f),y=u?.length===f?u:new Float64Array(f);let b,v;a&&(d?.length===f?b=d:b=new Uint32Array(f),g?.length===f?v=g:v=new Float64Array(f));const S=Number.isFinite(n)&&Number.isFinite(s),M=t.length;S&&(y.fill(p),m.fill(zc),a&&(v.fill(p),b.fill(zc)));const D=S?r/(s-n):r*(1/M);let I=-1,A=-1,k=p,T=-1,R=p,E=-1,F=p,N=-1,P=p,z=-1,Y=-1,j=p,ie=-1,ge=p,ae=-1,le=p,xt=-1,pe=p;const jt=t.length,di=e===i;for(let fe=0;fe<jt;fe++){const Ns=t[fe];if(Ns==null)continue;const wn=e[fe],Jn=di?wn:i[fe];let tt,me;c?(tt=wn==null?p:wn.valueOf(),me=Jn==null?p:Jn.valueOf()):(tt=wn??p,me=Jn??p);let He=!0;if(a)He=tt>=0;else if(o!=null&&tt>=0!==o)continue;let Me;S?l?Me=(Ns.valueOf()-n)*D:Me=(Ns-n)*D:Me=fe*D;const Ei=Math.floor(Me),kn=(Ei<r?Ei:r-1)*Di;if(He){kn!==I&&(I!==-1&&(m[I+dt]=A,m[I+St]=T,m[I+Et]=E,m[I+gt]=N,m[I+Kt]=0,y[I+dt]=k,y[I+St]=R,y[I+Et]=F,y[I+gt]=P),I=kn,A=-1,k=p,T=-1,R=p,E=-1,F=p,N=-1,P=p);const Xh=me===me,qh=tt===tt;A===-1?(A=fe,k=Me,T=fe,R=Me,Xh&&(E=fe,F=me),qh&&(N=fe,P=tt)):(Me<k&&(A=fe,k=Me),Me>R&&(T=fe,R=Me),Xh&&me<F&&(E=fe,F=me),qh&&tt>P&&(N=fe,P=tt))}else{kn!==z&&(z!==-1&&(b[z+dt]=Y,b[z+St]=ie,b[z+Et]=ae,b[z+gt]=xt,b[z+Kt]=0,v[z+dt]=j,v[z+St]=ge,v[z+Et]=le,v[z+gt]=pe),z=kn,Y=-1,j=p,ie=-1,ge=p,ae=-1,le=p,xt=-1,pe=p);const Xh=me===me,qh=tt===tt;Y===-1?(Y=fe,j=Me,ie=fe,ge=Me,Xh&&(ae=fe,le=me),qh&&(xt=fe,pe=tt)):(Me<j&&(Y=fe,j=Me),Me>ge&&(ie=fe,ge=Me),Xh&&me<le&&(ae=fe,le=me),qh&&tt>pe&&(xt=fe,pe=tt))}}return I!==-1&&(m[I+dt]=A,m[I+St]=T,m[I+Et]=E,m[I+gt]=N,m[I+Kt]=0,y[I+dt]=k,y[I+St]=R,y[I+Et]=F,y[I+gt]=P),a&&z!==-1&&(b[z+dt]=Y,b[z+St]=ie,b[z+Et]=ae,b[z+gt]=xt,b[z+Kt]=0,v[z+dt]=j,v[z+St]=ge,v[z+Et]=le,v[z+gt]=pe),{indexData:m,valueData:y,negativeIndexData:b,negativeValueData:v}}function So(t,e,i,{inPlace:n=!1,midpointData:s,reuseIndexData:r,reuseValueData:o}={}){const a=Math.trunc(i/2),l=a*Di;let c;n?c=t:r?.length===l?c=r:c=new Uint32Array(l);let h;n?h=e:o?.length===l?h=o:h=new Float64Array(l);const u=s??new Uint32Array(a);for(let d=0;d<a;d+=1){const g=Math.trunc(d*Di),p=Math.trunc(g*2),f=Math.trunc(p+Di),m=t[f+dt]===zc,y=m||e[p+dt]<e[f+dt]?p:f,b=t[y+dt];c[g+dt]=b,h[g+dt]=e[y+dt];const v=m||e[p+St]>e[f+St]?p:f,S=t[v+St];c[g+St]=S,h[g+St]=e[v+St],u[d]=b+S>>1;const M=m||e[p+Et]<e[f+Et]?p:f;c[g+Et]=t[M+Et],h[g+Et]=e[M+Et];const D=m||e[p+gt]>e[f+gt]?p:f;c[g+gt]=t[D+gt],h[g+gt]=e[D+gt],c[g+Kt]=t[p+Kt]|t[f+Kt]}return{maxRange:a,indexData:c,valueData:h,midpointData:u}}function rS(t){let e=0;for(let s=0;s<t.length;s++)t[s]===1&&e++;const i=new Uint32Array(e);let n=0;for(let s=0;s<t.length;s++)t[s]===1&&(i[n++]=s);return i}function oS(t,e,i,n,s,r,o){for(let h=0;h<i;h++)e[h*Di+Kt]=0;if(t.length===0)return;const a=Number.isFinite(s)&&Number.isFinite(r),l=n.length,c=a?i/(r-s):i*(1/l);for(let h=0;h<t.length;h++){const u=t[h];if(u>=l)continue;const d=n[u];if(d==null)continue;let g;a?g=o?(d.valueOf()-s)*c:(d-s)*c:g=u*c;const p=Math.floor(g),f=(p<i?p:i-1)*Di;e[f+Kt]=1}}function aS(t,e,i,n,s,r,o,a,l,c){for(let g=0;g<n;g++){const p=g*Di;e[p+Kt]=0,i[p+Kt]=0}if(t.length===0)return;const h=Number.isFinite(o)&&Number.isFinite(a),u=s.length,d=h?n/(a-o):n*(1/u);for(let g=0;g<t.length;g++){const p=t[g];if(p>=u)continue;const f=s[p];if(f==null)continue;const m=r[p];if(m==null)continue;const y=c?m.valueOf():m;if(y!==y)continue;let b;h?b=l?(f.valueOf()-o)*d:(f-o)*d:b=p*d;const v=Math.floor(b),S=(v<n?v:n-1)*Di;y>=0?e[S+Kt]=1:i[S+Kt]=1}}function gs(t,e,i,n=dt,s=St,r=-1){const o=i?.length===t?i:new Uint32Array(t);for(let a=0,l=0;a<t;a+=1,l+=Di){const c=e[l+n],h=e[l+s];o[a]=c===r?r:c+h>>1}return o}function uL(t,{collectLevel:e,shouldContinue:i,minRange:n=Dr,compactInPlace:s=!1}){let r=t,o=e(r);const a=[o];for(;r.maxRange>n&&i(o,r);){const l=So(r.indexData,r.valueData,r.maxRange,{inPlace:s});r={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},o=e(r),a.push(o)}return a.reverse(),a}function lS(t,e,i,n,s){if(e.length<Gs)return;const[r,o]=t,{smallestKeyInterval:a,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=s;let u=js(e,r,o,{smallestKeyInterval:a,xNeedsValueOf:l});const d=h?.find(y=>y.maxRange===u);let{indexData:g,valueData:p}=Hs(e,i,n,r,o,u,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),f=gs(u,g,d?.midpointIndices);const m=[{maxRange:u,indexData:g,valueData:p,midpointIndices:f}];for(;u>Dr;){const y=u,b=Math.trunc(y/2),v=h?.find(M=>M.maxRange===b),S=So(g,p,y,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});u=S.maxRange,g=S.indexData,p=S.valueData,f=S.midpointData??gs(u,g,v?.midpointIndices),m.push({maxRange:u,indexData:g,valueData:p,midpointIndices:f})}return m.reverse(),m}function dL(t,e,i,n,s){if(e.length<Gs)return;const[r,o]=t,{smallestKeyInterval:a,targetRange:l,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u}=s,d=js(e,r,o,{smallestKeyInterval:a,xNeedsValueOf:c}),g=Math.min(d,$a(Math.max(l,Dr))),p=u?.find(S=>S.maxRange===g),{indexData:f,valueData:m}=Hs(e,i,n,r,o,g,{xNeedsValueOf:c,yNeedsValueOf:h,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),y=gs(g,f,p?.midpointIndices),b={maxRange:g,indexData:f,valueData:m,midpointIndices:y};function v(){return lS([r,o],e,i,n,{smallestKeyInterval:a,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u})?.filter(M=>M.maxRange!==g)??[]}return{immediate:[b],computeRemaining:v}}var Qa=Symbol("is-dark-theme"),Mo=Symbol("default-shadow-colour"),kr=Symbol("default-caption-layout-style"),Tr=Symbol("default-caption-alignment"),wf=Symbol("palette-up-stroke"),kf=Symbol("palette-down-stroke"),Tf=Symbol("palette-up-fill"),Lf=Symbol("palette-down-fill"),Nf=Symbol("palette-neutral-stroke"),Of=Symbol("palette-neutral-fill"),Ef=Symbol("palette-alt-up-stroke"),Rf=Symbol("palette-alt-down-stroke"),Pf=Symbol("palette-alt-up-fill"),Ff=Symbol("palette-alt-down-fill"),Vf=Symbol("palette-gray-fill"),Bf=Symbol("palette-gray-stroke"),nd=Symbol("default-polar-series-stroke"),sd=Symbol("default-sparkline-crosshair-stroke"),Gi=Symbol("default-financial-charts-annotation-stroke"),_f=Symbol("default-hierarchy-strokes"),rd=Symbol("default-text-annotation-color"),ji=Symbol("default-financial-charts-annotation-background-fill"),od=Symbol("default-annotation-handle-fill"),ad=Symbol("default-annotation-statistics-fill"),ld=Symbol("default-annotation-statistics-stroke"),cd=Symbol("default-annotation-statistics-color"),hd=Symbol("default-annotation-statistics-divider-stroke"),zf=Symbol("default-annotation-statistics-fill"),Gf=Symbol("default-annotation-statistics-stroke"),ud=Symbol("default-textbox-fill"),dd=Symbol("default-textbox-stroke"),gd=Symbol("default-textbox-color"),Hc=Symbol("default-toolbar-position");function gL(t,e){return"context"in t}function cS(t,e){return t!=null&&gL(t,e)&&e!=null&&typeof e=="object"&&e.context===void 0?(e.context=t.context,!0):!1}function tn(t,e,i){if(Array.isArray(t)){for(const n of t)if(cS(n,i))break}else cS(t,i);return e(i)}var hS=class{constructor(){this.cache=new WeakMap}call(t,e,i,n){let s,r=this.cache.get(e);try{s=n??JSON.stringify(i)}catch{return this.invoke(t,e,r,void 0,i)}return r==null&&(r=new Map,this.cache.set(e,r)),r.has(s)?r.get(s):this.invoke(t,e,r,s,i)}invoke(t,e,i,n,s){try{const r=tn(t,e,s);return i&&n!=null&&i.set(n,r),r}catch(r){Fi("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}destroy(){this.invalidateCache()}},uS=class{constructor(t,e=t.defaultView){this.fallbackDocument=t,this.fallbackWindow=e,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(t){if(this.container=t,t==null)return;const e=t.ownerDocument,i=e.defaultView??void 0,n=e!==this.document;n&&this.removeWindowEvents(),this.cachedDocument=e,this.cachedWindow=i,n&&this.reattachWindowEvents()}removeWindowEvents(){for(const[t,e]of this.windowEvents)for(const{listener:i,options:n}of e)this.window.removeEventListener(t,i,n)}reattachWindowEvents(){for(const[t,e]of this.windowEvents)for(const{listener:i,options:n}of e)this.window.addEventListener(t,i,n)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(t,e){return this.window.getComputedStyle(t,e)}matchMedia(t){return this.window.matchMedia?.(t)}getSelection(){return this.window.getSelection()}requestAnimationFrame(t){return this.window.requestAnimationFrame(t)}cancelAnimationFrame(t){this.window.cancelAnimationFrame(t)}shimIdleCallback(t,e){return setTimeout(()=>t(null),e?.timeout)}requestIdleCallback(t,e){return typeof this.window.requestIdleCallback=="function"?this.window.requestIdleCallback(t,e):this.shimIdleCallback(t,e)}cancelIdleCallback(t){return typeof this.window.cancelIdleCallback=="function"?this.window.cancelIdleCallback(t):clearTimeout(t)}attachListener(t,e,i){let n=this.windowEvents.get(t);n==null&&(n=new Set,this.windowEvents.set(t,n));const s=()=>{n?.delete(o),n?.size===0&&this.windowEvents.delete(t)},r=ce(i)&&i.once?a=>{s(),e(a)}:e,o={listener:r,options:i};return n.add(o),this.window.addEventListener(t,r,i),()=>{s(),this.window.removeEventListener(t,r,i)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return this.document.readyState==="complete"}createElement(t,e,i){const n=this.document.createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const s of e.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}createSvgElement(t){return this.document.createElementNS("http://www.w3.org/2000/svg",t)}createResizeObserver(t){const e=this.window.ResizeObserver;if(e!=null)return new e(t)}createIntersectionObserver(t,e){const i=this.window.IntersectionObserver;if(i!=null)return new i(t,e)}createMutationObserver(t){const e=this.window.MutationObserver;if(e!=null)return new e(t)}};function jf(t,e,i=1/0){const n=e,s=i,r=t%180*(Math.PI/180),o=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));if(o===0)return{width:n,height:s};if(a===0)return{width:s,height:n};if(!Number.isFinite(s)){const c=a/o,h=n/(a+c*o);return{width:h,height:c*h}}const l=a*a-o*o;if(l===0){const c=Math.min(n,s)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((n*a-s*o)/l),height:Math.abs((s*a-n*o)/l)}}function pL(t,e,i=1/0){const n=e,s=i,r=t%180*(Math.PI/180),o=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return o===0?{width:n,height:s}:a===0?{width:s,height:n}:{width:n*a+s*o,height:n*o+s*a}}function Hf(t,e,i,n=0,s=0){const r=Math.cos(i),o=Math.sin(i),a=t-n,l=e-s;return{x:n+a*r-l*o,y:s+a*o+l*r}}var vn=Math.PI*2,$c=Math.PI/2;function Ci(t){return t%=vn,t+=vn,t%=vn,t}function fL(t){return t%=vn,t+=vn,t!==vn&&(t%=vn),t}function pd(t){return t%=vn,t<-Math.PI?t+=vn:t>=Math.PI&&(t-=vn),t}function Lr(t,e,i){const n=Ci(t),s=Ci(e),r=Ci(i);return s<r?s<=n&&n<=r:s>r?s<=n||n<=r:e!==i}function ni(t){return t/180*Math.PI}function mL(t){return t/Math.PI*180}function fd(t,e){return t=Ci(t),e=Ci(e),e-t+(t>e?vn:0)}function dS(t){const e=Ci(t);return e<=$c?e/$c:e<=Math.PI?(Math.PI-e)/$c:e<=1.5*Math.PI?(e-Math.PI)/$c:(vn-e)/$c}function $f(t,e,i){const n=dS(i);return t*n+e*Math.abs(1-n)}function $s(t){return t?Ci(ni(t)):0}var Wf=class{constructor(){this.queue=[]}waitForCompletion(t=50){const e=this.queue;function i(n){function s(){clearTimeout(o),n(!0)}function r(){const a=e.indexOf(s);a<0||(e.splice(a,1),n(!1))}const o=setTimeout(r,t);e.push(s)}return new Promise(i)}notify(){for(const t of this.queue.splice(0))t()}};function Uf(t=0){function e(i){setTimeout(i,t)}return new Promise(e)}async function yL(t,e,i=`Timeout after ${e}ms`){let n;const s=new Promise((r,o)=>{n=setTimeout(()=>o(new Error(i)),e)});try{return await Promise.race([t,s])}finally{clearTimeout(n)}}function Nr(t){return t==="true"}function bL(t){return Number(t)}function nn(t){return t}var vL={role:nn,"aria-checked":Nr,"aria-controls":nn,"aria-describedby":nn,"aria-disabled":Nr,"aria-expanded":Nr,"aria-haspopup":nn,"aria-hidden":Nr,"aria-label":nn,"aria-labelledby":nn,"aria-live":nn,"aria-orientation":nn,"aria-selected":Nr,"data-focus-override":Nr,"data-focus-visible-override":Nr,"data-preventdefault":Nr,class:nn,for:nn,id:nn,tabindex:bL,title:nn,placeholder:nn};function Ce(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function Io(t,e){if(e!=null)for(const[i,n]of ut(e))i!=="class"&&Ce(t,i,n)}function Do(t,e,i){if(!Da(t))return;const n=t.getAttribute(e);return n===null?i:vL[e]?.(n)??void 0}function Gn(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function gS(t,e){for(const[i,n]of ut(e))Gn(t,i,n)}function Hi(t,e){const i=Array.isArray(t)?t:t.split(".");if(i.length===1){const[n]=i;return fr((s,r,o)=>s[n]=o,s=>s[n],e)}return fr((n,s,r)=>ef(n,i,r),n=>Qp(n,i),e)}function xL(t){return fr((e,i,n)=>e[t]=n)}function Yt(t,e){return fr((i,n,s)=>i[t][e??n]=s)}function gi(t){const{newValue:e,oldValue:i,changeValue:n}=t;return fr((s,r,o,a)=>(o!==a&&(a!==void 0&&i?.call(s,a),o!==void 0&&e?.call(s,o),n?.call(s,o,a)),o))}function md(t){return Xp(t)}var el=class extends Fe{constructor(t){super(),this.node=t,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};x([gi({changeValue(t){t?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),C],el.prototype,"enabled",2),x([Yt("node","stroke"),C],el.prototype,"stroke",2),x([Yt("node","strokeOpacity"),C],el.prototype,"strokeOpacity",2),x([gi({changeValue(t){this.enabled?this.node.strokeWidth=t:this.node.strokeWidth=0}}),C],el.prototype,"strokeWidth",2);function yd(t,e,i,n,s){return e<t.x+t.width&&e+n>t.x&&i<t.y+t.height&&i+s>t.y}function tl(t,e,i,n=0,s=0){return e>=t.x&&e+n<=t.x+t.width&&i>=t.y&&i+s<=t.y+t.height}function SL(t){return t==null||t.height===0||t.width===0||Number.isNaN(t.height)||Number.isNaN(t.width)}function bd(t,e){return t===e?!0:t==null||e==null?!1:t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function il(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2);i(s)?(n=s,t=s+1):e=s-1}return n}function nl(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2);i(s)?(n=s,e=s-1):t=s+1}return n}function ML(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2),r=i(s);r==null?e=s-1:(n=r,t=s+1)}return n}function IL(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2),r=i(s);r==null?t=s+1:(n=r,e=s-1)}return n}function pS(t=0,e=0){const i=su();return new i(t,e).getContext("2d")}var DL=800,CL=600,AL={quality:1};function wL(t){const e=class extends t{constructor(...n){super(...n),this.gpu=!1}toBuffer(n,s){return super.toBuffer(n,{...s,msaa:!1})}transferToImageBitmap(){const{width:n,height:s}=this,r=new e(Math.max(1,n),Math.max(1,s));return n>0&&s>0&&r.getContext("2d").drawCanvas(this,0,0,n,s),Object.defineProperty(r,"close",{value:()=>{}}),r}};return e}var fS=!1;function kL(t,e){fS||(fS=!0,Object.defineProperty(t.prototype,"fillText",{value:function(i,n,s){let r=this.outlineText(i);r=r.transform(new e([1,0,0,1,n,s])),this.fill(r)},writable:!0,configurable:!0}))}var TL=class{constructor(t){this.getter=t}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},mS=class{constructor(t){this.getter=t}get(){let t=this.result?.deref();return t||(t=this.getter(),this.result=new WeakRef(t),t)}clear(){this.result=void 0}};function Kf(t,e){return t.valueOf()-e.valueOf()}function LL(t){let e=Number.NaN;const i=[];for(const n of t){const s=n.valueOf();e!==s&&i.push(n),e=s}return i}function Yf(t){const e=t.slice().sort(Kf);return Zf(e)==null?LL(e):e}function Zf(t){if(t.length===0)return 1;const e=Number(t.at(-1))>Number(t[0])?1:-1;let i=-1/0*e;for(const n of t){const s=n.valueOf();if(Math.sign(s-i)!==e)return;i=s}return e}function Xf(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");Fi(i)}}function NL(t,e){const i=Xf(),n=e?.default;return fr((s,r,o)=>(o!==n&&i(r.toString(),t),o))}function OL(t,e){const i=Xf();return fr((n,s,r)=>(r!==n[t]&&(i(s.toString(),`Use [${t}] instead.`),ef(n,t,e?e(r):r)),Ru),(n,s)=>(i(s.toString(),`Use [${t}] instead.`),Qp(n,t)))}function yS(t,e){const i=Math.max(t.length,e.length),n=new Set,s=new Set;for(let r=0;r<i;r++){const o=t[r],a=e[r];o!==a&&(s.has(a)?s.delete(a):a&&n.add(a),n.has(o)?n.delete(o):o&&s.add(o))}return{changed:n.size>0||s.size>0,added:n,removed:s}}function Wc(t,e,i,n){const s=t-i,r=e-n;return s*s+r*r}function vd(t,e,i,n,s,r,o){if(i===s&&n===r)return Math.min(o,Wc(t,e,i,n));const a=s-i,l=r-n,c=Math.max(0,Math.min(1,((t-i)*a+(e-n)*l)/(a*a+l*l))),h=i+c*a,u=n+c*l;return Math.min(o,Wc(t,e,h,u))}function EL(t,e,i,n,s,r,o,a,l){a&&([o,r]=[r,o]);const c=Math.atan2(e-n,t-i);if(!Lr(c,r,o)){const u=i+Math.cos(r)*s,d=n+Math.sin(r)*s,g=i+Math.cos(r)*s,p=n+Math.sin(r)*s;return Math.min(l,Wc(t,e,u,d),Wc(t,e,g,p))}const h=s-Math.sqrt(Wc(t,e,i,n));return Math.min(l,h*h)}function Or(t,e){if(t.length===0)return null;if(e!==void 0){const s=t.at(0),r=t.at(-1),o=s instanceof Date?s.getTime():s,a=r instanceof Date?r.getTime():r;if(Zi(o)&&Zi(a))return e===1?[o,a]:[a,o]}let i=1/0,n=-1/0;for(const s of t){const r=s instanceof Date?s.getTime():s;Zi(r)&&(r<i&&(i=r),r>n&&(n=r))}return On(i)&&On(n)?[i,n]:null}function xd(t,e,i,n,s,r,o){let a=!1;const l=Or(t,o),c=l&&r?[r(Number(l[0])),r(Number(l[1]))]:l;if(c==null){let d;return e!=null&&i!=null&&e<=i?d=[e,i]:n!=null&&s!=null&&n<=s&&(d=[n,s]),{extent:d??[],clipped:!1}}let[h,u]=c;return e!=null?(a||(a=e>h),h=e):n!=null&&n<h&&(h=n),i!=null?(a||(a=i<u),u=i):s!=null&&s>u&&(u=s),h>u?{extent:[],clipped:!1}:{extent:[h,u],clipped:a}}function Sd(t,e,i,n,s){const{extent:r,clipped:o}=xd(t.domain,Nn(e)?new Date(e):e,Nn(i)?new Date(i):i,Nn(n)?new Date(n):n,Nn(s)?new Date(s):s,a=>new Date(a),t.sortMetadata?.sortOrder);return{extent:r.map(a=>new Date(a)),clipped:o}}var RL=new Intl.NumberFormat("en-US",{style:"percent"});function Co(t,e=2){return typeof t=="number"?xS(t,e):typeof t=="bigint"?t.toLocaleString("en-US"):typeof t=="string"?t:String(t??"")}function bS(t){return RL.format(t)}var vS=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function xS(t,e){let i=vS.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),vS.set(e,i)),i.format(t)}function SS(t){return Array.isArray(t)&&t.length>=2&&t.every(Be)}function Md(t){return Array.isArray(t)&&t.length>=2&&t.every(SS)}function PL(t){const e=t[0],i=t.at(-1);return i===void 0?!1:Vi(e[0],i[0],.001)&&Vi(e[1],i[1],.001)}function MS(t){return Array.isArray(t)&&t.every(Md)&&t.every(PL)}function IS(t){if(t===null)return!0;if(!ce(t)||t.type==null)return!1;const{type:e,coordinates:i}=t;switch(e){case"GeometryCollection":return Array.isArray(t.geometries)&&t.geometries.every(IS);case"MultiPolygon":return Array.isArray(i)&&i.every(MS);case"Polygon":return MS(i);case"MultiLineString":return Array.isArray(i)&&i.every(Md);case"LineString":return Md(i);case"MultiPoint":return Md(i);case"Point":return SS(i);default:return!1}}function FL(t){return ce(t)&&t.type==="Feature"&&IS(t.geometry)}function VL(t){return ce(t)&&t.type==="FeatureCollection"&&Array.isArray(t.features)&&t.features.every(FL)}var DS=be(VL,"a GeoJSON object"),CS=class{constructor(t){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=t?.cachedNeighboursEdge,this.processedEdge=t?.processedEdge,this.singleValueEdges=t?.singleValueEdges}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(t){const e=new AS(t);return this._vertexCount++,e}addEdge(t,e,i){i===this.cachedNeighboursEdge?t.updateCachedNeighbours().set(e.value,e):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(t),this.pendingProcessingEdgesTo.push(e));const{edges:n}=t,s=n.get(i);s?s.includes(e)||(this.singleValueEdges?.has(i)?n.set(i,[e]):(s.push(e),this._edgeCount++)):(n.set(i,[e]),this._edgeCount++)}removeVertex(t){this._vertexCount--;const e=t.edges;if(e){for(const[,i]of e)this._vertexCount-=i.length;t.clear()}}removeEdge(t,e,i){const n=t.edges.get(i);if(!n)return;const s=n.indexOf(e);s!==-1&&(n.splice(s,1),n.length===0&&t.edges.delete(i),this._edgeCount--,i===this.cachedNeighboursEdge&&t.readCachedNeighbours()?.delete(e.value))}removeEdges(t,e){this._edgeCount-=t.edges.get(e)?.length??0,t.edges.delete(e)}getVertexValue(t){return t.value}*neighbours(t){for(const[,e]of t.edges)for(const i of e)yield i}*neighboursAndEdges(t){for(const[e,i]of t.edges)for(const n of i)yield[n,e]}neighboursWithEdgeValue(t,e){return t.edges.get(e)}findNeighbour(t,e){return t.edges.get(e)?.[0]}findNeighbourValue(t,e){const i=this.findNeighbour(t,e);if(i)return this.getVertexValue(i)}findNeighbourWithValue(t,e,i){const n=i==null?this.neighbours(t):this.neighboursWithEdgeValue(t,i);if(n){for(const s of n)if(this.getVertexValue(s)===e)return s}}findVertexAlongEdge(t,e,i){if(i===this.cachedNeighboursEdge){let s;for(const r of e)if(s=(s??t).readCachedNeighbours()?.get(r),!s)return;return s}if(e.length===0)return;let n=t;for(const s of e){const r=n?this.neighboursWithEdgeValue(n,i):void 0;if(!r)return;n=r.find(o=>o.value===s)}return n}adjacent(t,e){for(const[,i]of t.edges)if(i.includes(e))return!0;return!1}},AS=class{constructor(t){this.value=t,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}};function ps(t,e,i,n){if(ue(e)){if(!ue(t)||t.length!==e.length||e.some((s,r)=>ps(t[r],s,i,n)!=null))return e}else if(Le(e)){if(!Le(t))return e;const s={},r=new Set([...Object.keys(t),...Object.keys(e)]);for(const o of r)if(t[o]!==e[o])if(n!==void 0&&!(o in e)&&t[o]!==void 0)s[o]=n;else if(i?.has(o))s[o]=e[o];else if(typeof t[o]==typeof e[o]){const a=ps(t[o],e[o],i,n);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 wS(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function Ue(t,e){return ue(t)?BL(t,e):Le(t)?_L(t,e):t instanceof Map?new Map(Ue(Array.from(t))):Ao(t)}function BL(t,e){const i=[],n=e?.seen;for(const s of t){if(typeof s=="object"&&n?.includes(s)){Ca("cycle detected in array",s);continue}n?.push(s),i.push(Ue(s,e)),n?.pop()}return i}function _L(t,e){const i={};for(const n of Object.keys(t))e?.assign?.has(n)?i[n]=t[n]:e?.shallow?.has(n)?i[n]=Ao(t[n]):i[n]=Ue(t[n],e);return i}function Ao(t){return ue(t)?t.slice(0):Le(t)?{...t}:pn(t)?new Date(t):Fx(t)?new RegExp(t.source,t.flags):t}function fs(t,e,i,n,s,r){if(ue(t)){r=e(t,n,s,r);let o=0;for(const a of t)r=fs(a,e,i,n?.[o],s,r),o++}else if(Le(t)){r=e(t,n,s,r);for(const o of Object.keys(t)){if(i?.has(o))continue;const a=t[o];r=fs(a,e,i,n?.[o],s,r)}}return r}function rt(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function qf(t,e,i){return rt(t,"keydown",n=>{const s=i?.()??["Escape"];Id(n,...s)&&e(n)})}function kS(t,e){const i=t.ownerDocument.defaultView,n=rt(i,"mousedown",s=>{[0,2].includes(s.button)&&!LS(t,s)&&(e(),n())});return n}function TS(t,e){const i=t.ownerDocument.defaultView,n=rt(i,"touchstart",s=>{Array.from(s.targetTouches).some(o=>!LS(t,o))&&(e(),n())});return n}function LS(t,e){return Dp(e.target)&&e.target.shadowRoot!=null?!0:ru(e.target)&&t.contains(e.target)}function NS(t,e,i){const n=s=>{for(const r of e)Ce(r,"data-focus-visible-override",s)};return n(i),rt(t,"keydown",()=>n(!0),{once:!0})}function wo(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function Id(t,...e){return wo(t)&&e.includes(t.key)}function OS(t,e,i){return rt(t,"keydown",n=>{Id(n,i)&&e.focus()})}var zL={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},GL={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function Uc(t,e){return e&&t==="horizontal"?GL:zL[t]}function jL(t){const{orientation:e,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:r,onBlur:o}=t,{nextKey:a,prevKey:l}=Uc(e,Na(i[0])),c=g=>{if(g.target&&"tabIndex"in g.target){for(const p of i)p.tabIndex=-1;g.target.tabIndex=0}},[h,u]=n?[i.length,i.length]:[0,1/0],d=new it;for(let g=0;g<i.length;g++){const p=i[(h+g-1)%u],f=i[g],m=i[(h+g+1)%u];d.register(rt(f,"focus",c),r&&rt(f,"focus",r),o&&rt(f,"blur",o),s&&qf(f,s),p&&OS(f,p,l),m&&OS(f,m,a),rt(f,"keydown",y=>{Id(y,a,l)&&y.preventDefault()})),f.tabIndex=g===0?0:-1}return d}function HL(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function Jf(t){return"button"in t?t.button===0:wo(t)&&(t.code==="Space"||t.key==="Enter")}function Qf(t){const e=t?.target;if(Dp(e)&&"tabindex"in e.attributes)return e}function ES(t){return rt(t,"keydown",e=>{if(e.defaultPrevented)return;Do(e.target,"data-preventdefault",!0)&&Id(e,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&e.preventDefault()})}var em=new Map,RS=1;function $L(){em.clear(),RS=1}function xn(t){const e=t.constructor;let i=Object.hasOwn(e,"className")?e.className:e.name;px(()=>{if(!i)throw new Error(`The ${String(e)} is missing the 'className' property.`)}),i??(i="Unknown");const n=(em.get(i)??0)+1;return em.set(i,n),`${i}-${n}`}function Kc(){return`ag-charts-${RS++}`}function Dd(){return crypto.randomUUID?.()??WL()}function WL(){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}var UL=/^\d{4}-\d{2}-\d{2}(T([01]\d|2[0-3]):[0-5]\d(:[0-5]\d(\.\d+)?)?(Z|[+-]([01]\d|2[0-3]):[0-5]\d)?)?$/,KL=[31,28,31,30,31,30,31,31,30,31,30,31];function tm(t,e,i){let n=0;for(let s=0;s<i;s++)n=n*10+(t.charCodeAt(e+s)-48);return n}function ms(t){if(typeof t!="string"||!UL.test(t))return!1;const e=tm(t,5,2);if(e<1||e>12)return!1;const i=tm(t,0,4),n=tm(t,8,2),s=i%4===0&&i%100!==0||i%400===0,r=e===2&&s?29:KL[e-1];return n>=1&&n<=r}function PS(t){return ms(t)?new Date(t):t}function FS(t,e,i){let n=t,s=n;for(const r of e)if(n==null||i(n.value,r)>0)n={value:r,next:n},s=n;else{for(s=s;s.next!=null&&i(s.next.value,r)<=0;)s=s.next;s.next={value:r,next:s.next}}return n}var Yc=new WeakMap;function sl(t,e){const i=JSON.stringify(t,null,0);return Yc.has(e)||Yc.set(e,new Map),Yc.get(e)?.has(i)||Yc.get(e)?.set(i,e(t)),Yc.get(e)?.get(i)}var im=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function Zc(t,e){let i=new im;const n=(...s)=>{let r=i;for(const o of s){const a=typeof o=="object"||typeof o=="symbol"?r.weak:r.strong;let l=a.get(o);l==null&&(l=new im,a.set(o,l)),r=l}if(r.set)return e?.("hit",t,s),r.value;{const o=t(...s);return r.set=!0,r.value=o,e?.("miss",t,s),o}};return n.reset=()=>{i=new im},n}function Cd(t,e){const i=new Map,n=(...o)=>o.map(a=>typeof a=="object"||typeof a=="symbol"?a:(i.has(a)||i.set(a,{v:a}),i.get(a))),s={},r=new WeakMap;return(...o)=>{const a=o.length===0?[s]:n(...o);let l=r;for(const u of a.slice(0,-1))l.has(u)||l.set(u,new WeakMap),l=l.get(u);const c=a.at(-1);let h=l.get(c);return h?e?.("hit",t,o):(h=t(...o),l.set(c,h),e?.("miss",t,o)),h}}function Ad(t,e,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const r of i){const o=r.distanceSquared(t,e);if(o===0)return{nearest:r,distanceSquared:0};o<s.distanceSquared&&(s.nearest=r,s.distanceSquared=o)}return s}function YL(t,e,i,n=1/0){const{x:s=t,y:r=e}=i.transformPoint?.(t,e)??{},o={nearest:void 0,distanceSquared:n};for(const a of i.children){const{nearest:l,distanceSquared:c}=a.nearestSquared(s,r,o.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<o.distanceSquared&&(o.nearest=l,o.distanceSquared=c)}return o}var rl=class extends Fe{constructor(t=0,e=t,i=t,n=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=n}};x([C],rl.prototype,"top",2),x([C],rl.prototype,"right",2),x([C],rl.prototype,"bottom",2),x([C],rl.prototype,"left",2);function VS(t,e,i,n){let{top:s,right:r,bottom:o,left:a,width:l,height:c}=n;return a!=null?l!=null?r=i.width-a+l:r!=null&&(l=i.width-a-r):r!=null&&l!=null&&(a=i.width-r-l),s!=null?c!=null?o=i.height-s-c:o!=null&&(c=i.height-o-s):o!=null&&c!=null&&(s=i.height-o-c),l==null?c==null?(c=e,l=t):l=Math.ceil(t*c/e):c??(c=Math.ceil(e*l/t)),a==null&&(r==null?a=Math.floor((i.width-l)/2):a=i.width-r-l),s==null&&(o==null?s=Math.floor((i.height-c)/2):s=i.height-c-o),{x:a,y:s,width:l,height:c}}var nm="color: green",sm="color: grey";function ZL(){return Xp(()=>{})}function rm(t,e){const i=mr(e);if(i.length===0)return;const n=A0(t);for(const s of i)s in n&&(e[s]=n[s])}var BS=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},om=class Yi extends BS{constructor(e,i,n){super(),this.defaultState=e,this.states=i,this.enterEach=n,this.debug=gx(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,nm)}transition(e,i){if(!this.transitionChild(e,i)||this.state===Yi.child||this.state===Yi.parent)return;const s=this.state,r=this.states[this.state];let o=r[e];const a=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(o))o=o.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${a} (guarded)`,h.target,sm),u});else if(typeof o=="object"&&!(o instanceof Yi)&&o.guard&&!o.guard(i)){this.debug(`${a} (guarded)`,o.target,sm);return}if(!o){this.debug(`${a} ${this.state}`,sm);return}const l=this.getDestinationState(o),c=l===this.state?void 0:r.onExit;this.debug(`${a} ${l}`,nm),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof Yi)&&o.action?.(i),c?.(),this.enterEach?.(s,l),l!==s&&l!==Yi.child&&l!==Yi.parent&&this.states[l].onEnter?.(s,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===Yi.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!==Yi.child||!this.childState||(rm(this,this.childState),this.childState.transition(e,i),!this.childState.is(Yi.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,nm),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 Yi?(this.childState=e,this.childState.parent=this,i=Yi.child):typeof e=="object"&&(e.target instanceof Yi?(this.childState=e.target,this.childState.parent=this,i=Yi.child):e.target!=null&&(i=e.target)),i}};om.child="__child",om.parent="__parent";var Xc=om,XL=class extends BS{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)rm(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)rm(this,i),i.transitionAsync(t,e)}},am=class{constructor(t,e){this.ctx=t,this.measureTextCached=e,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(t){if(t==="alphabetic")return 0;if(this.baselineMap.has(t))return this.baselineMap.get(t);this.ctx.textBaseline=t;const{alphabeticBaseline:e}=this.ctx.measureText("");return this.baselineMap.set(t,e),this.ctx.textBaseline="alphabetic",e}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(t){const e=this.measureTextCached?.(t)??this.ctx.measureText(t),{width:i,fontBoundingBoxAscent:n=e.emHeightAscent,fontBoundingBoxDescent:s=e.emHeightDescent}=e,r=n+s;return{width:i,height:r,ascent:n,descent:s}}measureLines(t){const e=typeof t=="string"?t.split(lr):t;let i=0,n=0;const s=e.map(r=>{const o=this.measureText(r);return i<o.width&&(i=o.width),n+=o.height,{text:r,...o}});return{width:i,height:n,lineMetrics:s}}textWidth(t,e){if(e){let i=0;for(let n=0;n<t.length;n++)i+=this.textWidth(t.charAt(n));return i}return t.length>1?this.ctx.measureText(t).width:this.charMap.get(t)??this.charWidth(t)}charWidth(t){const{width:e}=this.ctx.measureText(t);return this.charMap.set(t,e),e}},lm=new cc(50);function Zt(t){typeof t=="object"&&(t=fu(t));let e=lm.get(t);if(e)return e;const i=new cc(1e4),n=pS();return n.font=t,e=new am(n,s=>{let r=i.get(s);return r||(r=n.measureText(s),i.set(s,r),r)}),lm.set(t,e),e}Zt.clear=()=>lm.clear();function wd(t){return t==null?{top:0,right:0,bottom:0,left:0}:typeof t=="number"?{top:t,right:t,bottom:t,left:t}:{top:t.top??0,right:t.right??0,bottom:t.bottom??0,left:t.left??0}}function qc(t){const e=wd(t.padding),i=t.width+e.left+e.right,n=t.height+e.top+e.bottom;return{width:i,height:n,ascent:n,descent:0}}function ol(t){return t==="baseline"?"alphabetic":t}function cm(t,e,i,n){switch(t){case"top":case"hanging":return{above:i,below:e-i};case"bottom":case"ideographic":return{above:e-n,below:n};case"middle":{const s=(i-n)/2+e/2;return{above:s,below:e-s}}case"alphabetic":default:return{above:e,below:0}}}var al=4;function Jc(t){if(t.length===0)return 0;let e=0;for(let i=0;i<t.length;i++)e+=t[i].textMetrics.width,i>0&&(e+=al);return e}function hm(t){let e=0;for(const i of t)e=Math.max(e,i.textMetrics.height);return e}function um(t,e){const i=t[e];if(i?.type!=="image"||i.block!==!0)return!1;let n=e;for(;n>0;){const s=t[n-1];if(s.type!=="image")return $e(s.text).endsWith(`
`);if(s.block!==!0)return!1;n--}return!0}function _S(){return{segments:[],width:0,height:0,ascent:0,descent:0,textAscent:0,textDescent:0}}function Ws(t,e){let i=_S();const n=[i];let s=!1,r=null;function o(){if(r===null)return;let h=n.length;s&&h>r+1&&(h-=1),n[r].blockRowSpan=h-r,r=null}function a(){i=_S(),n.push(i),s=!0}for(let h=0;h<t.length;h++){const u=t[h];if(um(t,h)){const D=h>0&&t[h-1].type==="image"&&t[h-1].block===!0;D||(o(),(i.segments.length>0||i.blockImages)&&a());const I=qc(u),A={...u,textMetrics:I};i.blockImages??(i.blockImages=[]),i.blockImages.push(A),D||(r=n.length-1),s=!1;continue}if(u.type==="image"){const D=qc(u);i.width+=D.width,i.segments.push({...u,textMetrics:D}),s=!1;continue}const{text:d,fontSize:g=e.fontSize,fontStyle:p=e.fontStyle,fontWeight:f=e.fontWeight,fontFamily:m=e.fontFamily,lineHeight:y,...b}=u,v={fontSize:g,fontStyle:p,fontWeight:f,fontFamily:m},S=Zt(v),M=$e(d).split(lr);for(let D=0;D<M.length;D++){const I=M[D],A=S.measureText(I);D>0&&a(),I&&(i.width+=A.width,i.ascent=Math.max(i.ascent,A.ascent),i.descent=Math.max(i.descent,A.descent),i.height=Math.max(i.height,i.ascent+i.descent),typeof y=="number"&&y>i.height&&(i.descent=y-i.ascent,i.height=y),i.segments.push({...v,...b,text:I,textMetrics:A}),s=!1)}}o();for(const h of n){h.textAscent=h.ascent,h.textDescent=h.descent;for(const u of h.segments){if(u.type!=="image")continue;const{above:d,below:g}=cm(ol(u.verticalAlign),u.textMetrics.height,h.textAscent,h.textDescent);h.ascent=Math.max(h.ascent,d),h.descent=Math.max(h.descent,g)}h.height=Math.max(h.height,h.ascent+h.descent)}let l=0,c=0;for(let h=0;h<n.length;){const u=n[h];if(u.blockImages?.length){const d=u.blockRowSpan??1,g=Jc(u.blockImages),p=hm(u.blockImages);let f=0,m=0;for(let v=0;v<d;v++){const S=n[h+v];f=Math.max(f,S.width),m+=S.height}const y=g+(f>0?al+f:0),b=Math.max(p,m);l=Math.max(l,y),c+=b,h+=d}else l=Math.max(l,u.width),c+=u.height,h+=1}return{width:l,height:c,lineMetrics:n}}function ye(t,e,i){const n=rr().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const s of e.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}function pt(t){return rr().createElementNS("http://www.w3.org/2000/svg",t)}function zS(t,e){const i=rr("body"),n=ye("a",{display:"none"});n.href=t,n.download=e,i.appendChild(n),n.click(),setTimeout(()=>n.remove())}function GS(t,e){return e.overflow==="hide"&&t.some(as)}function kd(t,e){return ue(t)?Ld(t,e):gm($e(t),e).join(`
`)}function dm(t,e){return gm(t,e).join(`
`)}function gm(t,e){return Td(t,e)}function ko(t,e,i,n){const s=e.textWidth(La),r=Rs(t);let o=0,a=0;for(const c of r){const h=e.textWidth(c);if(o+h>i)break;o+=h,a+=c.length}if(a===t.length&&(!n||o+s<=i))return n?Rp(t):t;t=t.slice(0,a).trimEnd();const l=Rs(t);for(;l.length&&e.textWidth(t)+s>i;){for(l.pop();l.length&&l.at(-1).trim()==="";)l.pop();t=l.join("")}return Rp(t)}function Td(t,e,i=0){const n=t.split(lr),s=Zt(e.font),r=[];if(e.textWrap==="never"){for(const c of n){const h=ko(c.trimEnd(),s,Math.max(0,e.maxWidth-i));if(!h)break;r.push(h),i=0}return GS(r,e)?[]:r}const o=e.textWrap==="hyphenate",a=e.textWrap==null||e.textWrap==="on-space";for(const c of n){let h=c.trimEnd();if(h===""){r.push(h);continue}let u=Rs(h),d=0,g=0,p=0,f=0;for(r.length||(p=i);d<u.length;){const m=u[d];if(m===" "&&(f=g),p+=s.textWidth(m),p>e.maxWidth){if(d===0){h="";break}let y=s.textWidth(h.slice(0,g+m.length));if(r.length||(y+=i),y<=e.maxWidth){p=y,g+=m.length,d++;continue}if(f){const M=qL(h,f+1),D=s.textWidth(M);if(D<=e.maxWidth){r.push(h.slice(0,f).trimEnd()),h=h.slice(f).trimStart(),u=Rs(h),d=0,g=0,p=0,f=0;continue}else a&&D>e.maxWidth&&r.push(h.slice(0,f).trimEnd(),ko(h.slice(f).trimStart(),s,e.maxWidth,!0))}else if(a){const M=ko(h,s,e.maxWidth,!0);M&&r.push(M)}if(a){h="";break}const b=o?"-":"";let v=h.slice(0,g).trim();const S=Rs(v);for(;S.length&&s.textWidth(v+b)>e.maxWidth;){for(S.pop();S.length&&S.at(-1).trim()==="";)S.pop();v=S.join("")}if(v&&v!==mc)r.push(Pp(v)+b);else{h="";break}h=h.slice(v.length).trimStart(),u=Rs(h),d=0,g=0,p=0,f=0;continue}g+=m.length,d++}h&&r.push(h)}JL(r,s,e);const l=jS(r,s,e);return GS(l,e)?[]:l}function qL(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}function jS(t,e,i){if(!Be(i.maxHeight))return t;const{height:n,lineMetrics:s}=e.measureLines(t);if(n<=i.maxHeight)return t;for(let r=0,o=0;r<s.length;r++)if(o+=s[r].height,o>i.maxHeight){if(i.overflow==="hide"||r===0)return[];const a=t.slice(0,r),l=a.pop();return a.concat(as(l)?l:ko(l,e,i.maxWidth,!0))}return t}function JL(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:n}=t,s=t[n-1],r=t[n-2];if(Rs(r).length<Rs(s).length)return;const o=r.lastIndexOf(" ");if(o===-1||o===r.indexOf(" ")||s.includes(" "))return;const a=r.slice(o+1);e.textWidth(s+a)<=i.maxWidth&&(t[n-2]=r.slice(0,o),t[n-1]=a+" "+s)}function QL(t){const e=[];let i=null;for(let n=0;n<t.length;n++){const s=t[n];um(t,n)?n>0&&t[n-1].type==="image"&&t[n-1].block===!0&&i?i.blockImages.push(s):(i&&e.push(i),i={blockImages:[s],segments:[]}):(i??(i={blockImages:[],segments:[]}),i.segments.push(s))}return i&&e.push(i),e}function Ld(t,e){const i=QL(t);if(i.length===0)return[];if(i.length===1&&i[0].blockImages.length===0&&!i[0].segments.some(r=>r.type==="image"))return Nd(i[0].segments,e);let n=e.maxHeight??1/0;const s=[];for(const r of i){if(n<=0)break;const o=Number.isFinite(n)?{...e,maxHeight:n}:e,a=eN(r,o);a.length!==0&&(s.push(...a),Number.isFinite(n)&&(n-=Ws(a,e.font).height))}return s}function eN(t,e){return t.blockImages.length===0?ll(t.segments,e):iN(t.blockImages,t.segments,e)}function ll(t,e){return t.length===0?[]:t.some(i=>i.type==="image")?tN(t,e):Nd(t,e)}function tN(t,e){const i=e.maxHeight??1/0,n=[];for(const r of t){if(r.type==="image"){const o=qc(r);if(o.width>e.maxWidth||o.height>i)continue}n.push(r)}let s=Nd(n,e);return s=pm(n,e,s,()=>cl(n,Qc("hide"))),s=pm(n,e,s,()=>aN(n,"keep")&&cl(n,HS)),s=pm(n,e,s,()=>cl(n,Qc("keep"))),s}function pm(t,e,i,n){for(;!rN(t,i)&&n();)i=Nd(t,e);return i}function iN(t,e,i){const n=i.maxHeight??1/0,s=nN(t,i);if(s.length===0)return ll(e,i);const r=s.every(h=>(h.overflowStrategy??"hide")==="keep"),o=Jc(s);if(e.length===0)return s;const a=i.maxWidth-o-al;if(a<=0)return r?s:ll(e,i);const l={...i,maxWidth:a,maxHeight:Math.max(0,n)},c=sN(e,l,r);return c.length>0&&Ws(c,i.font).width>a?s:[...s,...c]}function nN(t,e){const i=e.maxHeight??1/0,n=[];for(const r of t){const o=qc(r);o.width>e.maxWidth||o.height>i||n.push({...r,textMetrics:o})}const s=()=>Jc(n)<=e.maxWidth;for(;!s()&&cl(n,Qc("hide")););for(;!s()&&cl(n,Qc("keep")););return n}function sN(t,e,i){if(!i)return ll(t,e);const n=t.slice();let s=ll(n,e);for(;($S(s)||oN(n,s))&&cl(n,HS);)s=ll(n,e);return s}function cl(t,e){for(let i=t.length-1;i>=0;i--)if(e(t[i]))return t.splice(i,1),!0;return!1}var HS=t=>t.type!=="image";function Qc(t){return e=>e.type==="image"&&(e.overflowStrategy??"hide")===t}function rN(t,e){if($S(e))return!1;const i=t.reduce((s,r)=>s+(r.type==="image"?1:0),0);return e.reduce((s,r)=>s+(r.type==="image"?1:0),0)>=i}function $S(t){return t.some(e=>e.type!=="image"&&as(e.text))}function oN(t,e){const i=t.reduce((s,r)=>r.type==="image"?s:s+1,0);return e.reduce((s,r)=>r.type==="image"?s:s+1,0)<i}function aN(t,e){return t.some(Qc(e))}function Nd(t,e){const{maxHeight:i=1/0}=e,n=[];let s=0,r=0;function o(){const c=n.pop();if(!c||c.type==="image")return;const h=Zt(c),u=ko(c.text,h,e.maxWidth,!0),d=h.measureText(u);n.push({...c,text:u,textMetrics:d})}function a(c){const h=Zt(c),u=zx(c.text),d={...e,font:c,maxHeight:i-r};let g=Td(u,{...d,overflow:"hide"},s);if(g.length===0)if(e.textWrap==="never")g=Td(u,d,s);else{g=Td(u,d);const M=n.at(-1);M&&M.type!=="image"&&(M.text+=`
`,s=0)}if(g.length===0)return o(),!0;const p=g.findIndex(as);p!==-1&&(g=g.slice(0,p+1));const f=c.text.slice(0,c.text.length-c.text.trimStart().length),m=c.text.slice(c.text.trimEnd().length),y=g.map(Gx),b=y.findIndex(M=>M.trim()!==""),v=y.findLastIndex(M=>M.trim()!==""),S=y.length-1;for(let M=0;M<y.length;M++){let D=y[M];f&&M===b&&(D=f+D.trimStart()),m&&M===v&&(D=D.trimEnd()+m);const I=h.measureText(D),A={...c,text:D,textMetrics:I};M===S?s+=I.width:(A.text+=`
`,s=0),r+=I.height,n.push(A)}return p!==-1}let l=!0;for(const{width:c,height:h,segments:u}of Ws(t,e.font).lineMetrics){if(l||(WS(n,e.font),s=0),l=!1,r+h>i){n.length&&o();break}if(s+c<=e.maxWidth){s+=c,r+=h,n.push(...u);continue}let d=0;for(const g of u){if(s+g.textMetrics.width<=e.maxWidth){s+=g.textMetrics.width,d=Math.max(d,g.textMetrics.height),n.push(g);continue}if(g.type==="image"){const p=g.textMetrics.width,f=g.textMetrics.height;if(e.textWrap!=="never"&&s>0&&p<=e.maxWidth&&r+d+f<=i){WS(n,e.font),s=p,r+=d+f,d=0,n.push(g);continue}return o(),n}if(a(g))break;d=0}}return n}function WS(t,e){const i=t.at(-1);if(i&&i.type!=="image")i.text+=`
`;else if(i){const n=Zt(e);t.push({...e,text:`
`,textMetrics:n.measureText("")})}}function Od(t,[e,i],[n,s]){const r=s-n,o=i-e,a=e+o*t[0],l=e+o*t[1];return[(a-n)/r,(l-n)/r]}var ft=(t,e)=>({duration:zi(t)*e,timeInterval:t,step:e}),Ed=[ft({unit:"second"},1),ft({unit:"second"},5),ft({unit:"second"},15),ft({unit:"second"},30),ft({unit:"minute"},1),ft({unit:"minute"},5),ft({unit:"minute"},15),ft({unit:"minute"},30),ft({unit:"hour"},1),ft({unit:"hour"},3),ft({unit:"hour"},6),ft({unit:"hour"},12),ft({unit:"day"},1),ft({unit:"day"},2),ft({unit:"day",step:7},1),ft({unit:"day",step:7},2),ft({unit:"day",step:7},3),ft({unit:"month"},1),ft({unit:"month"},2),ft({unit:"month"},3),ft({unit:"month"},4),ft({unit:"month"},6),ft({unit:"year"},1)],fm=[1,2,5,10];function US(t,e){return Math.abs(Math.round(t)-t)<e}function KS(t,e,i){return Math.abs(e-t)>=i?Math.abs(e-t)/i+1:1}function hl(t,e,i,n,s,r){if(t===e)return{ticks:[t],count:1,firstTickIndex:0};if(i<2)return{ticks:[t,e],count:2,firstTickIndex:0};const o=To(t,e,i,n,s);if(!Number.isFinite(o))return{ticks:[],count:0,firstTickIndex:void 0};let a=t,l=e;US(a/o,1e-12)||(a=Math.ceil(a/o)*o),US(l/o,1e-12)||(l=Math.floor(l/o)*o),r!=null&&(r=Od(r,[t,e],[a,l]));const{ticks:c}=Rd(a,l,o,r),h=c.at(0);return{ticks:c,count:KS(a,l,o),firstTickIndex:h==null?void 0:Math.round((h-a)/o)}}var lN=Math.floor(2*U0/pf*10)/10;function YS({timeInterval:t,step:e}){const i=zi(t)*e,n=Bc(t),s=n?zi(n):void 0;return i<=(s??1/0)*lN}function mm(t,{weekStart:e}){if(t.unit==="day"&&t.step===7)return e}function eh(t,e,i,n,s,{weekStart:r,primaryOnly:o=!1,targetInterval:a}){if(i<=0)return;const l=a??Math.abs(e-t)/Math.max(i,1),c=Ed.findLast(g=>(!o||YS(g))&&l>g.duration),h=Ed.find(g=>(!o||YS(g))&&l<=g.duration);if(c==null)return{unit:"millisecond",step:Math.max(To(t,e,i,n,s),1)};if(h==null)return{unit:"year",step:a==null?To(t/Rc,e/Rc,i,n,s):1};const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return{unit:u.unit,step:Ir(u)*d,epoch:mm(u,{weekStart:r})}}function To(t,e,i,n=0,s=1/0){if(t===e)return J(1,n,s);if(i<1)return Number.NaN;const r=Math.abs(e-t),o=10**Math.floor(Math.log10(r/i));let a=Number.NaN,l=1/0,c=!1;for(const h of fm){const u=Math.ceil(r/(h*o)),d=u>=n&&u<=s;if(c&&!d)continue;const g=Math.abs(u-i);(l>g||c!==d)&&(c||(c=d),l=g,a=h)}return a*o}function ZS(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function cN(t,e){const i=xu(e??",f");if(i==null)return;(i.precision==null||Number.isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(s=>{if(!Number.isFinite(s))return 0;const[r,o]=s.toExponential((i.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+ZS(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const r=Math.floor(Math.log10(Math.abs(s))),o=i.type?6:12,a=s.toExponential(o-1).split(/[.e]/g)[1],l=ZS(a);return Math.max(0,l-r)}))));const n=Hp(i);return s=>n(typeof s=="bigint"?s:Number(s))}function ym(t,e){if(t.toString(2).length<4)return BigInt(Math.max(1,Math.round(To(0,Number(t),e))));const i=t/BigInt(Math.max(1,Math.round(e)));let n=1n;for(;n*10n<=i;)n*=10n;let s=n,r=1/0;for(const o of fm){const a=BigInt(o)*n,l=Number(t/a)+1,c=Math.abs(l-e);c<r&&(r=c,s=a)}return s}function bm(t,e){const i=t%e;return i===0n?t:t>0n?t-i+e:t-i}function vm(t,e){const i=t%e;return i===0n?t:t<0n?t-i-e:t-i}function XS(t,e,i){if(t===e)return[t];if(i<2)return[t,e];const n=t<e,s=n?t:e,r=n?e:t,o=ym(r-s,i);if(o<=0n)return[t,e];const a=bm(s,o),l=vm(r,o),c=[];for(let h=a;h<=l;h+=o)c.push(h);return n?c:c.reverse()}function qS(t,e,i){const n=t<e?t:e,s=t<e?e:t;if(n===s)return[[n,s]];const r=BigInt(Number.isFinite(i)?Math.max(1,Math.floor(i)):1),o=s-n,a=[];for(let l=0n;l<r;l+=1n){const c=n+l*o/r,h=l===r-1n?s:n+(l+1n)*o/r;a.push([c,h])}return a}function JS(t,e,i){const n=t<e?t:e,s=t<e?e:t,r=n===s?0n:ym(s-n,i);if(r<=0n)return[[n,s]];const o=bm(n,r),a=vm(s,r),l=[[o-r,o]];for(let c=o;c<=a;c+=r)l.push([c,c+r]);return l}function QS(t,e,i){if(t===e)return[t,e];const n=t<e,s=n?t:e,r=n?e:t,o=ym(r-s,i);if(o<=0n)return[t,e];const a=vm(s,o),l=bm(r,o);return n?[a,l]:[l,a]}function Rd(t,e,i,n){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(t===e)return{ticks:[t],count:1,firstTickIndex:0};const s=10**du(i),r=Math.min(t,e),o=Math.max(t,e);let a,l;if(n!=null&&(n[0]!==0||n[1]!==1)){const u=e-t,d=t+u*n[0],g=e-u*(1-n[1]);a=Math.min(d,g),l=Math.max(d,g)}else a=r,l=o;a=Math.floor(a*s)/s,l=Math.ceil(l*s)/s;const c=[];for(let u=0;;u+=1){const d=Math.round((r+i*u)*s)/s;if(d>o)break;d>=a&&d<=l&&c.push(d)}const h=c.at(0);return{ticks:c,count:KS(r,o,i),firstTickIndex:h==null?void 0:Math.round((h-r)/i)}}function ul(t,e){return t>=e?(Fi("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function xm(t,e){const i=Math.abs(e-t),n=10**Math.floor(Math.log10(i));let s=1/0,r=[t,e];for(const o of fm){const a=o*n,l=Math.floor(t/a)*a,c=Math.ceil(e/a)*a,h=1-i/Math.abs(c-l);s>h&&(s=h,r=[l,c])}return r}function eM(t,e,i,n,s,r){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};r=Math.max(r,t/(s+1)),i??(i=r),n??(n=t),i>n&&(i===r?i=n:n=i),i=Math.max(i,1);const o=Math.max(1,Math.floor(t/(e*i))),a=Math.min(o,Math.ceil(t/(e*n))),l=J(a,Math.floor(s/e),o);return{minTickCount:a,maxTickCount:o,tickCount:l}}function Sm(){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)}}function Mm(t){return t!=null&&Object.hasOwn(t,"toString")&&nt(t.toString())}function Im(t){return t!=null&&Object.hasOwn(t,"valueOf")&&Be(t.valueOf())}function jn(t){return Be(t)||typeof t=="bigint"||vc(t)||Im(t)}function tM(t,e){return t!=null&&(!e||jn(t))}function Pd(t){return Mm(t)&&Object.hasOwn(t,"id")?t.id:t}function Dm(t){return Mm(t)&&Object.hasOwn(t,"value")?t.value:t}var Lo={};Ri(Lo,{add:()=>hN,angle:()=>fN,apply:()=>DN,distance:()=>dN,distanceSquared:()=>gN,equal:()=>MN,from:()=>IN,gradient:()=>yN,intercept:()=>bN,intersectAtX:()=>xN,intersectAtY:()=>vN,length:()=>Fd,lengthSquared:()=>iM,multiply:()=>uN,normalized:()=>pN,origin:()=>nM,required:()=>CN,rotate:()=>mN,round:()=>SN,sub:()=>Cm});function hN(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 Cm(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 uN(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 Fd(t){return Math.hypot(t.x,t.y)}function iM(t){return t.x*t.x+t.y*t.y}function dN(t,e){return Fd(Cm(t,e))}function gN(t,e){return iM(Cm(t,e))}function pN(t){const e=Fd(t);return{x:t.x/e,y:t.y/e}}function fN(t,e){return e==null?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function mN(t,e,i=nM()){const n=Fd(t);return{x:i.x+n*Math.cos(e),y:i.y+n*Math.sin(e)}}function yN(t,e,i){const n=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/n}function bN(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function vN(t,e,i=0,n){return{x:t===1/0?1/0:(i-e)/t,y:n==null?i:n-i}}function xN(t,e,i=0,n){const s=t===1/0?1/0:t*i+e;return{x:i,y:n==null?s:n-s}}function SN(t,e=2){return{x:uu(t.x,e),y:uu(t.y,e)}}function MN(t,e){return t.x===e.x&&t.y===e.y}function IN(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 DN(t,e){return t.x=e.x,t.y=e.y,t}function CN(t){return{x:t?.x??0,y:t?.y??0}}function nM(){return{x:0,y:0}}var No={};Ri(No,{bottomCenter:()=>LN,center:()=>TN,clone:()=>RN,collides:()=>PN,end:()=>wN,from:()=>FN,height:()=>ON,normalise:()=>Vd,origin:()=>VN,round:()=>EN,start:()=>AN,topCenter:()=>kN,width:()=>NN});function AN(t){return{x:t.x1,y:t.y1}}function wN(t){return{x:t.x2,y:t.y2}}function kN(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function TN(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function LN(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function NN(t){return Math.abs(t.x2-t.x1)}function ON(t){return Math.abs(t.y2-t.y1)}function EN(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function RN(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function PN(t,e){const i=Vd(t),n=Vd(e);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1}function Vd(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 FN(t,e,i,n){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:n};if("width"in t)return Vd({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}] [${n}]`)}function VN(){return{x1:0,y1:0,x2:0,y2:0}}function sn(t){return ce(t)&&t.type=="gradient"}function BN(t){return ue(t)&&t.every(sn)}function sM(t){return ue(t)&&t.every(e=>typeof e=="string")}function Us(t){return t!==null&&ce(t)&&t.type=="pattern"}function Oo(t){return t!==null&&ce(t)&&t.type=="image"}function _N(t){return sn(t)||Us(t)}function dl(t,e,i,n,s){return(1-s)**3*t+3*(1-s)**2*s*e+3*(1-s)*s**2*i+s**3*n}function Bd(t,e,i,n,s){if(s<=Math.min(t,n))return t<n?0:1;if(s>=Math.max(t,n))return t<n?1:0;let r=0,o=1,a=Number.NaN;for(let l=0;l<12;l+=1)a=(r+o)/2,dl(t,e,i,n,a)<s?r=a:o=a;return a}function th(t,e,i,n,s,r,o,a,l){const c=(1-l)*t+l*i,h=(1-l)*e+l*n,u=(1-l)*i+l*s,d=(1-l)*n+l*r,g=(1-l)*s+l*o,p=(1-l)*r+l*a,f=(1-l)*c+l*u,m=(1-l)*h+l*d,y=(1-l)*u+l*g,b=(1-l)*d+l*p,v=(1-l)*f+l*y,S=(1-l)*m+l*b;return[[{x:t,y:e},{x:c,y:h},{x:f,y:m},{x:v,y:S}],[{x:v,y:S},{x:y,y:b},{x:g,y:p},{x:o,y:a}]]}function rM(t,e,i,n){const s=-t+3*e-3*i+n,r=2*(t-2*e+i),o=-t+e;if(s===0){if(r!==0){const l=-o/r;if(l>0&&l<1)return[l]}return[]}const a=r*r-4*s*o;if(a>=0){const l=Math.sqrt(a),c=(-r+l)/(2*s),h=(-r-l)/(2*s);return[c,h].filter(u=>u>0&&u<1)}return[]}function oM(t,e,i,n,s,r,o,a){const l=rM(t,i,s,o),c=rM(e,n,r,a);return[...l,...c]}function Am(t,e,i){const n=dl(t[0].x,t[1].x,t[2].x,t[3].x,.5),s=dl(t[0].y,t[1].y,t[2].y,t[3].y,.5),r=Math.hypot(n-e,s-i),o=Math.min(Math.hypot(t[0].x-e,t[0].y-i),Math.hypot(t[1].x-e,t[1].y-i),Math.hypot(t[2].x-e,t[2].y-i),Math.hypot(t[3].x-e,t[3].y-i));return{points:t,distance:r,minDistance:o}}function aM(t,e,i,n,s,r,o,a,l,c,h=1){let d={value:Am([{x:t,y:e},{x:i,y:n},{x:s,y:r},{x:o,y:a}],l,c),next:null},g;for(;d!=null;){const{points:p,distance:f,minDistance:m}=d.value;if(d=d.next,(g==null||f<g.distance)&&(g={distance:f,minDistance:m}),g!=null&&g.distance-m<=h)continue;const[y,b]=th(p[0].x,p[0].y,p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,.5),v=[Am(y,l,c),Am(b,l,c)].sort(lM);d=FS(d,v,lM)}return g?.distance??1/0}var lM=(t,e)=>e.minDistance-t.minDistance;function zN({point:t,anchor:e},i,n,s,r){if(t.size===0)return!1;let o=t.x,a=t.y;e!=null&&(o-=(e.x-.5)*t.size,a-=(e.y-.5)*t.size);let l=o;o<i?l=i:o>i+s&&(l=i+s);let c=a;a<n?c=n:a>n+r&&(c=n+r);const h=o-l,u=a-c;return Math.hypot(h,u)<=t.size/2}function cM(t){return t!=null&&typeof t.point=="object"&&typeof t.label=="object"}var GN={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 hM(t,e,i=5){const n=new Map,s=[],r=new Map(Array.from(t.entries(),([a,l])=>[a,l.toSorted((c,h)=>h.point.size-c.point.size)])),o=[...r.values()].flat();for(const[a,l]of r.entries()){const c=[];if(l[0]?.label){for(let h=0,u=l.length;h<u;h++){const d=l[h],{point:g,label:p,anchor:f}=d,{text:m,width:y,height:b}=p,v=g.size/2;let S=0,M=0;if(v>0&&d.placement!=null){const A=GN[d.placement];S=(y/2+v+i)*A.x,M=(b/2+v+i)*A.y}let D=g.x-y/2+S,I=g.y-b/2+M;if(f&&(D-=(f.x-.5)*g.size,I-=(f.y-.5)*g.size),tl(e,D,I,y,b)&&!o.some(A=>zN(A,D,I,y,b))&&!s.some(A=>yd(A,D,I,y,b))){const A={index:h,text:m,x:D,y:I,width:y,height:b,datum:d};c.push(A),s.push(A)}}n.set(a,c)}}return n}function uM(t){return t.type==="continuous"||t.type==="log"}function dM(t){return t.type==="category"}function Er(t){return"variant"in t&&t.variant==="unit-time"}function gM(t){return!("variant"in t)}function Eo(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:uM(t)&&uM(e)?t.type===e.type&&es(t.domain,e.domain)&&es(t.range,e.range):dM(t)&&dM(e)?Er(t)&&Er(e)?t.firstBandTime===e.firstBandTime&&t.lastBandTime===e.lastBandTime&&t.bandCount===e.bandCount&&t.intervalMs===e.intervalMs&&t.inset===e.inset&&t.step===e.step:gM(t)&&gM(e)?t.inset===e.inset&&t.step===e.step&&es(t.domain,e.domain):!1:!1}function ih(t){return t==null?!1:t.type==="category"?Er(t)?Number.isFinite(t.firstBandTime)&&Number.isFinite(t.lastBandTime)&&Number.isFinite(t.bandCount)&&t.bandCount>0:t.domain.every(e=>e!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}function Ai(t){switch(t.type){case"linear":case"step":case"multi-line":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 jN(t){const e=Ai(t);return e[0].x>e[1].x&&e.reverse(),e}function _d(t,e){const{x:i,y:n}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:n,cp1x:i,cp1y:n,cp2x:i,cp2y:n,cp3x:i,cp3y:n};case"multi-line":return{type:"multi-line",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n,midPoints:t.midPoints.map(()=>({x:i,y:n}))}}}function gl(t,e,i){const[n,s]=Ai(t),r=s.x===n.x?0:(i.x-e.x)/(s.x-n.x),o=s.y===n.y?0:(i.y-e.y)/(s.y-n.y);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-n.x)*r,cp1y:i.y-(t.cp2y-n.y)*o,cp2x:i.x-(t.cp1x-n.x)*r,cp2y:i.y-(t.cp1y-n.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-n.x)*r};case"multi-line":return{type:"multi-line",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,midPoints:t.midPoints.map(a=>({x:e.x+(a.x-n.x)*r,y:e.y+(a.y-n.y)*o}))}}}function wm(t,e,i){const{moveTo:n}=t,[s,r]=jN(t),{x:o,y:a}=s,{x:l,y:c}=r;if(i<o)return gl(t,s,s);if(e>l)return gl(t,r,r);switch(t.type){case"linear":{const h=a===c?void 0:(c-a)/(l-o),u=h==null?a:h*(e-o)+a,d=h==null?a:h*(i-o)+a;return{type:"linear",moveTo:n,x0:e,y0:u,x1:i,y1:d}}case"step":if(i<=t.stepX){const h=t.y0;return{type:"step",moveTo:n,x0:e,y0:h,x1:i,y1:h,stepX:i}}else if(e>=t.stepX){const h=t.y1;return{type:"step",moveTo:n,x0:e,y0:h,x1:i,y1:h,stepX:e}}else{const{y0:h,y1:u,stepX:d}=t;return{type:"step",moveTo:n,x0:e,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=Bd(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[u,d]=th(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const g=Bd(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=th(d[0].x,d[0].y,d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y,g),{type:"cubic",moveTo:n,cp0x:d[0].x,cp0y:d[0].y,cp1x:d[1].x,cp1y:d[1].y,cp2x:d[2].x,cp2y:d[2].y,cp3x:d[3].x,cp3y:d[3].y}}case"multi-line":{const{midPoints:h}=t,u=h.findLastIndex(D=>D.x<=e);let d=h.findIndex(D=>D.x>=i);d===-1&&(d=h.length);const g=u>=0?h[u]:void 0,p=g?.x??o,f=g?.y??a,m=d<h.length?h[d]:void 0,y=m?.x??l,b=m?.y??c,v=f===b?void 0:(b-f)/(y-p),S=v==null?f:v*(p-o)+f,M=v==null?f:v*(y-o)+f;return{type:"multi-line",moveTo:n,x0:e,y0:S,x1:i,y1:M,midPoints:h.slice(Math.max(u,0),d)}}}}var pM=(t=>(t[t.MoveTo=0]="MoveTo",t[t.LineTo=1]="LineTo",t[t.Skip=2]="Skip",t))(pM||{});function fM(t){const e=[];let i=0,n=Number.NaN,s=Number.NaN;for(const{x:r,y:o}of t){if(i>0){const a=i===1;e.push({type:"linear",moveTo:a,x0:n,y0:s,x1:r,y1:o})}i+=1,n=r,s=o}return e}var HN={start:0,middle:.5,end:1};function mM(t,e){const i=[];let n=0,s=Number.NaN,r=Number.NaN;const o=typeof e=="number"?e:HN[e];for(const{x:a,y:l}of t){if(n>0){const c=n===1,h=s+(a-s)*o;i.push({type:"step",moveTo:c,x0:s,y0:r,x1:a,y1:l,stepX:h})}n+=1,s=a,r=l}return i}function yM(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const n=.05,s=i.map((o,a)=>{const l=a===0?o:i[a-1],c=a===i.length-1?o:i[a+1],h=a===0||a===i.length-1;if(Math.sign(l.y-o.y)===Math.sign(c.y-o.y))return 0;if(!h){const u=Math.abs(l.y-c.y),d=Math.abs(o.y-l.y)/u,g=Math.abs(o.y-c.y)/u;if(d<=n||1-d<=n||g<=n||1-g<=n)return 0}return(c.y-l.y)/(c.x-l.x)});s[1]===0&&(s[0]*=2),s.at(-2)===0&&(s[s.length-1]*=2);const r=[];for(let o=1;o<i.length;o+=1){const a=i[o-1],l=s[o-1],c=i[o],h=s[o],u=c.x-a.x,d=c.y-a.y;let g=u*e/3,p=u*l*e/3,f=u*e/3,m=u*h*e/3;h===0&&Math.abs(p)>Math.abs(d)&&(g*=Math.abs(d/p),p=Math.sign(p)*Math.abs(d)),l===0&&Math.abs(m)>Math.abs(d)&&(f*=Math.abs(d/m),m=Math.sign(m)*Math.abs(d)),r.push({type:"cubic",moveTo:o===1,cp0x:a.x,cp0y:a.y,cp1x:a.x+g,cp1y:a.y+p,cp2x:c.x-f,cp2y:c.y-m,cp3x:c.x,cp3y:c.y})}return r}var km=0,Tm=1;function nh(t){return{x:{min:t?.x?.min??km,max:t?.x?.max??Tm},y:{min:t?.y?.min??km,max:t?.y?.max??Tm}}}function sh(t,e){if(e==="x")return t?.x;if(e==="y")return t?.y}function ys(t){let e,i;for(const n of Object.keys(t)){const s=t[n];s&&(s.direction==="x"?e??(e={min:s.min,max:s.max}):s.direction==="y"&&(i??(i={min:s.min,max:s.max})))}if(e||i)return{x:e,y:i}}var Lm=class extends Fe{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(t){this.markDirty()}},zd={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 Nm(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),n=t.getTime()-e.getTime()+i*6e4,s=36e5*24;return Math.floor(n/s)}function bM(t,e){const n=new Date(t.getFullYear(),0,1).getDay(),s=(e-n+7)%7,r=new Date(t.getFullYear(),0,s+1);return r<=t?Math.floor(Nm(t,r)/7)+1:0}var $N=0,vM=1,xM=4;function SM(t,e=t.getFullYear()){const n=new Date(e,0,1).getDay(),s=(xM-n+7)%7,r=new Date(e,0,s-(xM-vM)+1);return r<=t?Math.floor(Nm(t,r)/7)+1:SM(t,e-1)}function WN(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${si(Math.floor(i/60),2,"0")}${si(Math.floor(i%60),2,"0")}`}var UN={a:t=>zd.shortDays[t.getDay()],A:t=>zd.days[t.getDay()],b:t=>zd.shortMonths[t.getMonth()],B:t=>zd.months[t.getMonth()],c:"%x, %X",d:(t,e)=>si(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>si(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>si(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":si(i,2,e??"0")},j:(t,e)=>si(Nm(t)+1,3,e??"0"),m:(t,e)=>si(t.getMonth()+1,2,e??"0"),M:(t,e)=>si(t.getMinutes(),2,e??"0"),L:(t,e)=>si(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)=>si(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>si(bM(t,$N),2,e??"0"),V:(t,e)=>si(SM(t),2,e??"0"),w:(t,e)=>si(t.getDay(),2,e??"0"),W:(t,e)=>si(bM(t,vM),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>si(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>si(t.getFullYear(),4,e??"0"),Z:t=>WN(t),"%":()=>"%"},KN={_:" ",0:"0","-":""};function si(t,e,i){const n=String(Math.floor(t));return n.length>=e?n:`${i.repeat(e-n.length)}${n}`}function pl(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const a=i>0?t.substring(0,i):t;e.push(a)}if(i<0)break;const n=t[i+1],s=KN[n];s!=null&&i++;const r=t[i+1],o=UN[r];if(typeof o=="function")e.push([o,s]);else if(typeof o=="string"){const a=pl(o);e.push([a,s])}else e.push(`${s??""}${r}`);t=t.substring(i+2)}return i=>{const n=typeof i=="number"?new Date(i):i;return e.map(s=>typeof s=="string"?s:s[0](n,s[1])).join("")}}function YN(t,e){const i=ye("button",Gd("ag-charts-input ag-charts-button",e));return t.label===void 0?(i.append(MM(t.icon)),i.ariaLabel=t.altText):i.append(t.label),i.addEventListener("click",t.onPress),Io(i,e),i}function ZN(t,e){const i=ye("input",Gd("ag-charts-input ag-charts-checkbox",e));return i.type="checkbox",i.checked=t.checked,i.addEventListener("change",n=>t.onChange(i.checked,n)),i.addEventListener("keydown",n=>{Jf(n)&&(n.preventDefault(),i.click())}),Io(i,e),i}function XN(t,e){const i=ye("select",Gd("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(n=>{const s=ye("option");return s.value=n.value,s.textContent=n.label,s})),Ce(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",n=>t.onChange(i.value,n)),Io(i,e),i}function qN(t,e){const i=ye("textarea",Gd("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",n=>t.onChange(i.value,n)),Io(i,e),Ce(i,"data-preventdefault",!1),i}function MM(t){const e=ye("span",`ag-charts-icon ag-charts-icon-${t}`);return Ce(e,"aria-hidden",!0),e}function Gd(t,e){return e==null?t:`${t} ${e.class}`}var IM=t=>t,JN=t=>1-Math.cos(t*Math.PI/2),rh=t=>Math.sin(t*Math.PI/2),QN=t=>-(Math.cos(t*Math.PI)-1)/2,eO=t=>t*t,tO=t=>1-(1-t)**2,iO=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,DM=t=>2*Math.asin(t)/Math.PI,fl=(t,e)=>t===e;function H(t){return function(e,i){const n=`__${i}`;e[i]||Em(e,i,n,t)}}function jd(t){return H(t)}function Ro(t){return H(t)}function Om(t){const e=t??{};return e.equals=es,H(t)}function Xe(t){return function(e,i){const n=`__${i}`;e[i]||Em(e,i,n,t)}}function oh(t){return function(e,i){const n=`__${i}`;e[i]||Em(e,i,n,t)}}function Em(t,e,i,n){const{changeCb:s,convertor:r,checkDirtyOnAssignment:o=!1}=n??{},a={changeCb:s,checkDirtyOnAssignment:o,convertor:r},l=rO(i,sO(nO(oO(i,a),a),a),a);function c(){return this[i]}Object.defineProperty(t,e,{set:l,get:c,enumerable:!0,configurable:!0})}function nO(t,e){const{convertor:i}=e;if(i){let s=function(o){t.call(this,r(o))};var n=s;const r=i;return s}return t}var CM=Symbol("no-change");function sO(t,e){const{changeCb:i}=e;if(i){let s=function(o){const a=t.call(this,o);return a!==CM&&r.call(this,this),a};var n=s;const r=i;return s}return t}function rO(t,e,i){const{checkDirtyOnAssignment:n}=i;if(n){let r=function(o){const a=e.call(this,o);return o?._dirty===!0&&this.markDirty(t),a};var s=r;return r}return e}function oO(t,e){const{equals:i=fl}=e;function n(s){const r=this[t];return i(s,r)?CM:(this[t]=s,this.onChangeDetection(t),s)}return n}var AM=ht(We,We),aO=Ae({..._,...W,...U,marker:gr}),wM={showInMiniChart:L,connectMissingData:L,interpolation:Eu,label:ze,styler:aO,marker:Bn,tooltip:C0,shadow:cs,...Ie,...W,..._,...U,highlight:AM,segmentation:Ba},Rm={...wM,...Vn,highlight:AM,type:Z(_e("area")),xKey:Z(O),yKey:Z(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,legendItemName:O,stacked:L,stackGroup:O,normalizedTo:G};Rm.selectedKey=Q(O);var kM=ht(Rn,Rn),TM=Ae({...W,..._,...U,cornerRadius:w}),Pm={direction:V("horizontal","vertical"),showInMiniChart:L,cornerRadius:w,styler:TM,itemStyler:TM,crisp:L,label:{...ze,placement:V("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:w},errorBar:Tc,shadow:cs,tooltip:ke,...Ie,highlight:kM,...W,..._,...U,segmentation:Ba,width:Fs,widthRatio:X};Pm.sparklineMode=Q(L);var ml={...Pm,...Vn,highlight:kM,type:Z(_e("bar")),xKey:Z(O),yKey:Z(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,direction:V("horizontal","vertical"),grouped:L,stacked:L,stackGroup:O,normalizedTo:G,legendItemName:O,errorBar:Ou};ml.yFilterKey=Q(O),ml.pickOutsideVisibleMinorAxis=Q(L),ml.focusPriority=Q(G),ml.simpleItemStyler=Q(Pe);var LM=ht(We,ur),lO=Ae({..._,...U,marker:gr}),Fm={title:O,showInMiniChart:L,connectMissingData:L,interpolation:Eu,label:ze,styler:lO,marker:Bn,tooltip:ke,errorBar:Tc,...Ie,..._,...U,highlight:LM,segmentation:y0};Fm.sparklineMode=Q(L);var ah={...Fm,...Vn,highlight:LM,type:Z(_e("line")),xKey:Z(O),yKey:Z(O),xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,stacked:L,stackGroup:O,normalizedTo:G,legendItemName:O,errorBar:Ou};ah.selectedKey=Q(O),ah.pickOutsideVisibleMinorAxis=Q(L),ah.focusPriority=Q(G);var Qe="14.0.0",NM={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:sd,lineDash:[0],label:{enabled:!1}}},Vm={...NM,nice:!1},Hd={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Bm={style:[{stroke:{$ref:"gridLineColor"}}],width:2},cO={number:{gridLine:Bm},time:{gridLine:Bm},category:{gridLine:Bm}},hO={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{$applyPadding:0},axes:{number:{...Vm,interval:{values:[0]}},log:{...Vm},time:{...Vm},category:{...NM}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Hd,position:{...Hd.position,anchorTo:"pointer"},range:"nearest"},axes:cO},line:{seriesArea:{padding:{$applyPadding:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Hd},area:{seriesArea:{padding:{$applyPadding:{top:1,right:0,bottom:1,left:0}}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Hd}}},OM=Cd(uO);function uO(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:OM(t.baseTheme,e)}:e}function EM(t){if(Array.isArray(t)&&t.length!==0){const e=t.find(i=>i!=null);if(typeof e=="number")return{data:t.map((n,s)=>({x:s,y:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(n=>({x:n?.[0],y:n?.[1],datum:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(t?.length===0)return{data:t,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:t}}function dO(t){switch(t?.type){case"number":{const{reverse:e,min:i,max:n}=t??{};return{type:"number",reverse:e,min:i,max:n}}case"time":{const{reverse:e,min:i,max:n}=t??{};return{type:"time",reverse:e,min:i,max:n}}case"category":default:{if(t==null)return{type:"category"};const{reverse:e,paddingInner:i,paddingOuter:n}=t;return{type:"category",reverse:e,paddingInner:i,paddingOuter:n}}}}function gO(t,e,i){const n={};return t?.stroke!=null&&(n.style=[{stroke:t?.stroke}],n.enabled??(n.enabled=!0)),t?.strokeWidth!=null&&(n.width=t?.strokeWidth,n.enabled??(n.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(n.enabled??(n.enabled=!0)),t?.visible!=null&&(n.enabled=t.visible),n.enabled??(n.enabled=e),n}var pO=(t,e,i,n)=>!n&&i!=="y"&&t!=null?`${String(t)} ${String(e)}`:String(e),fO=Cd((t,e)=>i=>{const n=i.datum[i.xKey],s=i.datum[i.yKey],r=e==null?i.datum:i.datum[e],o=t?.renderer?.({context:i.context,datum:r,xValue:n,yValue:s});if(nt(o)||Nn(o)||pn(o))return $e(o);const a=o?.title!=null,l=o?.content??pO(n,s,e,a);return o?.title?{heading:void 0,title:void 0,data:[{label:o.title,value:l}]}:{heading:void 0,title:l,data:[]}});function mO(t){const{background:e,container:i,foreground:n,height:s,listeners:r,locale:o,minHeight:a,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:u,theme:d,data:g,crosshair:p,axis:f,min:m,max:y,tooltip:b,context:v,styleNonce:S,...M}=t,D={background:e,container:i,context:v,foreground:n,height:s,listeners:r,locale:o,minHeight:a,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:u,styleNonce:S},{data:I,series:[A]=[],datumKey:k}=EM(g),T=M;A!=null&&Object.assign(T,A),T.tooltip={...b,renderer:fO(b,k)},D.theme=OM(d,hO),D.data=I,D.series=[T];const R=T.type==="bar"&&T.direction==="horizontal",[E,F]=R?["left","bottom"]:["bottom","left"],N={...dO(f),position:E,...p==null?{}:{crosshair:p}},P={type:"number",gridLine:gO(f,!1,t),position:F,...m==null?{}:{min:m},...y==null?{}:{max:y}};return D.axes=R?{x:P,y:N}:{x:N,y:P},D}var _m=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],zm={visible:L,reverse:L,stroke:K,strokeWidth:w},lh={context:()=>!0,tooltip:he,theme:he,background:he,container:he,width:he,height:he,minWidth:he,minHeight:he,padding:he,listeners:he,locale:he,data:he,styleNonce:O,axis:Pa({number:{...zm,min:Se(G,Si("max")),max:Se(G,Mi("min"))},category:{...zm,paddingInner:X,paddingOuter:X},time:{...zm,min:Se(te(G,Ct),Si("max")),max:Se(te(G,Ct),Mi("min"))}},"axis options","category"),min:Se(G,Si("max")),max:Se(G,Mi("min")),crosshair:{enabled:L,snap:L,..._,...U},xKey:O,yKey:O};lh.overrideDevicePixelRatio=Q(G),lh.foreground=Q(he);var RM={type:"preset",name:"sparkline",version:Qe,options:Pa({area:{...lh,...q(Rm,_m)},bar:{...lh,...q(ml,_m)},line:{...lh,...q(ah,_m)}},"sparkline options"),create:mO,processData:EM},$d=class{invertWithPercentage(t){return this.invert(t,!0)}snapshotDomain(){return this.domain}restoreDomain(t){this.domain=t}get domainMin(){return this.getDomainMinMax()[0]}get domainMax(){return this.getDomainMinMax()[1]}ticks(t,e,i){}niceDomain(t,e=this.domain){return e}get bandwidth(){}get step(){}get inset(){}},ch=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(n){this[i]!==n&&(this[i]=n,this.invalid=!0)},enumerable:!0,configurable:!1})};function yO(t,e,i){if(i==null||i[0]===0&&i[1]===1)return;const n=J(0,Math.floor(i[0]*t.length),t.length),s=J(0,Math.ceil(i[1]*t.length),t.length),r=e?t.length-s:n,o=e?t.length-n:s;return[r,o]}function PM(t,e,i){const n=yO(t,e,i);if(n==null)return{ticks:t,count:t.length,firstTickIndex:0};const[s,r]=n;return{ticks:t.slice(s,r),count:t.length,firstTickIndex:s}}function Wd(t){const e=Dm(t.at(0)),i=Dm(t.at(-1));return e!=null&&i!=null?[e,i]:[void 0,void 0]}var Gm=class Zk extends $d{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof Zk}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=J(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=J(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=J(0,e,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&B.warnOnce("Expected update to not invalidate scale"))}convert(e,i){this.refresh();const n=this.findIndex(e,i?.alignment,i?.alignmentExclusive);return n==null||n<0||n>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(n)}getDomainMinMax(){return Wd(this.domain)}invertNearestIndex(e,i="center"){this.refresh();const n=this.getBandCountForUpdate();if(n===0)return-1;let s=0,r=n-1,o=1/0,a=0;for(;s<=r;){const l=Math.trunc((r+s)/2),c=this.ordinalRange(l),h=c-e;if(h===0)return l;(i==="center"||h<0)&&Math.abs(h)<o&&(o=Math.abs(h),a=l),c<e?s=l+1:r=l-1}return a}update(){const[e,i]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:s}=this,r=this.getBandCountForUpdate();if(r===0)return;const o=i-e;let a;r===1?(n=0,a=o*(1-s*2)):a=o/Math.max(1,r-n+s*2);const l=this.round&&Math.floor(a)>0,c=l?Math.floor(a):a;let h=e+(o-c*(r-n))/2,u=c*(1-n);l&&(h=Math.round(h),u=Math.round(u)),this._step=c,this._inset=h,this._bandwidth=u,this._rawBandwidth=a*(1-n)}ordinalRange(e){const{_inset:i,_step:n,range:s}=this,r=Math.min(s[0],s[1]),o=Math.max(s[0],s[1]);return J(r,i+n*e,o)}};x([ch],Gm.prototype,"range",2),x([ch],Gm.prototype,"round",2);var Hn=Gm,Ud=Symbol("interpolate"),Kd=t=>t[Ud]!=null,hh=class oc{constructor(e,i,n,s){this.x=e,this.y=i,this.width=n,this.height=s}static fromObject({x:e,y:i,width:n,height:s}){return new oc(e,i,n,s)}static merge(e){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(const o of e)o.x<i&&(i=o.x),o.y<n&&(n=o.y),pi(o.x,o.width)>s&&(s=pi(o.x,o.width)),pi(o.y,o.height)>r&&(r=pi(o.y,o.height));return new oc(i,n,s-i,r-n)}static nearestBox(e,i,n){return Ad(e,i,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:pi(this.x,this.width),bottom:pi(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:i,width:n,height:s}=this;return new oc(e,i,n,s)}equals(e){return bd(this,e)}containsPoint(e,i){return tl(this,e,i)}intersectsWith(e){return!(this.x+this.width<=e.x||e.x+e.width<=this.x||this.y+this.height<=e.y||e.y+e.height<=this.y)}intersection(e){const i=Math.max(this.x,e.x),n=Math.max(this.y,e.y),s=Math.min(pi(this.x,this.width),pi(e.x,e.width)),r=Math.min(pi(this.y,this.height),pi(e.y,e.height));if(!(i>s||n>r))return new oc(i,n,s-i,r-n)}collidesBBox(e){return this.x<pi(e.x,e.width)&&pi(this.x,this.width)>e.x&&this.y<pi(e.y,e.height)&&pi(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 n=e-J(this.x,e,pi(this.x,this.width)),s=i-J(this.y,i,pi(this.y,this.height));return n*n+s*s}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const n of Object.keys(e)){const s=e[n];typeof s=="number"&&this.applyMargin(s,n)}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 n of Object.keys(e)){const s=e[n];typeof s=="number"&&this.applyMargin(-s,n)}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}[Ud](e,i){return new oc(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)}};hh.zero=Object.freeze(new hh(0,0,0,0)),hh.NaN=Object.freeze(new hh(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var $=hh;function pi(t,e){return t===-1/0&&e===1/0?1/0:t+e}var FM=1e-8;function Po(t,e){const i=e*t,n=i-Math.floor(i),s=Math.abs(n-.5)<FM?i+FM:i;return Math.round(s)}function VM(t,e){return Po(t,e)/t}function wi(t,e,i){const n=VM(t,e);return i==null?n:i===0?0:i<1?bO(t,i):VM(t,i+e)-n}function BM(t,e){return Math.floor(e*t)/t}function bO(t,e){return Math.ceil(e*t)/t}function _M({context:t,pixelRatio:e,width:i,height:n}){t.save();try{t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(n*e))}finally{t.restore()}}function zM(t){if(re.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let n=0;Object.assign(t,{save(){e(),n++},restore(){if(n===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(n!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}function GM(t,e,i){return[Po(i,t),Po(i,e)]}var jm;function vO(){const t=su();return jm??(jm=new t(1,1)),jm}var Hm=class{constructor(t){const{width:e,height:i,pixelRatio:n,willReadFrequently:s=!1}=t;this.width=e,this.height=i,this.pixelRatio=n;const[r,o]=GM(e,i,n),a=su();this.canvas=new a(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(n,0,0,n,0,0),zM(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?vO().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:n,context:s}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[r,o]=GM(t,e,i);n.width=r,n.height=o}s.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){_M(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)}},$m=(t,e)=>Math.sign(t-e);function jM(t,e){if(typeof t=="number"&&typeof e=="number")return $m(t,e);const i=typeof t=="number"?[t]:t,n=typeof e=="number"?[e]:e,s=Math.min(i.length,n.length);for(let r=0;r<s;r+=1){const o=$m(i[r],n[r]);if(o!==0)return o}return $m(i.length,n.length)}var HM=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(HM||{}),xO=5,Fo=class Hv{constructor(e){this.serialNumber=Hv._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=xn(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=e?.name,this.tag=e?.tag??Number.NaN,this.zIndex=e?.zIndex??0,this.scene=e?.scene,(e?.debugDirty??Hv._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,n){const s=e?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const r=pt("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(n)),r.setAttribute("viewBox",`0 0 ${i} ${n}`),r.setAttribute("overflow","visible"),s.defs?.length){const o=pt("defs");o.append(...s.defs),r.append(o)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(e,i){for(const n of e)if(!i||n.visible&&!n.transitionOut){const s=n.getBBox();s&&(yield s)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get unsafeNonNullDatum(){return this.datum}get unsafeDatum(){return this.datum}set unsafeDatum(e){this.datum=e}get unsafePreviousDatum(){return this.previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}unsafeClosestDatum(){return this.closestDatum()}preRender(e,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){const i=e.currentFont;e.ctx.save();try{this.render(e)}catch(n){const s=n.errorCount??1;if(s>=xO)throw n.errorCount=s,n;B.warnOnce("Error during rendering",n,n.stack)}finally{e.ctx.restore(),e.currentFont=i}}render(e){const{stats:i}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const n=this.name??this.id;e.debugNodeSearch.some(s=>typeof s=="string"?s===n:s.test(n))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(e){throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(e){this.batchLevel++;try{e()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{const i=this,n=e,s=Object.keys(n);for(let r=0,o=s.length;r<o;r++){const a=s[r];i[a]=n[a]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,i){this.batchLevel++;try{const n=this,s=e;for(let r=0,o=i.length;r<o;r++){const a=i[r];n[a]=s[a]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,i){return!1}distanceSquared(e,i){return 1/0}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1)&&this.containsPoint(e,i))return this}pickNodes(e,i,n=[]){return!this.visible||this.pointerEvents===1||this.containsPoint(e,i)&&n.push(this),n}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){if(this.batchLevel>0){this.batchDirty=!0;return}e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],n=new Error("Stack trace for property change tracking").stack?.split(`
`).filter(s=>s!=="Error"&&!s.includes(".markDebugProperties")&&!s.includes(".markDirty")&&!s.includes("Object.assign ")&&!s.includes(`${this.constructor.name}.`))??"unknown";i.push(n[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,i]of this._debugDirtyProperties.entries())i.length>1&&B.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${i.length}x)`,()=>{for(const n of i)B.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};Fo.className="AbstractNode",Fo._nextSerialNumber=0,Fo._debugEnabled=!1,x([Xe()],Fo.prototype,"visible",2),x([Xe({equals:st,changeCb:Fo.handleNodeZIndexChange})],Fo.prototype,"zIndex",2);var bs=Fo,$M=t=>{const e=De.fromString(t),[i,n,s]=De.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:n,h:s,a:e.a}},Wm=1e-6,WM=t=>t.c<Wm||t.l<Wm||t.l>1-Wm,SO=(t,e,i)=>{i=J(0,i,1);let n;if(WM(t))n=e.h;else if(WM(e))n=t.h;else{const a=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),n=a*(1-i)+l*i}const s=t.c*(1-i)+e.c*i,r=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return De.fromOKLCH(r,s,n,o)},Rr=class extends $d{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.mode="continuous",this.parsedRange=this.range.map($M)}update(){const{domain:t,range:e}=this;t.length<2&&(B.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 n=1;n<t.length;n++){const s=t[n-1],r=t[n];if(s>r){B.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((o,a)=>o-a);break}}const i=this.mode==="discrete"?t.length-1:t.length;if(e.length<i)for(let n=e.length;n<i;n++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map($M)}normalizeDomains(...t){return{domain:t.map(e=>e.domain).flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const e=Ze(t),{domain:i,range:n,parsedRange:s}=this,r=i[0],o=i.at(-1),a=n[0],l=n.at(-1);if(e<=r)return a;if(e>=o)return l;let c,h;if(i.length===2){const g=(e-r)/(o-r),p=1/(n.length-1);c=n.length<=2?0:Math.min(Math.floor(g*(n.length-1)),n.length-2),h=(g-c*p)/p}else{for(c=0;c<i.length-2&&!(e<i[c+1]);c++);const g=i[c],p=i[c+1];h=(e-g)/(p-g)}if(this.mode==="discrete")return n[c];const u=s[c],d=s[c+1];return SO(u,d,h).toRgbaString()}invert(){}getDomainMinMax(){return Wd(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&B.warnOnce("Expected update to not invalidate scale"))}};x([ch],Rr.prototype,"domain",2),x([ch],Rr.prototype,"range",2),x([ch],Rr.prototype,"mode",2);var Um=class{constructor(t,e=[],i){this.colorSpace=t,this.stops=e,this.bbox=i,this._cache=void 0}createGradient(t,e,i){const n=this.bbox??e;if(!n.isFinite())return;if(this._cache?.ctx===t&&this._cache.bbox.equals(n))return this._cache.gradient;const{stops:s,colorSpace:r}=this;if(s.length===0)return;if(s.length===1)return s[0].color;let o=this.createCanvasGradient(t,n,i);if(o==null)return;const a=r==="oklch",l=.05;let c=s[0];o.addColorStop(c.stop,c.color);for(let h=1;h<s.length;h+=1){const u=s[h];if(a){const d=new Rr;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let g=c.stop+l;g<u.stop;g+=l)o.addColorStop(g,d.convert(g)??"transparent")}o.addColorStop(u.stop,u.color),c=u}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:t,bbox:n,gradient:o},o}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);for(const{stop:n,color:s}of this.stops){const r=pt("stop");r.setAttribute("offset",`${n}`),r.setAttribute("stop-color",`${s}`),i.appendChild(r)}return i}},MO=class extends Um{constructor(t,e,i=0,n){super(t,e,n),this.angle=i}createCanvasGradient(t,e,i){const{angle:s}=this,r=$s(s+-90),o=i?.centerX??e.x+e.width*.5,a=i?.centerY??e.y+e.height*.5;return t.createConicGradient(r,o,a)}createSvgGradient(t){return pt("linearGradient")}},IO=class extends Um{constructor(t,e,i=0,n){super(t,e,n),this.angle=i}getGradientPoints(t){const{angle:i}=this,n=$s(i+90),s=Math.cos(n),r=Math.sin(n),o=t.width,a=t.height,l=t.x+o*.5,c=t.y+a*.5,h=Math.hypot(a,o)/2,u=Math.atan2(a,o);let d;n<Math.PI/2?d=n:n<Math.PI?d=Math.PI-n:n<1.5*Math.PI?d=n-Math.PI:d=2*Math.PI-n;const g=h*Math.abs(Math.cos(d-u));return{x0:l+s*g,y0:c+r*g,x1:l-s*g,y1:c-r*g}}createCanvasGradient(t,e){const{x0:i,y0:n,x1:s,y1:r}=this.getGradientPoints(e);if(!(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(s)||Number.isNaN(r)))return t.createLinearGradient(i,n,s,r)}createSvgGradient(t){const{x0:e,y0:i,x1:n,y1:s}=this.getGradientPoints(t),r=pt("linearGradient");return r.setAttribute("x1",String(e)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(n)),r.setAttribute("y2",String(s)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},DO=class extends Um{constructor(t,e,i){super(t,e,i)}createCanvasGradient(t,e,i){const n=i?.centerX??e.x+e.width*.5,s=i?.centerY??e.y+e.height*.5,r=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(n,s,r,n,s,o)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,n=pt("radialGradient");return n.setAttribute("cx",String(e)),n.setAttribute("cy",String(i)),n.setAttribute("r",String(Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2)),n.setAttribute("gradientUnits","userSpaceOnUse"),n}},uh=class extends Fe{constructor(){super(...arguments),this.color="black"}};x([C],uh.prototype,"stop",2),x([C],uh.prototype,"color",2),x([C],uh.prototype,"name",2);var Vo=class extends Fe{constructor(){super(...arguments),this.fills=new Ga(uh),this.mode="continuous"}};x([C],Vo.prototype,"fills",2),x([C],Vo.prototype,"domain",2),x([C],Vo.prototype,"mode",2),x([C],Vo.prototype,"missingDataFill",2);function CO(t,e){const i=e==="discrete"?1:0,n=t.map((s,r,{length:o})=>({stop:(r+i)/(o-1+i),color:s}));return e==="discrete"?Np(n):n}function UM(t,e,i,n="continuous"){const s=t.map(d=>typeof d=="string"?{color:d}:d);if(s.length===0)return CO(e,n);const r=Math.min(...i),o=Math.max(...i),l=Tp(s,r,o,n==="discrete");let c=s.find(d=>d.color!=null)?.color,h;const u=s.map((d,g)=>{let p=d?.color;const f=Math.max(0,Math.min(1,(l[g]-r)/(o-r)));return p!=null?c=p:c==null?(h==null&&(h=new Rr,h.domain=[0,1],h.range=e),p=h.convert(f)):p=c,{stop:f,color:p}});return n==="discrete"?Np(u):u}var AO=class{constructor(t,e){this.imageLoader=t,this._cache=void 0,this.url=e.url,this.backgroundFill=e.backgroundFill??"black",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.repeat=e.repeat??"no-repeat",this.width=e.width,this.height=e.height,this.fit=e.fit??"stretch",this.rotation=e.rotation??0}createCanvasImage(t,e,i,n){if(!e)return null;const[s,r]=this.getSize(e.width,e.height,i,n);return s<1||r<1?(B.warnOnce("Image fill is too small to render, ignoring."),null):t.createPattern(e,this.repeat)}getSize(t,e,i,n){const{fit:s}=this;let r=t,o=e,a=1;const l=i/n,c=t/e;return s==="stretch"||t===0||e===0?(r=i,o=n):s==="contain"?a=c>l?i/t:n/e:s==="cover"&&(a=c>l?n/e:i/t),[Math.max(1,r*a),Math.max(1,o*a)]}setImageTransform(t,e){if(typeof t=="string")return;const{url:i,rotation:n,width:s,height:r}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const a=$s(n),l=Math.cos(a),c=Math.sin(a),[h,u]=this.getSize(o.width,o.height,s??e.width,r??e.height),d=h/o.width,g=u/o.height,p=e.x+e.width/2,f=e.y+e.height/2,m=l*h-c*u,y=c*h+l*u,b=m/2,v=y/2,S=Ip();t?.setTransform(new S([l*d,c*g,-c*d,l*g,p-b,f-v]))}createPattern(t,e,i,n){const s=this.width??e,r=this.height??i,o=this._cache;if(o?.ctx===t&&o.width===s&&o.height===r)return o.pattern;const a=this.imageLoader?.loadImage(this.url,n),l=this.createCanvasImage(t,a,s,r);if(l!=null)return this._cache={ctx:t,pattern:l,width:s,height:r},l}toSvg(t,e){const{url:i,rotation:n,backgroundFill:s,backgroundFillOpacity:r}=this,{x:o,y:a,width:l,height:c}=t,h=pt("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(o)),h.setAttribute("y",String(a)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const u=pt("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("fill",s),u.setAttribute("fill-opacity",String(r)),h.appendChild(u);const d=pt("image");return d.setAttribute("href",i),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("transform",`scale(${1/e}) rotate(${n}, ${l/2}, ${c/2})`),h.appendChild(d),h}},wO=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,qe=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,kO=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,KM=/^[01]/,TO={z:[],h:[qe],v:[qe],m:[qe,qe],l:[qe,qe],t:[qe,qe],s:[qe,qe,qe,qe],q:[qe,qe,qe,qe],c:[qe,qe,qe,qe,qe,qe],a:[qe,qe,qe,KM,KM,qe,qe]};function LO(t){if(!t)return;const e=[];let i=0,n;for(;i<t.length;){const s=wO.exec(t.slice(i));let r;if(s==null){if(!n){B.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=n}else r=s[1],i+=s[0].length;const o=NO(r,t,i);if(!o)return;i=o[0],n=r,e.push(o[1])}return e}function NO(t,e,i){const n=TO[t.toLocaleLowerCase()],s={command:t,params:[]};for(const r of n){const o=e.slice(i),a=r.exec(o);if(a!=null){s.params.push(Number.parseFloat(a[0])),i+=a[0].length;const l=kO.exec(o.slice(a[0].length));l!=null&&(i+=l[0].length)}else{if(s.params.length===1)return[i,s];B.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${t}]`);return}}return[i,s]}function OO(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function EO(t,e,i,n=1e-6){if(Math.abs(t)<n)return OO(e,i);const s=e*e-4*t*i,r=[];if(Math.abs(s)<n){const o=-e/(2*t);o>=0&&o<=1&&r.push(o)}else if(s>0){const o=Math.sqrt(s),a=(-e-o)/(2*t),l=(-e+o)/(2*t);a>=0&&a<=1&&r.push(a),l>=0&&l<=1&&r.push(l)}return r}function RO(t,e,i,n,s=1e-6){if(Math.abs(t)<s)return EO(e,i,n,s);const r=e/t,o=i/t,a=n/t,l=(3*o-r*r)/9,c=(9*r*o-27*a-2*r*r*r)/54,h=l*l*l+c*c,u=1/3,d=[];if(h>=0){const g=Math.sqrt(h),p=Math.sign(c+g)*Math.pow(Math.abs(c+g),u),f=Math.sign(c-g)*Math.pow(Math.abs(c-g),u),m=Math.abs(Math.sqrt(3)*(p-f)/2),y=-u*r+(p+f);if(y>=0&&y<=1&&d.push(y),Math.abs(m)<s){const b=-u*r-(p+f)/2;b>=0&&b<=1&&d.push(b)}}else{const g=Math.acos(c/Math.sqrt(-l*l*l)),p=u*r,f=2*Math.sqrt(-l),m=f*Math.cos(u*g)-p,y=f*Math.cos(u*(g+2*Math.PI))-p,b=f*Math.cos(u*(g+4*Math.PI))-p;m>=0&&m<=1&&d.push(m),y>=0&&y<=1&&d.push(y),b>=0&&b<=1&&d.push(b)}return d}function rn(t,e,i,n,s,r,o,a){const l=(i-t)*(a-r)-(n-e)*(o-s);if(l===0)return 0;const c=((o-s)*(e-r)-(t-s)*(a-r))/l,h=((i-t)*(e-r)-(n-e)*(t-s))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function PO(t,e,i,n,s,r,o,a,l,c,h,u){let d=0;const g=c-u,p=h-l,f=l*(u-c)-c*(h-l),m=YM(t,i,s,o),y=YM(e,n,r,a),b=g*m[0]+p*y[0],v=g*m[1]+p*y[1],S=g*m[2]+p*y[2],M=g*m[3]+p*y[3]+f,D=RO(b,v,S,M);for(const I of D){const A=I*I,k=I*A,T=m[0]*k+m[1]*A+m[2]*I+m[3],R=y[0]*k+y[1]*A+y[2]*I+y[3];let E;l===h?E=(R-c)/(u-c):E=(T-l)/(h-l),E>=0&&E<=1&&d++}return d}function YM(t,e,i,n){return[-t+3*e-3*i+n,3*t-6*e+3*i,-3*t+3*e,t]}var Bo=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const t=dc();this.path2d=new t}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.sx=t,this.sy=e,this.cx=t,this.cy=e,this.path2d.moveTo(t,e),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e}lineTo(t,e){this.openedPath?(this.cx=t,this.cy=e,this.path2d.lineTo(t,e),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e):this.moveTo(t,e)}cubicCurveTo(t,e,i,n,s,r){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,n,s,r),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=r}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(t,e,i,n){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.closePath()}roundRect(t,e,i,n,s){s=Math.min(s,i/2,n/2),this.moveTo(t,e+s),this.arc(t+s,e+s,s,Math.PI,1.5*Math.PI),this.lineTo(t+s,e),this.lineTo(t+i-s,e),this.arc(t+i-s,e+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+s),this.lineTo(t+i,e+n-s),this.arc(t+i-s,e+n-s,s,0,Math.PI/2),this.lineTo(t+i-s,e+n),this.lineTo(t+s,e+n),this.arc(t+ +s,e+n-s,s,Math.PI/2,Math.PI),this.lineTo(t,e+n-s),this.closePath()}ellipse(t,e,i,n,s,r,o,a=!1){const l=i,c=n/i,h=Math.cos(s),u=Math.sin(s),d=-c*u,g=c*h,p=l*Math.cos(r),f=l*Math.sin(r),m=t+h*p+d*f,y=e+u*p+g*f,b=(m-this.cx)**2+(y-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(m,y):this.moveTo(m,y);let v=a?-Ci(r-o):Ci(o-r);Math.abs(Math.abs(o-r)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(a?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),M=v/S,D=4/3*Math.tan(M/4);for(let I=0;I<S;I+=1){const A=r+M*(I+0),k=r+M*(I+1),T=l*Math.sin(A),R=l*Math.cos(A),E=l*Math.sin(k),F=l*Math.cos(k),N=R-D*T,P=T+D*R,z=F+D*E,Y=E-D*F,j=F,ie=E;this.cubicCurveTo(t+h*N+d*P,e+u*N+g*P,t+h*z+d*Y,e+u*z+g*Y,t+h*j+d*ie,e+u*j+g*ie)}}arc(t,e,i,n,s,r){this.ellipse(t,e,i,i,0,n,s,r)}appendSvg(t){const e=LO(t);if(e==null)return!1;let i=0,n=0,s,r,o=0,a=0;for(const{command:l,params:c}of e){s??(s=c[0]),r??(r=c[1]);const h=l===l.toLowerCase(),u=h?s:0,d=h?r:0;switch(l.toLowerCase()){case"m":this.moveTo(u+c[0],d+c[1]),s=u+c[0],r=d+c[1],i=s,n=r;break;case"c":this.cubicCurveTo(u+c[0],d+c[1],u+c[2],d+c[3],u+c[4],d+c[5]),o=u+c[2],a=d+c[3],s=u+c[4],r=d+c[5];break;case"s":this.cubicCurveTo(s+s-o,r+r-a,u+c[0],d+c[1],u+c[2],d+c[3]),o=u+c[0],a=d+c[1],s=u+c[2],r=d+c[3];break;case"q":this.cubicCurveTo((u+2*c[0])/3,(d+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),o=c[0],a=c[1],s=c[2],r=c[3];break;case"t":this.cubicCurveTo((s+2*(s+s-o))/3,(r+2*(r+r-a))/3,(2*(s+s-o)+c[0])/3,(2*(r+r-a)+c[1])/3,c[0],c[1]),o=s+s-o,a=r+r-a,s=c[0],r=c[1];break;case"a":this.svgEllipse(s,r,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],u+c[5],d+c[6]),s=u+c[5],r=d+c[6];break;case"h":this.lineTo(u+c[0],r),s=u+c[0];break;case"l":this.lineTo(u+c[0],d+c[1]),s=u+c[0],r=d+c[1];break;case"v":this.lineTo(s,d+c[0]),r=d+c[0];break;case"z":this.closePath(),s=i,r=n;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(t,e,i,n,s,r,o,a,l){i=Math.abs(i),n=Math.abs(n);const c=(t-a)/2,h=(e-l)/2,u=Math.sin(s),d=Math.cos(s),g=d*c+u*h,p=-u*c+d*h,f=g/i,m=p/n;let y=f*f+m*m,b=(t+a)/2,v=(e+l)/2,S=0,M=0;y>=1?(y=Math.sqrt(y),i*=y,n*=y):(y=Math.sqrt(1/y-1),r===o&&(y=-y),S=y*i*m,M=-y*n*f,b+=d*S-u*M,v+=u*S+d*M);const D=Math.atan2((p-M)/n,(g-S)/i),I=Math.atan2((-p-M)/n,(-g-S)/i)-D,A=D+I,k=!!(1-o);this.ellipse(b,v,i,n,s,D,A,k)}clear(t){t?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const e=dc();this.path2d=new e,this.openedPath=!1,this.closedPath=!1}isPointInPath(t,e){const i=this.commands,n=this.params,s=this.commandsLength,r=-1e4,o=-1e4;let a=Number.NaN,l=Number.NaN,c=0,h=0,u=0;for(let d=0,g=0;d<s;d++)switch(i[d]){case 0:u+=rn(a,l,c,h,r,o,t,e),c=n[g++],a=c,h=n[g++],l=h;break;case 1:u+=rn(c,h,n[g++],n[g++],r,o,t,e),c=n[g-2],h=n[g-1];break;case 2:u+=PO(c,h,n[g++],n[g++],n[g++],n[g++],n[g++],n[g++],r,o,t,e),c=n[g-2],h=n[g-1];break;case 3:u+=rn(a,l,c,h,r,o,t,e);break}return u%2===1}distanceSquared(t,e){let i=1/0;const n=this.commands,s=this.params,r=this.commandsLength;let o=Number.NaN,a=Number.NaN,l=0,c=0;for(let h=0,u=0;h<r;h++)switch(n[h]){case 0:l=o=s[u++],c=a=s[u++];break;case 1:{const d=l,g=c;l=s[u++],c=s[u++],i=vd(t,e,d,g,l,c,i);break}case 2:{const d=l,g=c,p=s[u++],f=s[u++],m=s[u++],y=s[u++];l=s[u++],c=s[u++],i=aM(d,g,p,f,m,y,l,c,t,e)**2;break}case 3:i=vd(t,e,l,c,o,a,i);break}return i}toSVG(t=(e,i)=>({x:e,y:i})){const e=[],{commands:i,params:n}=this,s=(o,a)=>{e.push(o);for(let l=0;l<a;l+=2){const{x:c,y:h}=t(n[r++],n[r++]);e.push(c,h)}};let r=0;for(let o=0;o<this.commandsLength;o++)switch(i[o]){case 0:s("M",2);break;case 1:s("L",2);break;case 2:s("C",6);break;case 3:s("Z",0);break}return e.join(" ")}computeBBox(){const{commands:t,params:e}=this;let[i,n,s,r]=[1/0,1/0,-1/0,-1/0],[o,a]=[Number.NaN,Number.NaN],[l,c]=[Number.NaN,Number.NaN];const h=(d,g)=>{i=Math.min(g,i),n=Math.min(d,n),s=Math.max(d,s),r=Math.max(g,r),o=d,a=g};let u=0;for(let d=0;d<this.commandsLength;d++)switch(t[d]){case 0:h(e[u++],e[u++]),l=o,c=a;break;case 1:h(e[u++],e[u++]);break;case 2:{const p=o,f=a,m=e[u++],y=e[u++],b=e[u++],v=e[u++],S=e[u++],M=e[u++],D=oM(p,f,m,y,b,v,S,M);for(const I of D){const A=dl(p,m,b,S,I),k=dl(f,y,v,M,I);h(A,k)}h(S,M);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new $(n,i,s-n,r-i)}};function Km(t,e,i){const{width:n,height:s,padding:r,strokeWidth:o}=e,a=n/2,l=s/2,c=Math.max(1,n-r-o/2),h=Math.max(1,s-r-o/2);let u=!1;for(const[d,g]of i){const p=a+(d-.5)*c,f=l+(g-.5)*h;u?t.lineTo(p,f):t.moveTo(p,f),u=!0}t.closePath()}var ZM={circles(t,{width:e,strokeWidth:i,padding:n}){const s=e/2,r=Math.max(1,s-n-i/2);t.arc(s,s,r,0,Math.PI*2)},squares(t,{width:e,height:i,pixelRatio:n,padding:s,strokeWidth:r}){const o=s+r/2;t.moveTo(wi(n,o),wi(n,o)),t.lineTo(wi(n,e-o),wi(n,o)),t.lineTo(wi(n,e-o),wi(n,i-o)),t.lineTo(wi(n,o),wi(n,i-o)),t.closePath()},triangles(t,e){Km(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){Km(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:n}){const r=Math.max(1,(e-n)/2),o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=e/2+Math.cos(h)*c,d=i/2+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},hearts(t,{width:e,height:i,padding:n}){const s=Math.max(1,e/4-n/2),r=e/2,o=i/2+s/2;t.arc(r-s,o-s,s,ni(130),ni(330)),t.arc(r+s,o-s,s,ni(220),ni(50)),t.lineTo(r,o+s),t.closePath()},crosses(t,e){Km(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:n,strokeWidth:s}){const r=wi(n,e/2)-s%2/2;t.moveTo(r,0),t.lineTo(r,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:n,strokeWidth:s}){const r=wi(n,i/2)-s%2/2;t.moveTo(0,r),t.lineTo(e,r)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:n}){const s=Math.atan2(i,e),r=n*Math.cos(s),o=n*Math.sin(s);t.moveTo(-r,o),t.lineTo(r,-o),t.moveTo(-r,i+o),t.lineTo(e+r,-o),t.moveTo(e-r,i+o),t.lineTo(e+r,i-o)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:n}){const s=Math.atan2(i,e),r=n*Math.cos(s),o=n*Math.sin(s);t.moveTo(e-r,-o),t.lineTo(e+r,o),t.moveTo(-r,-o),t.lineTo(e+r,i+o),t.moveTo(-r,i-o),t.lineTo(r,i+o)}},FO=class{constructor(t){this._cache=void 0,this.width=Math.max(t?.width??10,1),this.height=Math.max(t?.height??10,1),this.fill=t.fill??"none",this.fillOpacity=t.fillOpacity??1,this.backgroundFill=t.backgroundFill??"none",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,this.scale=t.scale??1,this.path=t.path}getPath(t){const{pattern:e,width:i,height:n,padding:s,strokeWidth:r,path:o}=this,a=new Bo;let l=ZM[e]!=null;return o&&l&&(l=!a.appendSvg(o)),l&&ZM[e](a,{width:i,height:n,pixelRatio:t,strokeWidth:r,padding:s}),a}renderStroke(t,e){const{stroke:i,strokeWidth:n,strokeOpacity:s}=this;n&&(e.strokeStyle=i,e.lineWidth=n,e.globalAlpha=s,e.stroke(t))}renderFill(t,e){const{fill:i,fillOpacity:n}=this;i!=="none"&&(e.fillStyle=i,e.globalAlpha=n,e.fill(t))}createCanvasPattern(t,e){const{width:i,height:n,scale:s,backgroundFill:r,backgroundFillOpacity:o}=this;if(i*s<1||n*s<1)return B.warnOnce("Pattern fill is too small to render, ignoring."),null;const a=new Hm({width:i,height:n,pixelRatio:e*s}),l=a.context;r!=="none"&&(l.fillStyle=r,l.globalAlpha=o,l.fillRect(0,0,i,n));const c=this.getPath(e).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=t.createPattern(a.canvas,"repeat");return this.setPatternTransform(h,e),a.destroy(),h}setPatternTransform(t,e,i=0,n=0){if(t==null)return;const s=$s(this.rotation),r=1/e,o=Math.cos(s)*r,a=Math.sin(s)*r,l=Ip();t.setTransform(new l([o,a,-a,o,i,n]))}createPattern(t,e){if(this._cache?.ctx===t&&this._cache.pixelRatio===e)return this._cache.pattern;const i=this.createCanvasPattern(t,e);if(i!=null)return this._cache={ctx:t,pattern:i,pixelRatio:e},i}toSvg(){const{width:t,height:e,fill:i,fillOpacity:n,backgroundFill:s,backgroundFillOpacity:r,stroke:o,strokeWidth:a,strokeOpacity:l,rotation:c,scale:h}=this,u=pt("pattern");u.setAttribute("viewBox",`0 0 ${t} ${e}`),u.setAttribute("width",String(t)),u.setAttribute("height",String(e)),u.setAttribute("patternUnits","userSpaceOnUse");const d=pt("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(t)),d.setAttribute("height",String(e)),d.setAttribute("fill",s),d.setAttribute("fill-opacity",String(r)),u.appendChild(d);const g=pt("path");return g.setAttribute("fill",i),g.setAttribute("fill-opacity",String(n)),g.setAttribute("stroke-opacity",String(l)),g.setAttribute("stroke",o),g.setAttribute("stroke-width",String(a)),g.setAttribute("transform",`rotate(${c}) scale(${h})`),g.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(g),u}};function XM(t,e){const{fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r}=e;i&&t.setAttribute("font-style",i),n&&t.setAttribute("font-weight",String(n)),s!=null&&t.setAttribute("font-size",String(s)),r&&t.setAttribute("font-family",r)}function VO(t,e){const{stroke:i,strokeWidth:n,strokeOpacity:s}=e;i&&t.setAttribute("stroke",i),n!=null&&t.setAttribute("stroke-width",String(n)),s!=null&&t.setAttribute("stroke-opacity",String(s))}function BO(t,e){const{lineDash:i,lineDashOffset:n}=e;if(i?.some(s=>s!==0)){const s=i.length%2===1?[...i,...i]:i;t.setAttribute("stroke-dasharray",s.join(" ")),n!=null&&t.setAttribute("stroke-dashoffset",String(n))}}var Xt=class extends bs{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(sn(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:n="linear",colorStops:s,rotation:r=0,reverse:o=!1}=e;if(s==null)return;let a=UM(s,["black"],[0,1]);switch(o&&(a=a.map(l=>({color:l.color,stop:1-l.stop})).reverse()),n){case"linear":return new IO(i,a,r);case"radial":return new DO(i,a);case"conic":return new MO(i,a,r)}}getPattern(e){if(Us(e))return this.createPattern(e)}createPattern(e){return new FO(e)}getImage(e){if(Oo(e))return this.createImage(e)}createImage(e){return new AO(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&st(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return wi(this.layerManager?.canvas?.pixelRatio??1,e,i)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,i,n,s){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,i),e.globalCompositeOperation="source-over"),this.renderFill(e,i,n,s),this.renderStroke(e,i,n)}renderFill(e,i,n,s){const{__fill:r,__fillOpacity:o=1,fillImage:a}=this;if(r!=null&&r!=="none"&&o>0){const l=e.globalAlpha;a&&(e.globalAlpha=a.backgroundFillOpacity,e.fillStyle=a.backgroundFill,this.executeFill(e,i),e.globalAlpha=l),this.applyFillAndAlpha(e,n,s),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=l,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,i){i?e.fill(i):e.fill()}applyFillAndAlpha(e,i,n){const{__fill:s,fillGradient:r,fillPattern:o,fillImage:a,__fillOpacity:l=1,__opacity:c=1}=this,h=c*l;if(h!==1&&(e.globalAlpha*=h),r){const u=n??this.fillBBox??this.getDefaultGradientFillBBox()??i??this.getBBox(),{fillParams:d}=this;e.fillStyle=r.createGradient(e,u,d)??"black"}else if(o){const{x:u,y:d}=i??this.getBBox(),g=this.layerManager?.canvas?.pixelRatio??1,p=o.createPattern(e,g);o.setPatternTransform(p,g,u,d),p?e.fillStyle=p:(e.fillStyle=o.fill,e.globalAlpha*=o.fillOpacity)}else if(a){const u=i??this.getBBox(),d=a.createPattern(e,u.width,u.height,this);a.setImageTransform(d,u),e.fillStyle=d??"transparent"}else e.fillStyle=typeof s=="string"?s:"black"}applyStrokeAndAlpha(e,i){const{__stroke:n,__strokeOpacity:s=1,strokeGradient:r,__opacity:o=1}=this;e.strokeStyle=r?.createGradient(e,i??this.getBBox())??(typeof n=="string"?n:void 0)??"black";const a=o*s;a!==1&&(e.globalAlpha*=a)}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:n}=this;n?.enabled&&(e.shadowColor=n.color,e.shadowOffsetX=n.xOffset*i,e.shadowOffsetY=n.yOffset*i,e.shadowBlur=n.blur*i)}renderStroke(e,i,n){const{__stroke:s,__strokeWidth:r=0,__strokeOpacity:o=1,__lineDash:a,__lineDashOffset:l,__lineCap:c,__lineJoin:h,__miterLimit:u}=this;if(s!=null&&s!=="none"&&r>0&&o>0){const{globalAlpha:d}=e;this.applyStrokeAndAlpha(e,n),e.lineWidth=r,a&&e.setLineDash(a),l&&(e.lineDashOffset=l),c&&(e.lineCap=c),h&&(e.lineJoin=h),u!=null&&(e.miterLimit=u),this.executeStroke(e,i),e.globalAlpha=d}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:n,fillOpacity:s}=this;if(typeof n=="string")e.setAttribute("fill",n);else if(sn(n)&&this.fillGradient){i??(i=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=Dd();r.setAttribute("id",o),i.push(r),e.setAttribute("fill",`url(#${o})`)}else if(Us(n)&&this.fillPattern){i??(i=[]);const r=this.fillPattern.toSvg(),o=Dd();r.setAttribute("id",o),i.push(r),e.setAttribute("fill",`url(#${o})`)}else if(Oo(n)&&this.fillImage){i??(i=[]);const r=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),r),a=Dd();o.setAttribute("id",a),i.push(o),e.setAttribute("fill",`url(#${a})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o}=this;VO(e,{stroke:nt(i)?i:void 0,strokeOpacity:n,strokeWidth:s}),BO(e,{lineDash:r,lineDashOffset:o})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,i,n){const s=e?.opacity??1,r=e?.fill,o=(e?.fillOpacity??1)*s,a=(e?.strokeOpacity??1)*s,l=e?.strokeWidth??0,c=e?.lineDashOffset??0;let h=!1;this.__fillOpacity!==o&&(this.__fillOpacity=o,h=!0),this.__strokeOpacity!==a&&(this.__strokeOpacity=a,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,h=!0),this.setFillProperties(r,i,n),r!==this.fill&&(this.fill=r),e?.stroke!==this.stroke&&(this.stroke=e?.stroke),h&&this.markDirty()}setFillProperties(e,i,n){const s=i==null||!sn(e)||e.bounds==null||e.bounds==="item"?void 0:i[e.bounds];let r=!1;this.__fillBBox!==s&&(this.__fillBBox=s,r=!0),this.__fillParams!==n&&(this.__fillParams=n,r=!0),r&&(this.onFillChange(),this.markDirty())}};x([Xe()],Xt.prototype,"drawingMode",2),x([Xe()],Xt.prototype,"fillOpacity",2),x([Xe()],Xt.prototype,"strokeOpacity",2),x([oh({equals:st,changeCb:Xt.handleFillChange})],Xt.prototype,"fill",2),x([Ro({equals:st,changeCb:Xt.handleStrokeChange})],Xt.prototype,"stroke",2),x([Xe()],Xt.prototype,"strokeWidth",2),x([Om()],Xt.prototype,"lineDash",2),x([Xe()],Xt.prototype,"lineDashOffset",2),x([Xe()],Xt.prototype,"lineCap",2),x([Xe()],Xt.prototype,"lineJoin",2),x([Xe()],Xt.prototype,"miterLimit",2),x([Xe({convertor:t=>J(0,t??1,1)})],Xt.prototype,"opacity",2),x([Ro({equals:fl,checkDirtyOnAssignment:!0})],Xt.prototype,"fillShadow",2),x([oh({equals:bd,changeCb:t=>t.onFillChange()})],Xt.prototype,"fillBBox",2),x([oh({equals:st,changeCb:t=>t.onFillChange()})],Xt.prototype,"fillParams",2);var _o=Xt,qM=[1,0,0,1,0,0],zo=class mp{get e(){return[...this.elements]}constructor(e=qM){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 Vi(e[0],1)&&Vi(e[1],0)&&Vi(e[2],0)&&Vi(e[3],1)&&Vi(e[4],0)&&Vi(e[5],0)}AxB(e,i,n){const s=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],a=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];n=n??e,n[0]=s,n[1]=r,n[2]=o,n[3]=a,n[4]=l,n[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return e instanceof mp?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 mp(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],n=e[1],s=e[2],r=e[3];const o=e[4],a=e[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,new mp([r,-n,-s,i,s*a-r*o,n*o-i*a])}invertSelf(){const e=this.elements;let i=e[0],n=e[1],s=e[2],r=e[3];const o=e[4],a=e[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,e[0]=r,e[1]=-n,e[2]=-s,e[3]=i,e[4]=s*a-r*o,e[5]=n*o-i*a,this}transformPoint(e,i){const n=this.elements;return{x:e*n[0]+i*n[2]+n[4],y:e*n[1]+i*n[3]+n[5]}}transformBBox(e,i){const n=this.elements,s=n[0],r=n[1],o=n[2],a=n[3],l=e.width*.5,c=e.height*.5,h=e.x+l,u=e.y+c,d=Math.abs(l*s)+Math.abs(c*o),g=Math.abs(l*r)+Math.abs(c*a);return i??(i=new $(0,0,0,0)),i.x=h*s+u*o+n[4]-d,i.y=h*r+u*a+n[5]-g,i.width=d+d,i.height=g+g,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,n,s,r,o,a){const l=i,c=n;let h,u;l===1&&c===1?(h=0,u=0):(h=a?.scalingCenterX??0,u=a?.scalingCenterY??0);const d=s,g=Math.cos(d),p=Math.sin(d);let f,m;d===0?(f=0,m=0):(f=a?.rotationCenterX??0,m=a?.rotationCenterY??0);const y=r,b=o,v=h*(1-l)-f,S=u*(1-c)-m;return e.setElements([g*l,p*l,-p*c,g*c,g*v-p*S+f+y,p*v+g*S+m+b]),e}};function Pr(t){return QM(t.constructor)}var JM=Symbol("isMatrixTransform");function QM(t){return t[JM]===!0}function Ym(t){var e,i;const n=t;if(QM(t))return t;const s=Symbol("matrix_combined_transform");class r extends n{constructor(){super(...arguments),this[i]=new zo,this._dirtyTransform=!0}onChangeDetection(a){super.onChangeDetection(a),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(a){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(qM),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(a){return this.computeTransformMatrix(),this[s].identity?a.clone():this[s].transformBBox(a)}toParentPoint(a,l){return this.computeTransformMatrix(),this[s].identity?{x:a,y:l}:this[s].transformPoint(a,l)}fromParent(a){return this.computeTransformMatrix(),this[s].identity?a.clone():this[s].inverse().transformBBox(a)}fromParentPoint(a,l){return this.computeTransformMatrix(),this[s].identity?{x:a,y:l}:this[s].inverse().transformPoint(a,l)}computeBBox(){const a=super.computeBBox();return a&&this.toParent(a)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(a,l){return{x:a,y:l}=this.fromParentPoint(a,l),super.pickNode(a,l)}pickNodes(a,l,c){return{x:a,y:l}=this.fromParentPoint(a,l),super.pickNodes(a,l,c)}distanceSquared(a,l){return{x:a,y:l}=this.fromParentPoint(a,l),super.distanceSquared(a,l)}render(a){this.computeTransformMatrix();const{ctx:l}=a,c=this[s];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(a)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const a=super.toSVG(),l=this[s];if(l.identity||a==null)return a;const c=pt("g");c.append(...a.elements);const[h,u,d,g,p,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${g} ${p} ${f})`),{elements:[c],defs:a.defs}}}return e=JM,i=s,r[e]=!0,r}function Go(t){var e;const i=t,n=Symbol("matrix_rotation");class s extends Ym(i){constructor(){super(...arguments),this[e]=new zo,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:a,rotationCenterX:l,rotationCenterY:c}=this;a!==0&&(zo.updateTransformMatrix(this[n],1,1,a,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[n]))}}return e=n,x([H()],s.prototype,"rotationCenterX",2),x([H()],s.prototype,"rotationCenterY",2),x([H()],s.prototype,"rotation",2),s}function _O(t){return"scalingX"in t&&"scalingY"in t&&"scalingCenterX"in t&&"scalingCenterY"in t}function Yd(t){var e;const i=t,n=Symbol("matrix_scale");class s extends Ym(i){constructor(){super(...arguments),this[e]=new zo,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(o){super.updateMatrix(o);const{scalingX:a,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;a===1&&l===1||(zo.updateTransformMatrix(this[n],a,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[n]))}resetScalingProperties(o,a,l,c){this.__scalingX=o,this.__scalingY=a,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return e=n,x([H()],s.prototype,"scalingX",2),x([H()],s.prototype,"scalingY",2),x([H()],s.prototype,"scalingCenterX",2),x([H()],s.prototype,"scalingCenterY",2),s}function yl(t){var e;const i=t,n=Symbol("matrix_translation");class s extends Ym(i){constructor(){super(...arguments),this[e]=new zo,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:a,translationY:l}=this;a===0&&l===0||(zo.updateTransformMatrix(this[n],1,1,0,a,l),o.multiplySelf(this[n]))}}return e=n,x([H()],s.prototype,"translationX",2),x([H()],s.prototype,"translationY",2),s}var Oe=class{static fromCanvas(t,e){const i=[];for(const n of t.traverseUp())Pr(n)&&i.unshift(n);for(const n of i)e=n.fromParent(e);return Pr(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():Pr(t)&&(e=t.toParent(e));for(const i of t.traverseUp())Pr(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const n=[];for(const s of t.traverseUp())Pr(s)&&n.unshift(s);for(const s of n)({x:e,y:i}=s.fromParentPoint(e,i));return Pr(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){Pr(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const n of t.traverseUp())Pr(n)&&({x:e,y:i}=n.toParentPoint(e,i));return{x:e,y:i}}},Zd,Zm=class Jh extends bs{constructor(e){super(e),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=e?.optimizeForInfrequentRedraws===!0}static is(e){return e instanceof Jh}static computeChildrenBBox(e,i=!0){return $.merge(bs.extractBBoxes(e,i))}static compareChildren(e,i){return jM(e.__zIndex,i.__zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return Jh.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let n=0;const s=4;for(const d of this.descendants())d instanceof _o&&(n=Math.max(n,d.strokeWidth));const r=Math.max(1,n/2*s),{x:o,y:a}=Oe.toCanvasPoint(this,0,0),l=BM(e,o+i.x-r)-o,c=BM(e,a+i.y-r)-a,h=Math.ceil(i.x+i.width-l+r),u=Math.ceil(i.y+i.height-c+r);return new $(l,c,h,u)}prepareSharedCanvas(e,i,n){return Zd?.pixelRatio===n?Zd.resize(e,i,n):Zd=new Hm({width:e,height:i,pixelRatio:n}),Zd}setScene(e){const i=this.scene;super.setScene(e),this.layer&&i&&i!==e&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const n of this.children())n.setScene(e)}resolveFont(){if(!this.renderToOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const e of this.children()){const i=e.resolveFont();if(i!=null){this._cachedChildFont=i;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(e){this.dirty=!0,this._childFontDirty=!0,super.markDirty(e)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(e){for(const i of w0(e))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),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}`);e.parentNode=void 0,e.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const n=[...this.children()];for(let s=n.length-1;s>=0;s--){const o=n[s].pickNode(e,i);if(o!=null)return o}}else if(!this.isContainerNode)return this}}pickNodes(e,i,n=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return n;this.isContainerNode||n.push(this);for(const s of this.children())s.pickNodes(e,i,n);return n}isDirty(e){const{width:i,height:n,devicePixelRatio:s}=e,{dirty:r,layer:o}=this,a=o!=null&&(this._lastWidth!==i||this._lastHeight!==n),l=this._lastDevicePixelRatio!==s;return this._lastWidth=i,this._lastHeight=n,this._lastDevicePixelRatio=s,r||a||l}preRender(e){let i;if(this.dirty){i=super.preRender(e,0);for(const n of this.children()){const s=n.preRender(e);i.groups+=s.groups,i.nonGroups+=s.nonGroups,i.complexity+=s.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:n}=this,s={...e},r=this.isDirty(e);if(this.dirty=!1,!n){this.renderInContext(s),super.render(s);return}const{ctx:o,stats:a,devicePixelRatio:l}=e;let{image:c}=this;if(r){c?.bitmap.close(),c=void 0;const u=i?void 0:this.computeSafeClippingBBox(l),d=(g,...p)=>{const f=g.context;f.direction=s.direction,s.ctx=f,s.currentFont=void 0,g.clear(),f.save();try{f.setTransform(...p),f.globalAlpha=1,this.renderInContext(s)}finally{f.restore(),f.verifyDepthZero?.()}};if(i)d(i,o.getTransform());else if(u){const{x:g,y:p,width:f,height:m}=u,y=Math.floor(f*l),b=Math.floor(m*l);if(y>0&&b>0){const v=this.prepareSharedCanvas(f,m,l);d(v,l,0,0,l,-g*l,-p*l),c={bitmap:v.transferToImageBitmap(),x:g,y:p,width:f,height:m}}}this.image=c,a&&a.layersRendered++}else a&&a.layersSkipped++;const{globalAlpha:h}=o;if(o.globalAlpha=h*this.opacity,i){o.save();try{o.resetTransform(),i.drawImage(o)}finally{o.restore()}}else if(c){const{bitmap:u,x:d,y:g,width:p,height:f}=c;o.drawImage(u,0,0,p*l,f*l,d,g,p,f)}o.globalAlpha=h,super.render(s)}applyClip(e,i){const{x:n,y:s,width:r,height:o}=i;e.beginPath(),e.rect(n,s,r,o),e.clip()}renderInContext(e){const{ctx:i,stats:n}=e;this.dirtyZIndex&&(this.sortChildren(Jh.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const s=this.resolveChildFont();s!=null&&e.currentFont!==s&&(i.font=s,e.currentFont=s),this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Oe.toCanvas(this,this.clipRect));for(const r of this.children()){if(!r.visible){n&&(n.nodesSkipped+=r.childNodeCounts.nonGroups+r.childNodeCounts.groups,n.opsSkipped+=r.childNodeCounts.complexity);continue}r.isolatedRender(e)}}finally{i.restore()}}sortChildren(e){if(!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const n of i)this.childNodes.add(n)}*children(){yield*this.childNodes}*excludeChildren(e){for(const i of this.children())(e.instance&&!(i instanceof e.instance)||e.name&&i.name!==e.name)&&(yield i)}*descendants(){for(const e of this.children())yield e,e instanceof Jh&&(yield*e.descendants())}setClipRect(e){this.clipRect=e?Oe.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=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 n of this.children()){const s=n.toSVG();s!=null&&(i.push(...s.elements),s.defs!=null&&e.push(...s.defs))}return{elements:i,defs:e}}};Zm.className="Group",x([H({convertor:t=>J(0,t,1)})],Zm.prototype,"opacity",2);var se=Zm,zO=Yd(se),FG=Go(se),qt=yl(se),bl=Go(yl(se)),vs=class extends _o{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.strokeWidth=1}computeBBox(){return new $(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:n,x2:s,y2:r}=this;i=this.align(i),n=this.align(n),s=this.align(s),r=this.align(r);const{fill:o,horizontal:a}=this,{globalAlpha:l}=e;o!=null&&(this.applyFillAndAlpha(e),e.beginPath(),e.moveTo(i,n),e.lineTo(s,n),e.lineTo(s,r),e.lineTo(i,r),e.closePath(),e.fill(),e.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:u,endLine:d}=this;if(!!((u||d)&&c&&h)){const{lineDash:p,lineDashOffset:f,lineCap:m,lineJoin:y}=this;this.applyStrokeAndAlpha(e),e.lineWidth=h,p&&e.setLineDash([...p]),f&&(e.lineDashOffset=f),m&&(e.lineCap=m),y&&(e.lineJoin=y),e.beginPath(),u&&(e.moveTo(i,n),a?e.lineTo(i,r):e.lineTo(s,n)),d&&(e.moveTo(s,r),a?e.lineTo(s,n):e.lineTo(i,r)),e.stroke(),e.globalAlpha=l}this.fillShadow?.markClean(),super.render(t)}};vs.className="Range",x([H()],vs.prototype,"x1",2),x([H()],vs.prototype,"y1",2),x([H()],vs.prototype,"x2",2),x([H()],vs.prototype,"y2",2),x([H()],vs.prototype,"startLine",2),x([H()],vs.prototype,"endLine",2),x([H()],vs.prototype,"horizontal",2);var GO=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){re.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval(()=>{this.logAccumulatedStats()},this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(t,e){const i=this.stats.get(t);i?(i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.sum+=e,i.count+=1):this.stats.set(t,{min:e,max:e,sum:e,count:1})}recordTimings(t){for(const[e,i]of Object.entries(t))e!=="start"&&typeof i=="number"&&this.recordTiming(e,i)}logAccumulatedStats(){if(this.stats.size===0)return;const t=(Date.now()-this.lastLogTime)/1e3,e=Array.from(this.stats.keys()).sort((r,o)=>r==="\u23F1\uFE0F"?-1:o==="\u23F1\uFE0F"?1:r.localeCompare(o)),i=[];for(const r of e){const o=this.stats.get(r),a=o.sum/o.count;i.push(`${r}[${o.min.toFixed(1)}/${a.toFixed(1)}/${o.max.toFixed(1)}]ms`)}const s=this.stats.get("\u23F1\uFE0F")?.count??0;B.log(`\u{1F4CA} Stats (${t.toFixed(0)}s, ${s} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},vl,jo=0;function jO(){return vl??(vl=new GO),vl}function HO(){jo++;let t=!1;return()=>{t||jo===0||(t=!0,jo--,jo===0&&nI())}}function $O(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 WO(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,n=[];for(const s of[e,t,i])typeof s=="number"&&n.push($O(s));return`Heap ${n.join(" / ")}`}function eI(t,e,i,n,s={},r=$.zero,o){if(!re.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:u=0,opsSkipped:d=0}=n??{},g=performance.now(),{start:p,...f}=e,m=g-p,y=jO();y.recordTimings(f),y.recordTiming("\u23F1\uFE0F",m);const b=Object.entries(f).map(([j,ie])=>iI(j,ie)).filter(j=>j!=null).join(" + "),v=Object.entries(s).map(([j,ie])=>`${j}: ${JSON.stringify(ie)}`).join(" ; "),S=re.check("scene:stats:verbose"),M=S?WO():null,D=S?or.flush():{},I=Object.entries(D),A=[],k=[];for(const[j,ie]of I)j.endsWith(":aggregation")&&Array.isArray(ie)?A.push(`${j.replace(":aggregation","")}(${ie.join(",")})`):j.endsWith(":nodeData")&&typeof ie=="number"&&k.push(`${j.replace(":nodeData","")}(${ie})`);const T=A.length>0?`Aggregation: ${A.join(", ")}`:null,R=k.length>0?`NodeData: ${k.join(", ")}`:null,E=[`${iI("\u23F1\uFE0F",p,g)} (${b})`,`${v}`,T,R,`Layers: ${S?Xm(a,l):t.size}`,S?`Nodes: ${Xm(c,h)}`:null,S?`Ops: ${Xm(u,d)}`:null,M].filter(nt),F=new am(i),N=new Map(E.map(j=>[j,F.measureText(j)])),P=Math.max(...Array.from(N.values(),j=>j.width)),z=qO(N.values(),j=>j.height),Y=2+r.x;i.save();try{i.fillStyle=o?.background??"white",i.fillRect(Y,0,P,z),i.fillStyle=o?.foreground??"black";let j=0;for(const[ie,ge]of N.entries())j+=ge.height,i.fillText(ie,Y,j)}catch(j){B.warnOnce("Error during debug stats rendering",j)}finally{i.restore()}}function UO(t){const e=hc(ts("agChartsSceneDebug")),i=[];for(const n of e)n==="layout"?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(n);t.debugNodeSearch=i}function KO(t,e){t.save();try{for(const[i,n]of Object.entries(e)){const s=Oe.toCanvas(n);if(!s){B.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(s.x,s.y,s.width,s.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,s.x,s.y,s.width),t.fillText(i,s.x,s.y,s.width)}}catch(i){B.warnOnce("Error during debug rendering",i)}finally{t.restore()}}var YO=new Set,ZO=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function XO(t){const{...e}=t;for(const i of Object.keys(e))ZO.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(YO.add(i),delete e[i]);return e}function Xd(t,e){if(!re.check(!0,"scene"))return{};let i=0;return{node:e==="json"?XO(t):t,name:t.name??t.id,dirty:t instanceof se?t.dirty:void 0,...Array.from(t instanceof se?t.children():[],n=>Xd(n,e)).reduce((n,s)=>{let{name:r}=s;const{node:{visible:o,opacity:a,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:g},node:p}=s;(!o||a<=0)&&(r=`(${r})`),se.is(p)&&p.renderToOffscreenCanvas&&(r=`*${r}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,m=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,g!=null&&g!==1&&`sy: ${g}`].filter(v=>!!v).join(" ");let y=m,b=1;for(;n[y]!=null&&b<100;)y=`${m} (${b++})`;return n[y]=s,n},{})}}function tI(t){const e=t instanceof se?t.dirty:void 0;if(!e)return{dirtyTree:{},paths:[]};const i=Array.from(t instanceof se?t.children():[],r=>tI(r)).filter(r=>r.paths.length>0),n=se.is(t)?t.name??t.id:t.id,s=i.length?i.flatMap(r=>r.paths).map(r=>`${n}.${r}`):[n];return{dirtyTree:{name:n,node:t,dirty:e,...i.map(r=>r.dirtyTree).filter(r=>r.dirty!=null).reduce((r,o)=>(r[o.name??"<unknown>"]=o,r),{})},paths:s}}function Xm(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function iI(t,e,i){const n=i==null?e:i-e;return`${t}: ${Math.round(n*100)/100}ms`}function qO(t,e){let i=0;for(const n of t)i+=e(n);return i}function nI(t=!1){if(!vl){t&&(jo=0);return}!t&&jo>0||(vl.destroy(),vl=void 0,t&&(jo=0))}var on=class extends bs{constructor(){super(...arguments),this.x=0,this.y=0,this.boxWidth=0,this.boxHeight=0,this.imageWidth=0,this.imageHeight=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0,this.paddingLeft=0,this.cornerRadius=0,this.opacity=1,this.url=""}setScene(t){t==null&&this.registeredLoader&&(this.registeredLoader.unregisterNode(this),this.registeredLoader=void 0),super.setScene(t)}destroy(){this.registeredLoader&&(this.registeredLoader.unregisterNode(this),this.registeredLoader=void 0),super.destroy()}render(t){const{ctx:e}=t,{x:i,y:n,boxWidth:s,boxHeight:r,cornerRadius:o,opacity:a}=this;if(s<=0||r<=0){super.render(t);return}const l=e.globalAlpha;if(e.globalAlpha=l*a,this.backgroundFill&&(this.tracePath(e,i,n,s,r,o),e.fillStyle=this.backgroundFill,e.fill()),this.url){const c=this.imageLoader;c!==this.registeredLoader&&(this.registeredLoader?.unregisterNode(this),this.registeredLoader=c);const h=c?.loadImage(this.url,this,{width:this.imageWidth,height:this.imageHeight});if(h){const u=i+this.paddingLeft,d=n+this.paddingTop,g=o>0;g&&(e.save(),this.tracePath(e,i,n,s,r,o),e.clip()),e.drawImage(h,u,d,this.imageWidth,this.imageHeight),g&&e.restore()}}else B.warnOnce(`Image segment has an empty url; rendering background only (${s}x${r} box).`);e.globalAlpha=l,super.render(t)}tracePath(t,e,i,n,s,r){t.beginPath();const o=Math.max(0,Math.min(r,n/2,s/2));if(o===0){t.rect(e,i,n,s);return}t.moveTo(e+o,i),t.arcTo(e+n,i,e+n,i+s,o),t.arcTo(e+n,i+s,e,i+s,o),t.arcTo(e,i+s,e,i,o),t.arcTo(e,i,e+n,i,o),t.closePath()}computeBBox(){return new $(this.x,this.y,this.boxWidth,this.boxHeight)}};x([H()],on.prototype,"x",2),x([H()],on.prototype,"y",2),x([H()],on.prototype,"boxWidth",2),x([H()],on.prototype,"boxHeight",2),x([H()],on.prototype,"imageWidth",2),x([H()],on.prototype,"imageHeight",2),x([H()],on.prototype,"paddingTop",2),x([H()],on.prototype,"paddingRight",2),x([H()],on.prototype,"paddingBottom",2),x([H()],on.prototype,"paddingLeft",2),x([H()],on.prototype,"cornerRadius",2),x([H()],on.prototype,"opacity",2);var dh=(t,{x0:e,y0:i,x1:n,y1:s,cx:r,cy:o},a,l)=>{if(l&&t.moveTo(e,i),e!==n||i!==s){const c=Math.atan2(i-o,e-r),h=Math.atan2(s-o,n-r);t.arc(r,o,a,c,h)}else t.lineTo(e,i)},Rt=class extends _o{constructor(){super(...arguments),this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}get path(){return this._path??(this._path=new Bo),this._path}set path(t){this._path=t}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))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(t){this._dirtyPath=!0,super.onChangeDetection(t)}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.pathComplexity())}pathComplexity(){return this.path.commands.length}render(t){const{ctx:e}=t;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){e.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Bo),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)}finally{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=pt("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};Rt.className="Path",x([H()],Rt.prototype,"clip",2),x([H()],Rt.prototype,"clipX",1),x([H()],Rt.prototype,"clipY",1);function qd(t,e,i,n,s){let r=!1,o=!1,a=n-Math.sqrt(Math.max(s**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(s**2-n**2,0));return a>t?(r=!0,a=t,l=i-Math.sqrt(Math.max(s**2-(n-t)**2))):Vi(a,0)&&(a=0),h>e?(o=!0,c=n-Math.sqrt(Math.max(s**2-(i-e)**2)),h=e):Vi(h,0)&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}}function Jd(t,e,i,n,s,r,o){let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(a+h,l+c),d=Math.max(a+l,h+c);if(u<=0&&d<=0){if(o==null)t.rect(e,i,n,s);else{const I=Math.max(e,o.x),A=Math.min(e+n,o.x+o.width),k=Math.max(i,o.y),T=Math.min(i+s,o.y+o.height);t.rect(I,k,A-I,T-k)}return}else if(o==null&&a===l&&a===c&&a===h){t.roundRect(e,i,n,s,a);return}if(n<0&&(e+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(o==null)o=new $(e,i,n,s);else{const I=Math.max(e,o.x),A=Math.min(e+n,o.x+o.width),k=Math.max(i,o.y),T=Math.min(i+s,o.y+o.height);o=new $(I,k,A-I,T-k)}const g=Math.max(u/s,d/n,1);g>1&&(a/=g,l/=g,c/=g,h/=g);let p=!0,f=!0,m=!0,y=!0,b,v,S,M;if(p){const I=qd(o.height,o.width,Math.max(e+a-o.x,0),Math.max(i+a-o.y,0),a);I.leadingClipped&&(y=!1),I.trailingClipped&&(f=!1);const A=Math.max(o.x+I.leading1,o.x),k=Math.max(o.y+I.leading0,o.y),T=Math.max(o.x+I.trailing1,o.x),R=Math.max(o.y+I.trailing0,o.y),E=e+a,F=i+a;b={x0:A,y0:k,x1:T,y1:R,cx:E,cy:F}}if(f){const I=qd(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+n-l),0),l);I.leadingClipped&&(p=!1),I.trailingClipped&&(m=!1);const A=Math.min(o.x+o.width-I.leading0,o.x+o.width),k=Math.max(o.y+I.leading1,o.y),T=Math.min(o.x+o.width-I.trailing0,o.x+o.width),R=Math.max(o.y+I.trailing1,o.y),E=e+n-l,F=i+l;v={x0:A,y0:k,x1:T,y1:R,cx:E,cy:F}}if(m){const I=qd(o.height,o.width,Math.max(o.x+o.width-(e+n-c),0),Math.max(o.y+o.height-(i+s-c),0),c);I.leadingClipped&&(f=!1),I.trailingClipped&&(y=!1);const A=Math.min(o.x+o.width-I.leading1,o.x+o.width),k=Math.min(o.y+o.height-I.leading0,o.y+o.height),T=Math.min(o.x+o.width-I.trailing1,o.x+o.width),R=Math.min(o.y+o.height-I.trailing0,o.y+o.height),E=e+n-c,F=i+s-c;S={x0:A,y0:k,x1:T,y1:R,cx:E,cy:F}}if(y){const I=qd(o.width,o.height,Math.max(o.y+o.height-(i+s-h),0),Math.max(e+h-o.x,0),h);I.leadingClipped&&(m=!1),I.trailingClipped&&(p=!1);const A=Math.max(o.x+I.leading0,o.x),k=Math.min(o.y+o.height-I.leading1,o.y+o.height),T=Math.max(o.x+I.trailing0,o.x),R=Math.min(o.y+o.height-I.trailing1,o.y+o.height),E=e+h,F=i+s-h;M={x0:A,y0:k,x1:T,y1:R,cx:E,cy:F}}let D=!1;p&&b!=null&&(dh(t,b,a,!D),D||(D=!0)),f&&v!=null&&(dh(t,v,l,!D),D||(D=!0)),m&&S!=null&&(dh(t,S,c,!D),D||(D=!0)),y&&M!=null&&dh(t,M,h,!D),t.closePath()}var Pt=class extends Rt{constructor(){super(...arguments),this.borderPath=new Bo,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.__strokeWidth,this.effectiveStrokeWidth=this.__strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(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:n,__topRightCornerRadius:s,__bottomRightCornerRadius:r,__bottomLeftCornerRadius:o}=this;let{__x:a,__y:l,__width:c,__height:h,__strokeWidth:u,__clipBBox:d}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(),e.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=p&&(f*=c/p),h<=p&&(f*=h/p),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),d=d==null?void 0:new $(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height))),u)if(c<p){const y=a+p/2;e.moveTo(y,l),e.lineTo(y,l+h),u=p,this.borderClipPath=void 0}else if(h<p){const y=l+p/2;e.moveTo(a,y),e.lineTo(a+c,y),u=p,this.borderClipPath=void 0}else if(u<c&&u<h){const y=u/2;a+=y,l+=y,c-=u,h-=u;const b=d?.clone().shrink(y),v={topLeft:n>0?n-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,c>0&&h>0&&(b==null||b?.width>0&&b?.height>0)&&(Jd(t,a,l,c,h,v,b),Jd(e,a,l,c,h,v,b))}else this.borderClipPath=this.borderClipPath??new Bo,this.borderClipPath.clear(),this.borderClipPath.rect(a,l,c,h),e.rect(a,l,c,h);else{const y={topLeft:n,topRight:s,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,Jd(t,a,l,c,h,y,d)}if([n,s,r,o].every(JO)){let y=function(S,M){return v.getBBox().distanceSquared(S,M)};var m=y;const b=this.getBBox();this.hittester=b.containsPoint.bind(b);const v=this;this.distanceSquared=y}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=f}computeBBox(){const{__x:t,__y:e,__width:i,__height:n,__clipBBox:s}=this;return s?.clone()??new $(t,e,i,n)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(t,e,i,n,s,r,o,a){this.__drawingMode=t,this.__topLeftCornerRadius=e,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=n,this.__bottomLeftCornerRadius=s,this.__visible=r,this.__crisp=o,this.__fillShadow=a,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(t,e,i,n,s,r){this.__x=t,this.__y=e,this.__width=i,this.__height=n,this.__opacity=s,this.__clipBBox=r,this.dirtyPath=!0,this.markDirty()}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAndAlpha(t){super.applyFillAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(t){super.applyStrokeAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:n}=t,{lineDash:s,lineDashOffset:r,lineCap:o,lineJoin:a,borderPath:l,borderClipPath:c}=this;c&&t.clip(c.getPath2D()),this.applyStrokeAndAlpha(t),t.lineWidth=i,s&&t.setLineDash(s),r&&(t.lineDashOffset=r),o&&(t.lineCap=o),a&&(t.lineJoin=a),t.stroke(l.getPath2D()),t.globalAlpha=n}}};Pt.className="Rect",x([Xe()],Pt.prototype,"x",2),x([Xe()],Pt.prototype,"y",2),x([Xe()],Pt.prototype,"width",2),x([Xe()],Pt.prototype,"height",2),x([Xe()],Pt.prototype,"topLeftCornerRadius",2),x([Xe()],Pt.prototype,"topRightCornerRadius",2),x([Xe()],Pt.prototype,"bottomRightCornerRadius",2),x([Xe()],Pt.prototype,"bottomLeftCornerRadius",2),x([Xe({equals:bd})],Pt.prototype,"clipBBox",2),x([Xe()],Pt.prototype,"crisp",2);function JO(t){return t===0}var $i=class _t extends _o{constructor(e){super(e),this.generatingTextMap=!1,this.suppressedDirtyDuringGenerate=!1,this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=_t.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=e?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),this.segmentMetrics=void 0,ue(this.text)){this.lines=[],this.richText??(this.richText=new se),this.richText.parentNode=this,this.richText.setScene(this.scene);const e=[];for(const i of this.text)if(i.type==="image")e.push(new on);else for(const n of $e(i.text).split(lr))n&&e.push(new _t({trimText:!1}));this.richText.append(e)}else{this.richText&&(this.richText.parentNode=void 0,this.richText.setScene(),this.richText=void 0);const e=$e(this.text).split(lr);this.lines=this.trimText?e.map(i=>i.trim()):e}}get font(){return this.fontCache??(this.fontCache=fu(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(e,i,n,s){if(ue(e)){const{font:r,lineHeight:o,textAlign:a,textBaseline:l}=s,{width:c,height:h,lineMetrics:u}=Ws(e,r),d=o?o*u.length:h,g=_t.calcTopOffset(d,u[0],l),p=_t.calcLeftOffset(c,a);return new $(i-p,n-g,c,d)}else return _t.computeBBox($e(e).split(lr),i,n,s)}static computeBBox(e,i,n,s){const{font:r,lineHeight:o,textAlign:a,textBaseline:l,isRtl:c}=s,{width:h,height:u,lineMetrics:d}=Zt(r).measureLines(e),g=o?o*d.length:u,p=_t.calcTopOffset(g,d[0],l),f=_t.calcLeftOffset(h,a,c);return new $(i-f,n-p,h,g)}static calcTopOffset(e,i,n){switch(n){case"alphabetic":return i?.ascent??0;case"middle":return e/2;case"bottom":return e;default:return 0}}static calcSegmentedTopOffset(e,i,n){switch(n){case"alphabetic":return i[0]?.ascent??0;case"middle":{const s=i[0];return i.length===1&&s.segments.length>0&&!s.blockImages?.length&&s.segments.every(o=>o.type!=="image")?s.ascent+s.segments.reduce((o,a)=>a.type==="image"?o:Math.min(o,Zt(a).baselineDistance("middle")),0):e/2}case"bottom":return e;default:return 0}}static calcLeftOffset(e,i,n){let s=0;switch(i){case"center":s=.5;break;case"right":case(n?"start":"end"):s=1}return e*s}getBBox(){const e=super.getBBox();if(!this.textMap?.size||!ue(this.text))return e;const{height:i,lineMetrics:n}=this.getSegmentMetrics(this.text),s=_t.calcSegmentedTopOffset(i,n,this.textBaseline),r=this.y-s;return e.y===r?e:new $(e.x,r,e.width,e.height)}computeBBox(){if(!this.hasRenderableText())return new $(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size){const l=$.merge(this.textMap.values());return l.x=this.x-_t.calcLeftOffset(l.width,this.textAlign),l.y=this.y,l}const e=this.scene?.isRtl,{x:i,y:n,lines:s,textBaseline:r,textAlign:o}=this,a=_t.computeBBox(s,i,n,{font:this,textBaseline:r,textAlign:o,isRtl:e});return this.boxing!=null&&a.grow(this.boxPadding),a}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return je(this.text)}isPointInPath(e,i){return this.getBBox()?.containsPoint(e,i)??!1}setScene(e){this.richText?.setScene(e),super.setScene(e)}generateTextMap(){if(!(!ue(this.text)||this.textMap?.size)){this.textMap??(this.textMap=new Map),this.generatingTextMap=!0,this.suppressedDirtyDuringGenerate=!1;try{this.buildTextMap(this.text)}finally{this.generatingTextMap=!1,this.suppressedDirtyDuringGenerate&&(this.suppressedDirtyDuringGenerate=!1,super.markDirty())}}}getSegmentMetrics(e){return this.segmentMetrics??(this.segmentMetrics=Ws(e,this)),this.segmentMetrics}buildTextMap(e){const i=this.richText.children(),{width:n,lineMetrics:s}=this.getSegmentMetrics(e),r=this.x-n/2;let o=0;for(let a=0;a<s.length;){const l=s[a];if(l.blockImages?.length){const c=l.blockRowSpan??1,h=this.layoutBlockRow(s,a,c,o,r,i);if(h==null)return;o=h,a+=c;continue}o=this.renderLine(l,this.x-l.width/2,o,i),a+=1}}layoutBlockRow(e,i,n,s,r,o){const a=e[i].blockImages,l=Jc(a),c=hm(a);let h=0;for(let m=0;m<n;m++)h+=e[i+m].height;const u=Math.max(c,h);let d=r;for(let m=0;m<a.length;m++){const y=a[m],b=y.textMetrics,v=ol(y.verticalAlign)??"middle",S=_t.calcAnchoredOffset(v,u,b.height),M=o.next().value;if(!M)return this.abandonTextMap(),null;_t.applyImageSegment(M,y,d,s+S),this.textMap.set(M,M.getBBox()),d+=b.width+(m<a.length-1?al:0)}const g=_t.findFirstTextSegment(e,i,n),p=r+l+al;let f=s+_t.calcAnchoredOffset(ol(g?.verticalAlign)??"alphabetic",u,h);for(let m=0;m<n;m++)f=this.renderLine(e[i+m],p,f,o);return s+u}static findFirstTextSegment(e,i,n){for(let s=0;s<n;s++){const r=e[i+s].segments.find(o=>o.type!=="image");if(r)return r}}renderLine(e,i,n,s){const{height:r,ascent:o,textAscent:a,textDescent:l,segments:c}=e,h=n+o;let u=0;for(const d of c){const g=s.next().value;if(!g)return this.abandonTextMap(),n+r;if(d.type==="image"){const M=d.textMetrics.width,D=d.textMetrics.height,{above:I}=cm(ol(d.verticalAlign),D,a,l),A=g;_t.applyImageSegment(A,d,i+u,h-I),this.textMap.set(A,A.getBBox()),u+=M;continue}const{color:p,textMetrics:f,verticalAlign:m,...y}=d,b=g,v=ol(m)??"alphabetic";b.x=i+u,b.y=_t.calcSegmentY(v,n,o,r),b.setProperties({...y,textBaseline:v,fill:p??this.fill});const S=b.getBBox();this.textMap.set(b,S),u+=f.width}return n+r}abandonTextMap(){this.textMap?.clear(),this.segmentMetrics=void 0}static calcAnchoredOffset(e,i,n){const s=Math.max(0,i-n);switch(e){case"middle":return s/2;case"bottom":case"ideographic":case"alphabetic":return s;case"top":case"hanging":default:return 0}}static applyImageSegment(e,i,n,s){const{top:r,right:o,bottom:a,left:l}=wd(i.padding);e.x=n,e.y=s,e.boxWidth=i.textMetrics.width,e.boxHeight=i.textMetrics.height,e.imageWidth=i.width,e.imageHeight=i.height,e.paddingTop=r,e.paddingRight=o,e.paddingBottom=a,e.paddingLeft=l,e.cornerRadius=i.cornerRadius??0,e.backgroundFill=i.backgroundFill,e.url=i.url}static calcSegmentY(e,i,n,s){switch(e){case"top":case"hanging":return i;case"middle":return i+s/2;case"bottom":case"ideographic":return i+s;case"alphabetic":default:return i+n}}render(e){const{ctx:i,stats:n}=e;if(!this.layerManager||!this.hasRenderableText()){n&&(n.nodesSkipped+=1);return}if(ue(this.text)&&this.richText){this.generateTextMap();const s=this.richText.getBBox(),{width:r,height:o,lineMetrics:a}=this.getSegmentMetrics(this.text);let l=0;switch(this.textAlign){case"left":case"start":l=r/2;break;case"right":case"end":l=r/-2}const c=this.y-_t.calcSegmentedTopOffset(o,a,this.textBaseline);this.renderBoxing(e,s.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(e),i.restore()}else this.renderText(e);if(_t.debug.check()){const s=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(s.x,s.y,s.width,s.height)}super.render(e)}markDirty(e){if(this.generatingTextMap){this.suppressedDirtyDuringGenerate=!0;return}return this.textMap?.clear(),this.segmentMetrics=void 0,super.markDirty(e)}renderText(e){const{fill:i,stroke:n,strokeWidth:s,font:r,textAlign:o}=this;if(!i&&!(n&&s)||!this.layerManager)return super.render(e);const{ctx:a}=e;e.currentFont!==r&&(a.font=r,e.currentFont=r),a.textAlign=o,this.renderBoxing(e),this.fillStroke(a)}renderBoxing(e,i){if(!this.boxing)return;const n=i??_t.computeBBox(this.lines,this.x,this.y,this);if(n.width===0||n.height===0)return;const{x:s,y:r,width:o,height:a}=n.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=s,this.boxing.y=r,this.boxing.width=o,this.boxing.height=a,this.boxing.preRender(e),this.boxing.render(e)}executeFill(e){this.renderLines((i,n,s)=>e.fillText(i,n,s))}executeStroke(e){this.renderLines((i,n,s)=>e.strokeText(i,n,s))}renderLines(e){const{x:i,y:n,lines:s}=this;if(!Number.isFinite(i)||!Number.isFinite(n))return;const r=Zt(this),{lineMetrics:o}=r.measureLines(s),{textBaseline:a,lineHeight:l=r.lineHeight()}=this;let c=0;a==="top"?c=o[0].ascent:(a==="middle"||a==="bottom")&&(c=l*(1-s.length),a==="middle"?(c/=2,c-=r.baselineDistance(a)):c-=o[0].descent);for(const h of o)e(h.text,i,n+c),c+=l}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}setBoxing(e){const i=e.border?.enabled?e.border?.stroke:void 0;e.fill!=null||i!=null?(this.boxing??(this.boxing=new Pt({scene:this.scene})),this.boxing.fill=e.fill,this.boxing.fillOpacity=e.fillOpacity??1,this.boxing.cornerRadius=e.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=e.border?.strokeWidth??0,this.boxing.strokeOpacity=e.border?.strokeOpacity??1,this.boxPadding=e.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}hasBoxing(){return this.boxing!=null}getBoxingProperties(){const{fill:e,fillOpacity:i,cornerRadius:n,stroke:s,strokeWidth:r,strokeOpacity:o}=this.boxing??{};return{border:{enabled:s!=null,stroke:s,strokeWidth:r,strokeOpacity:o},cornerRadius:n,fill:e,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const e=this.text;if(e==null)return;const i=pt("text");if(ue(e))for(const n of e){if(n.type==="image"){B.warnOnce("SVG export drops inline image segments; text content is preserved.");continue}const s=pt("tspan");XM(s,{fontSize:n.fontSize??this.fontSize,fontFamily:n.fontFamily??this.fontFamily,fontWeight:n.fontWeight??this.fontWeight,fontStyle:n.fontStyle??this.fontStyle}),this.applySvgFillAttributes(s),s.textContent=$e(n.text),i.append(s)}else this.applySvgFillAttributes(i),XM(i,this),i.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),i.setAttribute("alignment-baseline",this.textBaseline),i.setAttribute("x",String(this.x)),i.setAttribute("y",String(this.y)),i.textContent=$e(e);return{elements:[i]}}hasRenderableText(){const{text:e}=this;return e==null?!1:ue(e)?e.length>0:$e(e)!==""}};$i.className="Text",$i.debug=re.create(!0,"scene:text"),$i.defaultFontSize=10,x([H()],$i.prototype,"x",2),x([H()],$i.prototype,"y",2),x([jd({changeCb:t=>t.onTextChange()})],$i.prototype,"text",2),x([H({changeCb:t=>{t.fontCache=void 0}})],$i.prototype,"fontStyle",2),x([H({changeCb:t=>{t.fontCache=void 0}})],$i.prototype,"fontWeight",2),x([H({changeCb:t=>{t.fontCache=void 0}})],$i.prototype,"fontSize",2),x([H({changeCb:t=>{t.fontCache=void 0}})],$i.prototype,"fontFamily",2),x([H()],$i.prototype,"textAlign",2),x([H()],$i.prototype,"textBaseline",2),x([H()],$i.prototype,"lineHeight",2);var Wi=$i,qm=Go(Wi),xl=Go(yl(Wi)),sI=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 n=i.findIndex(s=>s.symbol===t);if(n>=0){i.splice(n,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(n){B.errorOnce(n)}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},xs={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},QO={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},fi={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},eE=/%[-_0]?L/,tE=/%[-_0]?S/,iE=/%[-_0]?M/,nE=/%[-_0]?[HI]/,sE=/^%[-_0]?[de]$/,rE=/^%[-_0]?[Bbm]$/,oE=/^%[-_0]?[Yy]$/;function aE(t,e,i){if(typeof t=="string")return t;t??(t=xs);const{millisecond:n=xs.millisecond,second:s=xs.second,minute:r=xs.minute,hour:o=xs.hour,day:a=xs.day,month:l=xs.month,year:c=xs.year}=t,h=fi[e],u=QO[e],d=i?fi[i]:-1;if(d<fi.year&&h>=fi.year&&!oE.test(c)||d<fi.month&&h>=fi.month&&!rE.test(l)||d<fi.day&&h>=fi.day&&!sE.test(a))return u;let g;switch(e){case"year":return c;case"month":return d<fi.year?`${l} ${c}`:l;case"day":return d<fi.year?`${l} ${a} ${c}`:`${l} ${a}`;case"hour":g=o;break;case"minute":g=r;break;case"second":g=s;break;case"millisecond":g=n;break;default:return u}if(h>=fi.hour&&!nE.test(g)||h>=fi.minute&&!iE.test(g)||h>=fi.second&&!tE.test(g)||h>=fi.millisecond&&!eE.test(g))return u;let p;return d<fi.year?p=`${l} ${a} ${c}`:d<fi.month&&(p=`${l} ${a}`),p?`${g} ${p}`:g}var Fr=class yp extends sI{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=Zc((e,i,n,s,r)=>{const o=yp.mergeSpecifiers(e,i)??xs;return yp.getFormatter("date",o,n,s,{truncateDate:r})}),this.formatter=void 0}static mergeSpecifiers(...e){let i;for(const n of e)Le(n)&&Le(i)?i={...i,...n}:i=n;return i}static getFormatter(e,i,n,s="long",{truncateDate:r}={}){if(Le(i)){if(e!=="date"){B.warn("Date formatter configuration is not supported for non-date types.");return}n??(n="millisecond");const o=s==="component"?i?.[n]??xs[n]:aE(i,n,r);return pl(o)}switch(e){case"number":{const o=xu(i);return o==null?void 0:Hp(o)}case"date":return pl(i);case"category":return o=>i.replace("%s",String(o))}}setFormatter(e){this.formatter!==e&&(this.formatter=e,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(e,i,{specifier:n,truncateDate:s,allowNull:r}={}){if(i.value==null&&!r)return;const{formatter:o}=this;if(o==null)return;if(typeof o=="function"){const h=e(o,i);return h==null?void 0:String(h)}const a=o[i.property];if(a==null)return;if(typeof a=="function"){const h=e(a,i);return h==null?h:$e(h)}else if(i.type==="date"){const{unit:h,style:u}=i;return this.dateFormatter(a,n,h,u,s)?.(i.value)}const l=n??a;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=yp.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(e,{specifier:i,truncateDate:n}={}){const{formatter:s}=this,r=typeof s=="function"?void 0:s?.[e.property];switch(e.type){case"date":{const{unit:o,style:a}=e,l=r!=null&&typeof r!="function"?r:void 0;return this.dateFormatter(l,i,o,a,n)?.(e.value)??String(e.value)}case"number":return Co(e.value,e.fractionDigits);case"category":return e.value==null?"":Array.isArray(e.value)?e.value.join(" - "):typeof e.value=="string"?e.value:typeof e.value=="number"?Co(e.value):String(e.value)}}},Sl=class{constructor(){this.enabled=!0}};x([C],Sl.prototype,"enabled",2),x([C],Sl.prototype,"stroke",2),x([C],Sl.prototype,"strokeWidth",2),x([C],Sl.prototype,"strokeOpacity",2);var an=class extends Fe{constructor(){super(...arguments),this.border=new Sl}};x([C],an.prototype,"border",2),x([C],an.prototype,"color",2),x([C],an.prototype,"cornerRadius",2),x([C],an.prototype,"fill",2),x([C],an.prototype,"fillOpacity",2),x([C],an.prototype,"fontStyle",2),x([C],an.prototype,"fontWeight",2),x([C],an.prototype,"fontSize",2),x([C],an.prototype,"fontFamily",2),x([C],an.prototype,"padding",2);var ln=class extends an{constructor(){super(...arguments),this.enabled=!1,this._cachedFormatter=void 0}formatValue(t,e,i,n){const{formatter:s,format:r}=this;let o;if(s!=null&&(o??(o=t(s,n))),r!=null){let a=this._cachedFormatter;(a?.type!==e||a?.format!==r)&&(a={type:e,format:r,formatter:Fr.getFormatter(e,r)},this._cachedFormatter=a),o??(o=a.formatter?.(i))}return o==null||ue(o)?o:String(o)}};x([C],ln.prototype,"enabled",2),x([C],ln.prototype,"formatter",2),x([C],ln.prototype,"format",2),x([C],ln.prototype,"itemStyler",2);function Ml(t){const{enabled:e=!1,stroke:i}=t?.border??{},s=t?.fill!=null||e&&i!=null?t?.padding:null;if(s==null)return{bottom:0,left:0,right:0,top:0};if(typeof s=="number")return{bottom:s,left:s,right:s,top:s};{const{bottom:r=0,left:o=0,right:a=0,top:l=0}=s;return{bottom:r,left:o,right:a,top:l}}}function rI(t,e){const i=t?.valueOf(),n=e?.valueOf();return!Zi(i)||!Zi(n)?[void 0,void 0]:i<n?[0,1]:[1,0]}var oI=class $v extends $d{constructor(e=[],i=[]){super(),this.range=i,this.defaultTickCount=$v.defaultTickCount,this.defaultClamp=!1,this._domain=[],this.domainNeedsValueOf=!0,this.d0Cache=Number.NaN,this.d1Cache=Number.NaN,this.d0Big=void 0,this.d1Big=void 0,this.domain=e}static is(e){return e instanceof $v}get domain(){return this._domain}set domain(e){if(!e||e.length<2){this._domain=Jm(e),this.d0Big=this.d1Big=void 0,this.d0Cache=Number.NaN,this.d1Cache=Number.NaN;return}const i=e[0],n=e[1];if(typeof i=="bigint"||typeof n=="bigint"){this.d0Big=typeof i=="bigint"?i:void 0,this.d1Big=typeof n=="bigint"?n:void 0,this.domainNeedsValueOf=!1,this.d0Cache=Number(i),this.d1Cache=Number(n),this._domain=Jm(e);return}this.d0Big=this.d1Big=void 0,this._domain=Jm(e),this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=i.valueOf(),this.d1Cache=n.valueOf()):(this.d0Cache=Number(i),this.d1Cache=Number(n))}normalizeDomains(...e){return lI(...e)}calcBandwidth(e=1,i=1){const{domain:n}=this,s=this.getPixelRange();if(n.length===0)return s;let o=Math.abs(this.d1Cache-this.d0Cache)/Number(e)+1;if(i!==0){const a=Math.floor(s);o=Math.min(o,a)}return s/Math.max(1,o)}convert(e,i){const{domain:n}=this;if(!n||n.length<2||e==null)return Number.NaN;const{range:s}=this,r=i?.clamp??this.defaultClamp;if(this.d0Big!=null&&this.d1Big!=null&&this.transform==null&&(typeof e=="bigint"||typeof e=="number"&&Number.isFinite(e)))return lE(e,this.d0Big,this.d1Big,s,r);let o=this.d0Cache,a=this.d1Cache,l;if(typeof e=="number"?l=e:typeof e=="bigint"?l=Number(e):l=e.valueOf(),this.transform&&(o=this.transform(o),a=this.transform(a),l=this.transform(l)),r){const[h,u]=Ot([o,a]);if(l<h)return s[0];if(l>u)return s[1]}if(o===a)return(s[0]+s[1])/2;if(l===o)return s[0];if(l===a)return s[1];const c=s[0];return c+(l-o)/(a-o)*(s[1]-c)}convertClamped(e){const{d0Big:i,d1Big:n}=this;if(typeof e=="bigint"&&i!=null&&n!=null){const l=Es(i,n),c=ss(i,n);return this.convert(Es(c,ss(l,e)))}const{d0Cache:s,d1Cache:r}=this,o=Math.min(s,r),a=Math.max(s,r);return this.convert(Math.min(a,Math.max(o,Ze(e))))}invert(e,i){const{domain:n}=this;if(n.length<2)return;let s=this.d0Cache,r=this.d1Cache;this.transform&&(s=this.transform(s),r=this.transform(r));const{range:o}=this,[a,l]=o;let c;return a===l?c=this.toDomain((s+r)/2):c=this.toDomain(s+(e-a)/(l-a)*(r-s)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return Wd(this.domain)}snapshotDomain(){const e=this._domain.slice();return this.d0Big!=null&&(e[0]=this.d0Big),this.d1Big!=null&&(e[1]=this.d1Big),e}exactEndpoint(e){return(e===0?this.d0Big:this.d1Big)??this._domain[e]}startIsMin(){return this.exactEndpoint(0)<=this.exactEndpoint(1)}get domainMin(){return this._domain.length<2?this._domain.at(0):this.exactEndpoint(this.startIsMin()?0:1)}get domainMax(){return this._domain.length<2?this._domain.at(0):this.exactEndpoint(this.startIsMin()?1:0)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};oI.defaultTickCount=5;var Ge=oI;function Jm(t){return t.map(e=>typeof e=="bigint"?Number(e):e)}var aI=10n**12n;function lE(t,e,i,n,s){const r=n[0],o=n[1];if(s){const d=e<i?e:i,g=e<i?i:e;if(t<d)return r;if(t>g)return o}if(e===i)return(r+o)/2;let a,l=0;if(typeof t=="number"){const d=Math.trunc(t);a=BigInt(d),l=t-d}else a=t;if(l===0){if(a===e)return r;if(a===i)return o}const c=i-e,h=(a-e)*aI/c,u=Number(h)/Number(aI)+l/Number(c);return r+u*(o-r)}function lI(...t){let e,i;for(const n of t)for(const s of n.domain)(e===void 0||s<e)&&(e=s),(i===void 0||s>i)&&(i=s);return e!=null&&i!=null?{domain:[e,i],animatable:!0}:{domain:[],animatable:!1}}var cE=1e3,cI=20;function hI(t,e=0,i=t.length-1){const n=i-e+1;if(!Number.isFinite(n)||n<2)return{isUniform:!1};if(e<0||i>=t.length)return{isUniform:!1};const s=Array.from({length:cI},(l,c)=>e+Math.floor(c*(n-1)/(cI-1))),r=s.map(l=>t[l].valueOf()),o=(r.at(-1)-r[0])/(n-1);if(!Number.isFinite(o)||o===0)return{isUniform:!1};const a=Math.abs(o*.01);for(let l=1;l<r.length;l++){const c=s[l]-s[l-1],h=(r[l]-r[l-1])/c;if(Math.abs(h-o)>a)return{isUniform:!1}}return{isUniform:!0,interval:o}}var Ks=class Xk extends Hn{static is(e){return e instanceof Xk}toDomain(e){return new Date(ds(e))}get reversed(){const{domain:e}=this;return e.length>0&&e[0].valueOf()>e.at(-1).valueOf()}get numericBands(){return this.bands.map(e=>e.valueOf())}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(ds(e)));const{domain:n,reversed:s}=this,r=this.numericBands,o=r.length;if(n.length<=0)return Number.NaN;const a=this.ordinalRange(0),l=this.ordinalRange(o-1);if(o===0)return a;if(i?.clamp===!0){const{range:v}=this;if(e.valueOf()<r[0])return v[0];if(e.valueOf()>r.at(-1))return v[1]}if((i?.alignment??0)!==2){const v=super.convert(e,i);return s?l-(v-a):v}const h=e.valueOf();let u=this.findIndex(e)??0,d;s?(u=Math.min(Math.max(u,1),o-1),d=-1):(u=Math.min(Math.max(u,0),o-2),d=1);const g=r[u],p=r[u+d],f=this.ordinalRange(u),m=this.ordinalRange(u+d),b=(h-g)/(p-g)*(m-f)+f;return s?l-(b-a):b}invert(e,i=!1){this.refresh();const{domain:n}=this;if(n.length<=0)return;const s=this.bands,r=this.getBandCountForUpdate(),o=n[0].valueOf()>n.at(-1).valueOf();let a;return i?a=this.invertNearestIndex(e-this.bandwidth/2):a=nl(0,r-1,c=>this.ordinalRange(c)>=e)??r-1,s[o?r-1-a:a]}getUniformityCache(e){}findIndex(e,i=0,n=!1){if(e==null)return;const s=this.numericBands,r=s.length;if(r===0)return;if(r===1)return 0;const o=e.valueOf();return i===1!==n?nl(0,r-1,l=>s[l]>=o):il(0,r-1,l=>s[l]<=o)}};function uI(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function dI(t,e){const i=uI(t);if(i==null)return!1;const n=Ge.is(e)||Ks.is(e),s=r=>tM(r,n)&&!Number.isNaN(e.convert(r,{clamp:!0}));if(t.type==="range"){const[r,o]=i;return s(r)&&s(o)}else return s(i)}var hE={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},uE={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},dE={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},gE={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},Ho=class extends an{constructor(){super(...arguments),this.padding=5}};x([C],Ho.prototype,"enabled",2),x([C],Ho.prototype,"padding",2),x([C],Ho.prototype,"text",2),x([C],Ho.prototype,"position",2),x([C],Ho.prototype,"rotation",2),x([C],Ho.prototype,"parallel",2);var mi=class extends Fe{constructor(){super(),this.id=xn(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Ho,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.position="top",this.rangeGroup=new se({name:this.id}),this.lineGroup=new se({name:this.id}),this.labelGroup=new se({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new vs),this.crossLineLabel=this.labelGroup.appendChild(new xl),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(t){const{enabled:e,type:i,data:n,scale:s}=this;if(!s||!e||!t||!dI(this,s)||n==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const r=i==="range";r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(t){if(this.data=void 0,!t)return;const{type:e,range:i,value:n,scale:s,clippedRange:r,strokeWidth:o=0}=this;if(!s)return;const a=s.bandwidth??0,l=s.step??0,c=s instanceof Hn?(l-a)/2:0;let[h,u]=Ot(r);h-=a,u+=a;let d,g,p,f;if(e==="line"){const m=a/2;if(d=s.convert(n)+m,g=Number.NaN,p=s.convert(n,{clamp:!0})+m,f=Number.NaN,p>=u||p<=h)return}else if(i){const[m,y]=i,[b,v]=rI(m,y);if(d=s.convert(m,{alignment:b}),g=s.convert(y,{alignment:v}),p=s.convert(m,{clamp:!0,alignment:b}),f=s.convert(y,{clamp:!0,alignment:v}),p>f&&([p,f]=[f,p],[d,g]=[g,d]),p>=u||f<=h)return;Number.isFinite(d)&&(p-=c),Number.isFinite(g)&&(g+=a,f+=a+c)}else return;p=Ha(p,r),f=Ha(f,r),d-c>=p&&(d-=c),g+c<=f&&(g+=c),this.startLine=o>0&&d>=p&&d<=p+c,this.endLine=o>0&&g>=f-a-c&&g<=f,this.data=[p,f],this.label.enabled===!1||this.label.text}updateNodes(){const{position:t,data:[e,i]=[0,0],gridLength:n,gridPadding:s}=this,r=Number.isFinite(i)?i-e:0,o=t==="bottom"||t==="right"?-1:1,a=Math.min(o*s,o*(n+s));let l;switch(t){case"top":case"bottom":l=new $(e,a,r,n);break;case"left":case"right":l=new $(a,e,n,r)}this.updateRangeNode(l);const{label:c}=this;c.enabled!==!1&&c.text&&(this.updateLabel(),this.positionLabel(l))}updateRangeNode(t){const{type:e,position:i,crossLineRange:n,startLine:s,endLine:r,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u}=this;n.x1=t.x,n.x2=t.x+t.width,n.y1=t.y,n.y2=t.y+t.height,n.horizontal=i==="top"||i==="bottom",n.startLine=s,n.endLine=r,n.fill=e==="range"?o:void 0,n.fillOpacity=a??1,n.stroke=l,n.strokeWidth=c??1,n.strokeOpacity=h??1,n.lineDash=u}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fill=e.color,t.text=e.text,t.textAlign="center",t.textBaseline="middle",t.setFont(e),t.setBoxing(e))}get anchor(){const t=this.position==="left"||this.position==="right",e=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return e?(t?dE:gE)[i]:(t?hE:uE)[i]}positionLabel(t){const{crossLineLabel:e,label:{padding:i,rotation:n},anchor:s}=this;e.rotation=ni(n??0);const r=e.getBBox();if(!r)return;const{width:o,height:a}=r,l=typeof i=="number"?0:(i.right??0)-(i.left??0),c=typeof i=="number"?0:(i.bottom??0)-(i.top??0);let h=o/2,u=a/2;typeof i=="number"&&!e.hasBoxing()&&(h+=i,u+=i);const d=t.x+t.width*(s.rangeH+1)/2-h*s.labelH-l/2,g=t.y+t.height*(s.rangeV+1)/2-u*s.labelV-c/2;e.x=d,e.y=g,e.rotationCenterX=d,e.rotationCenterY=g}computeLabelSize(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new xl;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.rotation=ni(t.rotation??0),e.textBaseline="middle",e.textAlign="center";const i=e.getBBox();if(!i)return;const{width:n,height:s}=i;return{width:n,height:s}}calculatePadding(t){const{label:{padding:e},anchor:i}=this,n=this.computeLabelSize();if(!n)return;const{width:s,height:r}=n,o=typeof e=="number"?e*2:(e.left??0)+(e.right??0),a=typeof e=="number"?e*2:(e.top??0)+(e.bottom??0),l=o+s,c=a+r,h=this.position==="left"||this.position==="right";h&&(i.rangeH===-1&&i.labelH===1?t.left=Math.max(t.left??0,l):i.rangeH===1&&i.labelH===-1&&(t.right=Math.max(t.right??0,l))),h||(i.rangeV===-1&&i.labelV===1?t.top=Math.max(t.top??0,c):i.rangeV===1&&i.labelV===-1&&(t.bottom=Math.max(t.bottom??0,c)))}};mi.className="CrossLine",x([C],mi.prototype,"enabled",2),x([C],mi.prototype,"type",2),x([C],mi.prototype,"range",2),x([C],mi.prototype,"value",2),x([C],mi.prototype,"defaultColorRange",2),x([C],mi.prototype,"fill",2),x([C],mi.prototype,"fillOpacity",2),x([C],mi.prototype,"stroke",2),x([C],mi.prototype,"strokeWidth",2),x([C],mi.prototype,"strokeOpacity",2),x([C],mi.prototype,"lineDash",2),x([C],mi.prototype,"label",2);function gI(){return{"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}function gh(t){return t?1:-1}function Qm(t,e,i,n,s,r){const o=t?.formatter,a=t?.format,{type:l,value:c,domain:h,boundSeries:u}=n,d=n.type==="number"?n.fractionDigits:void 0,g=n.type==="date"?n.unit:void 0;let p;if(o!=null){const f=n.type==="date"?n.step:void 0,m=n.type==="number"?n.visibleDomain:void 0;p=i(o,{type:l,value:c,index:s,domain:h,fractionDigits:d,unit:g,step:f,boundSeries:u,visibleDomain:m})}if(a!=null&&p==null){const{specifier:f,dateStyle:m="long",truncateDate:y}=r??{},b=`${m}:${y??"none"}`;let v=e[b];const S=Fr.mergeSpecifiers(f,a);(v?.type!==l||v?.unit!==g||!st(v?.mergedFormat,S))&&(v={type:l,mergedFormat:S,unit:g,formatter:Fr.getFormatter(l,S,g,m,{truncateDate:y})},e[b]=v),p=v.formatter?.(c,d)}return p==null||ue(p)?p:String(p)}var ey=class extends pc{constructor(t){super(),this.rangeGroup=new se({name:"CrossLines-Range"}),this.lineGroup=new se({name:"CrossLines-Line"}),this.labelGroup=new se({name:"CrossLines-Label"}),this.instances=[],this.ctx=t,this.axisCtx=t.parent,this.axisCtx.attachAxisOverlay(this.rangeGroup,"low"),this.axisCtx.attachAxisOverlay(this.lineGroup,"mid"),this.axisCtx.attachAxisOverlay(this.labelGroup,"high")}applyOptions(t){if(!this.optionsEquivalent(t)){this.lastOptions=t;for(const e of this.instances)this.detachInstance(e);if(t==null){this.instances=[];return}this.instances=t.map(e=>{const i=this.ctx.crossLine;return i.set(e),this.attachInstance(i),this.initInstance(i),i})}}onAxisUpdate(){const t=this.axisCtx.hasDefinedDomain()||this.axisCtx.hasVisibleSeries(),{gridPadding:e}=this.axisCtx,i=this.axisCtx.getPolarLayout?.();for(const n of this.instances)n.gridPadding=e,i&&n.applyPolarLayout(i),n.update(t)}onAxisLayout(){const t=this.axisCtx.getPolarLayout?.(),e=this.axisCtx.hasDefinedDomain()||this.axisCtx.hasVisibleSeries(),{reverse:i}=this.axisCtx;if(t){const n=-gh(this.axisCtx.mirrored);for(const s of this.instances){const r=s;r.sideFlag=n,r.parallelFlipRotation=t.parallelFlipRotation,r.regularFlipRotation=t.regularFlipRotation,r.calculateLayout?.(e,i)}}else for(const n of this.instances)n.calculateLayout?.(e,i)}onScaleChange(){const[t,e]=this.axisCtx.range;for(const i of this.instances)i.clippedRange=[t,e]}onGridChange(){for(const t of this.instances)this.initInstance(t)}setVisible(t){this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t}getInstances(){return this.instances}destroy(){for(const t of this.instances)this.detachInstance(t);this.instances=[],this.rangeGroup.remove(),this.lineGroup.remove(),this.labelGroup.remove(),super.destroy()}attachInstance(t){this.rangeGroup.appendChild(t.rangeGroup),this.lineGroup.appendChild(t.lineGroup),this.labelGroup.appendChild(t.labelGroup)}detachInstance(t){t.rangeGroup.remove(),t.lineGroup.remove(),t.labelGroup.remove()}initInstance(t){t.scale=this.axisCtx.scale,t.gridLength=this.axisCtx.gridLength,t.gridPadding=this.axisCtx.gridPadding}optionsEquivalent(t){const e=this.lastOptions;return t===e?!0:t==null||e==null?!1:ps(e,t)==null}};ey.className="CrossLines";var pI={type:"axis:plugin",name:"crossLines",chartType:"cartesian",enterprise:!1,version:Qe,themeTemplate:{$apply:[{enabled:!0,fill:{$if:[{$eq:[{$path:"./type"},"range"]},{$ref:"foregroundColor"},void 0]},fillOpacity:{$if:[{$eq:[{$path:"./type"},"range"]},.08,void 0]},stroke:{$ref:"foregroundColor"},strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]},register:t=>{t.factory("crossLine",()=>new mi)},create:t=>new ey(t)},At=class ao{constructor(e,i,n=!0){this.parentNode=e,this.autoCleanup=n,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=re.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(bs,i)?()=>new i:i}static select(e,i,n=!0){return new ao(e,i,n)}static selectNoInference(e,i,n=!0){return new ao(e,i,n)}static selectAll(e,i){const n=[],s=r=>{if(i(r)&&n.push(r),r instanceof se)for(const o of r.children())s(o)};return s(e),n}static selectByClass(e,...i){return ao.selectAll(e,n=>i.some(s=>n instanceof s))}static selectByTag(e,i){return ao.selectAll(e,n=>n.tag===i)}createNode(e,i,n){const s=this.nodeFactory(e);return s.datum=e,i?.(s),n==null?this._nodes.push(s):this._nodes.splice(n,0,s),this.parentNode.appendChild(s),s}update(e,i,n){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),n&&this._nodesMap.size===0&&this._nodes.length>0)for(const s of this._nodes)this.garbageBin.add(s);if(!n&&this._nodesMap.size>0&&this._nodesMap.clear(),n){const s=new Map,r=new Map;for(let o=0;o<e.length;o++){const a=e[o];let l=n(a);if(s.has(l)){const c=(r.get(l)??0)+1;r.set(l,c),l=`${l}:${c}`}s.set(l,o)}for(const[o,a]of this._nodesMap.entries()){const l=s.get(a);l==null?this.garbageBin.add(o):(o.datum=e[l],this.garbageBin.delete(o),s.delete(a))}for(const[o,a]of s.entries()){const l=e[a];this._nodesMap.set(this.createNode(l,i,a),o)}}else{const s=Math.max(e.length,this.data.length);for(let r=0;r<s;r++)r>=e.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(e[r],i):(this._nodes[r].datum=e[r],this.garbageBin.delete(this._nodes[r]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const e=this;function i(n){return e.garbageBin.has(n)?(e._nodesMap.delete(n),e.garbageBin.delete(n),n.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const e of this._nodesMap.keys())this.garbageBin.add(e);return this._nodesMap.clear(),this}isGarbage(e){return this.garbageBin.has(e)}each(e){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const s of i.entries())e(s[1],s[1].unsafeNonNullDatum,s[0])}),this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const i=this._nodes[e];yield{node:i,datum:i.unsafeNonNullDatum,index:e}}}select(e){return ao.selectAll(this.parentNode,e)}selectByClass(e){return ao.selectByClass(this.parentNode,e)}selectByTag(e){return ao.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}batchedUpdate(e){this.parentNode.batchedUpdate(e)}};function pE({orientation:t,bboxes:e,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:r=0,forceResult:o=!1}){const a=t==="horizontal",l={max:a?n:i,fn:a?d=>d.width:d=>d.height,padding:a?r:s},c={max:a?i:n,fn:a?d=>d.height:d=>d.width,padding:a?s:r};let h=0;const u=[];for(;h<e.length;){const d=e.slice(h),g=fE(d,h,l,c,o);if(!g)return;h+=g.processedBBoxCount,u.push(g.pageIndices)}return yE(u,t,e,s,r)}function fE(t,e,i,n,s){let o=vE(t,i);if(o<1){if(!s)return;o=1}let a=o;for(;a>=1;){const l=mE(t,e,a,i,n,s);if(l==null&&a<=1)return;if(l==null){a--;continue}if(typeof l=="number"){if(l<=1)return;a=l<a&&l>1?l:a,a--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function mE(t,e,i,n,s,r){const o=[];let a=0,l=0,c=[];const h=[];for(let u=0;u<t.length;u++){const d=(u+i)%i;d===0&&(a+=l,l=0,c.length>0&&o.push(c),c=[]);const g=n.fn(t[u])+n.padding;h[d]=Math.max(h[d]??0,g),l=Math.max(l,s.fn(t[u])+s.padding);const p=a+l,f=!r||o.length>0;if(p>s.max&&f){c=[];break}if(h.reduce((y,b)=>y+b,0)>n.max&&!r)return h.length<i?h.length:void 0;c.push(u+e)}return c.length>0&&o.push(c),o.length>0?o:void 0}function yE(t,e,i,n,s){let r=0,o=0;return{pages:t.map(l=>{e==="horizontal"&&(l=bE(l));let c=0;const h=l.map(g=>{const p=g.map(y=>(c=Math.max(y,c),i[y]));let f=0,m=0;for(const y of p)f+=y.height+n,m=Math.max(m,y.width+s);return{indices:g,bboxes:p,columnHeight:Math.ceil(f),columnWidth:Math.ceil(m)}});let u=0,d=0;for(const g of h)u+=g.columnWidth,d=Math.max(d,g.columnHeight);return r=Math.max(u,r),o=Math.max(d,o),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:r,maxPageHeight:o}}function bE(t){const e=[];for(const i of t[0])e.push([]);for(const[i,n]of t.entries())for(const[s,r]of n.entries())e[s][i]=r;return e}function vE(t,e){const i=t.length;let n=0;for(let s=0;s<i;s++)if(n+=e.fn(t[s])+e.padding,n>e.max)return i/s<2?Math.ceil(i/2):s;return i}var fI=(t=>(t[t.Default=64]="Default",t[t.ZoomDrag=32]="ZoomDrag",t[t.Annotations=16]="Annotations",t[t.ContextMenu=8]="ContextMenu",t[t.Animation=4]="Animation",t[t.AnnotationsSelected=2]="AnnotationsSelected",t[t.Frozen=1]="Frozen",t[t.Hoverable=82]="Hoverable",t[t.Clickable=83]="Clickable",t[t.Focusable=69]="Focusable",t[t.Keyable=87]="Keyable",t[t.ContextMenuable=72]="ContextMenuable",t[t.AnnotationsMoveable=18]="AnnotationsMoveable",t[t.AnnotationsDraggable=114]="AnnotationsDraggable",t[t.ZoomDraggable=101]="ZoomDraggable",t[t.ZoomClickable=69]="ZoomClickable",t[t.ZoomWheelable=119]="ZoomWheelable",t[t.All=126]="All",t))(fI||{}),mI=class{constructor(){this.stateQueue=68}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}},ty=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Scrollbar=4]="Scrollbar",t[t.Navigator=5]="Navigator",t[t.Overlay=6]="Overlay",t))(ty||{}),xE=class{constructor(t){this.eventsHub=t,this.elements=new Map}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={width:t,height:e,layoutBox:new $(0,0,t,e),scrollbars:{}};for(const n of Object.values(ty)){if(typeof n!="number")continue;const s=this.elements.get(n);if(s)for(const r of s)r(i)}return i}emitLayoutComplete({width:t,height:e},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:t,height:e},clipSeries:i.clipSeries??!1,series:i.series,layoutBox:i.layoutBox})}};function ph(t,e){const{path:i,size:n}=t,{x:s,y:r}=t;i.clear();let o=!1;for(const[a,l]of e){const c=s+(a-.5)*n,h=r+(l-.5)*n;o?i.lineTo(c,h):i.moveTo(c,h),o=!0}i.closePath()}var SE={circle({path:t,x:e,y:i,size:n}){const s=n/2;t.arc(e,i,s,0,Math.PI*2),t.closePath()},cross(t){ph(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){ph(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:n}){const s=n/4;i=i+s/2,t.arc(e-s,i-s,s,ni(130),ni(330)),t.arc(e+s,i-s,s,ni(220),ni(50)),t.lineTo(e,i+s),t.closePath()},pin({path:t,x:e,y:i,size:n}){t.moveTo(e+(.891-.5)*n,i+(.391-.5)*n),t.cubicCurveTo(e+(.891-.5)*n,i+(.606-.5)*n,e+(.5-.5)*n,i+(1-.5)*n,e+(.5-.5)*n,i+(1-.5)*n),t.cubicCurveTo(e+(.5-.5)*n,i+(1-.5)*n,e+(.109-.5)*n,i+(.606-.5)*n,e+(.109-.5)*n,i+(.391-.5)*n),t.cubicCurveTo(e+(.109-.5)*n,i+(.175-.5)*n,e+(.284-.5)*n,i+(0-.5)*n,e+(.5-.5)*n,i+(0-.5)*n),t.cubicCurveTo(e+(.716-.5)*n,i+(0-.5)*n,e+(.891-.5)*n,i+(.175-.5)*n,e+(.891-.5)*n,i+(.391-.5)*n),t.closePath()},plus(t){ph(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:n}){const s=n/2;t.moveTo(e-s,i-s),t.lineTo(e+s,i-s),t.lineTo(e+s,i+s),t.lineTo(e-s,i+s),t.closePath()},star({path:t,x:e,y:i,size:n}){const r=n/2,o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=e+Math.cos(h)*c,d=i+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},triangle(t){ph(t,[[.5,0],[1,.87],[0,.87]])}},yI=1024,Qd=new Map,bI=new WeakMap;function iy(t,e,i){const n=new Bo,s={path:n,x:0,y:0,size:e,pixelRatio:i};return typeof t=="string"?SE[t](s):t(s),n}function ME(t,e,i=1){if(typeof t=="string"){const n=`${t}:${e}`;let s=Qd.get(n);return s===void 0&&(Qd.size>=yI&&Qd.clear(),s=iy(t,e,1),Qd.set(n,s)),s}if(typeof t=="function"){let n=bI.get(t);n===void 0&&(n=new Map,bI.set(t,n));const s=`${e}:${i}`;let r=n.get(s);return r===void 0&&(n.size>=yI&&n.clear(),r=iy(t,e,i),n.set(s,r)),r}return iy("square",e,i)}var IE=Object.freeze({x:.5,y:1}),DE=Object.freeze({x:.5,y:.5}),fh=new $(0,0,0,0),mh=new $(0,0,0,0),yh=class extends Rt{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}onChangeDetection(t){if(t==="__x"||t==="__y"){this.markDirty(t);return}super.onChangeDetection(t)}isPointInPath(t,e){return this.distanceSquaredLocal(t,e)<=0}isPointInSharedPath(t,e){if(!this._sharedPath?.closedPath)return!1;const i=Mt.anchor(this.shape),n=t-this.x+(i.x-.5)*this.size,s=e-this.y+(i.y-.5)*this.size;return this._sharedPath.isPointInPath(n,s)}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(t,e){return this.distanceSquaredLocal(t,e)}distanceSquaredLocal(t,e){const i=Mt.anchor(this.shape),n=t-this.x+(i.x-.5)*this.size,s=e-this.y+(i.y-.5)*this.size,r=this.size/2;return Math.max(n*n+s*s-r*r,0)}pathComplexity(){return this._sharedPath?.commands.length??0}updatePath(){const{shape:t,size:e}=this;if(t==null||!(e>0)){this._sharedPath=void 0;return}const i=this.layerManager?.canvas?.pixelRatio??1,n=t==="square"?wi(i,e):e;this._sharedPath=ME(t,n,i)}computeBBox(){const{x:t,y:e,size:i}=this,n=Mt.anchor(this.shape);return new $(t-i*n.x,e-i*n.y,i,i)}drawPath(t){if(this._sharedPath===void 0)return;const{shape:e,x:i,y:n,size:s}=this,r=Mt.anchor(e),o=i-(r.x-.5)*s,a=n-(r.y-.5)*s,l=this.layerManager?.canvas?.pixelRatio??1,c=(e==="square"?wi(l,s):s)/2,h=e==="square"?wi(l,o-c)+c:o,u=e==="square"?wi(l,a-c)+c:a,d=super.getBBox();fh.x=d.x-h,fh.y=d.y-u,fh.width=d.width,fh.height=d.height;let g;const p=this.__fillBBox;p&&(mh.x=p.x-h,mh.y=p.y-u,mh.width=p.width,mh.height=p.height,g=mh),t.save(),t.translate(h,u);try{this.fillStroke(t,this._sharedPath.getPath2D(),fh,g)}finally{t.restore()}}svgPathData(t){if(this.updatePathIfDirty(),this._sharedPath===void 0)return"";const{shape:e,x:i,y:n,size:s}=this,r=Mt.anchor(e),o=i-(r.x-.5)*s,a=n-(r.y-.5)*s;return t?this._sharedPath.toSVG((l,c)=>t(l+o,c+a)):this._sharedPath.toSVG((l,c)=>({x:l+o,y:c+a}))}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};x([oh({equals:fl})],yh.prototype,"shape",2),x([Xe()],yh.prototype,"x",2),x([Xe()],yh.prototype,"y",2),x([Xe({convertor:Math.abs})],yh.prototype,"size",2);var Mt=class extends Go(Yd(yl(yh))){static anchor(t){return t==="pin"?IE:typeof t=="function"&&"anchor"in t?t.anchor:DE}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}resetAnimationProperties(t,e,i,n,s,r){const o=this.__size!==i;this.__x=t,this.__y=e,this.__size=i,this.__opacity=n,this.resetScalingProperties(s,r,t,e),o&&(this.dirtyPath=!0),this.markDirty()}setVisibilityAndPosition(t,e,i,n){let s=!1,r=!1;this.__visible!==t&&(this.__visible=t,s=!0),this.__shape!==e&&(this.__shape=e,s=!0,r=!0);const o=Math.abs(i);if(this.__size!==o&&(this.__size=o,s=!0,r=!0),n){const{x:a,y:l}=n;this.__x!==a&&(this.__x=a,s=!0),this.__y!==l&&(this.__y=l,s=!0),this.__scalingCenterX!==a&&(this.__scalingCenterX=a,s=!0),this.__scalingCenterY!==l&&(this.__scalingCenterY=l,s=!0)}s&&(r&&(this.dirtyPath=!0),this.markDirty())}},vI=class{constructor(t,e){this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=xn(this),this.group=new qt({name:"pagination"}),this.labelNode=new Wi,this.nextButton=new Mt,this.previousButton=new Mt,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.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",text:"1 / 0",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode])}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}applyRotations(){const{isRtl:t}=this;switch(this.orientation){case"horizontal":{this.previousButton.rotation=t?Math.PI/2:-Math.PI/2,this.nextButton.rotation=t?-Math.PI/2:Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}update(t){this.lastOpts=t,this.applyRotations(),this.updateLabel(t),this.updatePositions(t),this.enableOrDisableButtons()}updatePositions(t){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(t),this.updateButtonPositions(t)}updateLabelPosition(t){const{size:e,padding:i}=t.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+i.right}updateButtonPositions(t){const i=this.labelNode.getBBox().width+t.marker.size+t.marker.padding.left+t.marker.padding.right;this.isRtl&&this.orientation==="horizontal"?(this.nextButton.translationX=0,this.previousButton.translationX=i):(this.previousButton.translationX=0,this.nextButton.translationX=i)}updateLabel(t){const{isRtl:e,labelNode:i,currentPage:n,totalPages:s}=this,{color:r,fontStyle:o,fontWeight:a,fontSize:l,fontFamily:c}=t.label,h=[n+1,s];e&&h.reverse(),i.text=h.join(" / "),i.fill=r,i.fontStyle=o,i.fontWeight=a,i.fontSize=l,i.fontFamily=c}updateMarkers(t){const{nextButton:e,previousButton:i,nextButtonDisabled:n,previousButtonDisabled:s,highlightActive:r}=this,o=(a,l)=>l?t.inactiveStyle:a===r?t.highlightStyle:t.activeStyle;this.updateMarker(e,t,o("next",n)),this.updateMarker(i,t,o("previous",s))}updateMarker(t,e,i){const{shape:n,size:s}=e.marker;t.shape=n,t.size=s,t.fill=i.fill,t.fillOpacity=i.fillOpacity??1,t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.strokeOpacity=i.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,n=t===e-1,s=t===0;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}setPage(t){t=J(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.lastOpts&&this.updateMarkers(this.lastOpts),this.chartUpdateCallback()}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)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=Oe.toCanvas(this.previousButton),e=Oe.toCanvas(this.nextButton);return{prev:t,next:e}}};vI.className="Pagination";function xI(t,e,i,n){if(sn(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,colorSpace:t.colorSpace??e.colorSpace};if(Us(t)){const s=t.pattern??i.pattern;let r=t.strokeWidth;s==="backward-slanted-lines"||s==="forward-slanted-lines"||s==="horizontal-lines"||s==="vertical-lines"?r??(r=i.strokeWidth):r??(r=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,path:t.path,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:r,rotation:t.rotation??i.rotation,scale:t.scale??i.scale}}return Oo(t)?{type:"image",url:t.url,width:t.width,height:t.height,backgroundFill:t.backgroundFill??n.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??n.backgroundFillOpacity,rotation:t.rotation??n.rotation,repeat:t.repeat??n.repeat,fit:t.fit??n.fit}:t}function ny(t,e,i,n){return!sn(t?.fill)&&!Us(t?.fill)&&!Oo(t?.fill)?t:{...t,fill:xI(t.fill,e,i,n)}}var SI=.1,MI=200,II=12,CE=.5,AE=class{constructor(t){this.agDocument=t,this.events=new Os,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(this.agDocument.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&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,n=Date.now(),s=n-i;this.t0=n;const r=.001,o=Math.trunc(Math.ceil(s/(r*1e3)));let{x:a,y:l,vx:c,vy:h}=this;for(let u=0;u<o;u+=1){const d=a-t,g=l-e,p=-(MI*d+II*c)/SI,f=-(MI*g+II*h)/SI;c+=p*r,h+=f*r,a+=c*r,l+=h*r}Math.hypot(a-t,l-e)<CE?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=a,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}},wE={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},kE={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1};function TE(t){const{elementSize:e,anchorTo:i,placement:n,canvasX:s,canvasY:r,yOffset:o,xOffset:a,offset:l,canvasRect:c}=t,{width:h,height:u}=e,d={width:h,height:u};if(i==="node"||i==="pointer"){const g=wE[n],p=kE[n];return d.top=r+o+u*(p-1)/2+l*p,d.left=s+a+h*(g-1)/2+l*g,d}switch(n){case"top":return d.top=o+l,d.left=c.width/2-h/2+a,d;case"right":return d.top=c.height/2-u/2+o,d.left=c.width-h+a-l,d;case"left":return d.top=c.height/2-u/2+o,d.left=a+l,d;case"bottom":return d.top=c.height-u+o-l,d.left=c.width/2-h/2+a,d;case"top-left":return d.top=o+l,d.left=a+l,d;case"top-right":return d.top=o+l,d.left=c.width-h+a-l,d;case"bottom-right":return d.top=c.height-u+o-l,d.left=c.width-h+a-l,d;case"bottom-left":return d.top=c.height-u+o-l,d.left=a+l,d}return d}var eg=null;function Il(t){const e=je(t);return e===""?"":(eg??(eg=ye("div")),eg.textContent=e,eg.innerHTML.replaceAll(`
`,"<br>"))}var cn=class extends _o{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}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 $(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:n,x2:s,y2:r}=this;return vd(t,e,i,n,s,r,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;let{x1:n,y1:s,x2:r,y2:o}=this;if(n===r){const{strokeWidth:a}=this,l=Math.round(n*i)/i+Math.trunc(a*i)%2/(i*2);n=l,r=l}else if(s===o){const{strokeWidth:a}=this,l=Math.round(s*i)/i+Math.trunc(a*i)%2/(i*2);s=l,o=l}e.beginPath(),e.moveTo(n,s),e.lineTo(r,o),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=pt("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]}}};cn.className="Line",x([H()],cn.prototype,"x1",2),x([H()],cn.prototype,"y1",2),x([H()],cn.prototype,"x2",2),x([H()],cn.prototype,"y2",2);function LE(t,e,i=e*(5/3)){const n=new se,s=Math.min(t.marker.strokeWidth??1,2),r=t.line?.enabled?Math.min(t.line.strokeWidth,2):0,o=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),a=Math.max(t.marker.enabled===!1?0:e,r);if(t.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,u=new cn;u.x1=0,u.y1=a/2,u.x2=o,u.y2=a/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=r,u.lineDash=h,n.append(u)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:g,lineDashOffset:p}=t.marker,f=new Mt;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h??1,f.stroke=u,f.strokeOpacity=d??1,f.strokeWidth=s,f.lineDash=g,f.lineDashOffset=p??0;const m=Mt.anchor(l),y=o/2+(m.x-.5)*e,b=a/2+(m.y-.5)*e,v=e/(e+s);f.x=y,f.y=b,f.scalingCenterX=y,f.scalingCenterY=b,f.scalingX=v,f.scalingY=v,n.append(f)}return se.toSVG(n,o,a)}var Jt="ag-charts-tooltip",NE="ag-charts-tooltip--dark";function Ys(t){return t==null?!1:Array.isArray(t)?t.some(e=>e.type!=="image"&&Ys(e.text)):$e(t).trim()!==""}function $o(t,e=!1){return t==null?!e:typeof t=="number"&&!Number.isFinite(t)}function OE(t){return t.type==="raw"||!t.data||t.data.length===0?!1:t.data.every(e=>e.missing===!0)}function DI(t){const e=[],i=new Map;for(const n of t)if(!OE(n))if(n.type==="structured"){const{heading:s}=n,r=Ys(s)?i.get(s):void 0,o={type:"structured",heading:s,items:[n]};r==null?(i.set(s,o),e.push(o)):r.items.push(n)}else e.push(n);return e}function EE(t){const e=rr().createElement("div");e.innerHTML=t;const i=e.textContent?.trim();return i??(B.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),"")}function RE(t){const e=DI(t),i=[];for(const n of e){if(n.type==="raw"){i.push(EE(n.rawHtmlString));continue}Ys(n.heading)&&i.push(je(n.heading));for(const s of n.items)if(Ys(s.title)&&i.push(je(s.title)),s.data)for(const r of s.data)r.missing!==!0&&i.push(r.label??r.fallbackLabel,je(r.value))}return i.filter(n=>n!=="").join("; ")}function CI(t,e,i){let n="";Ys(t)?(n+=`<span class="${Jt}-label">${Il(t)}</span>`,n+=" ",n+=`<span class="${Jt}-value">${Il(e)}</span>`):n+=`<span class="${Jt}-label">${Il(e)}</span>`;const s=[`${Jt}-row`];return i&&s.push(`${Jt}-row--inline`),n=`<div class="${s.join(" ")}">${n}</div>`,n}function PE(t){let e="";if(t.data?.length&&t.data.every(r=>r.missing===!0))return e;const i=Ys(t.title),n=!i&&t.data?.length===1,s=t.symbol==null?void 0:LE(t.symbol,12);if(s!=null&&(i||t.data?.length)&&(e+=`<span class="${Jt}-symbol">${s}</span>`),i&&(e+=`<span class="${Jt}-title">${Il(t.title)}</span>`,e+=" "),t.data)for(const r of t.data)r.missing!==!0&&(e+=CI(r.label??r.fallbackLabel,je(r.value),n),e+=" ");return e}function AI(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${Jt}-footer">${i}</div>`}function wI(t,e,i,n){const s=e.items.length===1?e.items[0]:void 0;let r,o,a;switch(i){case"compact":r=!0,o=je(s?.title);break;case"single":const h=Ys(e.heading);r=s!=null&&(!h||s.title==null)&&s.data?.length===1&&s.data[0].label==null&&s.data[0].value!=null,a=je(h?e.heading:s?.title);break;case"shared":r=!1}let l="";if(r&&s!=null){if(Ys(o)&&(l+=`<span class="${Jt}-title">${Il(o)}</span>`),s.data)for(const h of s.data)h.missing!==!0&&(l+=CI(h.label??a,je(h.value),!1),l+=" ")}else{Ys(e.heading)&&(l+=`<span class="${Jt}-heading">${Il(je(e.heading))}</span>`,l+=" ");for(const h of e.items)l+=PE(h)}if(l.length===0)return;const c=i!=="compact"&&n!=null?AI(t,n):void 0;return c+null&&(l+=c),l=`<div class="${Jt}-content">${l.trimEnd()}</div>`,l}function FE(t,e){const i=e==null?void 0:AI(t,e);return i==null?"":`<div class="${Jt}-content">${i}</div>`}function VE(t,e,i,n){const s=DI(e);if(s.length!==0){if(s.length===1&&s[0].type==="structured")return wI(t,s[0],i,n);{const r=s.map(o=>o.type==="structured"?wI(t,o,i):o.rawHtmlString);return n!=null&&r.push(FE(t,n)??""),r.join("")}}}var BE=12,_E={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},kI={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},zE={pointer:["top","bottom","left","right"],node:["top","bottom","left","right"],chart:"top-left"},Wo=class extends Fe{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};x([C],Wo.prototype,"xOffset",2),x([C],Wo.prototype,"yOffset",2),x([C],Wo.prototype,"offset",2),x([C],Wo.prototype,"anchorTo",2),x([C],Wo.prototype,"placement",2);var $n=class extends Fe{constructor(t){super(),this.agDocument=t,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Wo,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new it,this.springAnimation=new AE(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",()=>{this.updateTooltipPosition()}))}get interactive(){return this.enableInteraction}setup(t,e){this.domManager=e,this.elementProxy=e.addDeferredProxyChild("tooltip-container",Jt),this.elementProxy.toggleClass(Jt,!0),this.elementProxy.setProperty("position-anchor",e.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener(n=>{this._elementSize=n,this.updateTooltipPosition()});return this.localeManager=t,()=>{e.removeChild("tooltip-container",Jt),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(t){return this.elementProxy?.contains(t)??!1}updateTooltipPosition(){const{elementProxy:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:n,relativeRect:s,meta:r}=i,{x:o,y:a}=this.springAnimation,l=r.position?.anchorTo??"pointer";let c=r.position?.placement??zE[l];Array.isArray(c)||(c=[c]);const h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=r.position?.offset??BE,g=s.x,p=s.y,f=s.width-e.width-1+g,m=s.height-e.height+p;let y=0,b,v,S=!1;do{b=c[y],y+=1;const k=TE({elementSize:e,placement:b,anchorTo:l,canvasX:o,canvasY:a,yOffset:u,xOffset:h,offset:d,canvasRect:n});v=VS(e.width,e.height,s,k),S=!1,kI[b]&1&&(S||(S=v.x<g||v.x>f)),kI[b]&2&&(S||(S=v.y<p||v.y>m))}while(y<c.length&&S);const M=J(g,v.x,f),D=J(p,v.y,m);S||(S=M!==v.x||D!==v.y);const I=l!=="chart"&&!S&&!h&&!u,A=r.showArrow??this.showArrow??I;this.arrowPosition=A?_E[b]:void 0,this.updateClassModifiers(),t.setProperty("translate",`${M}px ${D}px`)}clampAnchorToVisibleChart(t,e,i){const n=this.domManager?.getVisibleChartRect();return n==null?{x:t,y:e}:{x:J(n.left-i.left,t,n.right-i.left),y:J(n.top-i.top,e,n.bottom-i.top)}}show(t,e,i,n,s,r=!1){const{elementProxy:o}=this;if(o!=null&&n!=null&&n.length!==0){const u=VE(this.localeManager,n,this.mode,this.pagination?s:void 0);if(u==null){o.setInnerHTML(""),this.toggle(!1);return}o.setInnerHTML(u)}else if(o==null||o.innerHTML===""){this.toggle(!1);return}const a={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};this.positionParams={canvasRect:e,relativeRect:a,meta:i};const{scaleX:l,scaleY:c}=this.domManager?.getCanvasScale()??{scaleX:1,scaleY:1};switch(i.position?.anchorTo??"pointer"){case"node":{const{x:u,y:d}=this.clampAnchorToVisibleChart((i.nodeCanvasX??i.canvasX)*l,(i.nodeCanvasY??i.canvasY)*c,e);this.springAnimation.update(u,d);break}case"pointer":{const{x:u,y:d}=this.clampAnchorToVisibleChart(i.canvasX*l,i.canvasY*c,e);this.springAnimation.update(u,d);break}case"chart":this.springAnimation.reset()}this.enableInteraction=i.enableInteraction??!1,o.setProperty("pointer-events",this.enableInteraction?"auto":"none"),o.setAttr("aria-hidden",this.enableInteraction?null:"true"),o.setAttr("tabindex",this.enableInteraction?"-1":null),o.setProperty("--top",`${e.top}px`),o.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:t},e){const{interactive:i,interactiveLeave:n,enabled:s,elementProxy:r}=this;if(r==null)return!1;if(n)return!0;const o=i&&s&&this.isVisible()&&ru(t)&&this.contains(t);return o&&(this.interactiveLeave={callback:e,listener:a=>{(a.relatedTarget==null||ru(a.relatedTarget)&&!this.contains(a.relatedTarget))&&this.popInteractiveLeaveCallback()}},r.addEventListener("focusout",this.interactiveLeave.listener),r.addEventListener("mouseout",this.interactiveLeave.listener)),o}popInteractiveLeaveCallback(){const{interactiveLeave:t,elementProxy:e}=this;this.interactiveLeave=void 0,t&&(e&&(e.removeEventListener("focusout",t.listener),e.removeEventListener("mouseout",t.listener)),t.callback())}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.elementProxy?.isConnected&&this._visible!==t&&(this._visible=t,this.elementProxy.togglePopover(t),t?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:t}=this,{enableInteraction:e,arrowPosition:i,mode:n,darkTheme:s,wrapping:r}=this,o=(a,l)=>t.toggleClass(`${Jt}--${a}`,l);o("no-interaction",!e),o("arrow-top",i===1),o("arrow-right",i===3),o("arrow-bottom",i===2),o("arrow-left",i===0),o("compact",n==="compact"),t.toggleClass(NE,s);for(const a of this.wrapTypes)t.toggleClass(`${Jt}--wrap-${a}`,a===r)}};x([C],$n.prototype,"enabled",2),x([C],$n.prototype,"mode",2),x([C],$n.prototype,"showArrow",2),x([C],$n.prototype,"delay",2),x([C],$n.prototype,"range",2),x([C],$n.prototype,"wrapping",2),x([C],$n.prototype,"position",2),x([C],$n.prototype,"pagination",2),x([C],$n.prototype,"darkTheme",2),x([C],$n.prototype,"bounds",2);var GE=class{constructor(t,e){this.ctx=t,this.dirty=!0,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"}}),this.itemDescription=t.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=Kc(),this.itemDescription.textContent=this.getItemAriaDescription(),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(t){const e=t.getElement();return[":hover",":focus-visible"].some(i=>e.matches(i))}initLegendList(t){if(!this.dirty)return;const{itemSelection:e,datumReader:i,itemListener:n}=t,s=e.length;e.each((r,o,a)=>{r.proxyButton?.destroy(),r.proxyButton=this.ctx.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(je(i.getItemLabel(o)),a,s),ariaChecked:!!r.unsafeNonNullDatum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const l=r.proxyButton;l.addListener("click",c=>n.onClick(c.sourceEvent,r.datum,l)),l.addListener("dblclick",c=>n.onDoubleClick(c.sourceEvent,r.datum)),l.addListener("mouseenter",c=>n.onHover(c.sourceEvent,r)),l.addListener("mouseleave",()=>n.onLeave()),l.addListener("contextmenu",c=>n.onContextClick(c,r)),l.addListener("blur",()=>n.onLeave(!0)),l.addListener("focus",c=>this.shouldApplyHoverOnFocus(l)?n.onHover(c.sourceEvent,r,!0):n.onLeave()),l.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.syncItemLabels(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}syncItemLabels({itemSelection:t,datumReader:e}){const i=t.length;t.each(({proxyButton:n},s,r)=>{const o=n?.getElement();if(o!=null){const a=this.getItemAriaText(je(e.getItemLabel(s)),r,i);o.textContent!==a&&(o.textContent=a)}})}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:n}){const s=Oe.toCanvas(e);this.itemList.setBounds(s);const r=Math.max(...t.nodes().map(o=>o.getTextMeasureBBox().height));t.each((o,a)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=Oe.toCanvas(o,o.getTextMeasureBBox()),g=(r-u)/2,p={x:c-s.x,y:h-g-s.y,height:r,width:d},f=n&&l;o.proxyButton.setCursor(a.suppressHighlight?"default":"pointer"),o.proxyButton.setEnabled(f),o.proxyButton.setPointerEvents(f?void 0:"none"),o.proxyButton.setBounds(p),o.proxyButton.setAriaDescribedBy(f?this.itemDescription.id:void 0)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{oldPages:n,newPages:s}=t,r=(n?.length??s.length)>1,o=s.length>1;r!==o&&(o?this.createPaginationButtons(t):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(o?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:n,next:s}=i.computeCSSBounds(),r=$.merge([n,s]);n.x-=r.x,n.y-=r.y,s.x-=r.x,s.y-=r.y,this.paginationGroup.setBounds(r),this.prevButton.setBounds(n),this.nextButton.setBounds(s),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"))}}createPaginationButtons(t){const{ctx:e,pagination:i}=t;this.prevButton||(this.prevButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",n=>this.onPageButton(t,n,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",n=>this.onPageButton(t,n,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0)))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}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,n,s)=>{const[r,o]=[e[n],t[n]];return r.id!==o.id})}onLocaleChanged(t,e){const i=t.length;t.each(({proxyButton:n},s,r)=>{const o=n?.getElement();if(o!=null){const a=je(e.getItemLabel(s));o.textContent=this.getItemAriaText(a,r,i)}}),this.itemDescription.textContent=this.getItemAriaDescription()}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i){return e>=0&&t?(e++,this.ctx.localeManager.t("ariaLabelLegendItem",{label:t,index:e,count:i})):this.ctx.localeManager.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(){return this.ctx.localeManager.t("ariaDescriptionLegendItem")}};function TI(t,{itemId:e,seriesId:i,label:{text:n}},s){const r={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,text:je(n),preventDefault:()=>r.defaultPrevented=!0}};return r}var Sn=class extends qt{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new se({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Wi),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new Mt({zIndex:1})),this.line=this.symbolsGroup.appendChild(new cn({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),$.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i}=this;let n=0,s=0;if(t.visible){const{size:r}=t,o=Mt.anchor(t.shape);n=(o.x-.5)*r+i/2,s=(o.y-.5)*r,t.x=n,t.y=s,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,isRtl:i}=this;this.label.x=i?-e:t+e,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};Sn.className="MarkerLabel",x([Yt("label")],Sn.prototype,"text",2),x([Yt("label")],Sn.prototype,"fontStyle",2),x([Yt("label")],Sn.prototype,"fontWeight",2),x([Yt("label")],Sn.prototype,"fontSize",2),x([Yt("label")],Sn.prototype,"fontFamily",2),x([Yt("label","fill")],Sn.prototype,"color",2),x([md(t=>t.layoutLabel())],Sn.prototype,"spacing",2),x([md(t=>t.layoutLabel())],Sn.prototype,"length",2),x([H()],Sn.prototype,"isCustomMarker",2),x([md(t=>t.layoutLabel())],Sn.prototype,"isRtl",2);function jE(t,e){switch(typeof e.itemId){case"number":return{series:t,itemId:void 0,datum:void 0,datumIndex:e.itemId,legendItemName:e.legendItemName};case"string":return{series:t,itemId:e.itemId,datum:void 0,datumIndex:Number.NaN,legendItemName:e.legendItemName};default:return e.itemId}}var LI=class{constructor(t){this.ctx=t,this.id=xn(this),this.group=new qt({name:"legend",zIndex:16}),this.itemSelection=At.select(this.group,Sn),this.containerNode=this.group.appendChild(new Pt({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this.highlightUpdateToken=0,this._data=[],this.size=[0,0],this._visible=!0,this.cleanup=new it,this.group.visible=!1,this.pagination=new vI(()=>t.eventsHub.emit("chart:request-update",{type:9}),n=>this.updatePageNumber(n)),this.pagination.attachPagination(this.group);const e=t.contextMenuRegistry?.builtins.items;e&&(e["toggle-series-visibility"].action=n=>this.contextToggleVisibility(n),e["toggle-other-series"].action=n=>this.contextToggleOtherSeries(n));let i=this.opts?.enabled;this.cleanup.register(t.chartState.observe(n=>{const s=n("options","legend.enabled");i===!1&&s===!0&&t.legendManager&&t.stateManager.restoreState(t.legendManager),i=s,this.updateGroupVisibility()}),t.eventsHub.on("active:load-memento",n=>this.onActiveLoadMemento(n)),t.chartState.observe(n=>{n("activeItem")?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id)}),t.chartState.observe(n=>{const s=n("legendData");if(s==null)return;const r=Object.values(s).flat();this.data=r.filter(o=>!o.hideInLegend)}),t.layoutManager.registerElement(1,n=>this.positionLegend(n)),t.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>{e&&(delete e["toggle-series-visibility"].action,delete e["toggle-other-series"].action)},()=>this.group.remove()),this.domProxy=new GE(this.ctx,this.id),t.legendManager&&this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){st(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.syncProxyButtonStates(t),this.updateGroupVisibility())}get data(){return this._data}syncProxyButtonStates(t){const e=new Map(t.map(i=>[i.itemId,i.enabled]));this.itemSelection.each(({proxyButton:i},{itemId:n})=>{if(i==null)return;const s=e.get(n);s!=null&&i.setChecked(s)})}set visible(t){this._visible=t,this.ctx.chartState.setValue("legendVisible",t),this.updateGroupVisibility()}get visible(){return this._visible}get opts(){return this.ctx.chartState.getValue("options","legend")}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}updateGroupVisibility(){const t=this.ctx.chartState.getValue("options");if(t===void 0)return;const e=t.legend?.enabled??!1;this.group.visible=e&&this.visible&&this.data.length>0}updateItemSelection(){const t=[...this.data];this.opts.reverseOrder&&t.reverse(),this.itemSelection.update(t)}isInteractive(){const{toggleSeries:t,listeners:{legendItemClick:e,legendItemDoubleClick:i},item:{tooltip:n}}=this.opts,s=n!=null&&n.visible!=="never";return t||i!=null||e!=null||s}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{formatter:e}=this.opts.item.label;if(e){const i=t.datum;return this.cachedCallWithContext(e,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...i&&{datum:i}})}return t.label.text}calcLayout(t,e){const{item:i}=this.opts,{padding:n,label:s,maxWidth:r,label:{maxLength:o=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:h}}=i;this.updateItemSelection();const u=[],d=Zt(s),p=r??t*.8,{markerWidth:f,anyLineEnabled:m}=this.calculateMarkerWidth(),{isRtl:y}=this.ctx.domManager;if(this.itemSelection.each((T,R)=>{T.fontStyle=a,T.fontWeight=l,T.fontSize=c,T.fontFamily=h,T.isRtl=y;const E=this.updateMarkerLabel(T,R,f,m,i),F=R.itemId??R.id,N=this.getItemLabel(R),P=je(N,"<unknown>").replace(lr," ");T.text=this.truncate(P,o,p,E,d,F),u.push(T.getTextMeasureBBox())}),t=Math.max(1,t),e=Math.max(1,e),!Number.isFinite(t))return{};[t,e]=this.updateContainer(t,e);const b=this.size,v=this.oldSize;b[0]=t,b[1]=e,(b[0]!==v[0]||b[1]!==v[1])&&(v[0]=b[0],v[1]=b[1]);const{pages:S,maxPageHeight:M,maxPageWidth:D}=this.updatePagination(u,t,e),I=this.pages;this.pages=S,this.maxPageSize=[D-n.left-n.right,M-n.top-n.bottom];const A=this.pagination.currentPage,k=this.pages[A];return this.pages.length<1||!k?(this.visible=!1,{oldPages:I}):(this.visible=!0,this.updatePositions(A),this.update(),{oldPages:I})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t,e){const i=!e||(t.marker.enabled??!0),n=!!(t.line&&e),s=this.isCustomMarker(i,t.marker.shape);return{markerEnabled:i,lineEnabled:n,isCustomMarker:s}}calcSymbolsLengths(t,e,i,n){const{marker:s,line:r}=n;let o;const{shape:a}=t.marker;if(this.isCustomMarker(e,a)){const h=new Mt;h.shape=a,h.updatePath();const u=h.getBBox();o=Math.max(u.width,u.height)}const l=e?s.size:0,c=i?r.length:0;return{markerLength:l,lineLength:c,customMarkerSize:o}}calculateMarkerWidth(){const{item:t}=this.opts,{showSeriesStroke:e}=t;let i=0,n=!1;return this.itemSelection.each((s,r)=>{const{symbol:o}=r,{lineEnabled:a,markerEnabled:l}=this.calcSymbolsEnabled(o,e),{markerLength:c,lineLength:h,customMarkerSize:u=-1/0}=this.calcSymbolsLengths(o,l,a,t);i=Math.max(i,h,u,c),n||(n=a)}),{markerWidth:i,anyLineEnabled:n}}updateMarkerLabel(t,e,i,n,s){const{marker:r,padding:o,showSeriesStroke:a}=s,{symbol:l}=e;let c=o.left+o.right;const{markerEnabled:h,isCustomMarker:u}=this.calcSymbolsEnabled(l,a);(h||n)&&(c+=r.padding.right+i);const{marker:d,line:g}=t;return d.visible=h,d.visible&&(d.shape=r.shape??l.marker.shape??"square",d.size=r.size,d.setStyleProperties(this.getMarkerStyles(Ue(l)))),g.visible=n,g.visible&&g.setStyleProperties(this.getLineStyles(l)),t.length=i,t.spacing=r.padding.right,t.isCustomMarker=u,c}updateContainer(t,e){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,t-=i.strokeWidth*2+i.padding.left+i.padding.right,e-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[t,e]}truncate(t,e,i,n,s,r){let o=!1;t.length>e&&(t=t.substring(0,e),o=!0);const a=ko(t,s,i-n,o);return as(a)?this.truncatedItems.add(r):this.truncatedItems.delete(r),a}updatePagination(t,e,i){const{item:n,pagination:s,orientation:r}=this.opts,o=Math.min(this.paginationTrackingIndex,t.length),{isRtl:a}=this.ctx.domManager;this.pagination.orientation=r,this.pagination.isRtl=a,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:l,maxPageHeight:c,maxPageWidth:h,paginationBBox:u,paginationVertical:d}=this.calculatePagination(t,e,i,s),g=l.findIndex(D=>D.endIndex>=o);this.pagination.currentPage=J(0,g,Math.max(0,l.length-1));const{marker:p,padding:f}=n,m=8,y=h-f.left-f.right,b=c-f.top-f.bottom;let v=0,S=-u.y-p.size/2;d?(a&&(v=e-u.width+u.x),S+=b+m):a?(v=-u.x,S+=(b-u.height)/2):(v+=-u.x+y+m,S+=(b-u.height)/2),this.paginationItemsOffsetX=a&&!d&&this.pagination.visible?u.width+m:0,this.pagination.translationX=v,this.pagination.translationY=S,this.pagination.update(s),this.pagination.updateMarkers(s);let M=0;return this.itemSelection.each((D,I,A)=>{A>(l[M]?.endIndex??1/0)&&M++,D.pageIndex=M}),{maxPageHeight:c,maxPageWidth:h,pages:l}}calculatePagination(t,e,i,n){const{item:s,maxWidth:r,maxHeight:o,position:a,orientation:l}=this.opts,{padding:c}=s,h=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:u}=Ku(a),d=h.includes(u);this.pagination.update(n),this.pagination.updateMarkers(n);let g=this.pagination.getBBox(),p=new $(0,0,0,0),f=[],m=0,y=0,b=0;const v=M=>M.width===g.width&&M.height===g.height,S=r!==void 0&&o!==void 0;do{if(b++>10){B.warn("unable to find stable legend layout.");break}g=p;const M=pE({orientation:l,bboxes:t,maxWidth:e-(d?0:g.width),maxHeight:i-(d?g.height:0),itemPaddingY:c.top+c.bottom,itemPaddingX:c.left+c.right,forceResult:S});f=M?.pages??[],m=M?.maxPageWidth??0,y=M?.maxPageHeight??0;const D=f.length;if(this.pagination.visible=D>1,this.pagination.totalPages=D,this.pagination.update(n),this.pagination.updateMarkers(n),p=this.pagination.getBBox(),!this.pagination.visible)break}while(!v(p));return{maxPageWidth:m,maxPageHeight:y,pages:f,paginationBBox:p,paginationVertical:d}}updatePositions(t=0){const{opts:{item:{padding:e}},itemSelection:i,pages:n}=this;if(n.length<1||!n[t])return;const{columns:s,startIndex:r,endIndex:o}=n[t];let a=0,l=0;const c=s.length,h=s[0].indices.length,u=this.opts.orientation==="horizontal",d=s[0].bboxes[0].height+e.top+e.bottom,{isRtl:g}=this.ctx.domManager,p=[],f=s.reduce((m,y)=>m+y.columnWidth,0);i.each((m,y,b)=>{if(b<r||b>o){m.visible=!1;return}const v=b-r;let S,M;u?(S=v%c,M=Math.floor(v/c)):(S=Math.floor(v/h),M=v%h),m.visible=!0;const D=s[S];D&&(l=Math.floor(d*M),g?a=Math.floor(f-(p[M]??0)):a=Math.floor(p[M]??0),p[M]=(p[M]??0)+D.columnWidth,m.translationX=a+this.paginationItemsOffsetX,m.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:n,pages:s,opts:{pagination:r}}=this,o=s[t];if(!o)return;const{startIndex:a,endIndex:l}=o;a===0?this.paginationTrackingIndex=0:t===s.length-1?this.paginationTrackingIndex=l:this.paginationTrackingIndex=Math.floor((a+l)/2),this.pagination.update(r),this.pagination.updateMarkers(r),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:n,interactive:this.isInteractive()}),this.ctx.eventsHub.emit("chart:request-update",{type:9})}update(){const{color:t}=this.opts.item.label;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const t=this.opts.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry?.toggle("toggle-series-visibility",t),this.ctx.contextMenuRegistry?.toggle("toggle-other-series",t)}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:n,lineDash:s}=t.line??{},r=Math.min(2,n??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.opts.item.line.strokeWidth??r,lineDash:s}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:n=1,fillOpacity:s=1,strokeWidth:r,lineDash:o,lineDashOffset:a}=t,l=Math.min(2,r??1);return Us(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),Oo(e)&&(e.fit="contain",e.width=void 0,e.height=void 0,e.repeat="no-repeat"),ny({fill:e,stroke:i,strokeOpacity:n,fillOpacity:s,strokeWidth:this.opts.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},of,af,lf)}getContainerStyles(){const{border:t,cornerRadius:e,fill:i,fillOpacity:n,padding:s}=this.opts,{stroke:r,strokeOpacity:o,strokeWidth:a,enabled:l}=t,c=typeof s=="number";return ny({cornerRadius:e,fill:i,fillOpacity:n,padding:{top:c?s:s.top??0,right:c?s:s.right??0,bottom:c?s:s.bottom??0,left:c?s:s.left??0},stroke:r,strokeOpacity:o,strokeWidth:l?a:0},of,af,lf)}computePagedBBox(){const t=se.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[n,s]=this.maxPageSize;t.height=Math.max(s,t.height),t.width=Math.max(n,t.width)}const{strokeWidth:e,padding:i}=this.getContainerStyles();return t.grow(i).grow(e),t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(n=>n.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${JSON.stringify(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),this.clearHighlight()}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum),this.clearHighlight()}onContextClick(t,e){if(this.checkInteractionState())return;const{sourceEvent:i}=t,n=e.unsafeNonNullDatum;this.clearHighlight();const s=this.ctx.contextMenuRegistry?.builtins.items;s&&(s["toggle-series-visibility"].enabled=!(this.opts.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1));const o=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0?"show":"hide";this.ctx.contextMenuRegistry?.toggle("toggle-other-series",o);const{offsetX:a,offsetY:l}=i,{x:c,y:h}=Oe.toCanvasPoint(e,a,l);this.ctx.contextMenuRegistry?.dispatchContext("legend-item",{widgetEvent:t,canvasX:c,canvasY:h},{legendItem:n})}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{opts:{listeners:{legendItemClick:n},preventHidingAll:s,toggleSeries:r},ctx:{chartService:o}}=this;if(!e)return!1;const{legendType:a,seriesId:l,itemId:c,enabled:h,legendItemName:u}=e,d=o.series.find(f=>f.id===l);if(!d)return!1;let g=h;const p=TI("click",e,t);return n&&tn([d.properties,this.ctx.chartService],n,p.apiEvent),p.defaultPrevented||(r&&(g=!h,s&&!g&&this.getVisibleItemCount()<2&&(g=!0),i.setChecked(g),this.ctx.eventsHub.emit("legend:item-click",{legendType:a,series:d,itemId:c,enabled:g,legendItemName:u})),this.updateHighlight(g,e,d),this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1}})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{opts:{listeners:{legendItemDoubleClick:i},toggleSeries:n},ctx:{chartService:s}}=this;if(!e)return!1;const{legendType:r,id:o,itemId:a,seriesId:l}=e,c=s.series.find(u=>u.id===o);if(!c)return!1;const h=TI("dblclick",e,t);if(i&&tn([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(f=>f.getLegendData("category"));let d=0;const g=new Set;for(const f of u)f.enabled&&(d+=1,f.legendItemName!=null&&g.add(f.legendItemName));g.size>0&&(d=g.size);const p=u.find(f=>f.itemId===a&&f.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:r,series:c,itemId:a,numVisibleItems:d,enabled:p?.enabled??!1,legendItemName:p?.legendItemName})}return this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Oe.toCanvas(e).computeCenter():(t.preventDefault(),i=Oe.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}getTooltipContent(t){const e=this.opts.item.tooltip,i=this.truncatedItems.has(t.itemId??t.id),n=e?.text!=null||e?.renderer!=null,s=e?.visible??(n?"always":"auto");if(s!=="never"&&!(s==="auto"&&!i)){if(e?.renderer){const r={seriesId:t.seriesId,itemId:t.itemId??t.id,text:je(t.label.text),visible:t.enabled},o=this.cachedCallWithContext(e.renderer,r);if(o==="")return;if(o!=null)return[{type:"raw",rawHtmlString:$e(o)}]}return e?.text!=null?[{type:"structured",title:e.text}]:[{type:"structured",title:this.getItemLabel(t)}]}}onHover(t,e,i=!1){if(this.checkInteractionState())return;if(!this.opts.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const n=e.datum,s=n?this.ctx.chartService.series.find(o=>o.id===n?.id):void 0,r=n?this.getTooltipContent(n):void 0;if(r){const o=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,o,r)}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(n?.enabled,n,s,void 0,i),this.ctx.eventsHub.emit("legend:item-hover",null)}onLeave(t=!1){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight(t))}clearHighlight(t=!1){this.updateHighlight(void 0,void 0,void 0,void 0,t)}updateHighlight(t,e,i,n,s=!1){if(this.checkInteractionState())return;const r=h=>{if(h===void 0)return this.ctx.activeManager.clear();{const u=h.nodeDatum.series.id,d=h.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:u,itemId:d},void 0)}},o=h=>{r(h)||this.ctx.highlightManager.updateHighlight(this.id,h?.nodeDatum)},a=h=>{const u=++this.highlightUpdateToken;this.ctx.interactionManager.isState(64)||n?.initialState?o(h):this.ctx.interactionManager.isState(4)?s?o(h):this.ctx.animationManager.onBatchStop(()=>{u===this.highlightUpdateToken&&o(h)}):h===void 0&&o(h)},l=t===!0&&i!==void 0&&e!==void 0,c=e?.suppressHighlight===!0;if(l&&!c){const h=e.itemId,u=jE(i,e);a({itemId:h,nodeDatum:u})}else a(void 0)}onActiveLoadMemento(t){const{activeItem:e}=t;if(e?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id);const i=this.data.find(s=>s.seriesId===e.seriesId&&s.itemId===e.itemId),n=this.ctx.chartService.series.find(s=>s.id===e.seriesId);if(n===void 0)B.warn(`Cannot find seriesId: "${e.seriesId}"`),t.reject();else if(i===void 0){const s=JSON.stringify({seriesId:e.seriesId,itemId:e.itemId});B.warn(`cannot find legend item: ${s}`),t.reject()}else this.updateHighlight(i.enabled,i,n,t)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.itemSelection,this)}positionLegend(t){if(this.opts==null)return;const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){const{enabled:e,position:i,spacing:n}=this.opts;if(!e||!this.data.length)return;const{placement:s,floating:r,xOffset:o,yOffset:a}=Ku(i),l=r?new $(0,0,t.width,t.height):t.layoutBox,{x:c,y:h,width:u,height:d}=l,[g,p]=this.calculateLegendDimensions(l),{oldPages:f}=this.calcLayout(g,p),m=this.computePagedBBox();if(this.visible){let b=function(M){};var y=b;let v,S;switch(s){case"top":v=(u-m.width)/2,S=0;break;case"bottom":v=(u-m.width)/2,S=d-m.height;break;case"right":v=u-m.width,S=(d-m.height)/2;break;case"left":v=0,S=(d-m.height)/2;break;case"top-right":case"right-top":v=u-m.width,S=0;break;case"top-left":case"left-top":v=0,S=0;break;case"bottom-right":case"right-bottom":v=u-m.width,S=d-m.height;break;case"bottom-left":case"left-bottom":v=0,S=d-m.height;break;default:b(s)}if(!r){let M,D;switch(s){case"top":case"top-right":case"top-left":M=m.height+n,D="top";break;case"bottom":case"bottom-right":case"bottom-left":M=m.height+n,D="bottom";break;case"left":case"left-top":case"left-bottom":M=m.width+n,D="left";break;case"right":case"right-top":case"right-bottom":M=m.width+n,D="right";break;default:b(s)}l.shrink(M,D)}v+=o,S+=a,this.group.translationX=Math.floor(c+v-m.x),this.group.translationY=Math.floor(h+S-m.y),this.containerNode.x=m.x,this.containerNode.y=m.y,this.containerNode.width=m.width,this.containerNode.height=m.height}return f}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:n,pages:s,group:r}=this,o=this.visible&&this.opts.enabled,a=this.isInteractive();this.domProxy.update({visible:o,interactive:a,ctx:e,itemSelection:i,group:r,pagination:n,oldPages:t,newPages:s,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,{maxWidth:n,maxHeight:s,position:r}=this.opts,{placement:o}=Ku(r),a=e/i,l=.5,c=.2,h=.25;let u,d;function g(p){}switch(o){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const p=a<1?Math.min(l,c*(1/a)):c;u=n?Math.min(n,e):e,d=s?Math.min(s,i):Math.round(i*p);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const p=a>1?Math.min(l,h*a):h;u=n?Math.min(n,e):Math.round(e*p),d=s?Math.min(s,i):i;break}default:}return[u,d]}cachedCallWithContext(t,e){const{callbackCache:i,chartService:n,chartState:s}=this.ctx,r={context:s.getValue("options","context")};return i.call([r,n],t,e)}};LI.className="Legend";var HE=class{constructor(t){this.mementoOriginatorKey="legend",this.chartState=t.chartState}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:n})=>({visible:t,seriesId:e,itemId:i,legendItemName:n}))}guardMemento(t){return t==null||ue(t)}restoreMemento(t,e,i){if(i)for(const n of i){const{seriesId:s,data:r}=this.getRestoredData(n)??{};!s||!r||this.updateData(s,r)}}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:n,visible:s}=t;if(e){const o=(this.legendDataRecord[e]??[]).map(a=>{const l=a.seriesId===e&&(!i||a.itemId===i);return l&&a.isFixed&&this.warnFixed(a.seriesId,a.itemId),!a.isFixed&&l?{...a,enabled:s}:a});return{seriesId:e,data:o}}if(!(i==null&&n==null))for(const r of this.getData()){if(i!=null&&r.itemId!==i||n!=null&&r.legendItemName!==n)continue;if(r.isFixed){this.warnFixed(r.seriesId,i);return}const o=(this.legendDataRecord[r.seriesId]??[]).map(a=>a.itemId===i||a.legendItemName===n?{...a,enabled:s}:a);return{seriesId:r.seriesId,data:o}}}warnFixed(t,e){B.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}get legendDataRecord(){return this.chartState.getValue("legendData")??{}}updateData(t,e=[]){this.chartState.setValue("legendData",{...this.legendDataRecord,[t]:e})}clearData(){this.chartState.setValue("legendData",{})}toggleItem(t,e,i,n){if(n){const a=this.legendDataRecord;for(const l of this.getData()){const c=(a[l.seriesId]??[]).map(h=>h.legendItemName===n?{...h,enabled:t}:h);this.updateData(l.seriesId,c)}return}const s=this.getData(e),r=s.length===1,o=s.map(a=>i==null&&r||a.itemId===i?{...a,enabled:t}:a);this.updateData(e,o)}getData(t){const e=this.legendDataRecord;return t?e[t]??[]:Object.values(e).flat()}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}},sy={type:"plugin",name:"legend",version:Qe,options:{enabled:L,position:ku,orientation:V("horizontal","vertical"),maxWidth:w,maxHeight:w,spacing:w,border:po,cornerRadius:G,padding:Ut,fill:Xi,fillOpacity:X,preventHidingAll:L,reverseOrder:L,toggleSeries:L,item:{marker:{size:w,shape:dr,padding:Ut,strokeWidth:w},line:{length:w,strokeWidth:w},label:{maxLength:w,formatter:Pe,...we},tooltip:{visible:V("auto","always","never"),text:O,renderer:Pe},maxWidth:w,padding:Ut,showSeriesStroke:L},pagination:{marker:{size:w,shape:dr,padding:Ut},activeStyle:{...W,..._},inactiveStyle:{...W,..._},highlightStyle:{...W,..._},label:we},listeners:{legendItemClick:Pe,legendItemDoubleClick:Pe}},themeTemplate:{...z0,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"left-top"]},{$eq:[{$path:"./position"},"left-bottom"]},{$eq:[{$path:"./position"},"right"]},{$eq:[{$path:"./position"},"right-top"]},{$eq:[{$path:"./position"},"right-bottom"]},{$eq:[{$path:"./position/placement"},"left"]},{$eq:[{$path:"./position/placement"},"left-top"]},{$eq:[{$path:"./position/placement"},"left-bottom"]},{$eq:[{$path:"./position/placement"},"right"]},{$eq:[{$path:"./position/placement"},"right-top"]},{$eq:[{$path:"./position/placement"},"right-bottom"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{padding:{$applyPadding:{top:4,right:8,bottom:4,left:8}},marker:{size:15,padding:{$applyPadding:8}},line:{length:25},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:br.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{shape:"triangle",size:12,padding:{$applyPadding:8}},activeStyle:{fill:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1},inactiveStyle:{fill:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1},highlightStyle:{fill:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1},label:{color:{$ref:"textColor"},fontSize:{$rem:br.SMALL},fontFamily:{$ref:"fontFamily"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:t=>{const e=new LI(t);return e.attachLegend(t.scene),e},register:t=>{t.has("legendManager")||t.service("legendManager",e=>new HE(e))}},$E=class extends pc{constructor(t){super(),this.cleanup.register(t.chartState.observe(e=>{t.localeManager.setLocaleText(e("options","locale.localeText"))}),t.chartState.observe(e=>{t.localeManager.setLocaleTextFormatter(e("options","locale.getLocaleText"))}))}},ry={type:"plugin",name:"locale",version:Qe,options:{localeText:hr,getLocaleText:ti(O)},create:t=>new $E(t)},Dl={enabled:L,text:O,padding:Ut,border:po,cornerRadius:G,...we,...W},NI={enabled:L,..._,...U},bh={...NI,fill:K,fillOpacity:X},tg={...Dl,positionAngle:G};function Ss(t,e){const i={...NI,label:e};return Pa({line:{value:Z(t),...i},range:{range:Z(Se(ne(t),En(2,2))),fill:K,fillOpacity:X,...i}},"cross-line options")}var Uo={...Dl,position:V("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:G},WE=Ss(he,Uo),Vr={enabled:L,rotation:G,avoidCollisions:L,minSpacing:w,spacing:w,formatter:ti(yn),itemStyler:Ae({...we,...mn,spacing:G}),...we,...mn},ig={autoRotate:L,autoRotateAngle:G,wrapping:go,truncate:L,...Vr},OI={format:Fn,...ig},ng={format:te(O,hr),...ig},EI={enabled:L,width:w,size:w,stroke:K},oy={enabled:L,label:ng,tick:EI},RI={values:ne(he),minSpacing:w},Cl={reverse:L,gridLine:{enabled:L,width:w,style:ct({fill:K,fillOpacity:w,stroke:te(K,Vs),strokeWidth:w,lineDash:ne(w)},"a grid-line style object array")},interval:RI,label:Vr,line:{enabled:L,width:w,stroke:K},tick:EI,context:()=>!0};Cl.layoutConstraints=Q({stacked:Z(L),align:Z(V("start","end")),unit:Z(V("percent","px")),width:Z(w)});var ay={enabled:L,text:yn,spacing:w,maxWidth:w,maxHeight:w,wrapping:V("never","always","hyphenate","on-space"),truncate:L,formatter:ti(yn),...we},Br={...Cl,title:ay,crossAt:{value:Z(te(G,Ct,O,ne(O))),sticky:L},crossLines:ct(WE,"a cross-line options array"),position:V("top","right","bottom","left"),thickness:w,maxThicknessRatio:X};Br.title._enabledFromTheme=Q(L);var sg={enabled:L,...W,..._,...U};function Ko(t,e){const i={enabled:L,xOffset:G,yOffset:G,formatter:ti(O),renderer:ti(te(O,G,Ct,Re({text:O,color:K,backgroundColor:K,opacity:X},"crosshair label renderer result object")))};let n;return t&&(n={...i,format:e?te(O,Re({millisecond:O,second:O,hour:O,day:O,month:O,year:O})):O}),{enabled:L,snap:L,label:n??i,..._,...U}}function vh(t,e){return{min:Se(t,Si("max")),max:Se(t,Mi("min")),preferredMin:Se(t,Si("preferredMax"),Si("max")),preferredMax:Se(t,Mi("preferredMin"),Mi("min")),nice:L,interval:{step:e?te(Fs,za,kc):qx,values:ne(t),minSpacing:Se(w,Si("maxSpacing")),maxSpacing:Se(w,Mi("minSpacing"))}}}var PI={step:te(Fs,za,kc),values:ne(te(G,Ct)),minSpacing:Se(w,Si("maxSpacing")),maxSpacing:Se(w,Mi("minSpacing")),placement:V("on","between")},Al={...Br,type:_e("category"),label:ig,paddingInner:X,paddingOuter:X,groupPaddingInner:X,crosshair:Ko(),bandAlignment:V("justify","start","center","end"),bandHighlight:sg,interval:{...RI,placement:V("on","between")},skipNullBars:L},wl={...Br,type:_e("grouped-category"),label:ig,crosshair:Ko(),bandHighlight:sg,paddingInner:X,groupPaddingInner:X,depthOptions:ct({label:{enabled:L,avoidCollisions:L,wrapping:V("never","always","hyphenate","on-space"),truncate:L,rotation:G,spacing:G,...we,...mn},tick:{enabled:L,stroke:K,width:w}},"depth options objects array")},kl={...Br,...vh(Ne),type:_e("number"),label:OI,crosshair:Ko(!0),crossLines:ct(Ss(Ne,Uo),"a cross-line options array")},Tl={...Br,...vh(Ne),type:_e("log"),base:Se(Fs,be(t=>t!==1,"not equal to 1")),label:OI,crosshair:Ko(!0),crossLines:ct(Ss(Ne,Uo),"a cross-line options array")},Ll={...Br,...vh(te(G,Ct),!0),type:_e("time"),label:ng,parentLevel:oy,crosshair:Ko(!0,!0),crossLines:ct(Ss(te(Ne,Ct),Uo),"a cross-line options array")},Nl={...Br,type:_e("unit-time"),unit:te(kc,za),label:ng,parentLevel:oy,paddingInner:X,paddingOuter:X,groupPaddingInner:X,crosshair:Ko(!0,!0),bandAlignment:V("justify","start","center","end"),bandHighlight:sg,skipNullBars:L,min:Se(te(G,Ct),Si("max")),max:Se(te(G,Ct),Mi("min")),preferredMin:Se(te(G,Ct),Si("preferredMax"),Si("max")),preferredMax:Se(te(G,Ct),Mi("preferredMin"),Mi("min")),interval:PI,crossLines:ct(Ss(te(Ne,Ct),Uo),"a cross-line options array")},Yo=class qk extends Hn{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(e){return e instanceof qk}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let i;const n=new Set;let s=!0;for(const r of e){const o=r.domain;n.has(o)||(n.add(o),i==null?i=FI(o):(s&&(s=UE(o,i)),i=FI([...i,...o])))}return i??(i=[]),{domain:i,animatable:s}}toDomain(e){}invert(e,i=!1){this.refresh();const n=i?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,e-n));return i||e===this.ordinalRange(s)?this.domain[s]:void 0}invertWithPercentage(e){this.refresh();const i=this.invertNearestIndex(e,"left"),n=this.domain[i];if(n==null)return;const s=this.bandwidth===0?this.step:this.bandwidth,r=this.convert(n),o=s===0?0:(e-r)/s;return{value:n,groupPercentage:o}}ticks(e,i=this.domain,n){const{bands:s}=this;let{tickCount:r}=e;if(r===0){const f=s.length>1?1:0;return{ticks:s[f]?[s[f]]:[],count:void 0,firstTickIndex:f}}let o=r!=null&&r!==0?Math.trunc(s.length/r):1;if(o=gf(o),o<=1)return PM(i,!1,n);r=Math.trunc(s.length/o);const a=o*r,l=gf(Math.trunc((s.length-a)/2)),c=J(0,Math.floor((n?.[0]??0)*s.length),s.length),h=J(0,Math.ceil((n?.[1]??1)*s.length),s.length),u=Math.floor((c-l)/o)*o+l,d=Math.ceil((h-l)/o)*o+l,g=[];for(let f=u;f<d;f+=o)f>=0&&f<s.length&&g.push(s[f]);let p=g.length>0?this.findIndex(g[0]):void 0;return p!=null&&(p=Math.floor((p-l)/o)),{ticks:g,count:void 0,firstTickIndex:p}}findIndex(e){const{index:i,indexInitialized:n}=this;if(!n){const{domain:s}=this;for(let r=0;r<s.length;r++)i.set(ii(s[r]),r);this.indexInitialized=!0}return i.get(ii(e))}};function FI(t){let e;const i=new Set;for(const n of t){const s=ii(n),r=i.size;i.add(s),i.size!==r?e?.push(n):e??(e=t.slice(0,i.size))}return e??t}function UE(t,e){let i=-1;for(const n of t){const s=e.indexOf(n);if(s===-1)i=1/0;else{if(s<=i)return!1;i=s}}return!0}var VI={};Ri(VI,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Wn,fromToMotion:()=>wt,staticFromToMotion:()=>Zs});function KE(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function BI(t,e){if(typeof t=="string")try{t=De.fromString(t)}catch{t=De.fromArray([0,0,0])}if(typeof e=="string")try{e=De.fromString(e)}catch{e=De.fromArray([0,0,0])}return i=>De.mix(t,e,i).toRgbaString()}var ly=.2,xh=["initial","remove","update","add","trailing","end","none"],Sh={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:ly,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+ly,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function YE(t){return t.every(e=>e instanceof bs)}function cy(t){return YE(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function hy(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,n)=>hy(i,e[n])):Kd(t)&&Kd(e)?t.equals(e):Le(t)&&Le(e)?qp(t,e,hy):!1}var ZE=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??IM,this.phase=t.phase;const e=t.duration??Sh[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 hy(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 n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(n-e)):0}get delta(){return this.ease(J(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||Kd(e))return this.interpolateValue(t,e);if(Array.isArray(e)){const n=[];for(let s=0;s<e.length;s++){const r=this.createInterpolator(t[s],e[s]);r!=null&&n.push(r)}return s=>{const r=[];for(const o of n)r.push(o(s));return r}}const i=[];for(const n of Object.keys(e)){const s=this.createInterpolator(t[n],e[n]);s!=null&&i.push([n,s])}return n=>{const s={};for(const[r,o]of i)s[r]=o(n);return s}}interpolateValue(t,e){if(!(t==null||e==null)){if(Kd(t))return i=>t[Ud](e,i);try{switch(typeof t){case"number":return KE(t,e);case"string":return BI(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t;default:throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},Wn={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function wt(t,e,i,n,s,r,o){const{fromFn:a,toFn:l,applyFn:c=(p,f)=>p.setProperties(f)}=s,{nodes:h,selections:u}=cy(n),d=(p,f)=>{let m,y=0,b=0;for(const v of f){const S=p[y]===v,M={last:b>=f.length-1,lastLive:y>=p.length-1,prev:f[b-1],prevFromProps:m,prevLive:p[y-1],next:f[b+1],nextLive:p[y+(S?1:0)]},D=`${t}_${e}_${v.id}`;i.stopByAnimationId(D);let I="unknown";S?r&&o&&(I=XE(v,v.unsafeDatum,r,o)):I="removed",v.transitionOut=I==="removed";const{phase:A,start:k,finish:T,delay:R,duration:E,...F}=a(v,v.unsafeDatum,I,M),{phase:N,start:P,finish:z,delay:Y,duration:j,...ie}=l(v,v.unsafeDatum,I,M),ge=T==null;i.animate({id:D,groupId:t,phase:A??N??"update",duration:E??j,delay:R??Y,from:F,to:ie,ease:rh,collapsable:ge,onPlay:()=>{const ae={...k,...P,...F};c(v,ae,"start")},onUpdate(ae){c(v,ae,"update")},onStop:()=>{const ae={...k,...P,...F,...ie,...T,...z};c(v,ae,"end")}}),S&&y++,b++,m=F}};let g=0;for(const p of u){const f=p.nodes(),m=f.filter(y=>!p.isGarbage(y));d(m,f),i.animate({id:`${t}_${e}_selection_${g}`,groupId:t,phase:"end",from:0,to:1,ease:rh,onStop(){p.cleanup()}}),g++}d(h,h)}function Zs(t,e,i,n,s,r,o){const{nodes:a,selections:l}=cy(n),{start:c,finish:h,phase:u}=o;i.animate({id:`${t}_${e}`,groupId:t,phase:u??"update",from:s,to:r,ease:rh,onPlay:()=>{if(!c)return;const d=Object.keys(c);for(const g of a)g.setPropertiesWithKeys(c,d);for(const g of l){const p=g.nodes();g.batchedUpdate(function(){for(const m of p)m.setPropertiesWithKeys(c,d)})}},onUpdate(d){const g=Object.keys(d);for(const p of a)p.setPropertiesWithKeys(d,g);for(const p of l){const f=p.nodes();p.batchedUpdate(function(){for(const y of f)y.setPropertiesWithKeys(d,g)})}},onStop:()=>{const d={...r,...h},g=Object.keys(d);for(const p of a)p.setPropertiesWithKeys(d,g);for(const p of l){const f=p.nodes();p.batchedUpdate(function(){for(const y of f)y.setPropertiesWithKeys(d,g);p.cleanup()})}}})}function XE(t,e,i,n){const s=i(t,e);return n.added.has(s)?"added":n.removed.has(s)?"removed":t.previousDatum==null&&t.datum!=null?"added":t.previousDatum!=null&&t.datum==null?"removed":"updated"}var _I={};Ri(_I,{resetMotion:()=>Qt});function Qt(t,e){const{nodes:i,selections:n}=cy(t);for(const s of n){const r=s.nodes();s.batchedUpdate(function(){for(const a of r){const l=e(a,a.unsafeDatum);a.setProperties(l)}s.cleanup()})}for(const s of i){const r=e(s,s.unsafeDatum);s.setProperties(r)}}var rg=class extends Fe{};x([C],rg.prototype,"visible",2),x([C],rg.prototype,"text",2),x([C],rg.prototype,"renderer",2);var It=class extends Fe{constructor(){super(...arguments),this.id=xn(this),this.node=new qm({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,this.padding=0,this.layoutStyle="block",this.tooltip=new rg,this.truncated=!1}registerInteraction(t,e){return t.eventsHub.on("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:n,wrapping:s,truncate:r}=this,o=r?t:1/0,a=r?e:1/0,l=Math.min(this.maxWidth??1/0,o)-n*2,c=this.maxHeight??a-n*2,h={maxWidth:l,maxHeight:c,font:this,textWrap:s};if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=i;return}let u;ue(i)?(u=Ld(i,h),this.truncated=u.some(Mc)):(u=dm($e(i),h),this.truncated=as(u)),this.node.text=u}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(!this.enabled||!this.text){this.destroyProxyText();return}const n=Oe.toCanvas(this.node);if(!n)return;const{id:s}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:s,where:e}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",a=>this.handleMouseMove(t,a)),this.proxyText.addListener("mouseleave",()=>this.handleTooltipHide(t)),this.proxyText.addListener("focus",()=>this.handleFocus(t)),this.proxyText.addListener("blur",()=>this.handleTooltipHide(t))]);const r=je(this.text);r!==this.lastProxyTextContent&&(this.proxyText.textContent=r,this.lastProxyTextContent=r);const{lastProxyBBox:o}=this;(n.x!==o?.x||n.y!==o?.y||n.width!==o?.width||n.height!==o?.height)&&(this.proxyText.setBounds(n),this.lastProxyBBox={x:n.x,y:n.y,width:n.width,height:n.height})}getEffectiveTooltipVisible(){const{visible:t,text:e,renderer:i}=this.tooltip;return t??(e!=null||i!=null?"always":"auto")}getTooltipContent(t){const e=je(this.text),{renderer:i,text:n}=this.tooltip;if(i!=null){const r={text:e},o=tn(t.chartService,i,r);if(o==="")return;if(o!=null)return{type:"raw",rawHtmlString:$e(o)}}return{type:"structured",title:n??e}}showTooltip(t,e,i){if(!this.enabled)return;const n=this.getEffectiveTooltipVisible();if(n==="never"||n==="auto"&&!this.truncated)return;const s=this.getTooltipContent(t);s!=null&&t.tooltipManager.updateTooltip(this.id,{canvasX:e,canvasY:i,showArrow:!1},[s])}handleMouseMove(t,e){if(e==null)return;const{x:i,y:n}=Oe.toCanvas(this.node),s=e.sourceEvent.offsetX+i,r=e.sourceEvent.offsetY+n;this.showTooltip(t,s,r)}handleFocus(t){const e=Oe.toCanvas(this.node);if(!e)return;const i=e.x+e.width/2,n=e.y+e.height/2;this.showTooltip(t,i,n)}handleTooltipHide(t){t.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const t of this.proxyTextListeners??[])t();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};It.className="Caption",x([C,Yt("node","visible")],It.prototype,"enabled",2),x([C,Yt("node")],It.prototype,"text",2),x([C,Yt("node")],It.prototype,"textAlign",2),x([C,Yt("node")],It.prototype,"fontStyle",2),x([C,Yt("node")],It.prototype,"fontWeight",2),x([C,Yt("node")],It.prototype,"fontSize",2),x([C,Yt("node")],It.prototype,"fontFamily",2),x([C,Yt("node","fill")],It.prototype,"color",2),x([C],It.prototype,"spacing",2),x([C],It.prototype,"maxWidth",2),x([C],It.prototype,"maxHeight",2),x([C],It.prototype,"wrapping",2),x([C],It.prototype,"truncate",2),x([C],It.prototype,"padding",2),x([C],It.prototype,"layoutStyle",2),x([C],It.prototype,"tooltip",2);var uy=class{constructor(){this.moduleMap=new Map,this._version=0}get version(){return this._version}modules(){return this.moduleMap.values()}addModule(t,e){if(this.moduleMap.has(t))throw new Error(`AG Charts - module already initialised: ${t}`);this.moduleMap.set(t,e),this._version++}removeModule(t){this.moduleMap.has(t)&&(this.moduleMap.get(t)?.destroy?.(),this.moduleMap.delete(t),this._version++)}getModule(t){return this.moduleMap.get(t)}isEnabled(t){return this.moduleMap.has(t)}mapModules(t){return Array.from(this.moduleMap.values(),t)}destroy(){for(const t of this.moduleMap.values())t?.destroy?.();this.moduleMap.clear()}},zI=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(zI||{});function qE(t){const[e,i]=Ot(t.range),n=Math.floor(e),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}var dy=Math.PI*2,JE=dy/2;function QE(t,e){return Math.abs(e-t)<JE?e:t>e?e+dy:e-dy}function eR(t){const{min:e,max:i}=t,n=l=>l<e||l>i;return{tick:{fromFn(l,c,h){let{x1:u,x2:d,y1:g,y2:p}=l,f=l.opacity;return(h==="added"||n(c.offset))&&({x1:u,x2:d,y1:g,y2:p}=c,f=0),{x1:u,x2:d,y1:g,y2:p,opacity:f,phase:Wn[h]}},toFn(l,c,h){const{x1:u,x2:d,y1:g,y2:p}=c;let f=1;return h==="removed"&&(f=0),{x1:u,x2:d,y1:g,y2:p,opacity:f}},applyFn(l,c){l.setProperties(c),l.visible=!n(l.y)}},line:{fromFn(l,c){const{x1:h,x2:u,y1:d,y2:g}=l.unsafePreviousDatum??c;return{x1:h,x2:u,y1:d,y2:g,phase:Wn.updated}},toFn(l,c){const{x1:h,x2:u,y1:d,y2:g}=c;return{x1:h,x2:u,y1:d,y2:g}}},label:{fromFn(l,c,h){const u=l.previousDatum??c;let{x:d,y:g,rotationCenterX:p,rotationCenterY:f,rotation:m}=u,y=l.opacity;return h==="removed"||n(u.y)?m=c.rotation:(h==="added"||n(l.unsafeDatum.y))&&({x:d,y:g,rotationCenterX:p,rotationCenterY:f,rotation:m}=c,y=0),{x:d,y:g,rotationCenterX:p,rotationCenterY:f,rotation:m,opacity:y,phase:Wn[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:g,rotationCenterY:p}=c;let f=0,m=1;return h==="added"?f=c.rotation:h==="removed"?(m=0,f=c.rotation):f=QE(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:g,rotationCenterY:p,rotation:f,opacity:m,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:Wn.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function tR(){return(t,e)=>({translationX:e.translationX,translationY:e.translationY})}function og(){return(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})}function GI(){return(t,e)=>{const{x1:i,x2:n,y1:s,y2:r}=e;return{x1:i,x2:n,y1:s,y2:r}}}function iR(){return(t,e)=>{const{x1:i,x2:n,y1:s,y2:r}=e;return{x:i,y:s,width:n-i,height:r-s}}}var jI=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(jI||{});function HI(t,e){return t.domain===e.domain&&t.rangeExtent===e.rangeExtent&&t.nice[0]===e.nice[0]&&t.nice[1]===e.nice[1]&&t.gridLength===e.gridLength&&t.visibleRange[0]===e.visibleRange[0]&&t.visibleRange[1]===e.visibleRange[1]&&t.scrollbarKey===e.scrollbarKey&&t.initialPrimaryTickCount?.unzoomed===e.initialPrimaryTickCount?.unzoomed&&t.initialPrimaryTickCount?.zoomed===e.initialPrimaryTickCount?.zoomed}function $I(t,e,i){const n=t.bandwidth??0,r=((t.step??0)-n)/2,o=t.convert(i),a=o-r,l=o+n+r;return[o,Ha(a,e),Ha(l,e)]}var WI=class Jk{constructor(e,i,n,s){this.moduleCtx=e,this.scale=n,this.id="unknown",this.nice=!0,this.mirrored=!1,this.parallel=!1,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.caption=new It,this._gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this._layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new se({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new bl({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new bl({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new se({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new qt({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new se({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new se({name:`${this.id}-gridLines`})),this.overlayLowGroup=new bl({name:`${this.id}-Overlay-Low`,zIndex:6}),this.overlayMidGroup=new bl({name:`${this.id}-Overlay-Mid`,zIndex:10}),this.overlayHighGroup=new bl({name:`${this.id}-Overlay-High`,zIndex:15}),this.tickLabelGroupSelection=At.select(this.tickLabelGroup,xl,!1),this.formatterCache=gI(),this.defaultTickMinSpacing=Jk.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:5,format:void 0},labelThickness:0},this.axisContext=void 0,this.cleanup=new it,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new mS(()=>{const{direction:o,boundSeries:a}=this;return Ji(a.flatMap(l=>l.getFormatterContext(o)))}),this.moduleMap=new uy,this.id=i,this.options=s;const r=s.context;r!==void 0&&(this.context=r),this.syncOptionDerivedState(s),this.range=this.scale.range.slice(),this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",o=>this.onMouseMove(o)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}get gridLength(){return this._gridLength}set gridLength(e){const i=this._gridLength;this._gridLength=e,i!==e&&this.onGridLengthChange(e,i)}get type(){return this.constructor.type??""}get layoutConstraints(){return this._layoutConstraints}get requiredRange(){return this._requiredRange}set requiredRange(e){this._requiredRange=e}get primaryLabel(){}get primaryTick(){}getLabelFormat(){}getPrimaryLabelFormat(){}isCategoryLike(){return!1}applyOptions(e){this.options=e,this.syncOptionDerivedState(e),this.invalidateLayoutCache()}syncOptionDerivedState(e){this.nice=e.nice??!0;const i=e.layoutConstraints;i&&(this._layoutConstraints={...this._layoutConstraints,...i})}resetAnimation(e){}onMouseMove(e){const n=this.tickLabelGroup.pickNode(e.currentX,e.currentY)?.unsafeDatum,{textUntruncated:s=void 0}=n??{};s?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:e.currentX,canvasY:e.currentY,showArrow:!1},[{type:"structured",title:s}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}destroy(){this.moduleMap.destroy(),this.moduleContext?.destroy(),this.cleanup.flush()}setScaleRange(e){const{range:i,scale:n}=this,s=(i[1]-i[0])/(e[1]-e[0]),r=s*e[0],o=i[0]-r;n.range=[o,o+s]}updateScale(){this.setScaleRange(this.visibleRange),this.notifyAxisPlugins("onScaleChange")}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.overlayLowNode.appendChild(this.overlayLowGroup),e.overlayMidNode.appendChild(this.overlayMidGroup),e.overlayHighNode.appendChild(this.overlayHighGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.overlayLowGroup.remove(),this.overlayMidGroup.remove(),this.overlayHighGroup.remove()}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[n,s]=Ot(this.range);return e>=n-i&&e<=s+i}getRangeOverflow(e){const{range:i,visibleRange:n}=this,s=(i[1]-i[0])/(n[1]-n[0]),[r,o]=Ot([i[0]-s*n[0],i[0]-s*n[0]+s]);return e<r?e-r:e>o?e-o:0}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.notifyAxisPlugins("onGridChange")}onGridVisibilityChange(){}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.options.gridLine.enabled,this.updateLabels(),this.notifyAxisPlugins("onAxisUpdate")}getLabelStyles(e,i,n=this.options.label){const s={border:n.border,color:n.color,cornerRadius:n.cornerRadius,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,padding:n.padding,spacing:n.spacing};let r;n.itemStyler&&(r=this.cachedCallWithContext(n.itemStyler,{...e,...s}));const o=de(r,i,s);return{border:o.border,color:o.color,cornerRadius:o.cornerRadius,fill:o.fill,fillOpacity:o.fillOpacity,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,padding:o.padding,spacing:o.spacing}}getTickSize(e=this.options.tick){return e.enabled?e.size:0}getTickSpacing(e=this.options.tick){if(!e.enabled)return 0;const i=this.chartLayout?.scrollbars?.[this.id];return!i?.enabled||i.placement!=="inner"?0:i.tickSpacing??0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:e,boundSeries:i,direction:n}=this,r=(e?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(n));this.setDomains(...r)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...e){let i,n;if(e.length>0){const s=this.scale.normalizeDomains(...e);i={domain:s.domain,sortMetadata:{sortOrder:1}},n=s.animatable}else i={domain:[]},n=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(s){return s==null}),this.options.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=n}calculateDomain(e,i="none"){const{dataDomain:{domain:n},range:s,scale:r,gridLength:o}=this,a=bo(s),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let u;if(h==null||!HI(h,{domain:n,rangeExtent:a,nice:c,gridLength:o,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i})){const d=r.range;this.setScaleRange([0,1]);const g=c.map(p=>p?0:2);u=this.calculateTickLayout(n,g,[0,1],e),r.range=d,this.unzoomedTickLayoutCache={domain:n,rangeExtent:a,nice:c,gridLength:o,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i,tickLayout:u}}else u=h.tickLayout;return this.updateScale(),r.domain=u.niceDomain,{unzoomedTickLayout:u,domain:r.domain}}calculateLayout(e,i){this.chartLayout=i;const n=this.getScrollbarLayoutCacheKey(i),{visibleRange:s}=this,r=s[0]===0&&s[1]===1,{unzoomedTickLayout:o,domain:a}=this.calculateDomain(e,n),l=this.getDomainExtentsNice();let c;if(r)c=o;else{const{range:f,gridLength:m}=this,y=bo(f),b=l.map(S=>S?1:2),{tickLayoutCache:v}=this;v==null||!HI(v,{domain:a,rangeExtent:y,nice:l,gridLength:m,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:n})?(c=this.calculateTickLayout(a,b,s,e),this.tickLayoutCache={domain:a,rangeExtent:y,nice:l,gridLength:m,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:n,tickLayout:c}):c=v.tickLayout}const{rawTickCount:h=0,fractionDigits:u,bbox:d}=c,g=o.rawTickCount??0,p=h!==0&&g!==0?{zoomed:h,unzoomed:g}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:u,spacing:this.options.label.spacing,format:this.getLabelFormat()},this.notifyAxisPlugins("onAxisLayout"),{primaryTickCount:p,bbox:d}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(e){const i=e?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updatePosition(){const{gridGroup:e,overlayLowGroup:i,overlayMidGroup:n,overlayHighGroup:s,translation:r}=this,o=Math.floor(r.x),a=Math.floor(r.y);e.setProperties({translationX:o,translationY:a}),i.setProperties({translationX:o,translationY:a}),n.setProperties({translationX:o,translationY:a}),s.setProperties({translationX:o,translationY:a})}getOverlayGroup(e){return e==="low"?this.overlayLowGroup:e==="mid"?this.overlayMidGroup:this.overlayHighGroup}notifyAxisPlugins(e){for(const i of this.moduleMap.modules())i[e]?.()}tickFormatter(e,i,n,s,r,o="long"){const{moduleCtx:a}=this,l=this.options.label,{formatManager:c}=a,h=n?this.primaryLabel:void 0,u=this.tickFormatParams(e,i,s,r),d=this.formatterBoundSeries.get();let g,p,f;if(u.type==="number")g=u.fractionDigits;else if(u.type==="date"){const{unit:A,step:k,epoch:T}=u;p={unit:A,step:k,epoch:T},f=u.truncateDate}const m=this.uncachedCallWithContext.bind(this),y={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:e,boundSeries:d},b=h??l,v=this.getLabelFormat(),S=n?v:void 0,{allowNull:M}=this,D={specifier:Fr.mergeSpecifiers(this.getPrimaryLabelFormat(),v),truncateDate:f,allowNull:M},I=this.formatterCache;return(A,k)=>{const T=this.datumFormatParams(A,y,g,p,o);return T.value=A,Qm(b,I,m,T,k,{specifier:S,dateStyle:o,truncateDate:f})??c.format(m,T,D)??c.defaultFormat(T,D)}}formatDatum(e,i,n,s,r,o,a,l,c,h,u){if(i==null&&!u)return"";const{moduleCtx:d,dataDomain:g}=this;l??(l=g.domain);const{formatManager:p}=d,f=this.formatterBoundSeries.get();let m;switch(n){case"crosshair":case"annotation-label":m=this.layout.label.fractionDigits+1;break;case"series-label":m=2;break;case"tooltip":m=3;break;case"legend-label":m=void 0;break}const y=this.datumFormatParams(i,{source:n,datum:o,seriesId:s,legendItemName:r,key:a,property:this.getFormatterProperty(),domain:l,boundSeries:f},m,void 0,"long"),{type:b,value:v}=y,S=this.createCallWithContext(e),M=c?.formatValue(S,b,v,h??y)??p.format(S,y,{allowNull:u})??Qm(this.options.label,this.formatterCache,S,y,Number.NaN)??p.defaultFormat(y);return ue(M)?M:String(M)}getBBox(){return this.axisGroup.getBBox()}hasVisibleSeries(){return this.boundSeries.some(e=>e.isEnabled())}clipTickLines(e,i,n,s){this.tickLineGroup.setClipRect(new $(e,i,n,s))}clipGrid(e,i,n,s){this.gridGroup.setClipRect(new $(e,i,n,s))}getFormatterProperty(){const{direction:e,boundSeries:i}=this;let n=e;for(const s of i){const r=s.resolveKeyDirection(e);if(r!==e){n=r;break}}return n}getTitleFormatterParams(e){const{direction:i}=this,n=this.formatterBoundSeries.get(),s=this.options.title;return{domain:e,direction:i,boundSeries:n,defaultValue:s?.text}}normaliseDataDomain(e){return{domain:[...e.domain],clipped:!1}}getLayoutTranslation(){return this.translation}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),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}getUpdateTypeOnResize(){return 5}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),this.moduleContext??(this.moduleContext=this.moduleCtx.child().constant("parent",this.axisContext)),this.moduleContext}createAxisContext(){const e=this,{scale:i}=this;return{axisId:this.id,axisType:this.type,scale:this.scale,direction:this.direction,continuous:Ge.is(i)||Ks.is(i),get mirrored(){return e.mirrored},get reverse(){return e.options.reverse},get gridLength(){return e.gridLength},get gridPadding(){return e.gridPadding},get range(){return e.range},hasDefinedDomain:()=>this.hasDefinedDomain(),hasVisibleSeries:()=>this.hasVisibleSeries(),getCanvasBounds:()=>Oe.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((n,s)=>{const r=s.getKeyProperties(this.direction);for(const o of r)n.add(o);return n},new Set),seriesIds:()=>this.boundSeries.map(n=>n.id),scaleInvert:n=>i.invert(n,!0),formatScaleValue:(n,s,r)=>{const{allowNull:o}=this;return this.formatDatum(void 0,n,s,void 0,void 0,void 0,void 0,void 0,r,void 0,o)},attachLabel:n=>this.attachLabel(n),attachAxisOverlay:(n,s)=>this.getOverlayGroup(s).appendChild(n),inRange:(n,s)=>this.inRange(n,s),getRangeOverflow:n=>this.getRangeOverflow(n),pickBand:n=>this.pickBand(n),measureBand:n=>this.measureBand(n)}}pickBand(e){if(!Hn.is(this.scale))return;const{scale:i,range:n,id:s}=this,r=i.invert(this.isVertical()?e.y:e.x,!0),[o,a,l]=$I(i,n,r);return{id:s,value:r,band:[a,l],position:o}}measureBand(e){if(!Hn.is(this.scale))return;const[,i,n]=$I(this.scale,this.range,e);return{band:[i,n]}}isVertical(){return this.direction==="y"}isReversed(){return this.options.reverse}cachedCallWithContext(e,i){const{callbackCache:n,chartService:s}=this.moduleCtx;return n.call([this,s],e,i)}uncachedCallWithContext(e,i){const{chartService:n}=this.moduleCtx;return tn([this,n],e,i)}createCallWithContext(e){const{chartService:i}=this.moduleCtx;return(n,s)=>tn([e,this,i],n,s)}};WI.defaultTickMinSpacing=50;var gy=WI,ag=new Date(1970,0,4),Ol=class Qk extends Ge{constructor(){super([],[0,1]),this.type="time"}static is(e){return e instanceof Qk}toDomain(e){return new Date(e)}convert(e,i){return super.convert(e==null?Number.NaN:ds(e),i)}invert(e){return new Date(super.invert(e))}niceDomain(e,i=this.domain){if(i.length<2)return[];let[n,s]=i;const r=4,o=this.getPixelRange();for(let a=0;a<r;a++){const[l,c]=sR(n,s,e,o);if(ii(n)===ii(l)&&ii(s)===ii(c))break;n=l,s=c}return[n,s]}ticks(e,i=this.domain,n=[0,1],{extend:s=!1}={}){const{nice:r,interval:o,tickCount:a=Ge.defaultTickCount,minTickCount:l,maxTickCount:c}=e;if(i.length<2)return;const h=i.map(ii),u=h[0],d=h.at(-1);if(o!=null){const m=this.getPixelRange();return{ticks:UI({start:u,stop:d,interval:o,availableRange:m,visibleRange:n,extend:s})??nR({start:u,stop:d,tickCount:a,minTickCount:l,maxTickCount:c,visibleRange:n,extend:s}),count:void 0}}else{if(r.every(Boolean)&&a===2)return{ticks:i,count:void 0};if(r.every(Boolean)&&a===1)return{ticks:i.slice(0,1),count:void 0}}const g=eh(u,d,a,l,c,{weekStart:ag});if(g==null)return;const p=zn(g,new Date(u),new Date(d),{visibleRange:n,extend:s}),f=q0(g,new Date(u),new Date(d),{visibleRange:n,extend:s});return{ticks:p,count:void 0,firstTickIndex:f,timeInterval:g}}};function nR({start:t,stop:e,tickCount:i,minTickCount:n,maxTickCount:s,visibleRange:r,extend:o}){const a=eh(t,e,i,n,s,{weekStart:ag});return a?zn(a,new Date(t),new Date(e),{visibleRange:r,extend:o}):[]}function UI({start:t,stop:e,interval:i,availableRange:n,visibleRange:s,extend:r}){if(!i)return[];if(typeof i!="number"){const u=zn(i,new Date(t),new Date(e),{visibleRange:s,extend:r});return ul(u.length,n)?void 0:u}const o=Math.abs(i);if(ul(Math.abs(e-t)/o,n))return;const a=Ed.findLast(u=>o%u.duration===0);if(a){const{timeInterval:u,step:d,duration:g}=a,p={...u,step:d*Ir(u)*Math.round(o/g),epoch:mm(u,{weekStart:ag})};return zn(p,new Date(t),new Date(e),{visibleRange:s,extend:r})}let l=new Date(Math.min(t,e));const c=new Date(Math.max(t,e)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return h}function sR(t,e,i,n){const{interval:s}=i,r=Math.min(ii(t),ii(e)),o=Math.max(ii(t),ii(e));let a;if(s!=null&&typeof s!="number")a=s;else{let u;typeof s=="number"&&(u=(o-r)/Math.max(s,1),ul(u,n)&&(u=void 0)),u??(u=i.tickCount??Ge.defaultTickCount),a=eh(r,o,u,i.minTickCount,i.maxTickCount,{weekStart:ag})}if(a==null)return[t,e];const l=zn(a,new Date(r),new Date(o),{extend:!0});if(l==null||l.length<2)return[t,e];const c=l[0],h=l.at(-1);return t<=e?[c,h]:[h,c]}var rR=1e3,_r=class eT extends Ks{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Ge.defaultTickCount,this._domain=[],this.isReversed=!1}static is(e){return e instanceof eT}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._uniformityCacheVisibleStart=void 0,this._uniformityCacheVisibleEnd=void 0,this._uniformityCacheVisible=void 0,this.isReversed=KI(e))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map(e=>e.valueOf())),this._numericBands}getUniformityCache(e){const{bands:i}=this,n=i.length;if(!e||e[0]===0&&e[1]===1)return n>rR&&this._uniformityCache===void 0&&(this._uniformityCache=hI(i)),this._uniformityCache;const s=Math.floor(e[0]*n),r=Math.min(Math.ceil(e[1]*n),n-1);if(this._uniformityCacheVisible!==void 0&&this._uniformityCacheVisibleStart===s&&this._uniformityCacheVisibleEnd===r)return this._uniformityCacheVisible;const o=hI(i,s,r);return this._uniformityCacheVisibleStart=s,this._uniformityCacheVisibleEnd=r,this._uniformityCacheVisible=o,o}normalizeDomains(...e){const i=e.filter(r=>r.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const n=i[0].domain,s=i.every(r=>r.domain===n);if(i.length===1||s){const r=i[0];let o=r.domain,a,l=!1;return r.sortMetadata?.sortOrder===void 0?a=Zf(o):(a=r.sortMetadata.sortOrder,l=r.sortMetadata.isUnique??!1),a===-1?o=o.slice().reverse():a==null&&(o=l?o.slice().sort((c,h)=>c.valueOf()-h.valueOf()):Yf(o.slice())),{domain:o,animatable:!0}}return{domain:Yf(i.map(r=>r.domain).flat()),animatable:!0}}ticks(e,i,n=[0,1],{extend:s=!1,dropInitial:r=!1}={}){const{interval:o,maxTickCount:a,tickCount:l=a}=e,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(n=[1-n[1],1-n[0]]),this.refresh(),o==null){const{ticks:v,tickOffset:S,tickEvery:M}=this.getDefaultTicks(i,l,n,s);let D=v.length>0?this.findIndex(v[0]):void 0;return D=D==null?void 0:Math.floor((D-S)/M),{ticks:v,count:void 0,firstTickIndex:D}}let u,d;i&&i.length>=2?(u=i[0].valueOf(),d=i.at(-1).valueOf()):(u=c[0].valueOf(),d=c.at(-1).valueOf());const[g,p]=this.range,f=Math.abs(p-g),m=UI({start:u,stop:d,interval:o,availableRange:f,visibleRange:n,extend:s})??this.getDefaultTicks(i,l,n,s).ticks,y=[];let b=-1;for(const v of m){const S=this.findIndex(v,1)??-1,M=S===b;b=S,!(r&&S===0)&&S!==-1&&!M&&y.push(c[S])}return{ticks:y,count:void 0,firstTickIndex:void 0}}stepTicks(e,i,n=[0,1],s=!0){const r=i?this.bandDomainIndices(i):void 0,o=this.ticksEvery(r,n,e,0,!1),a=o.at(-1),l=s&&e>1?r?.[1]:void 0,c=l!=null&&a!=null?this.findIndex(a):void 0;return c!=null&&l!=null&&l-c<e&&o.pop(),o}bandCount(e=[0,1]){const{domain:i}=this,n=Math.floor(e[0]*i.length);return Math.ceil(e[1]*i.length)-n}getDefaultTicks(e,i,n,s){const{bands:r}=this,o=Math.ceil(r.length/i),a=Math.floor(o/2),l=e?this.bandDomainIndices(e):void 0;return{ticks:this.ticksEvery(l,n,o,a,s),tickOffset:a,tickEvery:o}}bandDomainIndices(e){const i=KI(e),n=this.findIndex(e[i?e.length-1:0],1)??0,s=this.findIndex(e[i?0:e.length-1],1)??this.bands.length-1;return[n,s]}ticksEvery([e,i]=[0,this.bands.length],n,s,r,o){const{bands:a}=this,l=e,c=i-e+1;let h=l+Math.floor(n[0]*c),u=l+Math.ceil(n[1]*c);o&&(h-=s,u+=s),h=Math.max(h,0),u=Math.min(u,a.length);let d;if(s<=1)d=a.slice(h,u);else{d=[];for(let g=h;g<u;g+=1)(g-l+r)%s===0&&d.push(a[g])}return d}};function KI(t){return t.length>0&&t[0]>t.at(-1)}var oR=1e3,YI=5e7,zr=class tT extends Ks{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(e){return e instanceof tT}static supportsInterval(e,i){return aR(e,i)}set domain(e){if(e===this._domain)return;const i=e.length===this._domain.length&&e.length>=2&&e[0].valueOf()===this._domain[0].valueOf()&&e[1].valueOf()===this._domain[1].valueOf();this._domain=e,i||this.invalidateCaches()}get domain(){return this._domain}get interval(){return this._interval}set interval(e){const i=e==null?void 0:vf(e);this._interval?.unit===i?.unit&&this._interval?.step===i?.step||(this._interval=i,this.invalidateCaches())}invalidateCaches(){this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._bands=this._encodedBands.map(i=>X0(i,e))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._numericBands=this._encodedBands.map(i=>Mr(i,e))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:e,interval:i}=this;if(e.length<2||i==null){this._encodedBands=[];return}const n=this.getCachedBandRange();if(n==null){this._encodedBands=[];return}const[s,r]=n,o={visibleRange:[0,1],extend:!1};if(yf(i,s,r,o)>YI){B.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:a,encodingParams:l}=Z0(i,s,r,o);this._encodedBands=a,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(e){const i=this.getBandCountForUpdate();if(!e||e[0]===0&&e[1]===1){if(i>oR&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=Mr(this._encodedBands[0],this._encodingParams),s=Mr(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:s-n}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=Mr(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:Mr(this._encodedBands[1],this._encodingParams)-n}}return{isUniform:!1}}normalizeDomains(...e){return lI(...e)}getCachedBandRange(){const{domain:e,interval:i}=this;if(!(e.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:_i(i,e[0]),stop:_i(i,e[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:e}=this;if(e!=null){if(this._domainBoundaries===void 0){const i=this.getCachedBandRange();if(i==null)return;const[n,s]=i,r=Math.min(n.valueOf(),s.valueOf()),o=Math.max(n.valueOf(),s.valueOf()),a=ff(e,new Date(o)).valueOf();this._domainBoundaries={d0:r,dNext:a}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const e=Mr(this._encodedBands[0],this._encodingParams),i=Mr(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:e,intervalMs:i-e}}return this._linearParams}isLinearUnit(){const e=this._encodingParams?.unit;return e==="millisecond"||e==="second"||e==="minute"||e==="hour"}findIndex(e,i=0){if(e==null)return;const n=this.getBandCountForUpdate();if(n===0)return;if(n===1)return 0;const s=this.getLinearParams();if(s==null||s.intervalMs===0)return super.findIndex(e,i);const{firstBandTime:r,intervalMs:o}=s,a=e.valueOf(),l=(a-r)/o;let c=i===1?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,n-1)),this.isLinearUnit()){if(i===1){if(r+c*o<a&&c===n-1)return}else if(r+c*o>a&&c===0)return;return c}const h=this.numericBands;if(i===1){for(;c>0&&h[c-1]>=a;)c--;for(;c<n-1&&h[c]<a;)c++;if(h[c]<a)return}else{for(;c<n-1&&h[c+1]<=a;)c++;for(;c>0&&h[c]>a;)c--;if(h[c]>a)return}return c}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(ds(e)));const{domain:n,interval:s}=this;if(n.length<2)return Number.NaN;if(i?.clamp!==!0&&s!=null){const r=this.getDomainBoundaries();if(r!=null){const o=e.valueOf();if(o<r.d0||o>=r.dNext)return super.convert(e,{...i,alignment:2})}}return super.convert(e,i)}ticks({interval:e},i=this.domain,n=[0,1]){const s=this.numericBands;if(s.length===0||i.length<2)return;const r=Math.min(i[0].valueOf(),i[1].valueOf()),o=Math.max(i[0].valueOf(),i[1].valueOf()),[a,l]=this.visibleBandRange(r,o,n);if(e==null)return{ticks:s.slice(a,l).map(u=>new Date(u)),count:void 0,firstTickIndex:a};const c=this.intervalCandidates(e,i,n),h=this.snapCandidatesToBands(c,s,a,l);return{ticks:h.map(u=>new Date(u)),count:h.length,firstTickIndex:a}}visibleBandRange(e,i,n){const s=this.numericBands,r=s.length;if(r===0)return[0,0];const o=i-e,a=e+n[0]*o,l=e+n[1]*o,c=il(0,r-1,u=>s[u]<=a)??0,h=(nl(0,r-1,u=>s[u]>=l)??r-1)+1;return[c,h]}intervalCandidates(e,i,n){return typeof e!="number"?zn(e,i[0],i[1],{extend:!0,visibleRange:n}).map(s=>s.valueOf()):this.numericBands}snapCandidatesToBands(e,i,n,s){const r=this.interval?zi(this.interval):1/0,o=[];let a=-1;for(const l of e){if(l<i[n]||l>i[s-1]+r)continue;const c=il(n,s-1,h=>i[h]<=l);c!=null&&c!==a&&l-i[c]<=r&&(o.push(i[c]),a=c)}return o}};function aR(t,e,i){const n=_i(e,t[0]),s=_i(e,t[1]);return yf(e,n,s,i)<=YI}function lR(t,e,i,n,s){let[r,o]=Ot(e.map(Number));const a=Math.floor(i.unzoomed);if(a<=1){const[S,M]=hR(r,o),D=5*Math.pow(2,-Math.ceil(Math.log2(s[1]-s[0]))),{ticks:I}=hl(S,M,D,void 0,void 0,s),A=[t.toDomain(S),t.toDomain(M)];return n&&A.reverse(),{domain:A,ticks:I}}if(r===o){const S=Math.floor(Math.log10(r)),M=Math.pow(10,S),D=Math.min(M,1),I=a-1;r-=D*Math.floor(I/2),o=r+D*I}let l=r,c=o;l=uR(l,c,a);const h=gR(l,c,a),u=a-1;c=l+u*h;const d=Math.floor(l/h)*h,g=Math.floor(c/h)*h;d<=r&&g>=o&&(l=d,c=g);const p=[t.toDomain(l),t.toDomain(c)];n&&p.reverse();const f=Math.max(1,Math.floor(i.zoomed)-1),m=cR(f/u),y=h/m,b=Math.min(u*m+1,Math.floor(i.zoomed)),v=dR(l,y,b);return{domain:p,ticks:v}}function cR(t){if(t<=1)return 1;const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),n=t/i;return n>=5?5*i:n>=2?2*i:i}function hR(t,e){let i=t,n=e,s=0;do{[i,n]=xm(i,n);const{ticks:r}=hl(i,n,5);if(r.length%2===1)return[i,n];i-=1,n+=1}while(s++<10);return[t,e]}function uR(t,e,i){t=Math.floor(t);const n=Math.abs(e-t)/(i-1),s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return Math.floor(t/r)*r}function dR(t,e,i){const n=du(e),s=Math.pow(10,n),r=[];for(let o=0;o<i;o++){const a=t+e*o;r.push(Math.round(a*s)/s)}return r}function gR(t,e,i){const n=i-1,s=(e-t)/n;return pR(s)}function pR(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),n=t/i;return n>0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:t}var fR=18,mR=[1,2,3,4,6,8,9,10,12];function ZI(t,e=0){const i=[];for(const n of t){const{x:s,y:r,width:o,height:a}=n;if(i.some(l=>yd(l,s,r,o+e,a+e)))return!0;i.push(n)}return!1}function yR(t,e,i,n){if(t==null)return e;if(typeof t!="number"){const a={...vf(t),epoch:e[0]};return zn(a,e[0],e[1],{visibleRange:i,extend:n})}const s=[],r=e[0].valueOf(),o=e[1].valueOf();for(let a=r;a<=o;a+=t)s.push(new Date(a));return s}function XI(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1)if(t[i]?.valueOf()!==e[i]?.valueOf())return!1;return!0}function bR(t){if(t.length<2)return 1/0;let e=0,i=t[0].translation;for(let n=1;n<t.length;n++){const s=t[n].translation,r=Math.abs(s-i);e=Math.max(e,r),i=s}return e}function vR(t,{niceDomain:e,rawTicks:i,rawFirstTickIndex:n=0,generatePrimaryTicks:s,primaryTicksIndices:r,alignment:o,fractionDigits:a,timeInterval:l}){const{scale:c,label:h,tickFormatter:u,inRange:d,isVertical:g,sizeLimit:p=1/0}=t,f=Ol.is(c)||Ks.is(c),m=Zt(h),y=Sm(),b=[];return qI(c,e,()=>{const v=Hn.is(c)&&c.bandwidth||1/0,S=(c.bandwidth??0)/2,M=xR(h.enabled,s,e,i,a,l,u);let D=g?p:v,I=g?v:p;if(h.rotation){const k=jf(h.rotation,D,I);D=k.width,I=k.height}const A={font:h,maxWidth:D,maxHeight:I,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping??"never"};for(let k=0;k<i.length;k++){const T=i[k],R=c.convert(T,{alignment:o})+S;if(d&&!d(R))continue;const E=r?.has(k)??!1,F=M(E,T,k);let N=null;h.avoidCollisions&&(N=kd(F,A)||null,N===La&&(N=null));const P=N??F,z=ue(P),Y=P!==F&&(z?Mc(P.at(-1)):as($e(P)));let j;if(f){const ie=T?.valueOf();Number.isFinite(ie)&&(j=y(`v:${ie}`))}j??(j=y(`l:${z?je(P.flat()):P}`)),b.push({tick:T,tickId:j,tickLabel:P,isPrimary:E,index:k+n,textUntruncated:Y?je(F):void 0,textMetrics:z?Ws(P,h):m.measureLines($e(P)),translation:Math.floor(R)})}}),b}function qI(t,e,i){const n=t.snapshotDomain();try{t.domain=e,i()}finally{t.restoreDomain(n)}}function xR(t,e,i,n,s,r,o){const a=e?"component":"long",l=e&&r?Bc(r):void 0,c=e?o(i,n,!0,s,l,a):null,h=t?o(i,n,!1,s,r,a):null;return(u,d,g)=>u?c?.(d,g)??String(d):h==null?"":h(d,g)??String(d)}function SR(t,e,i,n,s,r,o,a){if(!Ol.is(t)&&!Ks.is(t))return;const l=Bc(r);if(l==null)return;o&&(e=[1-e[1],1-e[0]]);const c=Math.min(t.domain[0].valueOf(),t.domain.at(-1).valueOf()),h=Math.max(t.domain[0].valueOf(),t.domain.at(-1).valueOf());let[u,d]=mf(new Date(c),new Date(h),e);u=_i(l,u),u.valueOf()>=c&&(u=Y0(l,u)),d=K0(l,d),d.valueOf()<=h&&(d=ff(l,d));const g=zn(l,u,d),p=zi(r),f=_r.is(t),m={...s,interval:r},y=[];let b,v,S,M=0;if(_r.is(t)){const D=zs(r);v=a!=null&&zi(a)>=zi(D)?2:3,S=1;const I=i/n,A=t.bandCount(e)/(I*fR);M=mR.findLast(k=>A>=k)??1}else zr.is(t)&&(t.interval==null||zi(t.interval)>=p)?v=1:(v=0,S=2);for(let D=0;D<g.length-1;D++){const I=g[D],A=g[D+1],k=D===0,T=D===g.length-2,R=A.valueOf()-I.valueOf(),E=[Math.max((c-I.valueOf())/R,0),Math.min((h-I.valueOf())/R,1)];let F;switch(v){case 0:F=yR(m.interval,[I,A],E,!0);break;case 1:{F=t.ticks(m,[I,A],E)?.ticks??[];break}case 3:{F=t.ticks(m,[I,A],E,{extend:!0,dropInitial:!0})?.ticks??[];break}case 2:F=t.stepTicks(M,[I,A],void 0,!T);break}if(ex(F,Y=>Y.valueOf()<I.valueOf()),T||tx(F,Y=>{switch(v){case 0:case 3:return Y.valueOf()+p>A.valueOf();case 1:case 2:return Y.valueOf()>=A.valueOf()}}),F.length===0)continue;const N=F[0],P=Kf(N,I);(v===0?P===0:P<=p)&&(!f||!k)&&(b??(b=new Set),b.add(y.length)),y.push(...F)}return b?.size===1&&b.has(0)&&(b=void 0),{ticks:y,primaryTicksIndices:b,alignment:S}}function MR(t,e,i,n,s){const r=JI(t.format,n);if(r==null)return{width:0,height:0};const o=pl(r),a=n?Bc(n):void 0,l=JI(e?.format,a),c=l?pl(l):o,h=new Date(i[0]),u=new Date(i.at(-1)),d=a?zn(a,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let g=0,p=0;if(o!=null){const f=Ml(t),m=f.left+f.right,y=f.top+f.bottom;let b,v;d!=null&&d.length>1?(b=d[0],v=d[1]):(b=h,v=u);const S=zn(n,b,v,{limit:50});for(const M of S){const D=o(M),{width:I,height:A}=s.measureLines(D);g=Math.max(g,I+m),p=Math.max(p,A+y)}}if(c!=null&&d!=null){const f=Ml(e),m=f.left+f.right,y=f.top+f.bottom;for(const b of d){const v=c(b),{width:S,height:M}=s.measureLines(v);g=Math.max(g,S+m),p=Math.max(p,M+y)}}return{width:Math.ceil(g),height:Math.ceil(p)}}function IR(t,e,i,n){return t&&!e?i*n===-1?"top":"bottom":"middle"}function DR(t,e,i,n,s){const r=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI,a=r||o?-1:1;if(t)if(e||i){if(n*a===-1)return"right"}else return"center";else if(n*s===-1)return"right";return"left"}function JI(t,e){if(t!=null){if(typeof t=="string")return t;if(Le(t)&&e!=null)return t[zs(e)]}}function CR(t,e,i=0){const n=$s(t),s=!n&&i>=0&&i<=Math.PI?-1:1,r=!n&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,o=e?s*(Math.PI/2):0;return{configuredRotation:n,defaultRotation:o,parallelFlipFlag:s,regularFlipFlag:r}}var AR=new Date(1970,0,4);function QI(t){const{label:e,parallel:i=!1,domain:n,axisRotation:s,labelOffset:r,sideFlag:o}=t,{defaultRotation:a,configuredRotation:l,parallelFlipFlag:c,regularFlipFlag:h}=CR(e.rotation,i,s),u=l+a,d=(k,T=0)=>{const R=e.minSpacing??(l===0&&T===0?10:0),E=u+T,F=Ml(e);return ZI(TR(t,k,E),R)||ZI(LR(k.ticks,r,E,F),R)},{maxTickCount:g}=eD(t),p=wR(t),f=e.enabled&&e.avoidCollisions,m=Number.isFinite(g)?g:10,y=f&&e.autoRotate&&e.rotation==null;let b=0,v=0,S=!0,M={tickDomain:[],niceDomain:n,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;S&&b<=m;)({tickData:M,index:b}=kR(t,p,M,b)),v=y&&d(M,0)?$s(e.autoRotateAngle??335):0,S=f&&d(M,v);const D=DR(i,l,v,o,h),I=IR(i,l,o,c),A=l+v;return{tickData:M,textAlign:D,textBaseline:I,rotation:A}}function wR(t){return t.interval?.values?2:t.primaryTickCount!=null?1:0}function eD({scale:t,domain:e,range:i,visibleRange:n,label:s,defaultTickMinSpacing:r,interval:o}){const{minSpacing:a,maxSpacing:l}=o??{},{defaultTickCount:c}=t,h=bo(i),u=bo(n),d=_r.is(t);if(Yo.is(t)||d&&e.length<1e3){const p=Yo.is(t)?e.length:Math.min(e.length,Math.max(1,Math.floor(h/(u*r)))),f=Math.ceil(h/(u*s.fontSize));return{tickCount:Math.min(f,p),minTickCount:0,maxTickCount:p}}const g=eM(h,u,a,l,c,r);return d&&(g.minTickCount=0),g}function kR(t,e,i,n){const{step:s,values:r}=t.interval??{},{maxTickCount:o,minTickCount:a,tickCount:l}=eD(t),c=k=>Math.max(l-k,a),h=s==null&&r==null&&c(n)>a,u=i.rawTicks,d=l-a,g={minTickCount:a,maxTickCount:o,tickCount:c(n)};let p=tD(t,e,g);if(h&&XI(p.rawTicks,u)){let k=n,T=d;for(;k<=T;){n=Math.trunc((k+T)/2),g.tickCount=c(n);const R=tD(t,e,g);XI(R.rawTicks,u)?k=n+1:(p=R,T=n-1)}}const{tickDomain:f,niceDomain:m,rawTicks:y,rawTickCount:b,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:M,alignment:D,fractionDigits:I,timeInterval:A}=p;return{tickData:{tickDomain:f,niceDomain:m,rawTicks:y,rawTickCount:b,fractionDigits:I,timeInterval:A,ticks:vR(t,{niceDomain:m,rawTicks:y,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:M,alignment:D,fractionDigits:I,timeInterval:A})},index:n+1}}function tD(t,e,i){const{domain:n,reverse:s,visibleRange:r,scale:o,interval:a,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:u}=t,d={nice:c.map(k=>k===0),interval:a?.step,...i},g={...d,nice:c.map(k=>k===0||k===1)};let p;e===1&&h!=null&&Ge.is(o)&&(p=lR(o,n,h,s,r));const f=c.includes(0)?p?.domain??o.niceDomain(d,n):n;let m=f,y,b,v,S,M,D;const I=l?.enabled===!0&&g.interval==null;qI(o,f,()=>{switch(e){case 2:if(m=a.values,y=a.values,b=y.length,_r.is(o)?D=1:zr.is(o)&&(D=2),Ge.is(o)){const[k,T]=Ot(f.map(Number));y=y.filter(R=>Number(R)>=k&&Number(R)<=T).sort((R,E)=>Number(R)-Number(E))}break;case 1:if(p)y=p.ticks,b=p.ticks.length;else{const k=o.ticks(g,f,r);y=k?.ticks,b=k?.count}break;default:{const{tickCount:k,minTickCount:T,maxTickCount:R}=i;if(f.length>0&&g.interval==null&&(zr.is(o)||I&&(Ol.is(o)||_r.is(o)))){const N=f,P=Math.min(N[0].valueOf(),N.at(-1).valueOf()),z=Math.max(N[0].valueOf(),N.at(-1).valueOf());S=eh(P,z,k,T,R,{weekStart:l==null?AR:void 0,primaryOnly:!0})}let E;_r.is(o)?E=u:zr.is(o)&&(E=o.interval),E!=null&&S!=null&&zi(E)>=zi(S)&&(S=E);const F=S?SR(o,r,k,R,g,S,s,u):void 0;if(F)({ticks:y,primaryTicksIndices:M,alignment:D}=F);else{const N=zr.is(o)&&g.interval==null&&S!=null?{...g,interval:S}:g,P=o.ticks(N,f,r);if(y=P?.ticks,b=P?.count,v=P?.firstTickIndex,Ol.is(o)||Ks.is(o)){const z=typeof g.interval=="number"?_c(g.interval):g.interval;S??(S=z??P?.timeInterval)}}}}}),y??(y=[]);let A=0;for(const k of y){if(typeof k!="number")continue;const T=du(k);T>A&&(A=T)}return I||(M=void 0),{tickDomain:m,niceDomain:f,rawTicks:y,rawTickCount:b,rawFirstTickIndex:v,generatePrimaryTicks:I,primaryTicksIndices:M,alignment:D,fractionDigits:A,timeInterval:S}}function TR(t,e,i){const{niceDomain:n,ticks:s,timeInterval:r}=e;if(r==null)return[];const o=bR(s),{label:a,labelOffset:l,primaryLabel:c,domain:h}=t,{width:u,height:d}=MR(a,c,n??h,r,Zt(a)),g=[];for(const p of[0,o]){const{x:f,y:m}=Hf(l,p,i);g.push({x:f,y:m,width:u,height:d})}return g}function LR(t,e,i,n){const s=[],r=n.left+n.right,o=n.top+n.bottom;for(const{tickLabel:a,textMetrics:l,translation:c}of t){if(!a)continue;const{x:h,y:u}=Hf(e,c,i),d=l.width+r,g=l.height+o;s.push({x:h,y:u,width:d,height:g})}return s}var Mh=class iT extends gy{constructor(e,i,n,s){super(e,i,n,s),this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.zoom={min:0,max:1},this.headingLabelGroup=this.axisGroup.appendChild(new qt({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new qt({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new cn({zIndex:1})),this.tickLineGroupSelection=At.select(this.tickLineGroup,cn,!1),this.gridLineGroupSelection=At.select(this.gridLineGroup,cn,!1),this.gridFillGroupSelection=At.select(this.gridFillGroup,Pt,!1),this.tempText=new xl({debugDirty:!1}),this.tempCaption=new It,this.animationManager=e.animationManager,this.animationState=new Xc("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:o=>this.animateReadyUpdate(o),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.caption.node);let r;this.cleanup.register(e.eventsHub.on("layout:complete",o=>{const a=[o.chart.width,o.chart.height];r!=null&&!es(a,r)&&this.animationState.transition("resize"),r=a}),this.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof iT}get position(){return this.options.position}getZoom(){return this.zoom}setZoom(e){this.zoom={min:e.min,max:e.max}}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){const e=super.createAxisContext();return e.position=this.position,e}updateDirection(){switch(this.position){case"top":this.mirrored=!0,this.parallel=!0;break;case"right":this.mirrored=!0,this.parallel=!1;break;case"bottom":this.mirrored=!1,this.parallel=!0;break;case"left":this.mirrored=!1,this.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,i){return this.updateDirection(),super.calculateLayout(e,i)}calculateTickLayout(e,i,n,s){const r=gh(this.mirrored),o=this.options.label,a=r*(this.getTickSize()+this.getTickSpacing()+o.spacing+this.seriesAreaPadding),l=this.chartLayout?.scrollbars?.[this.id],c=this.getScrollbarThickness(l);if(i[0]===2&&i[1]===2&&!o.enabled&&!(this.primaryLabel?.enabled??!1)&&this.options.tick.enabled===!1&&!(this.primaryTick?.enabled??!1)&&this.options.gridLine.enabled===!1){const{bbox:pe,spacing:jt}=this.measureAxisLayout(e,[],[],l,c);return{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:pe,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:jt}}}const{primaryLabel:h,scale:u,range:d,defaultTickMinSpacing:g,minimumTimeGranularity:p}=this,{interval:f,reverse:m}=this.options,y=QI({label:o,parallel:this.parallel,scale:u,interval:f,primaryLabel:h,domain:e,range:d,reverse:m,niceMode:i,visibleRange:n,defaultTickMinSpacing:g,minimumTimeGranularity:p,sideFlag:r,labelOffset:a,primaryTickCount:s,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction==="y",sizeLimit:this.chartLayout?.sizeLimit,inRange:pe=>this.inRange(pe,.001),tickFormatter:(...pe)=>this.tickFormatter(...pe)}),{tickData:b}=y;if((o?.avoidCollisions??!0)&&this.horizontal&&b.ticks.length>2&&(Ge.is(this.scale)||Ks.is(this.scale))){const pe=this.chartLayout?.padding.right??0,jt=b.ticks.at(-1);jt?.tickLabel!=null&&jt.translation+jt.textMetrics.width/2>d[1]+pe&&(jt.tickLabel=void 0,n[0]===0&&n[1]===1&&(b.ticks[0].tickLabel=void 0))}const{ticks:S,tickDomain:M,rawTicks:D,rawTickCount:I,fractionDigits:A,timeInterval:k,niceDomain:T}=b,R=S.map(pe=>this.getTickLabelProps(pe,y,c)),{position:E,gridPadding:F,gridLength:N}=this,P=E==="bottom"||E==="right"?-1:1,z=P*F,Y=P*(N+F),j=this.calculateGridLines(S,z,Y),ie=this.calculateGridFills(S,z,Y),ge=this.calculateTickLines(S,P,c),{bbox:ae,spacing:le}=this.measureAxisLayout(M,S,R,l,c);return{ticks:D,rawTickCount:I,tickDomain:M,niceDomain:T,fractionDigits:A,timeInterval:k,bbox:ae,layout:{ticks:S,gridLines:j,gridFills:ie,tickLines:ge,labels:R,spacing:le}}}calculateGridLines(e,i,n){return e.map((s,r)=>this.calculateGridLine(s,r,i,n,e))}calculateGridLine({index:e,tickId:i,translation:n},s,r,o,a){const{horizontal:l}=this,c=this.options.gridLine,[h,u,d,g]=l?[n,r,n,o]:[r,n,o,n],{style:p}=c,{stroke:f,strokeWidth:m=0,lineDash:y}=p[e%p.length]??{};return{tickId:i,offset:n,x1:h,y1:u,x2:d,y2:g,stroke:f,strokeWidth:m,lineDash:y}}calculateGridFills(e,i,n){const{horizontal:s,range:r,type:o}=this,a=[];if(e.length==0)return a;let l=0;const c=!s&&o==="unit-time";if(c&&e[0].translation<r[0]||!c&&e[0].translation>r[0]){const u={tickId:`before:${e[0].tickId}`,translation:r[0]};a.push(this.calculateGridFill(u,-1,e[0].index,i,n,e)),l=1}return a.push(...e.map((u,d)=>this.calculateGridFill(u,d,u.index+l,i,n,e))),a}calculateGridFill({tickId:e,translation:i},n,s,r,o,a){const{horizontal:l,range:c}=this,h=this.options.gridLine,u=a[n+1],d=i,g=u?u.translation:c[1],[p,f,m,y]=l?[d,Math.max(r,o),g,Math.min(r,o)]:[Math.min(r,o),Math.min(d,g),Math.max(r,o),Math.max(d,g)],{fill:b,fillOpacity:v}=h.style[s%h.style.length]??{};return{tickId:e,x1:p,y1:f,x2:m,y2:y,fill:b,fillOpacity:v}}calculateTickLines(e,i,n=0){return e.map(s=>this.calculateTickLine(s,s.index,i,e,n))}calculateTickLine({isPrimary:e,tickId:i,translation:n},s,r,o,a=0){const{horizontal:l,primaryTick:c}=this,h=this.options.tick,u=e&&c?c:h,d=this.getTickSize(u),g=this.getTickSpacing(u),p=-r*(a+g),f=-r*d,[m,y,b,v]=l?[n,p,n,p+f]:[p,n,p+f,n],{stroke:S,width:M}=u;return{tickId:i,offset:n,x1:m,y1:y,x2:b,y2:v,stroke:S,strokeWidth:M,lineDash:void 0}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.unsafeDatum.tickId);super.update();const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:o}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const a=o.map(c=>c.tickId),l=yS(e,a);this.animationState.transition("update",l)}}const{enabled:n,stroke:s,width:r}=this.options.line;this.lineNode.setProperties({stroke:s,strokeWidth:n?r:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)}}getLayoutTranslation(){const{translationX:e,translationY:i}=this.getAxisTransform();return{x:e,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}setAxisVisible(e){this.tickLineGroup.visible=e&&(this.options.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=e&&(this.options.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=e,this.headingLabelGroup.visible=e}getAxisLineCoordinates(){const{horizontal:e}=this,[i,n]=Ot(this.lineRange??this.range);return e?{x1:i,x2:n,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:n}}getTickLineBBox(e,i){const{translation:n}=e,{position:s,primaryTick:r}=this;let o=this.getTickSize();r?.enabled&&(o=Math.max(o,this.getTickSize(r)));const a=s==="bottom"||s==="right"?-1:1,l=this.getTickSpacing(this.options.tick),c=-a*(i+l),h=c,u=c-a*(o+l),d=Math.min(h,u),g=Math.max(h,u);switch(s){case"top":return new $(n,d,0,g-d);case"bottom":return new $(n,d,0,g-d);case"left":return new $(d,n,g-d,0);case"right":return new $(d,n,g-d,0)}}lineNodeBBox(){const{position:e,seriesAreaPadding:i}=this,{y1:n,y2:s}=this.getAxisLineCoordinates(),r=s-n;switch(e){case"top":return new $(n,-i,r,i);case"bottom":return new $(n,0,r,i);case"left":return new $(-i,n,i,r);case"right":return new $(0,n,i,r)}}titleBBox(e,i){const{tempCaption:n}=this,s=Math.abs(this.range[1]-this.range[0])||1/0;return n.node.setProperties(this.titleProps(n,e,i)),n.computeTextWrap(s,this.options.thickness??1/0),n.node.getBBox()}getScrollbarThickness(e){return e?.enabled&&e.placement==="inner"?e.spacing+e.thickness:0}resolveScrollbarLayout(e,i){if(!e)return;const{position:n}=this,s=n==="top"||n==="left"?-1:1;if(e.placement==="inner"){const o=s===1?e.spacing:-e.spacing-e.thickness;return{...e,offset:o}}const r=s===1?i+e.spacing:-i-e.spacing-e.thickness;return{...e,offset:r}}applyScrollbarLayout(e,i,n){const s=this.resolveScrollbarLayout(n,i);let r=i;if(s){const{offset:o,thickness:a,placement:l}=s;l==="outer"&&(r+=s.spacing+a),this.horizontal?e.push(new $(0,o,0,a)):e.push(new $(o,0,a,0))}return{spacing:r,scrollbarLayout:s}}measureAxisLayout(e,i,n,s,r){const{primaryTick:o,primaryLabel:a,position:l,horizontal:c,seriesAreaPadding:h}=this,u=this.options.tick,d=this.options.label,g=this.options.title,p=[];if(p.push(this.lineNodeBBox()),u.enabled||o?.enabled)for(const M of i)p.push(this.getTickLineBBox(M,r));const{tempText:f}=this;if(d.enabled)for(const M of n){if(!M.visible)continue;f.setProperties(M);const D=f.getBBox();D&&p.push(D)}if(a?.enabled&&l==="bottom"&&(p.push(new $(0,Ep(d.fontSize)+2,1,this.getTickSize(u)+this.getTickSpacing(u)+d.spacing+h)),a.format!=null)){const{format:D}=a,A=(Le(D)?Object.values(D):[D]).reduce((k,T)=>Math.max(k,$x(T)),0);p.push(new $(0,this.getTickSize(o??u)+this.getTickSpacing(o??u)+a.spacing+h,1,A*Ep(a.fontSize)+2))}const m=$.merge(p),y=c?m.height:m.width,{spacing:b,scrollbarLayout:v}=this.applyScrollbarLayout(p,y,s);return this.layout.labelThickness=y,this.layout.scrollbar=v,g.enabled&&p.push(this.titleBBox(e,b)),{bbox:$.merge(p),spacing:b}}titleProps(e,i,n){const s=this.options.title;if(!s.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};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,e.truncate=s.truncate,e.maxWidth=s.maxWidth,e.maxHeight=s.maxHeight;const{range:r}=this,o=(r[0]+r[1])/2,a=s.spacing+n;let l,c,h,u;switch(this.position){case"top":l=o,c=-a,h=0,u="bottom";break;case"bottom":l=o,c=a,h=0,u="top";break;case"left":l=-a,c=o,h=Math.PI/-2,u="bottom";break;case"right":l=a,c=o,h=Math.PI/2,u="bottom";break}const{formatter:d=p=>p.defaultValue}=s,g=this.cachedCallWithContext(d,this.getTitleFormatterParams(i));return e.text=g,{visible:!0,text:g,textBaseline:u,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(e,i,n){const{horizontal:s,primaryLabel:r,primaryTick:o,seriesAreaPadding:a,scale:l}=this,{tickId:c,tickLabel:h="",translation:u,isPrimary:d,textUntruncated:g}=e,p=d&&r?.enabled?r:this.options.label,f=d&&o?.enabled?o:this.options.tick,{rotation:m,textBaseline:y,textAlign:b}=i,{range:v}=l,S=gh(this.mirrored),M=Ml(p)[this.position];let D=S*(this.getTickSize(f)+this.getTickSpacing(f)+p.spacing+a)-M;n&&(D+=S*n);const I=h!=="",A=s?u:D,k=s?-D:u;return{...this.getLabelStyles({value:e.tick,formattedValue:h},void 0,p),tickId:c,rotation:m,text:h,textAlign:b,textBaseline:y,textUntruncated:g,visible:I,x:A,y:k,rotationCenterX:A,rotationCenterY:k,range:v}}updateSelections(){if(!this.tickLayout)return;const e=this.getAxisLineCoordinates(),{tickLines:i,gridLines:n,gridFills:s,labels:r}=this.tickLayout,o=l=>l.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.options.gridLine.enabled?n:[],void 0,o),this.gridFillGroupSelection.update(this.options.gridLine.enabled?s:[],void 0,o),this.tickLineGroupSelection.update(i,void 0,o);const a=this.options.label.enabled||(this.primaryLabel?.enabled??!1);this.tickLabelGroupSelection.update(a?r:[],void 0,o)}updateGridLines(){this.gridLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((e,i)=>{e.fill=i.fill,e.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateTitle(e,i){const{caption:n}=this,s=this.titleProps(n,e,i);if(n.node.visible=s.visible,n.node.text=s.text,n.node.textBaseline=s.textBaseline,n.node.datum=s,s.visible){const r=Math.abs(this.range[1]-this.range[0])||1/0;n.computeTextWrap(r,this.options.thickness??1/0)}}updateLabels(){(this.options.label.enabled||(this.primaryLabel?.enabled??!1))&&this.tickLabelGroupSelection.each((i,n)=>{i.fill=n.color,i.text=n.text,i.textBaseline=n.textBaseline,i.textAlign=n.textAlign??"center",i.pointerEvents=n.textUntruncated==null?1:0,i.setFont(n),i.setBoxing(n)})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,n=qE(this),s=eR(n);wt(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],s.group),wt(this.id,"line",i,[this.lineNode],s.line),wt(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],s.tick,(r,o)=>o.tickId,e),wt(this.id,"tick-labels",i,[this.tickLabelGroupSelection],s.label,r=>r.unsafeDatum.tickId,e),wt(this.id,"title",i,[this.caption.node],s.label,r=>r.unsafeDatum.tickId,e)}resetSelectionNodes(){Qt([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],tR()),Qt([this.gridLineGroupSelection,this.tickLineGroupSelection],GI()),Qt([this.gridFillGroupSelection],iR()),Qt([this.tickLabelGroupSelection],og()),Qt([this.caption.node],og()),Qt([this.lineNode],GI())}},py=class nT extends Mh{static is(e){return e instanceof nT}get layoutConstraints(){const e=this.options.bandAlignment;return e==null?this._layoutConstraints:{...this._layoutConstraints,align:e}}set requiredRange(e){this._requiredRange=e,e==null||e<=0?(this._layoutConstraints.width=100,this._layoutConstraints.unit="percent"):(this._layoutConstraints.width=e,this._layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}get requiredRange(){return this._requiredRange}constructor(e,i,n=new Yo,s,r=!0){super(e,i,n,s),this.includeInvisibleDomains=r,this.nice=!1}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}getUpdateTypeOnResize(){const{bandAlignment:e}=this.options;return e==null||e==="justify"?super.getUpdateTypeOnResize():3}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this.options;if(!Be(e)||!Be(i)){const n=this.reduceBandScalePadding();e??(e=n.inner),i??(i=n.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}calculateGridLines(e,i,n){const s=super.calculateGridLines(e,i,n);return this.options.interval?.placement==="between"&&e.length>0&&s.push(super.calculateGridLine({index:e.at(-1).index+1,tickId:`after:${e.at(-1).tickId}`,translation:this.range[1]},e.length,i,n,e)),s}calculateGridLine({index:e,tickId:i,translation:n},s,r,o,a){const{horizontal:l,scale:c}=this,h=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridLine({index:e,tickId:i,translation:n},s,r,o,a);const u=n<c.step?Math.floor(c.step/2):c.step/2,d=n-u,[g,p,f,m]=l?[d,Math.max(r,o),d,Math.min(r,o)]:[Math.min(r,o),d,Math.max(r,o),d],{style:y}=h,{stroke:b,strokeWidth:v=0,lineDash:S}=y[e%y.length]??{};return{tickId:i,offset:d,x1:g,y1:p,x2:f,y2:m,stroke:b,strokeWidth:v,lineDash:S}}calculateGridFills(e,i,n){const{horizontal:s,range:r,scale:o}=this;if(this.options.interval?.placement!=="between")return super.calculateGridFills(e,i,n);const a=[];if(e.length==0)return a;const l=e[0],c=l.translation>r[0]+o.step/2,h=e.at(-1),u=s&&h.translation<r[1]-o.step/2;if(c){const d={tickId:`before:${l.tickId}`,translation:l.translation-o.step};a.push(this.calculateGridFill(d,-1,l.index-1,i,n,e))}if(a.push(...e.map((d,g)=>this.calculateGridFill(d,g,d.index,i,n,e))),u){const d={tickId:`after:${h.tickId}`,translation:h.translation+o.step};a.push(this.calculateGridFill(d,e.length,h.index+1,i,n,e))}return a}calculateGridFill({tickId:e,translation:i},n,s,r,o,a){const{horizontal:l,scale:c}=this,h=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridFill({tickId:e,translation:i},n,s,r,o,a);const u=i-c.step/2,d=i+c.step/2,[g,p,f,m]=l?[u,Math.max(r,o),d,Math.min(r,o)]:[Math.min(r,o),u,Math.max(r,o),d],{fill:y,fillOpacity:b}=h.style[s%h.style.length]??{};return{tickId:e,x1:g,y1:p,x2:f,y2:m,fill:y,fillOpacity:b}}calculateTickLines(e,i,n=0){const s=super.calculateTickLines(e,i,n);return this.options.interval?.placement==="between"&&e.length>0&&s.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${e.at(-1)?.tickId}`,translation:this.range[1]},e.length,i,e,n)),s}calculateTickLine({isPrimary:e,tickId:i,translation:n},s,r,o,a=0){const{horizontal:l,primaryTick:c,scale:h}=this,u=this.options.tick;if(this.options.interval?.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:i,translation:n},s,r,o,a);const d=e&&c?.enabled?c:u,g=-r*this.getTickSize(d),p=n<h.step?Math.floor(h.step/2):h.step/2,f=n-p,m=-r*(a+this.getTickSpacing(d)),[y,b,v,S]=l?[f,m,f,m+g]:[m,f,m+g,f],{stroke:M,width:D}=d;return{tickId:i,offset:f,x1:y,y1:b,x2:v,y2:S,stroke:M,strokeWidth:D,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const n=i.getBandScalePadding?.();return n&&(e.inner>n.inner&&(e.inner=n.inner),e.outer<n.outer&&(e.outer=n.outer)),e},{inner:1/0,outer:-1/0})}tickFormatParams(e,i,n,s){return{type:"category"}}datumFormatParams(e,i,n,s,r){const{datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g}=i;return Array.isArray(e)&&e.some(p=>typeof p!="string")&&(e=e.map(String)),{type:"category",value:e,datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g}}};py.className="CategoryAxis",py.type="category";var El=py,Zo=class Wv extends Ge{constructor(){super([0,1],[0,1]),this.type="number"}static is(e){return e instanceof Wv}static getTickStep(e,i,n){const{interval:s,tickCount:r=Ge.defaultTickCount,minTickCount:o,maxTickCount:a}=n;return s==null?To(e,i,r,o,a):Number(s)}toDomain(e){return Ea(this.domainMin)&&Ea(this.domainMax)&&(Ea(e)||Number.isInteger(e))?BigInt(e):e}ticks({interval:e,tickCount:i=Ge.defaultTickCount,minTickCount:n,maxTickCount:s},r=this.domain,o){if(!r||r.length<2||i<1)return{ticks:[],count:0,firstTickIndex:0};const[a,l]=r,c=typeof a=="bigint"&&typeof l=="bigint",h=o==null||o[0]===0&&o[1]===1;if(c&&!e&&h){const p=XS(a,l,i);return{ticks:p,count:p.length,firstTickIndex:0}}const u=r.map(Number);if(!u.every(Number.isFinite))return{ticks:[],count:0,firstTickIndex:0};const[d,g]=u;if(e){const p=Math.abs(Number(e));if(!ul((g-d)/p,this.getPixelRange()))return Rd(d,g,p,o)}return hl(d,g,i,n,s,o)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:n=Ge.defaultTickCount}=e,[s,r]=i;if(typeof s=="bigint"&&typeof r=="bigint"&&e.interval==null){const[h,u]=QS(s,r,n);return[e.nice[0]?h:s,e.nice[1]?u:r]}const a=i.map(Number);let[l,c]=a;if(n===1)[l,c]=xm(l,c);else if(n>1){const h=l>c?Math.ceil:Math.floor,u=l>c?Math.floor:Math.ceil,d=4;for(let g=0;g<d;g++){const p=l,f=c,m=Wv.getTickStep(l,c,e),[y,b]=a;if(l=h(y/m)*m,c=u(b/m)*m,l===p&&c===f)break}}return[e.nice[0]?l:a[0],e.nice[1]?c:a[1]]}},Xs=class extends Mh{constructor(t,e,i=new Zo,n){super(t,e,i,n)}hasDefinedDomain(){const{min:t,max:e}=this.options;return t!=null&&e!=null&&t<e}getLabelFormat(){return this.options.label.format}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:o}=xd(t.domain,e,i,n,s,void 0,t.sortMetadata?.sortOrder);return{domain:r,clipped:o}}getDomainExtentsNice(){return[this.options.min==null&&this.nice,this.options.max==null&&this.nice]}getVisibleDomain(t){const e=Number(t[0]),i=Number(t[1]),[n,s]=this.visibleRange,r=i-e;return[e+n*r,i-(1-s)*r]}tickFormatParams(t,e,i){return{type:"number",visibleDomain:this.getVisibleDomain(t),fractionDigits:i}}datumFormatParams(t,e,i){const{datum:n,seriesId:s,legendItemName:r,key:o,source:a,property:l,domain:c,boundSeries:h}=e,u=this.getVisibleDomain(c);return{type:"number",value:t,datum:n,seriesId:s,legendItemName:r,key:o,source:a,property:l,domain:c,visibleDomain:u,boundSeries:h,fractionDigits:i}}};Xs.className="NumberAxis",Xs.type="number";var NR={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},OR=(t,e)=>Math.log(e)/Math.log(t);function fy(t,e,i){const n=Math.min(...e),s=NR[t]??OR;return n>=0?s(t,i):-s(t,-i)}var ER={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},RR=(t,e)=>t**e;function my(t,e,i){const n=Math.min(...e),s=ER[t]??RR;return n>=0?s(t,i):-s(t,-i)}var yy=class sT extends Ge{constructor(e=[1,10],i=[0,1]){super(e,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=n=>fy(this.base,this.domain,n),this.pow=n=>my(this.base,this.domain,n)}static is(e){return e instanceof sT}transform(e){const[i,n]=Ot(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[i,n]=Ot(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.exp(e):-Math.exp(-e)}toDomain(e){return e}niceDomain(e,i=this.domain){if(i.length<2)return[];i=i.map(Number);const{base:n}=this,[s,r]=i,o=s>r?Math.ceil:Math.floor,a=s>r?Math.floor:Math.ceil,l=my(n,i,o(fy(n,i,s))),c=my(n,i,a(fy(n,i,r)));return[e.nice[0]?l:i[0],e.nice[1]?c:i[1]]}ticks({interval:e,tickCount:i=Ge.defaultTickCount},n=this.domain,s){if(!n||n.length<2||i<1)return;n=n.map(Number);const r=this.base,[o,a]=n,l=Math.min(o,a),c=Math.max(o,a);let h=this.log(l),u=this.log(c);if(e){const m=D=>D>=l&&D<=c,y=Math.min(Math.abs(e),Math.abs(u-h)),{ticks:b,count:v,firstTickIndex:S}=Rd(h,u,y,s),M=b.map(this.pow).filter(m);if(!ul(M.length,this.getPixelRange()))return{ticks:M,count:v,firstTickIndex:S}}if(!Ix(r)||u-h>=i){const m=Math.min(u-h,i),{ticks:y,count:b,firstTickIndex:v}=hl(h,u,m,void 0,void 0,s);return{ticks:y.map(this.pow),count:b,firstTickIndex:v}}const d=[],g=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const p=bo(this.range)/i;let f=1/0;for(let m=h;m<=u;m++){const y=this.convert(this.pow(m+1));for(let b=1;b<r;b++){const v=g?b:r-b+1,S=this.pow(m)*v,M=this.convert(S),D=Math.abs(f-M),I=Math.abs(M-y),A=D>=p&&I>=p;S>=l&&S<=c&&(b===1||A||d.length===0)&&(d.push(S),f=M)}}return PM(d,g,s)}},by=class extends Rt{constructor(){super(...arguments),this.segmentPath=new Rt}drawPath(t){if(!this.segments||this.segments.length===0){super.drawPath(t);return}t.save();const e=dc(),i=new e,n=this.layerManager?.canvas?.pixelRatio??1,s=t.canvas.width/n,r=t.canvas.height/n;Rl(i,{x0:0,y0:0,x1:s,y1:r},!1);for(const a of this.segments)Rl(i,a.clipRect);t.clip(i),super.drawPath(t),t.restore();const{segmentPath:o}=this;o.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:a,fill:l,stroke:c,...h}of this.segments){t.save(),o.path=this.path,o.setProperties(h),o.fill=this.fill==null?"none":l,o.stroke=this.stroke==null?"none":c;const u=new e;Rl(u,a),t.clip(u),o.drawPath(t),t.restore()}}};x([jd()],by.prototype,"segments",2);function Rl(t,{x0:e,y0:i,x1:n,y1:s},r=!0){const o=Math.min(e,n),a=Math.min(i,s),l=Math.max(e,n),c=Math.max(i,s);t.moveTo(o,a),r?(t.lineTo(l,a),t.lineTo(l,c),t.lineTo(o,c)):(t.lineTo(o,c),t.lineTo(l,c),t.lineTo(l,a)),t.closePath()}var iD=class extends qt{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(Yd(Rt))}renderInContext(t){if(!this.visible)return;const{ctx:e}=t;if(!this.segments||this.segments?.length===0)return super.renderInContext(t);e.save();const i=dc(),n=new i;Rl(n,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const r of this.segments)Rl(n,r.clipRect);e.clip(n);for(const r of this.children())r.visible&&r.render(t);e.restore();const{scalablePath:s}=this;for(const{clipRect:r,...o}of this.segments){e.save();const a=new i;Rl(a,r),e.clip(a),s.setProperties(o);for(const l of this.children())!l.visible||!(l instanceof Rt)||(s.path=l.path,s.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,..._O(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),s.render(t));e.restore()}}};x([jd()],iD.prototype,"segments",2);var nD=class{constructor(t,e,i){this.root=new VR(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(n,s)=>t.distanceSquared(n,s)};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}},PR=class{constructor(t,e,i,n){this.nw=t,this.ne=e,this.sw=i,this.se=n}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)}},FR=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??$.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:n}=this.boundary,{capacity:s}=this,r=this.maxdepth-1,o=i/2,a=n/2,l=new $(t,e,o,a),c=new $(t+o,e,o,a),h=new $(t,e+a,o,a),u=new $(t+o,e+a,o,a);return new PR(this.child(s,r,l),this.child(s,r,c),this.child(s,r,h),this.child(s,r,u))}},VR=class rT extends FR{addCondition(e){const{x:i,y:n}=e.hitTester.midPoint;return this.boundary.containsPoint(i,n)}findCondition(e,i,n){const{best:s}=n;return s.distanceSquared!==0&&this.boundary.distanceSquared(e,i)<s.distanceSquared}findAction(e,i,n){const s=Ad(e,i,this.elems,n.best.distanceSquared);s.nearest!==void 0&&s.distanceSquared<n.best.distanceSquared&&(n.best=s)}child(e,i,n){return new rT(e,i,n)}};function Mn(t){return typeof t=="bigint"?Number(t):ms(t)?new Date(t):t}var lg=class extends Mh{constructor(t,e,i){super(t,e,new Ol,i)}hasDefinedDomain(){const{min:t,max:e}=this.options;return t!=null&&e!=null&&t<e}isCategoryLike(){return!1}get primaryLabel(){const t=this.options.parentLevel;return t?.enabled?t.label:void 0}getLabelFormat(){const t=this.options.label.format;return t}getPrimaryLabelFormat(){const t=this.primaryLabel?.format;return t}get primaryTick(){const t=this.options.parentLevel;return t?.enabled?t.tick:void 0}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:o}=Sd(t,Mn(e),Mn(i),Mn(n),Mn(s));return{domain:r,clipped:o}}processData(){super.processData();const{boundSeries:t,direction:e}=this,{min:i,max:n}=this.options;this.minimumTimeGranularity=sD(t,e,Mn(i),Mn(n))}tickFormatParams(t,e,i,n){n??(n=xf(e));const s=Sf(t),r=zs(n),o=Ir(n),a=Vc(n);return{type:"date",unit:r,step:o,epoch:a,truncateDate:s}}datumFormatParams(t,e,i,n,s){if(t instanceof Date||(t=new Date(ds(t))),n==null){const{minimumTimeGranularity:m}=this,y=qu(t);m!=null&&zi(m)<zi(y)?n=m:n=y}const{datum:r,seriesId:o,legendItemName:a,key:l,source:c,property:h,domain:u,boundSeries:d}=e,g=zs(n),p=Ir(n),f=Vc(n);return{type:"date",value:t,datum:r,seriesId:o,legendItemName:a,key:l,source:c,property:h,domain:u,boundSeries:d,unit:g,step:p,epoch:f,style:s}}};lg.className="TimeAxis",lg.type="time";function sD(t,e,i,n){const s=t.reduce((r,o)=>Math.min(o.minTimeInterval()??1/0,r),1/0);return Number.isFinite(s)?_c(s):rD(t,e,i,n)?.unit}function rD(t,e,i,n){let s=1/0,r=-1/0,o,a=0;const l=[];for(const d of t){if(!d.visible)continue;const{extent:g}=Sd(d.getDomain(e));if(g.length===0)continue;const p=g[0].valueOf(),f=g.at(-1).valueOf();l.push(p,f),s=Math.min(s??1/0,p,f),r=Math.max(r??-1/0,p,f);const m=Math.abs(f-p);if(m===0)continue;const y=d.dataCount();if(a=Math.max(a,y),y<=1)continue;const b=m/(y-1);o=Math.min(o??1/0,b)}if(s=Math.min(s,i?.valueOf()??1/0,n?.valueOf()??1/0),r=Math.max(r,i?.valueOf()??-1/0,n?.valueOf()??-1/0),!Number.isFinite(s)||!Number.isFinite(r))return;o??(o=Math.abs(r-s)),o=Math.min(o,BR(l));const c=_c(o);let h=o/zi(c);a<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const u=h===1?void 0:_i(c,s);return{unit:c,step:h,epoch:u}}function BR(t){t.sort((i,n)=>i-n);let e=1/0;for(let i=1;i<t.length;i++){const n=t[i-1],s=t[i];s-n>0&&(e=Math.min(e,Math.abs(s-n)))}return e}function _R(t,e,i,n){return e<t.startIndex?(t.startIndex+=i,t.endIndex+=i,!1):e<t.endIndex||e===t.endIndex&&n?(t.endIndex+=i,!0):!1}function zR(t,e,i){const n=e+i;if(n<=t.startIndex)return t.startIndex=Math.max(0,t.startIndex-i),t.endIndex=Math.max(t.startIndex,t.endIndex-i),!1;if(e>=t.endIndex)return!1;if(e<=t.startIndex&&n>=t.endIndex)t.startIndex=e,t.endIndex=e;else if(e<=t.startIndex){const s=n-t.startIndex,r=t.endIndex-t.startIndex;t.startIndex=e,t.endIndex=t.startIndex+Math.max(0,r-s)}else n>=t.endIndex?t.endIndex=Math.max(t.startIndex,e):t.endIndex=Math.max(t.startIndex,t.endIndex-i);return!0}function oD(t,e){const i=Math.ceil(t/1e3);return Math.max(e,i)}function aD(t,e){return Math.max(1,Math.ceil(t/e))}function GR(t){return t.filter(e=>e.endIndex>e.startIndex)}function jR(t,e,i){if(!e.enableBanding||t<e.minDataSizeForBanding)return[i(0,t)];const n=oD(t,e.targetBandCount),s=aD(t,n),r=[];for(let o=0;o<t;o+=s){const a=Math.min(o+s,t);r.push(i(o,a))}return r}function HR(t,e){for(const i of e)i.insertCount>0&&t.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&t.handleRemoval(i.index,i.deleteCount)}function $R(t,e){for(const i of e)t.handleInsertion(i,0)}function WR(t,e){HR(t,e.spliceOps),e.updatedIndices.size>0&&$R(t,e.updatedIndices)}var UR=1e3,KR=10,lD=class{constructor(t={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:t.minDataSizeForBanding??UR,targetBandCount:t.targetBandCount??KR,maxBandSize:t.maxBandSize??1/0,enableBanding:t.enableBanding??!0}}applyIndexMap(t){WR(this,t)}initializeBands(t){this.dataSize=Math.max(0,t),this.bands=jR(this.dataSize,this.config,(e,i)=>this.createBand(e,i))}getBandCount(){return this.bands.length}handleInsertion(t,e){if(this.dataSize+=e,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=oD(this.dataSize,this.config.targetBandCount),n=aD(this.dataSize,i),s=Math.ceil(n*1.1);for(let r=0;r<this.bands.length;r++){const o=this.bands[r],a=r===this.bands.length-1;if(t===o.endIndex&&a&&e>0){o.endIndex-o.startIndex>=n?this.bands.push(this.createBand(t,t+e)):(o.endIndex+=e,o.isDirty=!0);break}_R(o,t,e,a)&&(o.isDirty=!0,e>0&&t<o.endIndex&&o.endIndex-o.startIndex>s&&this.splitBand(r,n))}}handleRemoval(t,e){if(e<=0||this.bands.length===0)return;const i=Math.min(e,Math.max(0,this.dataSize-t));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const n of this.bands)zR(n,t,i)&&(n.isDirty=!0);this.bands=GR(this.bands)}}splitBand(t,e){const i=this.bands[t],n=i.endIndex-i.startIndex,s=Math.min(e,Math.floor(n/2)),r=i.startIndex+s,o=this.createBand(i.startIndex,r),a=this.createBand(r,i.endIndex);this.bands.splice(t,1,o,a)}getStats(){const t=this.bands.filter(e=>e.isDirty);return{totalBands:this.bands.length,dirtyBands:t.length,dataSize:this.dataSize}}markRangeDirty(t,e){for(const i of this.bands)t<i.endIndex&&e>i.startIndex&&(i.isDirty=!0)}},hn=class oT{constructor(e=!1){this.coerceDates=e,this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(e){return e instanceof oT}setSortedUniqueMode(e,i){i&&(this.isSortedUnique=!0,this.sortOrder=e,this.sortedValues=[])}extend(e){this.coerceDates&&typeof e=="string"&&(e=PS(e)),this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(e),e instanceof Date&&(this.hasDateValues=!0)):e instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(e.valueOf())):this.domain.add(e)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let e=!1;return this.sortedValues.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}if(this.hasDateValues){const e=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...e,...Array.from(this.domain)]:e}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(e){if(this.isSortedUnique&&e.isSortedUnique&&this.sortOrder===e.sortOrder&&this.sortOrder!==void 0&&e.sortedValues){e.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...e.sortedValues);return}if(this.convertToSetMode(),e.hasDateValues&&(this.hasDateValues=!0),e.isSortedUnique&&e.sortedValues)for(const i of e.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of e.dateTimestamps)this.dateTimestamps.add(i);for(const i of e.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const e of this.sortedValues)e instanceof Date?this.dateTimestamps.add(e.valueOf()):this.domain.add(e);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},ki=class aT{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof aT}static extendDomain(e,i=[1/0,-1/0]){for(const n of e)typeof n!="number"&&typeof n!="bigint"||(n<i[0]&&(i[0]=n),n>i[1]&&(i[1]=n));return i}extend(e){const i=e;typeof i!="number"&&typeof i!="bigint"&&!(i instanceof Date)||(this.domain[0]>i&&(this.domain[0]=i),this.domain[1]<i&&(this.domain[1]=i))}getDomain(){return[...this.domain]}},Pl=class extends lD{constructor(t,e={},i=!1){super(e),this.fullDomainCache=null,this.sortOrder=void 0,this.isUnique=!1,this.domainFactory=t,this.isDiscrete=i}get discrete(){return this.isDiscrete}setSortOrderMetadata(t,e){this.sortOrder=t,this.isUnique=e}createBand(t,e){const i=this.domainFactory();return this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&hn.is(i)&&i.setSortedUniqueMode(this.sortOrder,this.isUnique),{startIndex:t,endIndex:e,subDomain:i,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.fullDomainCache=null}handleInsertion(t,e){super.handleInsertion(t,e),this.fullDomainCache=null}handleRemoval(t,e){super.handleRemoval(t,e),this.fullDomainCache=null}splitBand(t,e){this.bands.length>1&&super.splitBand(t,e)}markBandsDirty(t,e){this.markRangeDirty(t,e),this.fullDomainCache=null}markAllBandsDirty(){for(const t of this.bands)t.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(t,e){const i=t.length;for(const n of this.bands){if(!n.isDirty)continue;const s=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&hn.is(s)&&s.setSortedUniqueMode(this.sortOrder,this.isUnique),n.subDomain=s;const{startIndex:r,endIndex:o}=n;for(let a=r;a<o&&a<i;a++)e?.[a]||n.subDomain.extend(t[a]);n.isDirty=!1}this.fullDomainCache=null}getDirtyBands(){return this.bands.filter(t=>t.isDirty)}extend(t){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const t of this.bands)if(!hn.is(t.subDomain)||!t.subDomain.isSortedUniqueMode()||t.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const t=new hn;t.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const e of this.bands)hn.is(e.subDomain)&&t.mergeFrom(e.subDomain);return t.getDomain()}deduplicateNulls(t){let e=!1;return t.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}getDomain(){if(this.fullDomainCache!==null)return this.fullDomainCache;if(this.bands.length===0)return this.fullDomainCache=[],[];if(this.bands.length===1){const t=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(t):t,this.fullDomainCache}if(this.isDiscrete){const t=this.bands[0].subDomain;if(hn.is(t))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const e=new hn;for(const i of this.bands)hn.is(i.subDomain)&&e.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(e.getDomain())}else{const e=new Set;for(const i of this.bands)for(const n of i.subDomain.getDomain())e.add(n);this.fullDomainCache=Array.from(e)}}else{let t,e;for(const i of this.bands){const n=i.subDomain.getDomain();if(n.length===2){const[s,r]=n;(t===void 0||s!=null&&t!=null&&s<t)&&(t=s),(e===void 0||r!=null&&e!=null&&r>e)&&(e=r)}}t!==void 0&&e!==void 0?this.fullDomainCache=[t,e]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const t=this.bands.filter(i=>i.isDirty).length,e=this.bands.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:t,averageBandSize:this.bands.length>0?e/this.bands.length:0,dataSize:this.dataSize}}};function Ti(t,e){return cu(t,e)}function cD(t,e=[0,0]){for(const i of t)typeof i!="number"&&typeof i!="bigint"||(i<0&&(e[0]=Ti(e[0],i)),i>0&&(e[1]=Ti(e[1],i)));return e}function YR(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,aggregateFunction:n=>cD(n),groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]=Ti(s[0],n?.[0]??0),s[1]=Ti(s[1],n?.[1]??0)),s)}}function ZR(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:n=>ki.extendDomain(n)}}function XR(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function qR(t,e){const i=e?.visible??!0;return{id:t,matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:s=>cD(s),groupAggregateFunction:(s,r=[0,0,-1])=>(i&&(r[0]=Ti(r[0],s?.[0]??0),r[2]++,r[1]=Ti(r[1],s?.[1]??0)),r),finalFunction:(s=[0,0,0])=>{const r=Number(s[0])+Number(s[1]);return r>=0?[0,r/s[2]]:[r/s[2],0]}}}function JR(t,e,i){const n={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(s,r=[])=>{const o=Number(fc(r[1],r[0]));return e.aggregateFunction(s).map(a=>Number(a)/o)}};return e.groupAggregateFunction&&(n.groupAggregateFunction=e.groupAggregateFunction),n}function QR(t){return()=>{let e=0;return i=>typeof i=="bigint"?(e=Ti(e,t&&i<0n?0n:i),e):Be(i)?(e=Ti(e,t?Math.max(0,i):i),e):i}}function eP(){return()=>{let t=0;return e=>{if(typeof e!="bigint"&&!Be(e))return e;typeof e=="bigint"&&typeof t!="bigint"&&(t=0n);const i=t;return t=Ti(t,e),i}}}var vy="\0__AG_NULL__\0",xy="\0__AG_UNDEFINED__\0";function hD(t){return t===null?vy:t===void 0?xy:Array.isArray(t)?"["+t.map(hD).join(",")+"]":ce(t)?JSON.stringify(t):String(t)}function Sy(t){return t.map(hD).join("-")}function tP(t){return t.every(e=>typeof e=="bigint")}function Li(t){if(t==null)return[];if(tP(t))return[...t];const e=t.map(i=>Number(i));return e.every(Number.isFinite)?e:[]}function My(t){if(t.length<2)return[];const[e,i]=t;if(typeof e=="bigint"&&typeof i=="bigint")return[e<0n?e:0n,i>0n?i:0n];const n=Number(e),s=Number(i);return Number.isFinite(s-n)?[Math.min(n,0),Math.max(s,0)]:[]}function uD(t,e){return e?.get(t.id)??0}function Iy(t){return"scopes"in t&&Array.isArray(t.scopes)}function Ms(t,e){const i=[];for(let n=0;n<t;n+=1)i[n]=e;return i}function cg(t){const e=new Set;for(const i of t.values())i&&e.add(i);return e}function Dy(t,e,i=!1){const n=[];for(const s of t){const r=s?.[e];if(r==null&&!i)return;n.push(r)}return n}function iP(t){const e=[];let i=0,n;const s=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;n=s.exec(t);){if(n.index!==i)return;i=n.index+n[0].length;const r=n[1].trim();if(r.startsWith("."))e.push(r.slice(1).trim());else if(r.startsWith("[")){const o=r.slice(1,-1).trim();o.startsWith("'")?e.push(o.slice(1,-1).replaceAll(/(?<!\\)\\'/g,"'")):o.startsWith('"')?e.push(o.slice(1,-1).replaceAll(/(?<!\\)\\"/g,'"')):e.push(o)}else e.push(r)}if(i===t.length)return e}function nP(t){return e=>{let i=e;for(const n of t)i=i[n];return i}}var sP=class{constructor(t,e,i){this.ctx=t,this.scopeCacheManager=e,this.resolvers=i}aggregateUngroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i,dataSources:n}=t,s=Ii(n.keys()),r=t.keys.map(l=>l.get(s)),o=n.get(s)?.data??[],a=this.ctx.keys.some(l=>l.allowNullKey===!0);t.aggregation=o?.map((l,c)=>{const h=[];for(const[u,d]of this.ctx.aggregates.entries()){const g=this.valueGroupIdxLookup(d);let p=d.groupAggregateFunction?.()??[1/0,-1/0];const f=g.map(v=>i[v][c]),m=Dy(r,c,a),y=m==null?void 0:d.aggregateFunction(f,m);y&&(p=d.groupAggregateFunction?.(y,p)??ki.extendDomain(y,p));const b=d.finalFunction?.(p)??p;h[u]=b,ki.extendDomain(b,e[u])}return h})}aggregateGroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[n,s]of this.ctx.aggregates.entries()){const r=this.valueGroupIdxLookup(s);for(let o=0;o<t.groups.length;o++){const a=t.groups[o];a.aggregation??(a.aggregation=[]);const l=a.keys;let c=s.groupAggregateFunction?.()??[1/0,-1/0];const h=Math.max(...r.map(d=>a.datumIndices[d]?.length??0));for(let d=0;d<h;d++){const g=r.map(f=>{const m=a.datumIndices[f]?.[d];if(m==null)return;const y=this.resolvers.resolveAbsoluteIndex(o,m);return i[f][y]}),p=s.aggregateFunction(g,l);p&&(c=s.groupAggregateFunction?.(p,c)??ki.extendDomain(p,c))}const u=s.finalFunction?.(c)??c;a.aggregation[n]=u,ki.extendDomain(u,e[n])}}}postProcessGroups(t){const{groupProcessors:e}=this.ctx,{columnScopes:i,columns:n,invalidData:s,columnValueType:r}=t;for(const o of e){const a=this.valueGroupIdxLookup(o).filter(c=>r?.[c]!=="date"?!0:(this.rejectDateStackColumn(t,c),!1)),l=o.adjust()();for(let c=0;c<t.groups.length;c++){const h=t.groups[c];l(n,a,h,c)}for(const c of a){const u=this.ctx.values[c].valueType==="category",d=n[c],g=Ii(i[c]),p=s?.get(g),f=u?new hn:new ki;for(let m=0;m<d.length;m+=1)p?.[m]!==!0&&f.extend(d[m]);t.domain.values[c]=f.getDomain()}}}rejectDateStackColumn(t,e){const i=this.ctx.values[e],n=Ii(t.columnScopes[e]);B.warnOnce(`Series "${String(n)}": column "${String(i.property)}" is date-typed; stacking is not meaningful for date data. The series renders empty; other series in this chart are unaffected.`);const s=t.columns[e];for(let r=0;r<s.length;r+=1)s[r]=void 0;t.domain.values[e]=[]}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}},rP=class{constructor(t){this.ctx=t}setupDomainForDefinition(t,e,i){const n=t.valueType==="category",s=t.timeDomain===!0;let r=e.get(t);return!r&&this.ctx.bandingConfig?.enableBanding!==!1&&(r=new Pl(n?()=>new hn(s):()=>new ki,this.ctx.bandingConfig,n),e.set(t,r)),r&&n&&r.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),r||(n?new hn(s):new ki)}extendDomainFromData(t,e,i){if((t instanceof Pl?!t.discrete:ki.is(t))&&(e=Ju(e)),t instanceof Pl)t.extendBandsFromData(e,i);else for(let s=0;s<e.length;s++)i?.[s]!==!0&&t.extend(e[s])}initializeBandedDomain(t,e,i){if(!(t instanceof Pl))return;const n=t.getStats(),s=n.bandCount===0||n.dataSize!==e;this.ctx.debug.check()&&s&&i&&this.ctx.debug(`Reinitializing bands for ${i}: bandCount=${n.bandCount}, dataSize=${n.dataSize}, dataLength=${e}`),s&&t.initializeBands(e)}},Gr=Symbol("key-sort-orders"),Cy=Symbol("column-sort-orders"),Ay=Symbol("domain-ranges"),Ih=Symbol("domain-bands"),Xo=Symbol("reducer-bands"),dD=Object.freeze([0]);function wy(t,e){if(typeof e=="string")t.set(e,(t.get(e)??0)+1);else for(const i of e)t.set(i,(t.get(i)??0)+1)}function hg(t,e){if(t.reusableResult.valid=!1,t.hasInvalidValue){t.reusableResult.value=t.invalidValue,t.domain.extend(t.invalidValue);return}t.mode!=="integrated"&&B.warnOnce(`invalid value of type [${typeof e}] for [${t.def.scopes} / ${t.def.id}] ignored:`,`[${e}]`),t.reusableResult.value=void 0}function Dh(t,e,i,n,s,r){return t&&e&&t(i,n,s)===!1?(r.reusableResult.missing=!1,hg(r,i),r.reusableResult):null}function Ch(t,e,i,n,s){s.missing=!t,!t&&!e&&wy(i,n)}function ug(t,e,i){return e.valid=!0,e.value=t,i.extend(t),e}var oP=class{constructor(t){this.ctx=t}createProcessValueFn(t,e,i,n,s,r){const o={def:t,accessor:e,domain:i,reusableResult:n,processorFns:s,mode:this.ctx.mode};return(r==="extend"?this.createSpecializedProcessValue(o,t.validation):null)??this.createGenericProcessValue(o,r)}createSpecializedProcessValue(t,e){return t.def.forceValue!=null?this.createSpecializedProcessValueForceValue(t):t.def.processor?this.createSpecializedProcessValueProcessor(t,e):e?t.def.type==="key"?this.createSpecializedProcessValueKeyValidation(t,e):this.createSpecializedProcessValueValueValidation(t,e):null}createValidationMeta(t){const{def:e,domain:i,reusableResult:n,mode:s}=t;return{reusableResult:n,hasInvalidValue:"invalidValue"in e,invalidValue:e.invalidValue,domain:i,def:e,mode:s}}createSpecializedProcessValueKeyValidation(t,e){const{def:i,accessor:n,domain:s,reusableResult:r}=t,o=i.property,a="missingValue"in i,l=i.missingValue,c=i.missing,h=i.allowNullKey??!1,u=this.createValidationMeta(t);if(n){const d=n;return function(p,f,m){let y;try{y=d(p)}catch{}const b=y!=null||h&&y==null,v=!h&&y==null;return!b||v||e(y,p,f)===!1?(r.missing=!b,!b&&!a&&wy(c,m),hg(u,y),r):(r.missing=!1,r.valid=!0,r.value=y,s.extend(y),r)}}return function(g,p,f){const m=o in g,y=m?g[o]:l,b=!h&&y==null;return!m||b||e(y,g,p)===!1?(r.missing=!m,!m&&!a&&wy(c,f),hg(u,y),r):(r.missing=!1,r.valid=!0,r.value=y,s.extend(y),r)}}createSpecializedProcessValueValueValidation(t,e){const{def:i,accessor:n,domain:s,reusableResult:r}=t,o=i.property,a="missingValue"in i,l=i.missingValue,c=i.missing,h=this.createValidationMeta(t);if(n){const u=n;return function(g,p,f){let m;try{m=u(g)}catch{}const y=m!=null,b=Dh(e,y,m,g,p,h);return b!==null?b:(Ch(y,a,c,f,r),ug(m,r,s))}}return function(d,g,p){const f=o in d,m=f?d[o]:l,y=Dh(e,f,m,d,g,h);return y!==null?y:(Ch(f,a,c,p,r),ug(m,r,s))}}createSpecializedProcessValueForceValue(t){const{def:e,accessor:i,domain:n,reusableResult:s}=t,r=e.property,o=e.forceValue;if(i){const a=i;return function(c,h,u){let d;try{d=a(c)}catch{}const f=d!=null&&Ta(d)?-1*o:o;return s.missing=!1,s.valid=!0,s.value=f,n.extend(f),s}}return function(l,c,h){const u=r in l,d=u?l[r]:void 0,p=u&&Ta(d)?-1*o:o;return s.missing=!1,s.valid=!0,s.value=p,n.extend(p),s}}createSpecializedProcessValueProcessor(t,e){const{def:i,accessor:n,domain:s,reusableResult:r,processorFns:o}=t,a=i.property,l="missingValue"in i,c=i.missingValue,h=i.missing,u=i.processor,d=this.createValidationMeta(t);if(n){const g=n;return function(f,m,y){let b;try{b=g(f)}catch{}const v=b!=null,S=Dh(e,v,b,f,m,d);if(S!==null)return S;Ch(v,l,h,y,r);let M=o.get(i);return M==null&&(M=u(),o.set(i,M)),b=M(b,m),ug(b,r,s)}}return function(p,f,m){const y=a in p;let b=y?p[a]:c;const v=Dh(e,y,b,p,f,d);if(v!==null)return v;Ch(y,l,h,m,r);let S=o.get(i);return S==null&&(S=u(),o.set(i,S)),b=S(b,f),ug(b,r,s)}}createGenericProcessValue(t,e){const{def:i,accessor:n,domain:s,processorFns:r}=t,o=i.property,a="missingValue"in i,l=i.missingValue,c=i.missing,h=e==="extend",u=t.reusableResult,d=this.createValidationMeta(t);return function(p,f,m){let y,b;if(n){try{y=n(p)}catch{}b=y!=null}else b=o in p,y=b?p[o]:l;i.forceValue!=null&&(y=b&&Ta(y)?-1*i.forceValue:i.forceValue,b=!0),Ch(b,a,c,m,u);const v=i.allowNullKey??!1;if(i.type==="key"&&y==null&&!v)return hg(d,y),u;const M=Dh(i.validation,b,y,p,f,d);if(M!==null)return M;if(u.valid=!0,i.processor){let D=r.get(i);D==null&&(D=i.processor(),r.set(i,D)),y=D(y,f)}return h&&s.extend(y),u.value=y,u}}};function aP(t,e){return!t||!e||t.length===0||e.length===0?!0:t.some(i=>e.includes(i))}function gD(t,e){if(t.valueType==="category"){for(const i of e)if(i.property===t.property&&i.valueType===t.valueType&&aP(i.scopes,t.scopes)&&i.validation===t.validation)return i}}var lP=class{constructor(t,e,i){this.ctx=t,this.initializer=e,this.scopeCacheManager=i,this.processValueFactory=new oP(t)}recomputeDomains(t){const e=this.ctx.debug.check()?performance.now():0,i=t[Ih];let n;const s=t[Gr],r=this.setupDefinitionDomains(this.ctx.keys,i,s),o=new Map;for(const h of this.ctx.values){const u=gD(h,this.ctx.keys);u&&o.set(h,u)}const a=this.setupValueDomainsWithSharing(this.ctx.values,i,r,o),l=new Set;for(const[,h]of o){const u=r.get(h);u&&l.add(u)}this.initializeDomainBands(this.ctx.keys,r,h=>{const u=t.keys[h];return Math.max(...Array.from(u.values()).map(d=>d.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,a,h=>t.columns[h].length,h=>String(h.property));const c=new Map;if(i.size>0){n={totalBands:0,dirtyBands:0,totalData:0};for(const h of i.values())if(h instanceof Pl){const u=h.getStats();c.set(h,u),n.totalBands+=u.bandCount,n.dirtyBands+=u.dirtyBandCount,n.totalData=Math.max(n.totalData,u.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,r,(h,u)=>t.keys[h]?.get(u),h=>h.scopes??[],h=>t.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,a,(h,u)=>t.columns[h],h=>[Ii(h.scopes)],h=>t.invalidKeys?.get(h),l),t.domain.keys=this.ctx.keys.map(function(u){const d=r.get(u),g=d.getDomain();return ki.is(d)&&g[0]>g[1]?[]:g}),t.domain.values=this.ctx.values.map(function(u){const d=a.get(u),g=d.getDomain();return ki.is(d)&&g[0]>g[1]?[]:g}),t.type==="grouped"&&(t.domain.groups=t.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(t,r,a,i,c),this.ctx.debug.check()&&e>0){const u=performance.now()-e;if(n&&n.totalBands>0){const d=n.dirtyBands/n.totalBands,g=Math.round(d*n.totalData);this.ctx.debug(`recomputeDomains with banding: ${u.toFixed(2)}ms, bands: ${n.dirtyBands}/${n.totalBands} dirty, data scanned: ~${g}/${n.totalData} (${(d*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${u.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(t,e,i){const n=new Map;for(const[s,r]of t.entries()){const o=i?.get(s);n.set(r,this.initializer.setupDomainForDefinition(r,e,o))}return n}initializeDomainBands(t,e,i,n){for(const[s,r]of t.entries()){const o=e.get(r);if(!o)continue;const a=i(s);this.initializer.initializeBandedDomain(o,a,n(r))}}extendDomainsFromData(t,e,i,n,s,r){for(const[o,a]of t.entries()){const l=e.get(a);if(l&&!r?.has(l))for(const c of n(a)){if(!c)continue;const h=i(o,c);if(!h)continue;const u=s(c);this.initializer.extendDomainFromData(l,h,u)}}}setupValueDomainsWithSharing(t,e,i,n){const s=new Map;for(const r of t){const o=n.get(r);if(o){const a=i.get(o);if(a){s.set(r,a);continue}}s.set(r,this.initializer.setupDomainForDefinition(r,e))}return s}initDataDomainProcessor(t){const{keys:e,values:i}=this.ctx,n=new Set;for(const d of i)if(d.scopes)for(const g of d.scopes)n.add(g);const s=new Map,r=new Map;let o=!0;const a=()=>{for(const d of e)d.valueType==="category"?s.set(d,new hn(d.timeDomain===!0)):s.set(d,new ki);for(const d of i){const g=gD(d,e);if(g){const p=s.get(g);if(p){s.set(d,p),o&&(o=(d.scopes?.length??0)===n.size);continue}}d.valueType==="category"?s.set(d,new hn(d.timeDomain===!0)):(s.set(d,new ki),o&&(o=(d.scopes?.length??0)===n.size))}};a();const l=this.scopeCacheManager.buildAccessors(fo(e,i)),c=new WeakMap;for(const d of fo(e,i)){const g=l.get(d.property),p=s.get(d),f={value:void 0,missing:!1,valid:!1},m=this.processValueFactory.createProcessValueFn(d,g,p,f,r,t);c.set(d,m)}function h(d){const g=c.get(d);if(!g)throw new Error("AG Charts - missing processValue function for definition");return g}function u(d,g,p,f){return h(d)(g,p,f)}return{dataDomain:s,processValue:u,getProcessValue:h,initDataDomain:a,scopes:n,allScopesHaveSameDefs:o}}collectDomainBandingMetadata(t,e,i,n,s){t.optimizations??(t.optimizations={});const r=(l,c)=>l.map(h=>{const u=c.get(h),d=n.get(h),g=u instanceof Pl;let p;g||(p=h.valueType==="category"?"discrete domain":"not configured");let f;if(g&&d){const m=s.get(d)??d.getStats(),y=m.bandCount>0?m.dirtyBandCount/m.bandCount:0;f={totalBands:m.bandCount,dirtyBands:m.dirtyBandCount,dataSize:m.dataSize,scanRatio:y}}return{property:String(h.property),applied:g,reason:p,stats:f}}),o=r(this.ctx.keys,e),a=r(this.ctx.values,i);t.optimizations.domainBanding={keyDefs:o,valueDefs:a}}};function cP(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function hP(t,e){let i;if(typeof e=="number")i=Number.isFinite(e)?e:void 0;else if(typeof e=="bigint")i=e;else if(ms(e)){const s=ds(e);i=Number.isFinite(s)?s:void 0}else{const s=e?.valueOf?.();i=typeof s=="number"&&Number.isFinite(s)?s:void 0}if(i===void 0)return;const{lastValue:n}=t;if(n===void 0){t.lastValue=i;return}if(i===n)t.isUnique=!1;else if(t.isOrdered){const s=i>n?1:-1;t.sortOrder===0?t.sortOrder=s:t.sortOrder!==s&&(t.isOrdered=!1)}t.lastValue=i}function uP(t){return{sortOrder:t.isOrdered&&t.sortOrder!==0?t.sortOrder:void 0,isUnique:t.isUnique,isDirty:!1}}function dP(t){switch(typeof t){case"number":return"number";case"bigint":return"bigint";case"boolean":return"boolean";case"string":return ms(t)?"date":"string";case"object":return t==null?void 0:t instanceof Date?"date":Im(t)?"number":"object";default:return}}function ky(t,e){return(t==="number"||t==="bigint"||t==="boolean")&&typeof e===t}function pD(t,e,i){const n=t.type;if(ky(n,e))return n;const s=dP(e);if(s!=null){if((s==="string"||s==="date"&&typeof e=="string")&&(t.sawString=!0),t.type==null||t.type===s)t.type=s;else if(Ly(t.type)||Ly(s)){const r=Ly(t.type)?s:t.type;Ty(r)||(t.mixedDateAtIndex??(t.mixedDateAtIndex=i)),t.type="date"}else Ty(t.type)&&Ty(s)&&(t.mixedAtIndex??(t.mixedAtIndex=i),t.type="mixed-numeric");return s}}function Ty(t){return t==="number"||t==="bigint"||t==="mixed-numeric"}function Ly(t){return t==="date"}var gP=/(Z|[+-]\d{2}:\d{2})$/;function fD(t){return t.explicit!=null||t.implicit!=null}function mD(t,e){if(!ki.is(t))return;const i=Ju(e);for(let n=0;n<i.length;n++)t.extend(i[n])}function yD(t,e,i){typeof e=="string"&&(gP.test(e)?t.explicit??(t.explicit={value:e,index:i}):t.implicit??(t.implicit={value:e,index:i}))}var pP=class{constructor(t,e){this.ctx=t,this.domainManager=e}extractData(t){const{dataDomain:e,getProcessValue:i,allScopesHaveSameDefs:n}=this.domainManager.initDataDomainProcessor("extend"),{keys:s,values:r}=this.ctx,{invalidData:o,invalidKeys:a,invalidKeyCount:l,invalidDataCount:c,missingData:h,allKeyMappings:u,keySortOrders:d,keyHasIsoStrings:g}=this.extractKeys(s,t,i),{columns:p,columnScopes:f,columnNeedValueOf:m,columnValueType:y,columnHasIsoStrings:b,partialValidDataCount:v,maxDataLength:S}=this.extractValues(o,c,h,r,t,a,i);for(const[D,I]of r.entries())b[D]&&mD(e.get(I),p[D]);for(const[D,I]of s.entries()){if(!g[D])continue;const A=e.get(I);for(const k of new Set(u.get(I)?.values()))mD(A,k)}const M=D=>{const I=e.get(D),A=I.getDomain();return ki.is(I)&&A[0]>A[1]?[]:A};return{type:"ungrouped",input:{count:S},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...u.values()],columns:p,columnScopes:f,columnNeedValueOf:m,columnValueType:y,invalidKeys:a,invalidKeyCount:l,invalidData:o,invalidDataCount:c,missingData:h,domain:{keys:s.map(M),values:r.map(M)},defs:{allScopesHaveSameDefs:n,keys:s,values:r},partialValidDataCount:v,time:0,version:0,[Ay]:new Map,[Gr]:d,[Cy]:new Map,[Ih]:new Map,[Xo]:new Map}}extractKeys(t,e,i){const n=new Map,s=new Map,r=new Map,o=new Map,a=new Map,l=new Map,c=new Map,h=[];let u,d;const g=t.map(f=>i(f)),p=(f,m)=>{const y=d.get(f);u.set(m,u.get(y)),n.has(y)&&(n.set(m,n.get(y)),s.set(m,s.get(y)),o.set(m,o.get(y)))};for(const[f,m]of t.entries()){const{invalidValue:y,scopes:b}=m,v=g[f];u=new Map,d=new Map,l.set(m,u);const S=cP(),M={type:void 0,mixedAtIndex:void 0,mixedDateAtIndex:void 0,sawString:!1},D={explicit:void 0,implicit:void 0};for(const I of b??[]){const A=e.get(I)?.data??[];if(d.has(A)){p(A,I);continue}const k=[];u.set(I,k),d.set(A,I);let T,R,E=0,F;for(let N=0;N<A.length;N++){if(A[N]==null||typeof A[N]!="object"){T??(T=Ms(A.length,!1)),R??(R=Ms(A.length,!1)),E+=1,T[N]=!0,R[N]=!0,k.push(y);continue}const P=v(A[N],N,I);if(P.valid){k.push(P.value),hP(S,P.value),!ky(M.type,P.value)&&pD(M,P.value,N)==="date"&&yD(D,P.value,N);continue}P.missing&&(F??(F=Ms(A.length,!1))),k.push(y),T??(T=Ms(A.length,!1)),R??(R=Ms(A.length,!1)),E+=1,T[N]=!0,R[N]=!0}T&&R&&(n.set(I,T),s.set(I,R),r.set(I,E),o.set(I,E)),F&&a.set(I,F)}if(c.set(f,uP(S)),this.warnMixedTimezoneColumn(m.property,M.type,D,m.timeDomain===!0),h.push(M.type==="date"&&fD(D)),!M.sawString)for(const I of u.values())Mf(I)}return{invalidData:s,invalidKeys:n,invalidKeyCount:r,invalidDataCount:o,missingData:a,allKeyMappings:l,keySortOrders:c,keyHasIsoStrings:h}}markScopeDatumInvalid(t,e,i,n,s){for(const r of t){n.has(r)||(n.set(r,Ms(e.length,!1)),s.set(r,0));const o=n.get(r);o[i]||(o[i]=!0,s.set(r,s.get(r)+1))}}markScopeDatumMissing(t,e,i,n){for(const s of t){n.has(s)||n.set(s,Ms(e.length,!1));const r=n.get(s);r[i]||(r[i]=!0)}}extractValues(t,e,i,n,s,r,o){let a=0;const l=[],c=[],h=[],u=[],d=[];let g=0;const p=n.map(f=>o(f));for(const[f,m]of n.entries()){const{invalidValue:y}=m,b=p[f];if(new Set(m.scopes.map(E=>s.get(E))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(m)}`);const S=new Set(m.scopes),M=Ii(m.scopes),D=s.get(M)?.data??[],I=new Array,A=r.get(M);let k=!1;const T={type:void 0,mixedAtIndex:void 0,mixedDateAtIndex:void 0,sawString:!1},R={explicit:void 0,implicit:void 0};for(let E=0;E<D.length;E++){if(D[E]==null||typeof D[E]!="object"){this.markScopeDatumInvalid(m.scopes,D,E,t,e),I[E]=y;continue}const F=D[E],N=A==null?!1:A[E],P=b(F,E,m.scopes);let z=P.value;N||!P.valid?this.markScopeDatumInvalid(m.scopes,D,E,t,e):P.missing?this.markScopeDatumMissing(m.scopes,D,E,i):!ky(T.type,P.value)&&pD(T,P.value,E)==="date"&&yD(R,P.value,E),N?z=y:P.valid||(a+=1,z=y),!k&&z!=null&&typeof z=="object"&&(k=!0),I[E]=z}T.type==="mixed-numeric"&&T.mixedAtIndex!=null&&this.warnMixedNumericColumn(M,m.property,T.mixedAtIndex),T.mixedDateAtIndex!=null&&this.warnMixedDateColumn(M,m.property,T.mixedDateAtIndex),this.warnMixedTimezoneColumn(m.property,T.type,R,m.timeDomain===!0),l.push(I),c.push(S),h.push(k),u.push(T.type),d.push(T.type==="date"&&fD(R)),T.sawString||Mf(I),T.type==="number"&&tS(I),g=Math.max(g,I.length)}return{columns:l,columnScopes:c,columnNeedValueOf:h,columnValueType:u,columnHasIsoStrings:d,partialValidDataCount:a,maxDataLength:g}}warnMixedNumericColumn(t,e,i){B.warnOnce(`Series "${t}": column "${String(e)}" mixes 'number' and 'bigint' values (first detected at row ${i}); the bigints are narrowed to Number and may lose precision beyond \xB1(2^53 - 1) (Number.MAX_SAFE_INTEGER). Use one numeric type per column.`)}warnMixedDateColumn(t,e,i){B.warnOnce(`Series "${t}": column "${String(e)}" mixes date/time values with non-date values (first detected at row ${i}). Each column must be uniformly typed; the non-date values cannot be placed on a time axis and may render at invalid positions.`)}warnMixedTimezoneColumn(t,e,i,n){const{explicit:s,implicit:r}=i;!n||e!=="date"||s==null||r==null||B.warnOnce(`Time axis: column "${String(t)}" contains both timezone-explicit values (e.g. "${s.value}", row ${s.index}) and timezone-implicit values (e.g. "${r.value}", row ${r.index}). Ambiguous timezone semantics may produce unexpected positions \u2014 points without an explicit offset are interpreted as local time. Use explicit offsets (Z or \xB1HH:MM) for cross-environment determinism.`)}warnDataMissingProperties(t){if(t.size!==0)for(const e of fo(this.ctx.keys,this.ctx.values))for(const[i,n]of e.missing){if(n<(t.get(i)?.data.length??1/0))continue;const s=i==null?"":` for ${i}`;B.warnOnce(`the key '${e.property}' was not found in any data element${s}.`)}}},fP=class{constructor(t){this.ctx=t}groupData(t,e){var i;const{keys:n,columns:s,columnScopes:r,invalidKeys:o,invalidData:a}=t,l=t.scopes,c=[],h=[],u=l.size!==1||e!=null?new Map:void 0;let d=!0,g=0;const p=l.size,f=this.groupBatches(l,s,r,n,a,o),m=f.length;if(this.ctx.debug?.check()&&!t.optimizations&&(t.optimizations={}),this.ctx.debug?.check()){const v=p>0?1-m/p:0;t.optimizations.batchMerging={originalBatchCount:p,mergedBatchCount:m,mergeRatio:v}}const y=f.length===1,b=Object.freeze(Ms(f[0][1].length,dD));for(const[v,S,M,D,I,A]of f){const k=s[Ii(S)];for(let T=0;T<k.length;T++){if(A?.[T]===!0)continue;const R=M.map(j=>j[T]);if(R==null||R.length===0)throw new Error("AG Charts - no keys found for scope(s): "+v.join(", "));const E=e?.(R)??R,F=u==null?void 0:Sy(E);let N=u?.get(F),P,z,Y=!1;if(N==null?(P={keys:E,datumIndices:[],aggregation:[],validScopes:l},z=g++,N=[z,P],Y=!0,u?.set(F,N),c.push(P.keys),h.push(P)):([z,P]=N,d=!1),I?.[T]===!0){P.validScopes===l&&(P.validScopes=new Set(l.values()));for(const j of D)P.validScopes.delete(j)}if(Y&&T===z&&y)P.datumIndices=b;else{!Y&&P.datumIndices===b&&(P.datumIndices=b.map(j=>[...j]));for(const j of S)(i=P.datumIndices)[j]??(i[j]=[]),P.datumIndices[j].push(T-z)}}}return{...t,type:"grouped",domain:{...t.domain,groups:c},groups:h,groupsUnique:d,optimizations:t.optimizations,[Ih]:t[Ih],[Xo]:t[Xo]}}groupBatches(t,e,i,n,s,r){const o=[],a=new Set;for(const l of t){const c=e.map((p,f)=>f).filter(p=>!a.has(p)&&i[p].has(l));if(c.length===0)continue;for(const p of c)a.add(p);const h=new Set;for(const p of c)for(const f of i[p])h.add(f);const u=n.map(p=>p.get(l)).filter(p=>p!=null),d=s?.get(l),g=r?.get(l);o.push([l,c,u,h,d,g])}return this.mergeCompatibleBatches(o)}areBatchesCompatible(t,e){const[,,i,,n,s]=t,[,,r,,o,a]=e;return i.every((l,c)=>l===r[c])&&s===a&&n===o}mergeCompatibleBatches(t){const e=[],i=new Set;for(let n=0;n<t.length;n++){if(i.has(n))continue;const[s,r,o,a,l,c]=t[n],h=[[s],[...r],o,new Set(a),l,c];this.findAndMergeCompatibleBatches(t,n,h,i),e.push(h),i.add(n)}return e}findAndMergeCompatibleBatches(t,e,i,n){const s=t[e];for(let r=e+1;r<t.length;r++){if(n.has(r))continue;const o=t[r],[a,l,,c]=o;if(this.areBatchesCompatible(s,o)){i[0].push(a),i[1].push(...l);for(const h of c)i[3].add(h);n.add(r)}}}};function bD(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount>0}function mP(t){return t.removedIndices.size===0&&t.totalAppendCount===0&&t.totalPrependCount>0}function yP(t){return t.removedIndices.size===0}function bP(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0&&e.deleteCount===0)}function vP(t){return t.removedIndices.size>0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0)}function xP(t){return Ny(t.removedIndices)>0}function Ny(t){if(t.size===0)return 0;const e=Array.from(t).sort((i,n)=>i-n);if(e[0]!==0)return 0;for(let i=0;i<e.length;i++)if(e[i]!==i)return 0;return e.length}function SP(t){return xP(t)&&t.totalAppendCount>0&&t.totalPrependCount===0}var vD=class{constructor(t,e){this.indexMap=t,this.prependValues=e.prependValues,this.appendValues=e.appendValues,this.insertionValues=e.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((t,e)=>t-e)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((t,e)=>t-e)}forEachPreservedIndex(t){const{originalLength:e,removedIndices:i,totalPrependCount:n}=this.indexMap;let s=0;const r=Array.from(i).sort((a,l)=>a-l);let o=0;for(let a=0;a<e;a++){for(;o<r.length&&r[o]<a;)s++,o++;if(!i.has(a)){const l=a+n-s;t(a,l)}}}getPrependedValues(){return this.prependValues}getAppendedValues(){return this.appendValues}getInsertionValues(){return this.insertionValues}applyToArray(t,e,i){const{spliceOps:n,finalLength:s,originalLength:r}=this.indexMap;if(!(r===s&&n.length===0)){for(const o of n){const a=o.insertCount>0?Array.from({length:o.insertCount},function(h,u){return e(o.index+u)}):[],l=t.splice(o.index,o.deleteCount,...a);i&&l.length>0&&i(l,o)}t.length!==s&&(t.length=s)}}applyToTypedArray(t,e=0){const{finalLength:i,removedIndices:n,totalPrependCount:s,totalAppendCount:r,spliceOps:o}=this.indexMap;if(i===t.length&&n.size===0&&o.length===0)return t;const a=new Uint8Array(i);e!==0&&a.fill(e);let l=0;for(const c of o)l+=c.insertCount;if(l>s+r){const c=this.collectMidArrayInsertions();this.forEachPreservedIndex(function(u,d){let g=0;for(const p of c)if(p.destIndex<=d+g)g+=p.count;else break;a[d+g]=t[u]})}else{const c=n.size>0?Array.from(n).sort((g,p)=>g-p):[];let h=0,u=s;for(const g of c){const p=g-h;p>0&&(a.set(t.subarray(h,h+p),u),u+=p),h=g+1}const d=t.length-h;d>0&&a.set(t.subarray(h,h+d),u)}return a}collectMidArrayInsertions(){const{totalPrependCount:t,totalAppendCount:e,finalLength:i,spliceOps:n}=this.indexMap,s=i-e,r=[];for(const o of n)if(o.insertCount>0){if(o.deleteCount===0&&o.index===0&&o.insertCount===t||o.deleteCount===0&&o.index===s&&o.insertCount===e)continue;r.push({destIndex:o.index,count:o.insertCount})}return r.sort((o,a)=>o.destIndex-a.destIndex)}},MP=class extends lD{constructor(t={}){super(t),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(t,e){return{startIndex:t,endIndex:e,cachedResult:void 0,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(t,e,i=!1){const n=t.reducer();for(const s of this.bands){if(i&&!s.isDirty)continue;const r=t.needsOverlap&&s.startIndex>0?Math.max(0,s.startIndex-1):s.startIndex,o=this.evaluateRange(t,n,e,r,s.endIndex);s.cachedResult=o,s.isDirty=!1}}getResult(t){const e=this.bands.map(i=>i.cachedResult);return t.combineResults(e)}evaluateRange(t,e,i,n,s){let r=t.initialValue;const{keyColumns:o,keysParam:a,rawData:l}=i,c=Math.min(s,l.length);for(let h=n;h<c;h+=1){for(let u=0;u<a.length;u++)a[u]=o[u]?.[h];r=e(r,a)}return r}captureStatsBeforeProcessing(){const t=this.bands.filter(i=>i.isDirty),e=t.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);this.lastDirtyBandCount=t.length,this.lastScanRatio=this.dataSize>0?e/this.dataSize:0,this.statsCaptured=!0}getStats(){const t=this.bands.filter(n=>!n.isDirty&&n.cachedResult!==void 0);let e,i;if(this.statsCaptured)e=this.lastDirtyBandCount,i=this.lastScanRatio;else{const n=this.bands.filter(r=>r.isDirty),s=n.reduce((r,o)=>r+(o.endIndex-o.startIndex),0);e=n.length,i=this.dataSize>0?s/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:e,dataSize:this.dataSize,scanRatio:i,cacheHits:t.length}}},xD=class{constructor(t={}){this.bandingConfig=t}static evaluateRange(t,e,i,n,s){let r=t.initialValue;const{keyColumns:o,keysParam:a,rawData:l}=i,c=Math.min(s,l.length);for(let h=n;h<c;h+=1){for(let u=0;u<a.length;u++)a[u]=o[u]?.[h];r=e(r,a)}return r}evaluate(t,e,i={}){var n;const s=this.createContext(t,e);if(!s)return;e[n=Xo]??(e[n]=new Map);const r=e[Xo],o=t.property;let a=r.get(o);return a||(a=new MP(this.bandingConfig),r.set(o,a)),a.getBandCount()===0&&a.initializeBands(s.rawData.length),i.beforeEvaluate?.(a,s),a.captureStatsBeforeProcessing(),a.evaluateFromData(t,s,i.reuseCleanBands??!1),a.getResult(t)}applyIndexMap(t,e){const i=t[Xo];if(i)for(const n of i.values())n.applyIndexMap(e)}createContext(t,e){if(e.type!=="ungrouped")return;const i=Iy(t)?t.scopes[0]:Ii(e.dataSources.keys());if(i==null)return;const n=e.dataSources.get(i)?.data??[],s=e.keys.map(o=>o.get(i)).filter(o=>o!=null),r=s.map(()=>{});return{scopeId:i,rawData:n,keyColumns:s,keysParam:r}}},IP=class{constructor(t,e){this.ctx=t,this.reducerManager=e}isReprocessingSupported(t){if(t.type==="grouped"){if(!t.groupsUnique||this.getUniqueDataSets(t).size!==1)return!1;const s=Ii(t.scopes);if(t.invalidKeys?.get(s)?.some(o=>o))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(n=>n.supportsBanding!==!0||typeof n.combineResults!="function")||this.ctx.processors.some(n=>n.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(n=>n.supportsReprocessing??!1)}reprocessData(t,e,i,n,s,r,o){const a=performance.now(),l=this.collectScopeChanges(t,e);if(l.size===0)return t;this.commitPendingTransactions(t,o);const c=this.buildDefinitionProcessors(this.ctx.keys,i),h=this.buildDefinitionProcessors(this.ctx.values,i),u=this.processAllInsertions(t,l,c,h);this.processAllUpdates(t,l,c,h,u),this.updateBandsForChanges(t,l);const d=this.transformKeysArrays(t,l,u);this.transformColumnsArrays(t,l,u),this.transformInvalidityArrays(t,l,u),this.reprocessBandedReducers(t,l),t.type==="grouped"&&(this.transformGroupsArray(t,l,u),this.ctx.groupProcessors.length>0&&n(t,l)),this.invalidateSortOrdersForChanges(t,l),s(t),this.reprocessProcessors(t),t.reduced?.diff!=null&&l.size>0&&this.generateDiffMetadata(t,l,d),this.updateProcessedDataMetadata(t);const g=performance.now();t.time=g-a,t.version+=1,r(t,"reprocess");const p=cg(l);return t.changeDescription=p.size===1?p.values().next().value:void 0,t}updateBandsForChanges(t,e){const i=t[Ih];if(i.size===0)return;const n=cg(e);for(const s of n){const{indexMap:r}=s;for(const o of i.values())o.applyIndexMap(r)}}reprocessBandedReducers(t,e){if(t.type!=="ungrouped")return;const i=this.ctx.reducers.filter(n=>n.supportsBanding&&typeof n.combineResults=="function");if(i.length!==0){t.reduced??(t.reduced={});for(const n of i){const s=this.reducerManager.evaluate(n,t,{reuseCleanBands:!0,beforeEvaluate:(r,o)=>{if(!o.scopeId)return;const a=e.get(o.scopeId);a&&r.applyIndexMap(a.indexMap)}});s!==void 0&&(t.reduced[n.property]=s)}}}collectScopeChanges(t,e){const i=new Map;for(const[n,s]of t.dataSources){const r=e?.get(s)??s.getChangeDescription();r&&i.set(n,r)}return i}commitPendingTransactions(t,e){const i=this.getUniqueDataSets(t);for(const n of i)n.commitPendingTransactions(e)}buildDefinitionProcessors(t,e){return t.map((i,n)=>({def:i,index:n,processValue:e(i)}))}processAllInsertions(t,e,i,n){const s=new Map;for(const[r,o]of e){const a=t.dataSources.get(r);if(!a)continue;const l=this.processInsertionsOnce(r,o,a,i,n);s.set(r,l)}return s}processAllUpdates(t,e,i,n,s){for(const[r,o]of e){const a=t.dataSources.get(r);if(!a)continue;const l=o.getUpdatedIndices();if(l.length===0)continue;let c=s.get(r);c||(c=new Map,s.set(r,c));for(const h of l){if(h<0||h>=a.data.length)continue;const u=this.processDatum(a,h,r,i,n);u&&c.set(h,u)}}}processInsertionsOnce(t,e,i,n,s){const r=new Map,{finalLength:o}=e.indexMap;for(const a of e.indexMap.spliceOps)if(!(a.insertCount<=0))for(let l=0;l<a.insertCount;l++){const c=a.index+l;if(c<0||c>=o)continue;const h=this.processDatum(i,c,t,n,s);h&&r.set(c,h)}return r}processDatum(t,e,i,n,s){const r=t.data[e],o=new Map,a=new Map;let l=!1,c=!1,h=!1;if(r==null||typeof r!="object")l=!0,c=!0;else{for(const{index:u,def:d,processValue:g}of n){if(!d.scopes?.includes(i))continue;const p=g(r,e,i);o.set(u,{value:p.value,valid:p.valid}),p.valid||(l=!0)}for(const{index:u,def:d,processValue:g}of s){if(!d.scopes?.includes(i))continue;const p=g(r,e,d.scopes);a.set(u,{value:p.value,valid:p.valid}),p.valid||(c=!0),p.missing&&(h=!0)}}return{keys:o,values:a,hasInvalidKey:l,hasInvalidValue:c,hasMissingValue:h}}transformArraysWithCache(t,e,i,n,s,r){for(const[o,a]of t.entries())for(const l of s(a)){const c=e.get(l);if(!c)continue;const h=n(o,l);if(!h)continue;const u=i.get(l);this.applyChangeDescWithCache(c,h,u,(d,g)=>r(d,a,o))}}transformKeysArrays(t,e,i){const n=new Map,s=a=>{let l=n.get(a);return l||(l={tuples:[]},n.set(a,l)),l},r=new WeakSet;for(const[a,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=e.get(c);if(!h)continue;const u=t.keys[a]?.get(c);if(!u)continue;if(r.has(u)){const f=Array.from(t.keys[a].entries()).find(([m,y])=>y===u)?.[0];f&&f!==c&&n.has(f)&&n.set(c,n.get(f));continue}r.add(u);const d=i.get(c),g=s(c);let p=0;this.applyChangeDescWithCache(h,u,d,f=>{const m=f?.keys.get(a);return m?.valid?m.value:l.invalidValue},f=>{for(const m of f)g.tuples[p]||(g.tuples[p]=new Array(this.ctx.keys.length)),g.tuples[p][a]=m,p+=1})}const o=new Map;for(const[a,{tuples:l}]of n){if(l.length===0)continue;const c=new Set;for(const h of l){const u=[];for(const[d,g]of h.entries())this.ctx.keys[d].scopes?.includes(a)&&u.push(g);u.length>0&&c.add(Sy(u))}o.set(a,c)}return o}transformColumnsArrays(t,e,i){this.transformArraysWithCache(this.ctx.values,e,i,n=>t.columns[n],n=>[Ii(n.scopes)],(n,s,r)=>{if(n){if(n.hasInvalidKey)return s.invalidValue;const o=n.values.get(r);return o?.valid?o.value:s.invalidValue}return s.invalidValue})}transformInvalidityMap(t,e,i,n){const s=new Set;for(const[r,o]of e){let a=t.get(r);if(!a){const c=i.get(r);if(c&&Array.from(c.values()).some(n))a=Ms(o.indexMap.originalLength,!1),t.set(r,a);else continue}if(s.has(a))continue;s.add(a);const l=i.get(r);this.applyChangeDescWithCache(o,a,l,(c,h)=>n(c))}}transformInvalidityArrays(t,e,i){t.invalidKeys&&this.transformInvalidityMap(t.invalidKeys,e,i,n=>n?.hasInvalidKey??!1),t.invalidData&&this.transformInvalidityMap(t.invalidData,e,i,n=>n?n.hasInvalidKey||n.hasInvalidValue:!1),t.missingData&&this.transformInvalidityMap(t.missingData,e,i,n=>n?.hasMissingValue??!1)}applyChangeDescWithCache(t,e,i,n,s){const r=If(e),o=r!==void 0&&r===e;let a=!1;const l=(c,h)=>{const u=n(c,h);return o&&typeof u=="string"&&(a=!0),u};t.applyToArray(e,c=>l(i?.get(c),c),s);for(const c of t.getUpdatedIndices())c<0||c>=e.length||(e[c]=l(i?.get(c),c));r!==void 0&&(!o||a)&&eS(e)}transformGroupsArray(t,e,i){const n=Ii(t.scopes),s=e.get(n);if(!s)return;const r=i.get(n);for(const[,a]of r??[])if(a.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");s.applyToArray(t.groups,a=>this.createDataGroupForInsertion(a,t,n,r));const o=s.getUpdatedIndices();if(o.length>0)for(const a of o)a<0||a>=t.groups.length||(t.groups[a]=this.createDataGroupForInsertion(a,t,n,r))}createDataGroupForInsertion(t,e,i,n){const s=[];for(const u of e.keys){const d=u.get(i);d&&s.push(d[t])}const r=e.groups[0],o=()=>Object.freeze(Ms(e.columnScopes.length,dD)),a=r?.datumIndices??o(),c=n?.get(t)?.hasInvalidValue??!1;let h;return c?(h=new Set(e.scopes),h.delete(i)):h=e.scopes,{keys:s,datumIndices:a,aggregation:[],validScopes:h}}generateDiffMetadata(t,e,i){const n=(s,r)=>{const o=[];for(const a of t.keys){const l=a.get(s);if(!l)return;o.push(l[r])}return o.length>0?Sy(o):void 0};for(const[s,r]of e){const o={changed:!0,added:new Set,removed:i.get(s)??new Set,updated:new Set,moved:new Set};for(const c of r.indexMap.spliceOps)if(c.insertCount>0)for(let h=0;h<c.insertCount;h++){const u=c.index+h,d=n(s,u);d&&o.added.add(d)}const{originalLength:a,totalPrependCount:l}=r.indexMap;if(!bD(r.indexMap))if(mP(r.indexMap)&&a>0)for(let c=l;c<l+a;c++){const h=n(s,c);h&&o.moved.add(h)}else if(yP(r.indexMap)&&l>0)for(let c=0;c<a;c++){const h=c+l,u=n(s,h);u&&o.moved.add(u)}else r.forEachPreservedIndex((c,h)=>{if(c!==h){const u=n(s,h);u&&o.moved.add(u)}});t.reduced.diff[s]=o}}updateProcessedDataMetadata(t){let e=0;for(const n of t.dataSources.values())e=Math.max(e,n.data.length);t.input.count=e;let i=0;for(const[n,s]of t.invalidData??new Map){const r=t.invalidKeys?.get(n);for(let o=0;o<s.length;o++)s[o]&&!r?.[o]&&(i+=1)}if(t.partialValidDataCount=i,this.recountInvalid(t.invalidKeys,t.invalidKeyCount),this.recountInvalid(t.invalidData,t.invalidDataCount),t.missingData)for(const[n,s]of t.missingData)s.includes(!1)||t.missingData.delete(n);this.invalidateCachesForChanges(t)}updateSortOrderForAppend(t,e,i){if(i.length===0)return;const n=o=>{if(typeof o=="number")return o;if(o instanceof Date)return o.valueOf()};let s=n(e);const r=t.sortOrder;for(const o of i){const a=n(o);if(a===void 0)continue;if(s===void 0){s=a;continue}const l=a-s;if(l===0&&(t.isUnique=!1),t.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==r&&(t.sortOrder=void 0)}s=a}}updateKeySortOrdersForAppend(t,e){for(const[i,n]of t.keys.entries()){const s=t[Gr].get(i);if(!s)continue;const r=Ii(n.values());if(!r||r.length<=e)continue;const o=e>0?r[e-1]:void 0,a=r.slice(e);this.updateSortOrderForAppend(s,o,a)}}invalidateSortOrdersForChanges(t,e){const i=cg(e);let n=!0,s=!1,r=!1,o,a;for(const l of i){const{indexMap:c}=l;bP(c)||(bD(c)?(s=!0,o=c.originalLength):vP(c)||(SP(c)?(r=!0,a={originalLength:c.originalLength,removedCount:c.removedIndices.size}):n=!1))}n?s&&o!==void 0?this.updateKeySortOrdersForAppend(t,o):r&&a&&this.updateKeySortOrdersForRollingWindow(t,a):(t[Gr].clear(),t[Cy].clear())}updateKeySortOrdersForRollingWindow(t,e){const{originalLength:i,removedCount:n}=e;for(const[s,r]of t.keys.entries()){const o=t[Gr].get(s);if(!o)continue;const a=Ii(r.values());if(!a||a.length===0)continue;const l=i-n,c=l>0?a[l-1]:void 0,h=a.slice(l);this.updateSortOrderForAppend(o,c,h)}}invalidateCachesForChanges(t){this.markDomainRangesDirty(t[Ay])}markDomainRangesDirty(t){for(const e of t.values())e.isDirty=!0}recountInvalid(t,e){if(!(!t||!e))for(const[i,n]of t){const s=n.filter(Boolean).length;s===0?(t.delete(i),e.delete(i)):e.set(i,s)}}reprocessProcessors(t){if(this.ctx.processors.length!==0){t.reduced??(t.reduced={});for(const e of this.ctx.processors){const i=t.reduced[e.property],n=e.incrementalCalculate?.(t,i)??e.calculate(t,i);t.reduced[e.property]=n}}}getUniqueDataSets(t){return new Set(t.dataSources.values())}},qo=0,Jo=1,Is=2,DP=class Qh{constructor(e){this.isDirty=!1;const i=e.reduce((r,o)=>Math.max(r,o.length),0),{maxLevelSize:n,buffer:s}=Qh.createBuffer(i);this.maxLevelSize=n,this.buffer=s,this.dataLength=i,this.populateBuffer(e)}static computeMaxLevelSize(e){let n=1<<32-Math.clz32(e);return e===n/2&&(n=n>>>1),n}static createBuffer(e){const i=Qh.computeMaxLevelSize(e),n=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:n}}populateBuffer(e){const{maxLevelSize:i,buffer:n}=this,s=i-1;for(const r of e){const o=r.length;for(let a=0;a<o;a+=1){const l=Number(r[a]);if(l!==l)continue;const c=s+a<<1,h=n[c],u=n[c+1];(h!==h||l<h)&&(n[c]=l),(u!==u||l>u)&&(n[c+1]=l)}}for(let r=i>>>1;r>=1;r>>>=1){const o=r-1,a=o+r<<1;let l=o<<1,c=a;for(let h=0;h<r;h+=1){const u=c+2,d=n[c],g=n[u];n[l]=g!==g||d<g?d:g;const p=n[c+1],f=n[u+1];n[l+1]=f!==f||p>f?p:f,l+=2,c+=4}}}rebuild(e){const i=e.reduce((s,r)=>Math.max(s,r.length),0);if(Qh.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:s,buffer:r}=Qh.createBuffer(i);this.maxLevelSize=s,this.buffer=r}this.dataLength=i,this.populateBuffer(e)}updateValue(e,i){const{maxLevelSize:n,buffer:s}=this,r=n+e-1,o=Math.trunc(r*Is)+qo,a=Math.trunc(r*Is)+Jo;s[o]=Number.NaN,s[a]=Number.NaN;for(const l of i){const c=Number(l),h=s[o],u=s[a];(!Number.isFinite(h)||c<h)&&(s[o]=c),(!Number.isFinite(u)||c>u)&&(s[a]=c)}this.propagateUp(r)}updateValues(e){for(const{index:i,values:n}of e)this.updateValue(i,n)}propagateUp(e){const{buffer:i}=this;for(;e>0;){const n=Math.trunc((e-1)/2),s=2*n+1,r=2*n+2,o=i[Math.trunc(s*Is)+qo],a=i[Math.trunc(s*Is)+Jo],l=i[Math.trunc(r*Is)+qo],c=i[Math.trunc(r*Is)+Jo];i[Math.trunc(n*Is)+qo]=!Number.isFinite(l)||o<l?o:l,i[Math.trunc(n*Is)+Jo]=!Number.isFinite(c)||a>c?a:c,e=n}}computeRangeInto(e,i,n,s,r,o,a){const l=r+o-1;if(l<i||r>=n)return a;if(r>=i&&l<n){const c=e[Math.trunc(s*Is)+qo],h=e[Math.trunc(s*Is)+Jo];Number.isFinite(c)&&(a[0]=Math.min(a[0],c)),Number.isFinite(h)&&(a[1]=Math.max(a[1],h))}else o>1&&(s=Math.trunc(s*2),o=Math.trunc(o/2),this.computeRangeInto(e,i,n,Math.trunc(s+1),r,o,a),this.computeRangeInto(e,i,n,Math.trunc(s+2),r+o,o,a));return a}rangeBetween(e,i,n){const s=n??[0,0];if(e>i)return s[0]=Number.NaN,s[1]=Number.NaN,s;const{maxLevelSize:r,buffer:o}=this;return s[0]=1/0,s[1]=-1/0,this.computeRangeInto(o,e,i,0,0,r,s),s}getRange(e){const{buffer:i}=this,n=e??[0,0];return n[0]=i[qo],n[1]=i[Jo],n}get range(){const{buffer:e}=this;return[e[qo],e[Jo]]}get length(){return this.dataLength}};function SD(t,e){const i=t.length;if(t.length<=1)return 1;let n=0,s;for(let r=0;r<i;r++){const o=t[r];if(o==null)continue;let a=e?o.valueOf():o;if(typeof a=="string"&&ms(a)&&(a=ds(a),!Number.isFinite(a))||typeof a!="number"&&typeof a!="bigint"||typeof a=="number"&&Number.isNaN(a))return;if(s!==void 0){let l=0;if(a>s?l=1:a<s&&(l=-1),l!==0){if(n!==0&&n!==l)return;n=l}}s=a}return n===0?1:n}var MD=new Set(["number","bigint","mixed-numeric"]);function CP(t,e){switch(t){case"number":case"bigint":case"mixed-numeric":return MD.has(e)||e==="date";case"date":return e==="date"||MD.has(e);case"string":return e==="string"||e==="object";case"boolean":return e==="boolean";case"object":return!0}}function AP(t,e,i,n){n==null||CP(i,n)||B.warnOnce(`column '${e}' for scope '${t.id}' was resolved as '${i}' but holds '${n}' values; check the series data types.`)}var wP=class{constructor(t){this.ctx=t,this.rangeBetweenBuffer=[0,0]}resolveMissingDataCount(t){let e=0;for(const i of this.ctx.values)e=Math.max(e,i.missing.get(t.id)??0);return e}resolveProcessedDataDefById(t,e){const i=this.ctx.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){const i=this.ctx.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return i.index}resolveKeysById(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.keys[n];if(s==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return s.get(t.id)}hasColumnById(t,e){return this.ctx.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i,n){const s=this.resolveProcessedDataIndexById(t,e),r=i.columns?.[s];if(r==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return AP(t,e,n,i.columnValueType?.[s]),r}resolveColumnNeedsValueOf(t,e,i){const n=this.resolveProcessedDataIndexById(t,e);return i.columnNeedValueOf?.[n]??!0}resolveAbsoluteIndex(t,e){return t+e}getDomain(t,e,i,n){return this.getDomainsByType(i??"value",n)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,n],s){const r=e.map(u=>this.resolveProcessedDataIndexById(t,u)),o=s.input.count;if(i<=0&&n>=o){const u=s.domain.values;let d=1/0,g=-1/0;for(const p of r){const f=u[p];f!=null&&(f[0]<d&&(d=f[0]),f[1]>g&&(g=f[1]))}return this.rangeBetweenBuffer[0]=d,this.rangeBetweenBuffer[1]=g,this.rangeBetweenBuffer}const a=r.join(":"),l=s[Ay],c=r.map(u=>s.columns[u]);let h=l.get(a);return h==null?(h=new DP(c),l.set(a,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,n,this.rangeBetweenBuffer)}getSortOrder(t,e,i,n){const s=i.get(e);if(s==null||s.isDirty){const r=If(t),o={sortOrder:r!=null&&r!==t?SD(r,!1):SD(t,n)};return i.set(e,o),o.sortOrder}return s.sortOrder}getKeySortOrder(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.keys[n]?.get(t.id);return s?this.getSortOrder(s,n,i[Gr],!0):void 0}getKeySortEntry(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i[Gr].get(n);return s?.isDirty?void 0:s}getColumnSortOrder(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.columnNeedValueOf?.[n]??!0;return this.getSortOrder(i.columns[n],n,i[Cy],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}}},kP=class{constructor(t){this.ctx=t}processScopeCache(){this.ctx.scopeCache.clear();for(const t of fo(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const n of i)if(!this.ctx.scopeCache.has(e))this.ctx.scopeCache.set(e,new Map([[n,t]]));else{if(this.ctx.scopeCache.get(e)?.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(e).set(n,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,n]of this.ctx.values.entries())(!t||n.groupId&&t.includes(n.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,n=typeof e=="string"?e:e.id,s=o=>{if(o.idsMap){for(const[a,l]of o.idsMap)if(t?.includes(a)&&l.has(n))return!0}return!1},r=this.ctx.values.reduce((o,a,l)=>((a.scopes==null||i&&!a.scopes.length||a.scopes.some(h=>t?.includes(h)))&&(a.property===n||a.id===n||s(a))&&o.push(l),o),[]);if(r.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return r}buildAccessors(t){const e=new Map;if(this.ctx.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const s=iP(i.property);if(s==null){B.warnOnce("Invalid property path [%s]",i.property);continue}const r=nP(s);e.set(i.property,r)}return e}},Oy=class{constructor(t,e="standalone",i=!1,n){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=re.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let s=!0;for(const c of t.props){if(c.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&s&&(s=!1)}const r=({matchGroupIds:c=[]})=>{for(const h of c)if(this.values.every(u=>u.groupId!==h))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${h}).`)},o=new Set,a=new Set;for(const c of t.props){const h=c.type==="key"?o:a;if(Iy(c)&&c.scopes)for(const u of c.scopes)h.add(u);switch(c.type){case"key":this.keys.push({...c,index:this.keys.length,missing:new Map});break;case"value":if(c.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(c)}`);this.values.push({...c,index:this.values.length,missing:new Map});break;case"aggregate":r(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":r(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(a.values());for(const h of o)c.delete(h);if(c.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...c.values()]}`)}const l={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new wP(l),this.scopeCacheManager=new kP(l),this.domainInitializer=new rP(l),this.domainManager=new lP(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new xD(this.opts.domainBandingConfig),this.dataExtractor=new pP(l,this.domainManager),this.dataGrouper=new fP(l),this.aggregator=new sP(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new IP(l,this.reducerManager)}resolveProcessedDataDefById(t,e){return this.resolvers.resolveProcessedDataDefById(t,e)}resolveProcessedDataIndexById(t,e){return this.resolvers.resolveProcessedDataIndexById(t,e)}resolveKeysById(t,e,i){return this.resolvers.resolveKeysById(t,e,i)}hasColumnById(t,e){return this.resolvers.hasColumnById(t,e)}resolveColumnById(t,e,i,n){return this.resolvers.resolveColumnById(t,e,i,n)}resolveColumnNeedsValueOf(t,e,i){return this.resolvers.resolveColumnNeedsValueOf(t,e,i)}resolveMissingDataCount(t){return this.resolvers.resolveMissingDataCount(t)}*forEachDatum(t,e,i,n){const s=e.columnScopes.findIndex(o=>o.has(t.id)),r=e.dataSources.get(t.id)?.data;for(const o of i.datumIndices[s]??[]){const a=this.resolvers.resolveAbsoluteIndex(n,o);yield r?.[a]}}getUniqueDataSets(t){return new Set(t.dataSources.values())}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(r=>r.has(t.id)),n={groupIndex:0,columnIndex:i},s=[];for(const r of e.groups){n.group=r;for(const o of r.datumIndices[i]??s)n.datumIndex=this.resolvers.resolveAbsoluteIndex(n.groupIndex,o),yield n;n.groupIndex++}}getDomain(t,e,i,n){const s=this.resolvers.getDomain(t,e,i,n);if(s.length>0){if(i==="key"){const o=this.getKeySortMetadata(t,e,n);return{domain:s,sortMetadata:o}}const r=this.getColumnSortOrder(t,e,n);if(r!=null)return{domain:s,sortMetadata:{sortOrder:r}}}return{domain:s}}getDomainBetweenRange(t,e,[i,n],s){return this.resolvers.getDomainBetweenRange(t,e,[i,n],s)}getKeySortOrder(t,e,i){return this.resolvers.getKeySortOrder(t,e,i)}getColumnSortOrder(t,e,i){return this.resolvers.getColumnSortOrder(t,e,i)}getKeySortMetadata(t,e,i){const n=this.resolvers.getKeySortEntry(t,e,i);if(n?.sortOrder!=null)return{sortOrder:n.sortOrder,isUnique:n.isUnique}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:n,groupProcessors:s,reducers:r,processors:o,propertyProcessors:a}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.dataGrouper.groupData(c):i&&(c=this.dataGrouper.groupData(c,i(c))),s.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),n.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):n.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),a.length>0&&this.postProcessProperties(c),r.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&TP(c),this.processScopeCache(),c}isReprocessingSupported(t){return this.incrementalProcessor.isReprocessingSupported(t)}reprocessData(t,e,i){if(!this.isReprocessingSupported(t)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const o=this.getUniqueDataSets(t);for(const a of o)a.commitPendingTransactions(i);return this.processData(t.dataSources)}const{getProcessValue:n}=this.initDataDomainProcessor("skip"),s=this.incrementalProcessor.reprocessData(t,e,n,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this),i),{diff:r}=s.reduced??{};return r&&this.eventsHub?.emit("datamodel:diff",{diff:r}),s}recomputeDomains(t){this.domainManager.recomputeDomains(t)}warnDataMissingProperties(t){this.dataExtractor.warnDataMissingProperties(t)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}valueIdxLookup(t,e){return this.scopeCacheManager.valueIdxLookup(t,e)}extractData(t){return this.dataExtractor.extractData(t)}reprocessGroupProcessors(t,e){const{groupProcessors:i}=this,{columns:n}=t;for(const r of i)if(!r.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const s=cg(e);for(const r of i){const o=this.valueGroupIdxLookup(r),a=r.adjust()();for(const l of s){const{indexMap:c}=l;for(const h of c.spliceOps)if(h.insertCount>0)for(let u=0;u<h.insertCount;u++){const d=h.index+u,g=t.groups[d];a(n,o,g,d)}}}}postProcessProperties(t){for(const{adjust:e,property:i,scopes:n}of this.propertyProcessors)for(const s of this.valueIdxLookup(n,i))e()(t,s)}reduceData(t){t.reduced??(t.reduced={});for(const e of this.reducers)this.shouldUseReducerBanding(e,t)?t.reduced[e.property]=this.reduceWithBands(e,t):t.reduced[e.property]=this.reduceStandard(e,t)}shouldUseReducerBanding(t,e){return e.type==="ungrouped"&&t.supportsBanding===!0&&typeof t.combineResults=="function"}reduceWithBands(t,e){const i=this.reducerManager.evaluate(t,e,{reuseCleanBands:!1});return i===void 0?this.reduceStandard(t,e):i}reduceStandard(t,e){const i=t.reducer();if(e.type==="grouped"){let a=t.initialValue;for(const l of e.groups)a=i(a,l.keys);return a}const n=Iy(t)?t.scopes[0]:Ii(e.scopes);if(n==null)return t.initialValue;const s=e.dataSources.get(n)?.data??[],r=e.keys.map(a=>a.get(n)).filter(a=>a!=null),o=r.map(()=>{});return xD.evaluateRange(t,i,{rawData:s,keyColumns:r,keysParam:o},0,s.length)}postProcessData(t){t.reduced??(t.reduced={});for(const i of this.processors)t.reduced[i.property]=i.calculate(t,t.reduced[i.property]);const{diff:e}=t.reduced;e&&this.eventsHub?.emit("datamodel:diff",{diff:e})}initDataDomainProcessor(t){return this.domainManager.initDataDomainProcessor(t)}collectOptimizationMetadata(t,e){const i=t.optimizations?.domainBanding,n=t[Xo];this.reducers.length>0&&n&&this.collectReducerBandingMetadata(t,n);const s=t.optimizations?.reducerBanding;t.optimizations={performance:{processingTime:t.time,pathTaken:e},...i&&{domainBanding:i},...s&&{reducerBanding:s}};const r=this.isReprocessingSupported(t),o=e==="reprocess";let a;if(!r){const l=[];if(t.type==="grouped"){t.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(t).size!==1&&l.push("multiple data sources");const h=Ii(t.scopes);t.invalidKeys?.get(h)?.some(d=>d)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),a=l.length>0?l.join(", "):void 0}if(t.optimizations.reprocessing={applied:o,reason:a},t.type==="grouped"){let l=0;const c=t.groups[0];if(c){const h=c.datumIndices;for(const u of t.groups)u.datumIndices===h&&l++}t.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:t.groups.length}}}collectReducerBandingMetadata(t,e){if(this.reducers.length===0)return;t.optimizations??(t.optimizations={});const i=[];for(const n of this.reducers){const s=e.get(n.property),r=this.shouldUseReducerBanding(n,t)&&s!=null;let o;r||(n.supportsBanding!==!0?o="reducer does not support banding":t.type!=="ungrouped"?o="grouped data not supported":n.combineResults===void 0?o="missing combineResults function":o="banding not applied");let a;r&&s&&(a=s.getStats()),i.push({property:String(n.property),applied:r,reason:o,stats:a})}t.optimizations.reducerBanding={reducers:i}}buildAccessors(t){return this.scopeCacheManager.buildAccessors(t)}};function TP(t){const e=(i,n)=>{n.length>0&&(B.log(`DataModel.processData() - ${i}`),B.table(n))};if(B.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[]),t.optimizations){B.log("DataModel.processData() - Optimization Summary");const i=t.optimizations;if(i.performance&&B.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const n=i.reprocessing.applied?"\u2713":"\u2717",s=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";B.log(` Reprocessing: ${n}${s}`)}if(i.domainBanding){const n=i.domainBanding.keyDefs.filter(a=>a.applied),s=i.domainBanding.valueDefs.filter(a=>a.applied),r=n.length+s.length,o=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(r>0){B.log(` Domain Banding: \u2713 (${r}/${o} definitions)`);for(const a of[...n,...s])if(a.stats){const l=(a.stats.scanRatio*100).toFixed(1);B.log(` ${a.property}: scanned ${a.stats.dirtyBands}/${a.stats.totalBands} bands (${l}%)`)}}else{const a=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(a)].join(", ");B.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const n=i.sharedDatumIndices.applied?"\u2713":"\u2717",s=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;B.log(` Shared DatumIndices: ${n} (${s} groups)`)}if(i.batchMerging){const n=(i.batchMerging.mergeRatio*100).toFixed(0),s=`${i.batchMerging.originalBatchCount} \u2192 ${i.batchMerging.mergedBatchCount}`;B.log(` Batch Merging: ${s} (${n}% reduction)`)}}}var ID=1e3;function DD(t,e,i){let n;for(const s of t)On(s)&&(n=n==null?s:i(n,s));return n??e}function In(t){return t.input.count<=ID}function CD(t){return t!=null&&jn(t)}var LP="Date, epoch number/bigint, or strict ISO 8601 string (e.g. '2024-01-15', '2024-01-15T10:30:00Z')";function NP(t,e,i){return t==null?!1:jn(t)||ms(t)?!0:(typeof t=="string"&&B.warnOnce(`unsupported value [${t}] at row ${i??"?"} on a time axis; expected ${LP}. The value is ignored.`),!1)}function OP(t){return t!=null}function EP(t){return!0}function AD(t,e){switch(t){case"time":case"unit-time":case"ordinal-time":return NP;case"number":case"log":case"color":return CD;default:return e?EP:OP}}function wD(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function kD(t){return t==="time"||t==="unit-time"||t==="ordinal-time"}function jr(t,e,i={}){const n=i.allowNullKey??!1;return{property:t,type:"key",valueType:wD(e),timeDomain:kD(e),validation:i.validation??AD(e,n),...i}}function et(t,e,i={}){const n=i.allowNullKey??!1;return{property:t,type:"value",valueType:wD(e),timeDomain:kD(e),validation:i.validation??AD(e,n),...i}}function RP(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...e}}var PP=function(t){return t};function TD(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>PP:e.length===1?e[0]:function(){const n=e.map(s=>s());return function(r,o){return n.reduce((a,l)=>l(a,o),r)}}}function FP(t,e={}){const{min:i=-1/0,max:n=1/0,processor:s,...r}=e;return{type:"value",property:t,valueType:"range",validation:CD,processor:TD(s,function(){return function(l){return Be(l)?J(i,l,n):l}}),...r}}function Ey(t,e,i={}){const{onlyPositive:n,processor:s,...r}=i;return{...et(t,e,r),processor:TD(s,QR(n))}}function VP(t,e,i={}){return{...et(t,e,i),processor:eP()}}function Qo(t,e,i,n){return[et(t,n,i),ZP(i.groupId,e,i.separateNegative),...i.rangeId==null?[]:[ZR(i.rangeId,i.groupId)]]}function dg(t){if(typeof t=="bigint")return t;if(ms(t))return ds(t);const e=Number(t);return Number.isFinite(e)?e:void 0}function LD(t,e){return hu(fc(t,e))}var ND={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let t;return function(i,n){const s=dg(n[0]),r=i??1/0;if(s==null)return r;const o=t==null?void 0:LD(s,t);return t=s,o!=null&&o>0&&o<r?o:r}},supportsBanding:!0,combineResults(t){return DD(t,1/0,Es)},needsOverlap:!0},OD={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let t;return function(i,n){const s=dg(n[0]),r=i??-1/0;if(s==null)return r;const o=t==null?void 0:LD(s,t);return t=s,o!=null&&o>0&&o>r?o:r}},supportsBanding:!0,combineResults(t){return DD(t,-1/0,ss)},needsOverlap:!0};function BP(t,e){return typeof t=="bigint"||typeof e=="bigint"?t<e?-1:t>e?1:0:t-e}var _P={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:e}}){return e?.slice().sort((i,n)=>{for(let s=0;s<i.length;s++){const r=BP(i[s],n[s]);if(r!==0)return r}return 0})}};function zP({normaliseTo:t}){const e=(i,n)=>{if(n===0)return 0;const s=Number(i??0)*t/n;return s>=0?Math.min(t,s):Math.max(-t,s)};return()=>()=>(i,n,s,r)=>{const o=GP(i,n,s,r);for(const a of n){const l=s.datumIndices[a];if(l!=null)for(const c of l){const h=r+c,u=i[a],d=u[h];if(d==null){u[h]=void 0;continue}u[h]=e(d,o)}}}}function GP(t,e,i,n){const s=[0,0];for(const r of e){const o=t[r],a=i.datumIndices[r];if(a!=null)for(const l of a){const c=n+l,h=o[c];if(h==null)continue;let u;typeof h=="number"?u=h:typeof h=="bigint"?u=Number(h):u=Math.max(...h.map(g=>Number(g??0)));const d=u<0?0:1;d===0?s[d]=Math.min(s[d],u):s[d]=Math.max(s[d],u)}}return Math.max(Math.abs(s[0]),s[1])}function gg(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:sl({normaliseTo:e},zP)}}function jP({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:n}){const s=t[1]-t[0],r=function(a,l,c){const h=t[0]+(a-l)/c*s;return c===0?e:h>=t[1]?t[1]:h<t[0]?t[0]:h};return function(){return function(l,c){let[h,u]=l.domain.values[c];i!=null&&(h=i),n!=null&&(u=n);const d=ka(h),g=ka(u)-d;l.domain.values[c]=[t[0],t[1]];const p=l.columns[c];for(let f=0;f<p.length;f+=1)p[f]=r(ka(p[f]),d,g)}}}function Ry(t,e,i,n,s){return{type:"property-value-processor",property:t,adjust:sl({normaliseTo:e,rangeMin:n,rangeMax:s,zeroDomain:i},jP)}}function HP([t,e,i]){return function(s,r){if(r===!0)return!0;const o=s.defs.values.findIndex(h=>h.scopes.includes(t)&&h.id===e),a=s.defs.values.findIndex(h=>h.scopes.includes(t)&&h.id===i),l=s.columns[o],c=s.columns[a];if(l.length!==c.length)return!0;for(let h=0;h<l.length;h++)if(hu(c[h])>hu(l[h]))return!0;return!1}}function $P(t,e,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:sl([t,e,i],HP)}}var Ah=1,pg=2;function WP(t,e,i){let n=Ah|pg;if(t.valueType==="category")return e.length<i.length&&(n&=~Ah),n;let s=i[0]==null?void 0:dg(i[0]);for(let r=1;n!==0&&r<i.length;r++){const o=i[r]==null?void 0:dg(i[r]);(o===void 0||s!==void 0&&s>o)&&(n&=~pg),o!==void 0&&s===o&&(n&=~Ah),s=o}return n}function UP(t){return function(i,n){if(!In(i))return;const{keys:s,values:r}=i.defs,{input:o,domain:{values:a},columns:l}=i;let c=!0,h=!0;if(o.count!==0){const u=i[Gr];for(let d=0;(c||h)&&d<s.length;d++){const g=s[d],p=u.get(d);if(g.valueType==="category"){const f=i.domain.keys[d]?.length??0,m=i.keys[d]?.values().next().value?.length??0;f<m&&(c=!1)}else p&&(p.isUnique===!1&&(c=!1),p.sortOrder!==1&&(h=!1))}if(t&&t.length>0){let d=Ah|pg;for(let g=0;d!==0&&g<r.length;g++){const p=r[g];t.includes(p.id)&&(d&=WP(p,a[g],l[g]))}d&Ah||(c=!1),d&pg||(h=!1)}}return{uniqueKeys:c,orderedKeys:h}}}function KP(){return{uniqueKeys:!0,orderedKeys:!1}}function wh(t){return{type:"processor",property:"animationValidation",calculate:sl(t,UP),incrementalCalculate:KP}}function YP({mode:t,separateNegative:e}){return function(){return function(){return function(r,o,a,l){const c=[0,0];for(const h of o){const u=a.datumIndices[h];if(u==null)continue;const d=c[0],g=c[1],p=r[h];let f=!1;for(const m of u){const y=l+m,b=p[y],v=typeof b=="bigint";if(!v&&!Be(b))continue;const S=e&&(v?b<0n:Ta(b)),M=S?d:g;if(t==="normal"?p[y]=Ti(M,b):p[y]=M,!f){const D=S?0:1;c[D]=Ti(M,b),f=!0}}}}}}}function ZP(t,e,i=!1){const n=sl({mode:e,separateNegative:i},YP);return{type:"group-value-processor",matchGroupIds:[t],adjust:n,supportsReprocessing:!0}}function ED(t){return t.id??t.property}function XP(t,e,i){const n=new Map,s=e.defs.values;for(let a=0;a<s.length;a+=1){const l=s[a];if(l.scopes?.includes(t)===!1)continue;const c=ED(l);if(n.has(c))return;n.set(c,a)}const r=[],o=i.defs.values;for(let a=0;a<o.length;a+=1){const l=o[a];if(l.scopes?.includes(t)===!1)continue;const c=ED(l),h=n.get(c);if(h==null)return;n.delete(c),r.push({previousIndex:h,nextIndex:a})}if(n.size===0)return r}function Py(t,e,i,n,s){for(const{previousIndex:r,nextIndex:o}of i){const a=t[r],l=e[o],c=a[n],h=l[s];if(c!==h)return!1}return!0}function fg(t,e,i=!0){return{type:"processor",property:"diff",calculate(n,s){if(!In(n))return{...s,[t]:{changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set}};const r=new Map,o=new Map,a=new Map,l=new Map,c=e.keys.map(b=>b.get(t)),h=n.keys.map(b=>b.get(t)),u=e.columns,d=n.columns,g=XP(t,e,n);if(g==null)return s;const p=Math.max(e.input.count,n.input.count),f=n.defs.keys.some(b=>b.allowNullKey===!0);for(let b=0;b<p;b++){const v=b<e.input.count,S=b<n.input.count,M=v?Dy(c,b,f):void 0,D=M==null?"":ei(...M),I=S?Dy(h,b,f):void 0,A=I==null?"":ei(...I);if(S&&v&&D===A){Py(u,d,g,b,b)||a.set(A,b);continue}const k=l.get(A);k!=null?((i||!Py(u,d,g,k,b))&&(a.set(A,b),r.set(A,b)),l.delete(A)):S&&o.set(A,b);const T=o.get(D);T!=null?((i||!Py(u,d,g,T,b))&&(a.set(D,b),r.set(D,b)),o.delete(D)):v&&(a.delete(D),l.set(D,b))}const y={changed:o.size>0||a.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...s,[t]:y}}}}function ei(...t){if(t.length===1){const e=Pd(t[0]);if(e===null)return vy;if(e===void 0)return xy;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e}return t.map(e=>{const i=Pd(e);return i===null?vy:i===void 0?xy:i}).join("___")}var RD=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.Series=2]="Series",t[t.OtherSeries=3]="OtherSeries",t[t.OtherItem=4]="OtherItem",t))(RD||{}),PD=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.OtherSeries=3]="OtherSeries",t))(PD||{}),Fy=[0,1,2,3,4];function qP(t){switch(t){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function JP(t){switch(t){case 1:return["selectedItem"];case 2:return["unselectedItem"];case 3:return["unselectedSeries"];case 0:return[];default:return(i=>i)(t)}}function Hr(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return e(t)}}function un(t){const e=i=>i;switch(t){case 1:return"selected-item";case 2:return"unselected-item";case 3:return"unselected-series";case 0:return"none";case void 0:return;default:return e(t)}}function Vy(t){return t===void 0||t===0||t===2||t===3}function QP(t){return!(t===void 0||t===0)}function FD(t,e){return t===1||e===1?1:QP(e)?e:t}var qs=class extends Fe{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(t){const e=qP(t);return e.length===0?{}:de(...e.map(i=>this[i]))}};x([C],qs.prototype,"enabled",2),x([C],qs.prototype,"range",2),x([C],qs.prototype,"bringToFront",2),x([C],qs.prototype,"highlightedItem",2),x([C],qs.prototype,"unhighlightedItem",2),x([C],qs.prototype,"highlightedSeries",2),x([C],qs.prototype,"unhighlightedSeries",2);var $r=class extends Fe{constructor(){super(...arguments),this.enabled=!1,this.containment="any",this.selectedItem={},this.unselectedItem={},this.unselectedSeries={},this.selectedOffset=0}getStyle(t){const e=JP(t);return e.length===0?{}:de(...e.map(i=>this[i]))}};x([C],$r.prototype,"enabled",2),x([C],$r.prototype,"containment",2),x([C],$r.prototype,"selectedItem",2),x([C],$r.prototype,"unselectedItem",2),x([C],$r.prototype,"unselectedSeries",2),x([C],$r.prototype,"selectedOffset",2);var Ds=class extends Fe{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};x([C],Ds.prototype,"start",2),x([C],Ds.prototype,"stop",2),x([C],Ds.prototype,"fill",2),x([C],Ds.prototype,"fillOpacity",2),x([C],Ds.prototype,"stroke",2),x([C],Ds.prototype,"strokeWidth",2),x([C],Ds.prototype,"strokeOpacity",2),x([C],Ds.prototype,"lineDash",2),x([C],Ds.prototype,"lineDashOffset",2);var mg=class{constructor(){this.key="x",this.segments=new Ga(Ds)}};x([C],mg.prototype,"enabled",2),x([C],mg.prototype,"key",2),x([C],mg.prototype,"segments",2);var Wr=class extends Fe{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};x([C],Wr.prototype,"type",2),x([C],Wr.prototype,"colorStops",2),x([C],Wr.prototype,"bounds",2),x([C],Wr.prototype,"gradient",2),x([C],Wr.prototype,"rotation",2),x([C],Wr.prototype,"reverse",2),x([C],Wr.prototype,"colorSpace",2);var Ft=class extends Fe{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};x([C],Ft.prototype,"type",2),x([C],Ft.prototype,"colorStops",2),x([C],Ft.prototype,"bounds",2),x([C],Ft.prototype,"gradient",2),x([C],Ft.prototype,"rotation",2),x([C],Ft.prototype,"scale",2),x([C],Ft.prototype,"reverse",2),x([C],Ft.prototype,"path",2),x([C],Ft.prototype,"pattern",2),x([C],Ft.prototype,"width",2),x([C],Ft.prototype,"height",2),x([C],Ft.prototype,"padding",2),x([C],Ft.prototype,"fill",2),x([C],Ft.prototype,"fillOpacity",2),x([C],Ft.prototype,"backgroundFill",2),x([C],Ft.prototype,"backgroundFillOpacity",2),x([C],Ft.prototype,"stroke",2),x([C],Ft.prototype,"strokeOpacity",2),x([C],Ft.prototype,"strokeWidth",2);var Js=class extends Fe{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};x([C],Js.prototype,"type",2),x([C],Js.prototype,"url",2),x([C],Js.prototype,"rotation",2),x([C],Js.prototype,"scale",2),x([C],Js.prototype,"backgroundFill",2),x([C],Js.prototype,"backgroundFillOpacity",2),x([C],Js.prototype,"repeat",2),x([C],Js.prototype,"fit",2);var Dn=class extends Fe{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new qs,this.selection=new $r}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context")),"allowNullKeys"in e&&(this.allowNullKeys=e.allowNullKeys,t.delete("allowNullKeys"))}};x([C],Dn.prototype,"id",2),x([C],Dn.prototype,"visible",2),x([C],Dn.prototype,"focusPriority",2),x([C],Dn.prototype,"showInLegend",2),x([C],Dn.prototype,"cursor",2),x([C],Dn.prototype,"nodeClickRange",2),x([C],Dn.prototype,"highlight",2),x([C],Dn.prototype,"selection",2);function VD(t,e){if(e.length===0)return[!1,!1];const i=e[0],n=e.at(-1);if(typeof i=="string"||i===null||i===void 0)return[t===i,t===n];if(t==null)return[!1,!1];const s=t.valueOf();if(i==null||n==null)return[!1,!1];let r=i.valueOf(),o=n.valueOf();return r>o&&([r,o]=[o,r]),[s===r,s===o]}function yg(t,e,i,n,s,r){const[o,a]=VD(e,r),[l,c]=VD(t,s);return{xKey:i,yKey:n,xValue:t,yValue:e,first:l,last:c,min:o,max:a}}function kh(t,e,[i,n],s){let r=nl(0,e-1,a=>{const l=t===1?a:e-a,c=s(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,o=il(0,e-1,a=>{const l=t===1?a:e-a,c=s(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=n})??e-1;return t===-1&&([r,o]=[e-o,e-r]),r=Math.max(r,0),o=Math.min(o+1,e),[r,o]}function By(t,e,i){if(i){const{x:s,y:r,width:o,height:a}=i;return{canvasX:s+o/2,canvasY:r+a/2}}const n=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(n){const{x:s,y:r}=Oe.toCanvasPoint(t.contentGroup,n.x,n.y);return{canvasX:Math.round(s),canvasY:Math.round(r)}}}function eF(t,e,i,n,s){let r=-1,o=0,a=0,l=!1;for(;o<n&&r<=e-t;){r+=1;const c=i+a;if(l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),c<t||c>e){l=!0;continue}s(c)&&(o+=1)}return o}function _y(t){const e={};for(const i of Fy)e[i]=t(void 0,!1,i,void 0,void 0);return e}function tF(t,...e){const i={};for(const n of e??["default"])for(const s of Fy){const r=i[n]??(i[n]={});r[s]=t(void 0,!1,s,n)}return i}function zy(t){return(t?.opacity??1)<1||(t?.fillOpacity??1)<1||(t?.strokeOpacity??1)<1}var BD=new Map;function iF(t){if(t==null)return!1;const e=t.fill;if(!nt(e))return!1;const i=e.trim(),n=i.toLowerCase();if(n==="transparent"||n==="none")return!1;let s=BD.get(i);if(s==null){try{s=De.fromString(i).a===1}catch{s=!1}BD.set(i,s)}return s}function nF(t,e){return t!=="cutout"?t:iF(e)?"cutout":"overlay"}function _D(t,e,i){for(const n of e??[])switch(typeof t){case"string":if(n.itemId===t)return n;if(n.itemId===void 0&&i!==void 0){const s=n.datum?.[i];if(s!=null&&String(s)===t)return n}break;case"number":if(n.datumIndex===t||n.itemId===void 0&&i!==void 0&&n.datum?.[i]===t)return n;break;default:return t}}function sF(t,e,i){const n=By(t,i.datum,i.movedBounds);if(n!=null)return{x:n.canvasX,y:n.canvasY};const s=i.bounds;if(s!=null){if(s instanceof $){const{x:r,y:o}=s.computeCenter();return{x:e.x+r,y:e.y+o}}return Oe.toCanvas(s).computeCenter()}}function Gy({bounds:t}){return t instanceof $?t:t!=null?Oe.toCanvas(t):$.NaN}function rF(t,e,i){const{x:n,y:s}=sF(t,e,i)??{};if(n!==void 0&&s!==void 0)return{type:"keyboard",canvasX:n,canvasY:s}}var Fl=class Uv{constructor(e,i){this.data=e,this.dataIdKey=i,this.pendingTransactions=[]}static empty(e){return new Uv([],e)}static wrap(e,i){return new Uv(e,i)}size(){return this.data.length}netSize(){if(!this.hasPendingTransactions())return this.data.length;const e=this.getChangeDescription();return e?e.indexMap.finalLength:this.data.length}getDatumAt(e){return this.data[e]}addTransaction(e){const i=this.normalizeTransaction(e);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}getIdArray(){if(this.dataIdKey!=null){if(this.idArrayCache===void 0){this.idArrayCache=[];for(let e=0;e<this.size();e++)this.idArrayCache.push(this.getIdValue(this.getDatumAt(e)))}return this.idArrayCache}}getItemIdFromIndex(e){const i=this.getDatumAt(e);return(i?this.getIdValue(i):void 0)??e}getIndexFromItemId(e){return typeof e=="number"?!Number.isInteger(e)||e<0||e>=this.size()?void 0:e:this.getIdToIndexMap().get(e)}normalizeTransaction(e){const{add:i,addIndex:n,prepend:s,append:r,remove:o,update:a}=e;if(i===void 0)return e;const l={remove:o,update:a};if(s&&(l.prepend=s),r&&(l.append=r),i&&i.length>0){const c=this.netSize();n===void 0||n>=c?l.append=r?[...r,...i]:i:n===0?l.prepend=s?[...i,...s]:i:l.insertions=[{index:n,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(e){if(this.dataIdKey!=null&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const i=this.getChangeDescription();if(!i)return!1;const n=i.getPrependedValues(),s=i.getInsertionValues(),r=i.getAppendedValues(),o=[...n,...s,...r];let a=0;if(i.applyToArray(this.data,function(c){if(a>=o.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${c}`);return o[a++]}),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:l}=i.indexMap;for(const c of l){const h=this.getIdValue(this.data[c]);h!==void 0&&this.cachedPendingReplacements.has(h)&&(this.data[c]=this.cachedPendingReplacements.get(h))}}if(this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(i,r,n,s),this.updateIdToIndexCache(i,r,n,s),e?.onDataChange(i),this.idArrayCache){i.applyToArray(this.idArrayCache,c=>this.getIdValue(this.data[c]));const{updatedIndices:l}=i.indexMap;for(const c of l)this.idArrayCache[c]=this.getIdValue(this.data[c])}return!0}updateItemToIndexCache(e,i,n,s){if(!this.itemToIndexCache)return;if(this.dataIdKey){this.itemToIndexCache=void 0;return}const{indexMap:r}=e,{totalPrependCount:o,totalAppendCount:a,removedIndices:l}=r,c=l.size>0,h=s.length>0;if(!c&&o===0&&a===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}const u=Ny(l);if(c&&u===0){this.itemToIndexCache=void 0;return}const d=this.itemToIndexCache,g=o-u;if(g!==0)for(const[f,m]of d)l.has(m)?d.delete(f):d.set(f,m+g);else if(c)for(const[f,m]of d)l.has(m)&&d.delete(f);for(let f=0;f<n.length;f++){const m=n[f];d.has(m)||d.set(m,f)}const p=r.finalLength-a;for(let f=0;f<i.length;f++){const m=i[f];d.has(m)||d.set(m,p+f)}}updateIdToIndexCache(e,i,n,s){if(!this.idToIndexCache)return;const{indexMap:r}=e,{totalPrependCount:o,totalAppendCount:a,removedIndices:l}=r,c=l.size>0,h=s.length>0;if(!c&&o===0&&a===0&&!h)return;if(h){this.idToIndexCache=void 0;return}const u=Ny(l);if(c&&u===0){this.idToIndexCache=void 0;return}const d=this.idToIndexCache,g=o-u;if(g!==0)for(const[f,m]of d)l.has(m)?d.delete(f):d.set(f,m+g);else if(c)for(const[f,m]of d)l.has(m)&&d.delete(f);for(let f=n.length-1;f>=0;f--){const m=this.getIdValue(n[f]);m!==void 0&&d.set(m,f)}const p=r.finalLength-a;for(let f=0;f<i.length;f++){const m=this.getIdValue(i[f]);m!==void 0&&!d.has(m)&&d.set(m,p+f)}}clearPendingTransactions(){const e=this.pendingTransactions.length;return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,e}getPendingTransactions(){return[...this.pendingTransactions]}toJSON(){return this.data}getChangeDescription(){if(!this.hasPendingTransactions())return;if(this.cachedChangeDescription)return this.cachedChangeDescription;const{indexMap:e,prependValues:i,appendValues:n,insertionValues:s,pendingReplacements:r}=this.buildIndexMap(),o=new vD(e,{prependValues:i,appendValues:n,insertionValues:s});return this.cachedChangeDescription=o,this.cachedPendingReplacements=r,o}removeFromGroups(e,i){for(const n of e){let s=0;for(;s<n.length&&i.size>0;)i.has(n[s])?(i.delete(n[s]),n.splice(s,1)):s++;if(i.size===0)break}}buildIndexMap(){const e=this.data.length,i=this.collectTransactionEffects(),n=i.prependsList.flat(),s=i.appendsList.flat(),r=i.insertionsList.flat(),o=n.length,a=s.length,l=r.length,c=e-i.removedOriginalIndices.size,h=o+c+l+a,u=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,d=this.buildSpliceOperations(o,l,a,c,i.trackedInsertions,u?.desc,u?.asc),g=this.resolveUpdatedIndices(o,l,c,i.updateTracking,u?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:e,finalLength:h,spliceOps:d,removedIndices:i.removedOriginalIndices,updatedIndices:g,totalPrependCount:o,totalAppendCount:a},prependValues:n,appendValues:s,insertionValues:r,pendingReplacements:i.pendingReplacements}}getSortedRemovedIndices(e){const i=Array.from(e).sort((n,s)=>n-s);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const e={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const i of this.pendingTransactions){const{prepend:n,append:s,insertions:r,remove:o,update:a}=i;this.applyPrepends(n,e),this.applyInsertions(r,e),this.applyAppends(s,e),this.applyRemovals(o,e),this.applyUpdates(a,e)}return{prependsList:e.prependsList,appendsList:e.appendsList,insertionsList:e.insertionsList,trackedInsertions:e.trackedInsertions,removedOriginalIndices:e.removedOriginalIndices,updatedOriginalIndices:e.updatedOriginalIndices,updateTracking:e.updateTracking,pendingReplacements:e.pendingReplacements}}applyPrepends(e,i){!Array.isArray(e)||e.length===0||(i.prependsList.unshift([...e]),i.virtualLength+=e.length)}applyInsertions(e,i){if(Array.isArray(e))for(const{index:n,items:s}of e)n>=0&&n<=i.virtualLength&&s.length>0&&(i.trackedInsertions.push({virtualIndex:n,items:[...s]}),i.insertionsList.push([...s]),i.virtualLength+=s.length)}applyAppends(e,i){!Array.isArray(e)||e.length===0||(i.appendsList.push([...e]),i.virtualLength+=e.length)}applyRemovals(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyRemovalsById(e,i):this.applyRemovalsByRef(e,i))}applyRemovalsByRef(e,i){const n=new Set(e);if(this.removeFromGroups(i.prependsList,n),n.size>0&&this.removeFromGroups(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(e,i),n.size>0&&this.removeFromGroups(i.appendsList,n),n.size>0)for(let s=0;s<this.data.length&&n.size>0;s++){const r=this.data[s];n.has(r)&&(i.removedOriginalIndices.add(s),n.delete(r),i.virtualLength--)}n.size>0&&B.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyRemovalsById(e,i){const n=new Set;for(const s of e){const r=this.getIdValue(s);r===void 0?B.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):n.add(r)}if(n.size!==0){if(this.removeFromGroupsById(i.prependsList,n),n.size>0&&this.removeFromGroupsById(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,i),n.size>0&&this.removeFromGroupsById(i.appendsList,n),n.size>0){const s=this.getIdToIndexMap();for(const r of n){const o=s.get(r);o!==void 0&&(i.removedOriginalIndices.add(o),i.virtualLength--,n.delete(r))}}n.size>0&&B.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyUpdatesById(e,i):this.applyUpdatesByRef(e,i))}applyUpdatesByRef(e,i){const n=new Set(e),s=this.collectUpdatedIndicesFromGroups(i.prependsList,n),r=n.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,n):[],o=n.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndices(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:o,updatedInsertionsIndices:r},n.size>0&&B.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}applyUpdatesById(e,i){const n=new Map;for(const a of e){const l=this.getIdValue(a);l===void 0?B.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):n.set(l,a)}if(n.size===0)return;const s=this.collectUpdatedIndicesFromGroupsById(i.prependsList,n),r=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.insertionsList,n):[],o=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndicesById(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:o,updatedInsertionsIndices:r},n.size>0&&B.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(e,i){if(i.size===0||e.length===0)return[];const n=[];let s=0;for(const r of e){for(const o of r)i.has(o)&&(n.push(s),i.delete(o)),s++;if(i.size===0)break}return n}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let e=0;e<this.data.length;e++)this.itemToIndexCache.has(this.data[e])||this.itemToIndexCache.set(this.data[e],e)}return this.itemToIndexCache}getIdValue(e){if(this.dataIdKey==null||e==null||typeof e!="object")return;const i=e[this.dataIdKey];if(typeof i=="string"||typeof i=="number"&&!Number.isNaN(i))return i}getIdToIndexMap(){if(this.idToIndexCache===void 0){this.idToIndexCache=new Map;for(let e=0;e<this.data.length;e++){const i=this.getIdValue(this.data[e]);i!==void 0&&(this.idToIndexCache.has(i)?B.warnOnce(`dataIdKey '${this.dataIdKey}' has duplicate value '${i}'; first occurrence used.`):this.idToIndexCache.set(i,e))}this.idToIndexCache.size===0&&this.data.length>0&&B.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(e,i){for(const n of e){let s=0;for(;s<n.length&&i.size>0;){const r=this.getIdValue(n[s]);r!==void 0&&i.has(r)?(i.delete(r),n.splice(s,1)):s++}if(i.size===0)break}}collectUpdatedIndicesFromGroupsById(e,i){if(i.size===0||e.length===0)return[];const n=[];let s=0;for(const r of e){for(let o=0;o<r.length;o++){const a=this.getIdValue(r[o]);a!==void 0&&i.has(a)&&(r[o]=i.get(a),n.push(s),i.delete(a)),s++}if(i.size===0)break}return n}collectUpdatedOriginalIndicesById(e,i){const n=this.getIdToIndexMap();for(const[s,r]of e){const o=n.get(s);o!==void 0&&!i.removedOriginalIndices.has(o)&&(i.updatedOriginalIndices.add(o),i.pendingReplacements??(i.pendingReplacements=new Map),i.pendingReplacements.set(s,r),e.delete(s))}}collectUpdatedOriginalIndices(e,i){const n=this.getItemToIndexMap();for(const s of e){const r=n.get(s);r!==void 0&&!i.removedOriginalIndices.has(r)&&(i.updatedOriginalIndices.add(r),e.delete(s))}}removeFromTrackedInsertions(e,i){for(let n=0;n<i.trackedInsertions.length;n++){const s=i.trackedInsertions[n],r=s.items.length,o=[];let a=0;for(;a<s.items.length;)e.includes(s.items[a])?(o.push(a+o.length),s.items.splice(a,1),i.virtualLength--):a++;o.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,s,r,o)}}removeFromTrackedInsertionsById(e,i){const n=new Set;for(const s of e){const r=this.getIdValue(s);r!==void 0&&n.add(r)}if(n.size!==0)for(let s=0;s<i.trackedInsertions.length;s++){const r=i.trackedInsertions[s],o=r.items.length,a=[];let l=0;for(;l<r.items.length;){const c=this.getIdValue(r.items[l]);c!==void 0&&n.has(c)?(a.push(l+a.length),r.items.splice(l,1),i.virtualLength--,n.delete(c)):l++}if(a.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,r,o,a),n.size===0)break}}adjustLaterInsertionsAfterRemoval(e,i,n,s,r){const o=r.length;for(let a=i+1;a<e.length;a++){const l=e[a];if(l.virtualIndex<=n.virtualIndex)continue;const c=Math.min(Math.max(l.virtualIndex-n.virtualIndex,0),s);let h=0;for(const u of r)if(u<c)h++;else break;c===s&&(h=o),h>0&&(l.virtualIndex-=h)}}buildSpliceOperations(e,i,n,s,r,o,a){const l=[];if(e>0&&l.push({index:0,deleteCount:0,insertCount:e}),o&&o.length>0){let c=o[0],h=1;for(let u=1;u<o.length;u++){const d=o[u];o[u-1]-d===1?h++:(l.push({index:c-h+1+e,deleteCount:h,insertCount:0}),c=d,h=1)}l.push({index:c-h+1+e,deleteCount:h,insertCount:0})}if(r.length>0)for(const c of r){const h=this.countRemovalsBeforeIndex(a,e,c.virtualIndex),u=c.virtualIndex-h;l.push({index:u,deleteCount:0,insertCount:c.items.length})}return n>0&&l.push({index:e+s+i,deleteCount:0,insertCount:n}),l}countRemovalsBeforeIndex(e,i,n){if(!e||e.length===0)return 0;let s=0;for(const r of e)if(r+i<n)s++;else break;return s}resolveUpdatedIndices(e,i,n,s,r,o,a){const l=new Set;if(s)for(const c of s.updatedPrependsIndices)l.add(c);if(o.size>0){const c=Array.from(o).sort((u,d)=>u-d);let h=0;for(const u of c){if(r)for(;h<r.length&&r[h]<u;)h++;const d=r?h:0,g=u+e;let p=0;for(const m of a)m.virtualIndex<=g&&(p+=m.items.length);const f=u+e-d+p;l.add(f)}}if(s){const c=e+n+i;for(const h of s.updatedAppendsIndices)l.add(c+h);if(s.updatedInsertionsIndices.length>0&&a.length>0){let h=0;for(const u of a){const d=this.countRemovalsBeforeIndex(r,e,u.virtualIndex),g=u.virtualIndex-d;for(let p=0;p<u.items.length;p++)s.updatedInsertionsIndices.includes(h)&&l.add(g+p),h++}}}return l}},zD=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new TypeError("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){const e=this.eventListeners.get(t.type);if(e)for(const i of e)i(t)}};function Th(t,e){if(t.itemId!==void 0)return t.itemId;if(e!==void 0){const i=t.datum?.[e];if(i!=null)return typeof i=="number"?i:String(i)}return typeof t.datumIndex=="number"?t.datumIndex:JSON.stringify(t.datumIndex)}function jy(t,e){return t.series===e.series&&st(t.datumIndex,e.datumIndex)}function oF(t,e){return e==null?-1:t.findIndex(i=>jy(i,e))}function aF(t){return t.filter(e=>e.series.properties.tooltip.enabled??!0)}var lF=class{constructor(t,e){this.activeManager=t,this.tooltipProperties=e,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const t=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,t}getActivationArgs(t){if(t===void 0)return[void 0,void 0];{const e=t.series.id,i=Th(t,t.series.data?.dataIdKey);return[{type:"series-node",seriesId:e,itemId:i},t]}}maybeActivate(t,e,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[n,s]=this.getActivationArgs(t);this.activeManager.update(n,s)?this.activationPrevented=!0:(this.active=t,e(i?.defaultCbArg))}finally{this.blockEntrance=!1}}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(t){if(t!==void 0){const i=this.active;if(this.tooltipProperties.pagination&&i!==void 0){const n=t.matches.find(s=>jy(s,i));if(n)return n}}return t?.matches[0]}onPickedNodesTooltip(t){if(t!==void 0&&this.tooltipProperties.pagination){const i=this.active,n=aF(t.matches);this.candidates=n;let s=oF(n,i);s===-1&&(s=0);const r=n[s],o={index:s,length:n.length};return{active:r,paginationState:o}}return{active:t?.matches[0]}}onPickedNodesAPI(t){return this.pendingPickedNodes=t,t.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:t}=this,e=this.active,i=e==null?-1:t.findIndex(o=>jy(o,e));if(i===-1)return{active:void 0,paginationState:void 0};let n=i+1;n>=t.length&&(n=0);const s=t[n],r={index:n,length:this.candidates.length};return{active:s,paginationState:r}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}},Ni=class extends Lm{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}onChangeDetection(t){this._cachedStyle=void 0,super.onChangeDetection(t)}getStyle(){if(this._cachedStyle!==void 0)return this._cachedStyle;const{size:t,shape:e,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this,c={size:t,shape:e,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l};return this._cachedStyle=c,c}getDiameter(){return this.size+this.strokeWidth}};x([C,H()],Ni.prototype,"enabled",2),x([C,Ro({equals:fl})],Ni.prototype,"shape",2),x([C,H()],Ni.prototype,"size",2),x([C,Ro({equals:st})],Ni.prototype,"fill",2),x([C,H()],Ni.prototype,"fillOpacity",2),x([C,H()],Ni.prototype,"stroke",2),x([C,H()],Ni.prototype,"strokeWidth",2),x([C,H()],Ni.prototype,"strokeOpacity",2),x([C],Ni.prototype,"lineDash",2),x([C],Ni.prototype,"lineDashOffset",2),x([C,Ro({equals:fl})],Ni.prototype,"itemStyler",2);function cF(t,e,i,n,s){return{size:t?.size??e?.size??i.size,shape:t?.shape??e?.shape??i.shape??n.shape??s?.shape,fill:t?.fill??e?.fill??i.fill??n.fill??s?.fill,fillOpacity:t?.fillOpacity??e?.fillOpacity??i.fillOpacity??n.fillOpacity??s?.fillOpacity,stroke:t?.stroke??e?.stroke??i.stroke??n.stroke??s?.stroke,strokeWidth:t?.strokeWidth??e?.strokeWidth??i.strokeWidth??n.strokeWidth??s?.strokeWidth,strokeOpacity:t?.strokeOpacity??e?.strokeOpacity??i.strokeOpacity??n.strokeOpacity??s?.strokeOpacity,lineDash:t?.lineDash??e?.lineDash??i.lineDash??n.lineDash??s?.lineDash,lineDashOffset:t?.lineDashOffset??e?.lineDashOffset??i.lineDashOffset??n.lineDashOffset??s?.lineDashOffset,opacity:t?.opacity??e?.opacity??s?.opacity}}function hF(t,e){return t==null?e:{size:t.size??e.size,shape:t.shape??e.shape,fill:t.fill??e.fill,fillOpacity:t.fillOpacity??e.fillOpacity,stroke:t.stroke??e.stroke,strokeWidth:t.strokeWidth??e.strokeWidth,strokeOpacity:t.strokeOpacity??e.strokeOpacity,lineDash:t.lineDash??e.lineDash,lineDashOffset:t.lineDashOffset??e.lineDashOffset,opacity:t.opacity??e.opacity}}var GD=(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))(GD||{}),uF=.25,dF=.125,bg=class{constructor(t,e,i,n,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.datums=i.datums,this.totalValue=i.totalValue,this.seriesId=n.id,this.dataIdKey=n.data?.dataIdKey,this.itemId=Th(i,this.dataIdKey),this.selectionState=s}preventDefault(){this.defaultPrevented=!0}},Hy=class{constructor(t,e){this.series=t,this.seriesGrouping=e,this.type="groupingChanged"}};function jD(t){switch(t){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function $y(t){switch(t){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius";default:return"x"}}var Ur=class extends zD{constructor(t){super(),this.cleanup=new it,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.supportsStandaloneZoom=!1,this.hasChangesOnHighlight=!1,this.hasChangesOnSelection=!1,this.seriesGrouping=void 0,this.NodeEvent=bg,this.internalId=xn(this),this.contentGroup=new qt({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new qt({name:`${this.internalId}-highlight`,zIndex:1}),this.highlightNodeGroup=this.highlightGroup.appendChild(new se({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new se({name:`${this.internalId}-highlight-label`,zIndex:2})),this.annotationGroup=new qt({name:`${this.internalId}-annotation`}),this.labelGroup=new qt({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new uy,this._dataConnected=!0,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new Os,this._pickNodeCache=new cc(5),this.fireEventWrapper=c=>super.fireEvent(c);const{moduleCtx:e,pickModes:i,propertyKeys:n={},propertyNames:s={},canHaveAxes:r=!1,usesPlacedLabels:o=!1,alwaysClip:a=!1,supportsStandaloneZoom:l=!1}=t;this.ctx=e,this.propertyKeys=n,this.propertyNames=s,this.canHaveAxes=r,this.usesPlacedLabels=o,this.pickModes=i,this.alwaysClip=a,this.supportsStandaloneZoom=l,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",c=>{this._dataConnected&&this.setChartData(c)}),this.ctx.eventsHub.on("highlight:change",c=>this.onChangeHighlight(c)),this.events.on("data-selection-change",()=>{this.hasChangesOnSelection=!0,this.bucketLookup?.refresh()}))}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.visibleMaybeChanged()}get visible(){return this.ctx.legendManager?.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const t=this.data;return t==null?!1:t.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}isSelectionEnabled(){return this.properties.selection.enabled}isDatumSelectable(t){return!0}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:n,visible:s}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:n,visible:s,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new Hy(this,e))}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){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(t,e=!1){const i=this.bringToFront();return!e&&t===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=t,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:t),this.fireEvent(new Hy(this,this.seriesGrouping)),!0)}setZIndex(t){this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t}renderToOffscreenCanvas(){return!1}disconnectData(){this._dataConnected=!1}reconnectData(){this._dataConnected=!0}hasHighlightOpacity(){if(!this.properties.highlight.enabled)return!1;const t=this.ctx.highlightManager.getActiveHighlight();if(t==null||t.series?.isHighlightEnabled()===!1)return!1;const{unhighlightedItem:e,unhighlightedSeries:i}=this.properties.highlight;return zy(e)||zy(i)}getDrawingMode(t,e="cutout"){return t?e:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const t=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:t}}}addEventListener(t,e){return super.addEventListener(t,e)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this),this.moduleContext?.destroy()}getPropertyValues(t,e){const i=jD(t),n=i==null?t:$y(this.resolveKeyDirection(i)),s=e?.[n],r=[];if(!s)return r;const o=(...a)=>{for(const l of a)Array.isArray(l)?o(...l):typeof l=="object"?o(...Object.values(l)):r.push(l)};return o(...s.map(a=>this.properties[a])),r}getKeyAxis(t){}getKeys(t){return this.getPropertyValues($y(t),this.propertyKeys)}getKeyProperties(t){return this.propertyKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getPropertyValues($y(t),this.propertyNames)}getFormatterContext(t){const{id:e}=this,i=this.getPropertyValues(t,this.propertyKeys),n=this.getPropertyValues(t,this.propertyNames),s=[];for(let r=0;r<i.length;r++)s.push({seriesId:e,key:i[r],name:n[r]});return s}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(n=>n.getDomain(t)).flat();return i.length===0?e:{domain:e.domain.concat(i)}}getRange(t,e){return this.getSeriesRange(t,e)}getMinimumRangeSeries(t){}getMinimumRangeChart(t){return 0}getZoomRangeFittingItems(t,e,i){}getVisibleItems(t,e,i){return 1/0}toCanvasFromMidPoint(t){const{x:e=0,y:i=0}=t.midPoint??{};return Oe.toCanvasPoint(this.contentGroup,e,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:t,seriesGrouping:e,type:i,visible:n}=this;this.ctx.seriesStateManager.updateSeries({internalId:t,type:i,visible:n,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0})}getOpacity(){return this.properties.highlight?this.getSelectionStyle()?.opacity??this.getHighlightStyle().opacity??1:1}getHighlightState(t,e,i,n){return this.properties.highlight.enabled?e?1:t?.series==null||t.series.isHighlightEnabled()===!1?0:this.isSeriesHighlighted(t,n)?this.isItemHighlighted(t,i)==null?2:4:3:0}getDataSelectionState(t){return this.ctx.dataSelectionService?.getDataSelectionState(this,t)}getDataCandidacyState(t){return this.ctx.dataSelectionService?.getDataCandidateState(this,t)}createBucketLookupFeature(){}ensureBucketLookupFeature(){if(this.bucketLookup===void 0){const t=this.createBucketLookupFeature();t&&(this.bucketLookup=t,t.refresh())}return this.bucketLookup}getHighlightStateString(t,e,i,n){return Hr(this.getHighlightState(t,e,i,n))}getSelectionStateString(t,e){if(e??(e=this.getDataSelectionState(t)),e!==void 0)return un(e)}getCandidateStateString(t,e){if(e??(e=this.getDataCandidacyState(t)),e!==void 0)return un(e)}onChangeHighlight(t){const e=t.previousHighlight,i=t.currentHighlight,n=this.getHighlightState(i),s=this.getHighlightState(e);this.setSeriesIndex(this.declarationOrder);const r=this.hasItemStylers();if(!r&&n===s){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:o,unhighlightedItem:a,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=r||!xc(o)||!xc(a)||!xc(l)}bringToFront(){return this.hasDataSelection()?!0:this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(t,e){return this.properties.highlight.enabled?t?.series===this:!1}isItemHighlighted(t,e){if(!(t==null||Number.isNaN(t.datumIndex)||e==null))return t.datumIndex===e}hasDataSelection(){return(this.ctx.dataSelectionService?.getDataSetSelection(this)?.getSelectedCount()??0)>0}getHighlightStyle(t,e,i,n){if(i===void 0){const s=this.ctx.highlightManager?.getActiveHighlight();i=this.getHighlightState(s,t,e,n)}return this.properties.highlight.getStyle(i)}getSelectionStyle(t,e,i){i??(i=this.getDataCandidacyState(t)),e??(e=this.getDataSelectionState(t));const n=FD(e,i);if(n!==void 0)return this.properties.selection.getStyle(n)}resolveMarkerDrawingModeForState(t,e){return nF(t,e)}filterItemStylerFillParams(t){return sn(t)?q(t,["bounds","colorSpace","gradient","reverse"]):Us(t)?q(t,["padding"]):t}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:n,pickModeAxis:s,visible:r,contentGroup:o}=this;if(!r||!o.visible)return;let a=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:d}=this.properties;a=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:d}=this.properties;a=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=n.filter(d=>!i||d===0),{x:c,y:h}=t,u=JSON.stringify({x:c,y:h,maxDistance:a,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let g;switch(d){case 0:{const p=this.pickNodesExactShape(t);g=p.length===0?void 0:{datums:p,distance:0};break}case 1:{const p=this.pickNodeClosestDatum(t),f=p?.distance===0?this.pickNodesExactShape(t):void 0;f!=null&&f.length!==0?g={datums:f,distance:0}:p?g={datums:[p.datum],distance:p.distance}:g=void 0;break}case 2:{const p=s==null?void 0:this.pickNodeMainAxisFirst(t,s==="main-category");g=p==null?void 0:{datums:[p.datum],distance:p.distance};break}}if(g&&g.distance<=a)return this._pickNodeCache.set(u,{pickMode:d,datums:g.datums,distance:g.distance})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const n=i.unsafeClosestDatum();typeof n=="object"&&n!=null&&n.missing!==!0&&e.push(n)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=Ad(t.x,t.y,e),n=i.nearest?.unsafeClosestDatum();if(typeof n=="object"&&n!=null&&n.missing!==!0)return{datum:n,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}pickNodesInBBoxPredicate(){const{containment:t}=this.properties.selection,e=i=>i;switch(t){case"any":return(i,n)=>{const s=Oe.toCanvas(this.contentGroup,n.getBBox());return yd(i,s.x,s.y,s.width,s.height)};case"all":return(i,n)=>{const s=Oe.toCanvas(this.contentGroup,n.getBBox());return tl(i,s.x,s.y,s.width,s.height)};default:return e(t)}}*pickNodesInBBox(t){function*e(n,s){for(const r of n.children())if(!(!r.visible||r.pointerEvents===1))if(typeof r.datum=="object"&&r.datum!=null&&"datumIndex"in r.datum){const o=s(r);o!==void 0&&(yield o)}else r instanceof se&&(yield*e(r,s))}const i=this.pickNodesInBBoxPredicate();yield*e(this.contentGroup,n=>{if(i(t,n))return n.unsafeDatum})}getLabelData(){return[]}updatePlacedLabelData(t){}fireEvent(t){tn([this.properties,this.ctx.chartService],this.fireEventWrapper,t)}fireNodeClickEvent(t,e){const i=this.getSelectionStateString(e.datumIndex),n=new this.NodeEvent("seriesNodeClick",t,e,this,i);return this.fireEvent(n),!n.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=this.getSelectionStateString(e.datumIndex),n=new this.NodeEvent("seriesNodeDoubleClick",t,e,this,i);return this.fireEvent(n),!n.defaultPrevented}createNodeContextMenuActionEvent(t,e){const i=this.getSelectionStateString(e.datumIndex);return new this.NodeEvent("nodeContextMenuAction",t,e,this,i)}onLegendInitialState(t,e){const{visible:i=!0,itemId:n,legendItemName:s}=e??{};this.toggleSeriesItem(i,t,n,s)}onLegendItemClick(t){const{enabled:e,itemId:i,series:n,legendType:s}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=r!=null&&r===t.legendItemName;(n.id===this.id||a||o!=null)&&this.toggleSeriesItem(e,s,i,r,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:n,numVisibleItems:s,legendType:r}=t,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===t.legendItemName;n.id===this.id||l||a!=null?this.toggleSeriesItem(!0,r,i,o,t):e&&s===1?this.toggleSeriesItem(!0,r,void 0,o):this.toggleSeriesItem(!1,r,void 0,o)}toggleSeriesItem(t,e,i,n,s){const r=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:s?.legendItemName??n,visible:t};this.fireEvent(o),this.ctx.legendManager?.toggleItem(t,r,i,n)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return this.moduleContext??(this.moduleContext=this.ctx.child().constant("series",this)),this.moduleContext}getAxisValueText(t,e,i,n,s,r,o){const{id:a,properties:l}=this;return t.formatDatum(l,i,e,a,r,n,s,void 0,void 0,void 0,o)}getLabelText(t,e,i,n,s,r,o,a=!1){if(t==null&&!a)return"";const{axes:l,canHaveAxes:c,ctx:h,id:u,properties:d}=this,g="series-label",p="legendItemName"in d?d.legendItemName:void 0,f={seriesId:this.id,...o},m=c?jD(n):void 0,y=m==null?void 0:l[this.resolveKeyDirection(m)];if(y!=null)return y.formatDatum(d,t,g,u,p,e,i,s,r,f,a);const{formatManager:b}=h,v=this.callWithContext.bind(this),S=D=>r.formatValue(v,D.type,D.value,f)??b.format(v,D)??(t==null?"":String(t)),M=this.getFormatterContext(n);switch(n){case"y":case"color":case"size":return S({type:"number",value:t,datum:e,seriesId:u,legendItemName:p,key:i,source:g,property:n,domain:s,boundSeries:M,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return S({type:"category",value:t,datum:e,seriesId:u,legendItemName:p,key:i,source:g,property:n,domain:s,boundSeries:M})}}getMarkerStyle(t,{datumIndex:e,datum:i,point:n},s,r,o={size:n?.size??t.size??0},a){const{itemStyler:l}=t,{highlightState:c,isHighlight:h=!1,checkForHighlight:u=!0,resolveMarkerSubPath:d=["marker"],resolveStyler:g=!1,hideWithSize0:p=!1}=r??{},f=r?.selectionState??this.getDataSelectionState(e),m=this.getDataCandidacyState(e);if(p&&Vy(FD(f,m)))return{size:0};let y;const b=()=>y??(y=["series",`${this.declarationOrder}`,...d]);if(g){const D={permissivePath:!0},I=this.ctx.optionsGraphService.resolvePartial(b(),o,D);I&&(o={...I,size:I.size??o.size})}const v=u?this.getHighlightStyle(h,e,c):void 0,S=u&&this.isSelectionEnabled()?this.getSelectionStyle(e,f,m):void 0;let M=cF(S,v,o,t.getStyle(),a);if(l&&s){const D=c===void 0?this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),h,e):Hr(c),I=f===void 0?void 0:un(f),A=m===void 0?void 0:un(m),k=this.filterItemStylerFillParams(M.fill),T=this.cachedCallWithContext(l,{seriesId:this.id,...M,fill:k,...s,highlightState:D,selectionState:I,candidateState:A,datum:i}),R=this.ctx.optionsGraphService.resolvePartial(b(),T);M=hF(R,M)}return M}applyMarkerStyle(t,e,i,n,s){const{shape:r,size:o=0}=t,{applyPosition:a=!0,crossFilterSelected:l=!0,hideWithSize0:c}=s,h=this.visible&&(c||this.visible&&o>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y));if(e.setStyleProperties(t,n),e.setVisibilityAndPosition(!!h,r,o,a?i:void 0),l||(e.fillOpacity*=uF,e.strokeOpacity*=dF),typeof r=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const u=e.getBBox();if(i!=null&&u.isFinite()){const d=u.computeCenter(),[g,p]=["x","y"].map(f=>(t.strokeWidth??0)+Math.abs(d[f]-i[f]));i.focusSize=Math.max(u.width+g,u.height+p)}}}runMarkerStylePass(t,e,i,n){const{keyExtra:s,cacheable:r=!0,compute:o,apply:a}=n,l=r?new Map:null,c=this.ctx.highlightManager.getActiveHighlight(),h=this,u=h;t.each(function(g,p){if(t.isGarbage(g))return;const f=h.getHighlightState(c,e,p.datumIndex),m=h.getDataSelectionState(p.datumIndex),y=h.getDataCandidacyState(p.datumIndex),b=s===void 0?"":`:${s(p)}`,v=`${f}:${m??"-"}:${y??"-"}${b}`;let S=l?.get(v);S===void 0&&(S=o(u,i,f,m,p),l?.set(v,S)),a(u,i,p,f,m,S)})}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(t){const{width:e,height:i}=t??{width:Number.NaN,height:Number.NaN},n=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,s=ps(this.nodeDataDependencies,n)!=null;return s&&(this._nodeDataDependencies=n,this.markNodeDataDirty()),s}pickFocus(t){}pickViewportFocus(t){}mapFocusBBoxToPanTarget(t,e){return e}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,n=i.get(t);if(n!=null)return n;try{const s=e();return i.set(t,s),s}catch(s){B.error(String(s))}}cachedCallWithContext(t,e,i){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],t,e,i)}callWithContext(t,e){return tn([this.properties,this.ctx.chartService],t,e)}formatTooltipWithContext(t,e,i){return t.formatTooltip([this.properties,this.ctx.chartService],e,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};Ur.className="Series",Ur.assignCachedStyle=(t,e,i,n,s,r)=>{i.style=r},x([gi({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Ur.prototype,"seriesGrouping",2);var Wy=class extends Ur{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:t,yScale:e}){const i=Ge.is(t),n=Ge.is(e);return{isContinuousX:i,isContinuousY:n,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()),e??(e=Fl.empty());const{dataModel:n,processedData:s}=await t.request(this.id,e,i);return this.dataModel=n,this.processedData=s,this.events.emit("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}}isProcessedDataAnimatable(){const{processedData:t,ctx:e}=this;if(!t)return!1;const i=this.getNodeData();if(i!=null&&i.length>e.animationManager.maxAnimatableItems)return!1;const n=t.reduced?.animationValidation;if(!n)return!0;const{orderedKeys:s,uniqueKeys:r}=n;return s&&r}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return _D(t,this.getNodeData(),this.data?.dataIdKey)}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:n}=this,s=e[i],r={...t,datumIndex:i},o=this.computeFocusBounds(r);if(o!==void 0)return{bounds:o,clipFocusBox:n,datum:s,datumIndex:i}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,n)=>i.datumIndex-n.datumIndex),e}isDatumEnabled(t,e){const{missing:i=!1,enabled:n=!0,focusable:s=!0}=t[e];return!i&&n&&s}computeFocusDatumIndex(t,e){const i=(o,a)=>{for(;o>=0&&!this.isDatumEnabled(e,o);)o+=a;return o===-1?void 0:o},n=(o,a)=>{for(;o<e.length&&!this.isDatumEnabled(e,o);)o+=a;return o===e.length?void 0:o};let s;const r=J(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?s=i(r,t.datumIndexDelta):t.datumIndexDelta>0?s=n(r,t.datumIndexDelta):s=n(r,1)??i(r,-1),s===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:s}dataModelPropertyIsKey(t){const{processedData:e}=this;return e?e.defs.keys.some(i=>i.id===t&&i.idsMap?.get(this.id)?.has(t)===!0):!1}keysOrValues(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:this.dataModelPropertyIsKey(t)?e.resolveKeysById(this,t,i):e.resolveColumnById(this,t,i,"object")}sortOrder(t){const{dataModel:e,processedData:i}=this;if(!(!e||!i))return this.dataModelPropertyIsKey(t)?e.getKeySortOrder(this,t,i):e.getColumnSortOrder(this,t,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,n=this.getCategoryKey();return!e||!i||!n||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(n)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,n=this.getCategoryKey();if(!e||!i||!n)return;t=t.valueOf();const s=e.invalidData?.get(this.id),r=this.keysOrValues(n);for(let o=0;o<r.length;o+=1){if(s?.[o]===!0)continue;const a=r[o]?.valueOf();if(st(t,a))return o}}},Vl={x:["xKey"],y:["yKey"]},Bl={x:["xName"],y:["yName"]},vg=class extends bg{constructor(t,e,i,n,s){super(t,e,i,n,s),this.xKey=n.properties.xKey,this.yKey=n.properties.yKey}},Un=class extends Dn{constructor(){super(...arguments),this.xKeyAxis="x",this.yKeyAxis="y",this.pickOutsideVisibleMinorAxis=!1,this.segmentation=new mg}};x([C],Un.prototype,"xKeyAxis",2),x([C],Un.prototype,"yKeyAxis",2),x([C],Un.prototype,"legendItemName",2),x([C],Un.prototype,"pickOutsideVisibleMinorAxis",2),x([C],Un.prototype,"segmentation",2);var Uy=100,Kr=class extends Wy{constructor({pathsPerSeries:t=["path"],pathsZIndexSubOrderOffset:e=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:n=!1,animationAlwaysPopulateNodeData:s=!1,segmentedDataNodes:r=!0,animationResetFns:o,propertyKeys:a,propertyNames:l,...c}){if(super({propertyKeys:a,propertyNames:l,canHaveAxes:!0,...c}),this.NodeEvent=vg,this.dataNodeGroup=this.contentGroup.appendChild(new iD({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new qt({name:`${this.id}-series-labels`})),this.labelSelection=At.select(this.labelGroup,Wi),this.highlightSelection=At.selectNoInference(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=At.select(this.highlightLabelGroup,Wi),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=re.create(),!a||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,pathsZIndexSubOrderOffset:e,propertyKeys:a,propertyNames:l,animationResetFns:o,animationAlwaysUpdateSelections:n,animationAlwaysPopulateNodeData:s,datumSelectionGarbageCollection:i,segmentedDataNodes:r},this.paths=t.map(h=>new by({name:`${this.id}-${h}`})),this.datumSelection=At.selectNoInference(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new Xc("empty",{empty:{update:{target:"ready",action:h=>this.animateEmptyUpdateReady(h)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:h=>this.animateReadyHighlight(h),resize:h=>this.animateReadyResize(h),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:h=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(h):this.animateWaitingUpdateReady(h)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:h=>this.resetAllAnimation(h),reset:"empty"},clearing:{update:{target:"empty",action:h=>this.animateClearingUpdateEmpty(h)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",h=>this.onLegendItemClick(h)),this.ctx.eventsHub.on("legend:item-double-click",h=>this.onLegendItemDoubleClick(h)))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(t){if(this.shouldFlipXY()){if(t==="x")return this.properties.yKeyAxis;if(t==="y")return this.properties.xKeyAxis}if(t==="x")return this.properties.xKeyAxis;if(t==="y")return this.properties.yKeyAxis}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(t){for(const e of t)this.contentGroup.appendChild(e)}detachPaths(t){for(const e of t)e.remove()}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>Uy}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(t){if(!this.properties.highlight.enabled)return!1;const{series:e,legendItemName:i}=t??{},{legendItemName:n}=this.properties;return e===this||n!=null&&n===i}strokewidthChange(){const t=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,e=this.properties.highlight.highlightedSeries.strokeWidth??t,i=this.properties.highlight.highlightedItem?.strokeWidth??t;return t>i||e>i}update({seriesRect:t}){const{_contextNodeData:e}=this,i=this.checkResize(t),n=this.updateHighlightSelection(),s=this;this.contentGroup.batchedUpdate(function(){const a=s.updateSelections(),l=s.contextNodeData?.segments;s.opts.segmentedDataNodes?s.dataNodeGroup.segments=l??s.dataNodeGroup.segments:s.dataNodeGroup.segments=void 0,s.updateNodes(n,i||a)});const r=this.getAnimationData(t,e);r&&(i&&this.animationState.transition("resize",r),this.animationState.transition("update",r),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(t=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!In(i)||t:!1}trimIncrementalNodeArray(t,e){e<t.length&&(t.length=e)}createNodeData(){const t=this.validateCreateNodeDataPreconditions();if(!t)return;const{xAxis:e,yAxis:i}=t,n=this.createNodeDatumContext(e,i);if(!n)return this.getEmptyResult();const s=this.initializeResult(n);return!this.visible&&(this.seriesGrouping==null&&!this.opts.animationAlwaysPopulateNodeData||!n.animationEnabled)?s:(this.populateNodeData(n),this.finalizeNodeData(n),this.assembleResult(n,s))}createNodeDatumContext(t,e){throw new Error(`${this.constructor.name}: createNodeDatumContext() must be implemented when using the template method pattern`)}populateNodeData(t){throw new Error(`${this.constructor.name}: populateNodeData() must be implemented when using the template method pattern`)}initializeResult(t){throw new Error(`${this.constructor.name}: initializeResult() must be implemented when using the template method pattern`)}validateCreateNodeDataPreconditions(){const t=this.axes.x,e=this.axes.y;if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getEmptyResult(){}finalizeNodeData(t){t.canIncrementallyUpdate&&this.trimIncrementalNodeArray(t.nodes,t.nodeIndex)}assembleResult(t,e){return e}updateSelections(){var t;const e=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&e)return this._contextNodeData&&(this._contextNodeData.visible=!1),!1;const{nodeDataRefresh:i}=this;if(!i&&!this.isPathOrSelectionDirty())return!1;if(i){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const n=this.isProcessedDataAnimatable();if(this._contextNodeData){(t=this._contextNodeData).animationValid??(t.animationValid=n);const o=this._contextNodeData.nodeData?.length;o!=null&&or.record(`${this.type}:nodeData`,o)}const{dataModel:s,processedData:r}=this;s!==void 0&&r!==void 0&&this.events.emit("data-update",{dataModel:s,processedData:r}),this.updateSeriesSelections()}return i}updateSeriesSelections(){const{datumSelection:t,labelSelection:e,paths:i}=this,n=this._contextNodeData;if(!n)return;const{nodeData:s,labelData:r,itemId:o}=n;this.updatePaths({itemId:o,contextData:n,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:e})??e})}getShapeFillBBox(){const{axes:t}=this,e=t.x,i=t.y,[n,s]=Ot(e?.range??[0,1]),[r,o]=Ot(i?.range??[0,1]),a=lc(this.getSeriesDomain("x")),l=[e?.scale.convert(a.at(0)),e?.scale.convert(a.at(-1))],c=lc(this.getSeriesDomain("y")),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=Ot(l),[g,p]=Ot(h);return{axis:new $(n,r,s-n,o-r),series:new $(u,g,d-u,p-g)}}updateNodes(t,e){const{highlightSelection:i,datumSelection:n}=this,s=!this.ctx.animationManager.isSkipped(),r=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=s||r,this.annotationGroup.visible=s||r,this.highlightGroup.visible=(s||r)&&t,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:o}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:a,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:u}=this.contextNodeData??{};if(this.updatePathNodes({itemId:u,paths:c,visible:r,animationEnabled:s}),a.visible=s||r,h.visible=r,!a.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:n,isHighlight:!1});const d=this.strokewidthChange()||this.hasChangesOnHighlight||this.hasChangesOnSelection;this.hasChangesOnSelection=!1,(e||d)&&(this.updateDatumNodes({datumSelection:n,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(t,e){return e?[{...e}]:void 0}getHighlightLabelData(t,e){const i=t.filter(n=>n.datum===e.datum&&n.itemId===e.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:t,highlightLabelSelection:e,_contextNodeData:i}=this;if(!i)return!1;const n=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(n),r=n?.datumIndex,o=typeof r=="number"&&!Number.isNaN(r),a=s&&o?n:void 0;if(a==null)return!1;const{nodeData:l,labelData:c}=i,h=this.getHighlightData(l,a);this.highlightSelection=this.updateHighlightSelectionItem({items:h,highlightSelection:t});const u=this.getHighlightLabelData(c,a)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:u,labelSelection:e})??e,!0}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 t=this.ctx.scene?.canvas??{width:0,height:0},e=new $(0,0,t.width,t.height);this.quadtree=new nD(100,10,e),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickViewportFocus(t){if(this.contextNodeData?.nodeData===void 0)return;const{otherIndex:e,where:i,hoverRect:n}=t;if(i==="data-start")return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(i==="data-end"){const b=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:b,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0})}let s,r=0,o,a=this.contextNodeData.nodeData.length-1;const l=this.axes.x?.options.reverse===!0;function c(b){const v=n.x+n.width;return b.x+b.width<=v}function h(b){return b.x>=n.x}function u(b,v){const S=Gy(v);b(S)?(s=v,a=o-1):r=o+1}function d(b,v){const S=Gy(v);b(S)?(s=v,r=o+1):a=o-1}const g={"viewport-start + true":{predicate:c,iterator:u},"viewport-start + false":{predicate:h,iterator:u},"viewport-end + true":{predicate:h,iterator:d},"viewport-end + false":{predicate:c,iterator:d}},{predicate:p,iterator:f}=g[`${i} + ${l}`];let m=0;const y=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;r<=a&&m<=y;){o=Math.floor((r+a)/2);const b=this.pickFocus({datumIndex:o,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(b===void 0){B.error(`pickFocus (datumIndex: ${o}) failed`);return}f(p,b),m++}return s}pickNodeDataExactShape(t){const{x:e,y:i}=t,{dataNodeGroup:n}=this,s=n.pickNodes(e,i).filter(r=>{const{unsafeDatum:o}=r;return o!==void 0&&o?.missing!==!0});if(s.length!==0)return s.map(o=>o.datum)}pickModulesExactShape(t){for(const e of this.moduleMap.modules()){const{unsafeDatum:i}=e.pickNodeExact(t)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.length!==0?e:this.pickNodeDataExactShape(t)??this.pickModulesExactShape(t)??[]}pickNodeDataClosestDatum(t){const{x:e,y:i}=t,{axes:n,_contextNodeData:s}=this;if(!s)return;const r=n.x,o=n.y,a={x:e,y:i};let l=1/0,c;for(const h of s.nodeData){const{point:{x:u=Number.NaN,y:d=Number.NaN}={}}=h;if(Number.isNaN(u)||Number.isNaN(d)||!(r?.inRange(u)&&o?.inRange(d)))continue;const p=Math.max((a.x-u)**2+(a.y-d)**2,0);p<l&&(l=p,c=h)}if(l!=null){const h=(c?.point?.size??0)/2,u=Math.sqrt(l);return{datum:c,distance:Math.max(u-h,0)}}}pickModulesClosestDatum(t){let e=1/0,i;for(const n of this.moduleMap.modules()){const s=n.pickNodeNearest(t);s!==void 0&&s.distanceSquared<e&&(e=s.distanceSquared,i=s.unsafeDatum)}if(e!=null)return{unsafeClosestDatum:i,distance:Math.sqrt(e)}}pickNodeClosestDatum(t){let e=1/0,i;const n=this.pickNodeDataClosestDatum(t);n!=null&&n.distance<e&&(e=n.distance,i=n.datum);const s=this.pickModulesClosestDatum(t);if(s!=null&&s.distance<e&&(e=s.distance,i=s.unsafeClosestDatum),i)return{datum:i,distance:e}}pickNodeMainAxisFirst(t,e){const{x:i,y:n}=t,{axes:s,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!r)return;const a=s.x,l=s.y;if(a==null||l==null)return;const c=[a,l].filter(p=>p.isCategoryLike()).map(p=>p.direction);if(e&&c.length===0)return;const[h="x"]=c,u=[i,n];h!=="x"&&u.reverse();const d=[1/0,1/0];let g;for(const p of r.nodeData){const{x:f=Number.NaN,y:m=Number.NaN}=p.point??p.midPoint??{};if(Number.isNaN(f)||Number.isNaN(m)||p.missing===!0)continue;const y=[a?.inRange(f,1),l?.inRange(m,1)];if(h!=="x"&&y.reverse(),!y[0]||!o&&!y[1])continue;const b=[f,m];h!=="x"&&b.reverse();let v=!0;for(let S=0;S<b.length;S++){const M=Math.abs(b[S]-u[S]);if(M>d[S]){v=!1;break}else M<d[S]&&(d[S]=M,d.fill(1/0,S+1,d.length))}v&&(g=p)}if(g){let p=Math.max(d[0]**2+d[1]**2-(g.point?.size??0),0);for(const f of this.moduleMap.modules()){const m=f.pickNodeMainAxisFirst(t,h);if(m!=null&&m.distanceSquared<p){g=m.unsafeDatum,p=m.distanceSquared;break}}return{datum:g,distance:Math.sqrt(p)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(t,e,i,n){let s;if(n==null){const{processedData:c,dataModel:h}=this;s=h.getColumnSortOrder(this,t,c)??1}else s=n.sortOrder;const r=this.keysOrValues(t),o=0,[a,l]=kh(s,i?.length??r.length,e,c=>{const h=i?.[c]??c;return this.xCoordinateRange(r[h],o,h)});return a<l?[a,l]:[l,a]}domainForVisibleRange(t,e,i,n,s){const{processedData:r,dataModel:o}=this,[a,l]=n,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const p=this.visibleRangeIndices(i,n,s,{sortOrder:h});return o.getDomainBetweenRange(this,e,p,r)}const u=e.map(p=>this.keysOrValues(p));let d=1/0,g=-1/0;for(const[p,f]of c.entries()){const[m,y]=this.xCoordinateRange(f,0,p);if(!(y<a||m>l))for(let b=0;b<e.length;b++){const v=u[b][p];On(v)&&(d=Es(d,v),g=ss(g,v))}}return d>g?[Number.NaN,Number.NaN]:[d,g]}domainForClippedRange(t,e,i){const{processedData:n,dataModel:s,axes:r}=this,a=gF(r[t==="x"?"y":"x"]);if(!a)return e.flatMap(f=>s.getDomain(this,f,"value",n).domain);const l=this.keysOrValues(i),c=this.sortOrder(i);if(c!=null){const f=pF(c,l.length,a,m=>l[m]);return s.getDomainBetweenRange(this,e,f,n)}const h=e.map(f=>this.keysOrValues(f)),u=a[0].valueOf(),d=a[1].valueOf();let g=1/0,p=-1/0;for(const[f,m]of l.entries()){const y=m.valueOf();if(!(y<u||y>d))for(let b=0;b<e.length;b++){const v=h[b][f];On(v)&&(g=Es(g,v),p=ss(p,v))}}return g>p?[Number.NaN,Number.NaN]:[g,p]}zoomFittingVisibleItems(t,e,i,n,s){const{dataModel:r,processedData:o}=this;if(!r||!o)return;const a=this.axes.x;if(n!=null)return;const l=this.sortOrder(t);if(l==null)return;const c=this.keysOrValues(t);if(s>c.length)return{x:[0,1],y:void 0};const h=a.scale,u=h.range;h.range=[0,1];let[d,g]=this.visibleRangeIndices(t,i,void 0,{sortOrder:l});g-=1;const p=0;this.xCoordinateRange(c[d],p,d)[0]<i[0]&&(d+=1),this.xCoordinateRange(c[g],p,g)[1]>i[1]&&(g-=1);let f;if(Math.abs(g-d)>=s-1)f=i;else{const m=(i[0]+i[1])/2;for(;Math.abs(g-d)<s-1&&(d>0||g<c.length-1);)if(d===0)g+=1;else if(g===c.length-1)d-=1;else{const v=this.xCoordinateRange(c[d-1],p,d-1)[0],S=this.xCoordinateRange(c[g+1],p,g+1)[1];Math.abs(v-m)<Math.abs(S-m)?d-=1:g+=1}const y=this.xCoordinateRange(c[d],p,d)[0],b=this.xCoordinateRange(c[g],p,g)[1];f=[Math.min(i[0],y),Math.max(i[1],b)]}return h.range=u,{x:f,y:void 0}}countVisibleItems(t,e,i,n,s){const{dataModel:r,processedData:o}=this;if(!r||!o)return 1/0;const a=this.keysOrValues(t),l=e.map(I=>r.resolveColumnById(this,I,o,"object")),c=this.shouldFlipXY(),h=c?this.axes.y:this.axes.x,u=c?this.axes.x:this.axes.y,d=c?n??[0,1]:i,g=c?i:n??[0,1];if(n==null){const I=this.sortOrder(t);if(I!=null){const A=h.scale,k=A.range;A.range=[0,1];const T=this.keysOrValues(t);let[R,E]=this.visibleRangeIndices(t,d,void 0,{sortOrder:I});if(E-=1,E<R)return 0;const F=0;this.xCoordinateRange(T[R],F,R)[0]<d[0]&&(R+=1),this.xCoordinateRange(T[E],F,E)[1]>d[1]&&(E-=1);const N=Math.abs(E-R)+1;return A.range=k,N}}const p=(I,A,k)=>I[0]+(k-A[0])/(A[1]-A[0])*(I[1]-I[0]),f=h.range.toSorted(),m=u.range.toSorted(),y=p(f,h.visibleRange,d[0]),b=p(f,h.visibleRange,d[1]),v=p(m,u.visibleRange,Math.min(...g)),S=p(m,u.visibleRange,Math.max(...g)),M=Math.round((d[0]+(d[1]-d[0])/2)*a.length),D=0;return eF(0,a.length-1,M,s,I=>{const[A,k]=this.xCoordinateRange(a[I],D,I),[T,R]=this.yCoordinateRange(l.map(E=>E[I]),D,I);return!Be(A)||!Be(k)||!Be(T)||!Be(R)?!1:A>=y&&k<=b&&T>=v&&R<=S})}minTimeInterval(){let t;try{t=this.keysOrValues("xValue")}catch{}if(t==null||t.length>1e3)return;let e=1/0,i=t[0],n;for(let s=1;s<t.length;s++){const r=t[s];if(r!=null&&i!=null){const o=Number(r.valueOf())-Number(i.valueOf()),a=Math.sign(o);if(a===0)continue;if(n!==void 0&&a!==n)return;e=Math.min(e,Math.abs(o)),n=a}i=r}if(Number.isFinite(e))return e}updateHighlightSelectionItem(t){const{items:e,highlightSelection:i}=t,n=e??[];return this.updateDatumSelection({nodeData:n,datumSelection:i})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateDatumStyles(t){}updatePaths(t){for(const e of t.paths)e.visible=!1}updatePathNodes(t){const{paths:e,visible:i}=t;for(const n of e)n.visible=i}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};if(e)for(const i of t.paths)Qt([i],e)}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Qt([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&Qt([t.labelSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(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&&Qt([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,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 yy){const{range:e,domain:i}=t;return{type:"log",convert:n=>t.convert(n),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Ge){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Hn){if(t instanceof zr){const e=t.getLinearParams(),i=t.getBandCountForUpdate();if(e!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:e.firstBandTime,lastBandTime:e.firstBandTime+(i-1)*e.intervalMs,bandCount:i,intervalMs:e.intervalMs,inset:t.inset,step:t.step}}return{type:"category",domain:t.domain,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(df)){const i=this.axes[e];if(!i)continue;const n=this.getScaling(i.scale);n!=null&&(t[e]=n)}return t}};function gF(t){let e,i;if((t instanceof Xs||t instanceof lg)&&({min:e,max:i}=t.options),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function pF(t,e,i,n){const s=i[0].valueOf(),r=i[1].valueOf();let o=nl(0,e-1,l=>{const c=t===1?l:e-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h>=s}),a=il(0,e-1,l=>{const c=t===1?l:e-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h<=r});return o==null||a==null?[0,0]:(t===-1&&([o,a]=[e-a,e-o]),o=Math.max(o,0),a=Math.min(a+1,e),[o,a])}function HD(t){const e=new Map;for(const i of t){if(!(i instanceof Kr))continue;const s=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(s==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const r=`${i.type}-${s}`;let o=e.get(r);o==null&&(o=[],e.set(r,o)),o.push(i)}for(const i of e.values()){i.sort((s,r)=>(s.seriesGrouping?.stackIndex??0)-(r.seriesGrouping?.stackIndex??0));let n;for(const s of i)s.seriesBelowStackContext=n,n=s.createStackContext()}}var fF=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise((e,i)=>{this.acquireQueue.push([t,e,i]),this.available&&this.dispatchNext().catch(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,i]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(n){i?.(n)}[t,e,i]=this.acquireQueue.shift()??[]}this.available=!0}};function mF(t,e){function i(s,r){return t.requestAnimationFrame(s)}function n(s){t.cancelAnimationFrame(s)}return $D(i,e,n)}function Ky(t){function e(n,s=0){if(s===0){queueMicrotask(n);return}return setTimeout(n,s)}function i(n){clearTimeout(n)}return $D(e,t,i)}function $D(t,e,i){let n=0,s=!1,r,o,a;function l(){return s}function c(){s=!1,a=void 0,o?.(),o=void 0,r=void 0,n>0&&(a=t(h))}function h(){const f=n;n=0,s=!0;const m=e({count:f});if(!m){c();return}m.then(c,c)}function u(f){n===0&&!l()&&(a=t(h,f)),n++}function d(){a!=null&&i&&(i(a),a=void 0,n=0)}async function g(){if(l())for(r??(r=new Promise(p));l();)await r}function p(f){o=f}return{schedule:u,cancel:d,waitForCompletion:g}}var WD=class extends pc{constructor(t){super(),this.ctx=t,this.rectNode=new Pt,this.textNode=new Wi,this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}applyOptions(){const t=this.ctx.chartState.getValue("options","background");this.node.visible=t.visible,this.rectNode.fill=t.fill}createNode(){return new se({name:"background",zIndex:0})}onLayoutComplete(t){this.applyOptions();const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}},xg=class extends Array{destroy(){for(const t of this)t.destroy();this.length=0}findById(t){return this.find(e=>e.id===t)}matches(t){return this.length===Object.keys(t).length&&k0(t,(e,i)=>ce(i)&&"type"in i&&this.findById(e)?.type===i.type)}getById(t){const e=this.findById(t);if(!e)throw new Error(`Could not find axis by id [${t}].`);return e}},yF=class extends xg{get x(){return this.getById("x")}get y(){return this.getById("y")}perpendicular(t){const e=t.direction==="x"?"y":"x";return this[e]}},bF=class extends xg{get angle(){return this.getById("angle")}get radius(){return this.getById("radius")}};function Yy(t){return{fontSize:t.fontSize??10,fontStyle:t.fontStyle,fontWeight:t.fontWeight,fontFamily:t.fontFamily??"sans-serif"}}var Sg=class{constructor(t,e){this.ctx=t,this.key=e,this.id=xn(this),this.node=new qm({zIndex:1}).setProperties({visible:!1,textAlign:"center",pointerEvents:1}),this.truncated=!1}get opts(){return this.ctx.chartState.getValue("options",this.key)??{}}get enabled(){return this.opts.enabled??!1}get text(){return this.opts.text}get padding(){return this.opts.padding??0}applyToNode(){const t=this.opts,{node:e}=this;e.visible=t.enabled??!1,e.text=t.text,e.textAlign=t.textAlign??"center",e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize??10,e.fontFamily=t.fontFamily??"sans-serif",e.fill=t.color}registerInteraction(t,e){return t.eventsHub.on("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const i=this.opts,n=i.wrapping??"always",s=i.truncate??!0,r=i.padding??0,o=s?t:1/0,a=s?e:1/0,l=Math.min(i.maxWidth??1/0,o)-r*2,c=i.maxHeight??a-r*2,h={maxWidth:l,maxHeight:c,font:Yy(i),textWrap:n},u=i.text;if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=u;return}let d;ue(u)?(d=Ld(u,h),this.truncated=d.some(Mc)):(d=dm($e(u),h),this.truncated=as(d)),this.node.text=d}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(!this.enabled||!this.text){this.destroyProxyText();return}const n=Oe.toCanvas(this.node);if(!n)return;const{id:s}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:s,where:e}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",a=>this.handleMouseMove(t,a)),this.proxyText.addListener("mouseleave",()=>this.handleTooltipHide(t)),this.proxyText.addListener("focus",()=>this.handleFocus(t)),this.proxyText.addListener("blur",()=>this.handleTooltipHide(t))]);const r=je(this.text);r!==this.lastProxyTextContent&&(this.proxyText.textContent=r,this.lastProxyTextContent=r);const{lastProxyBBox:o}=this;(n.x!==o?.x||n.y!==o?.y||n.width!==o?.width||n.height!==o?.height)&&(this.proxyText.setBounds(n),this.lastProxyBBox={x:n.x,y:n.y,width:n.width,height:n.height})}getEffectiveTooltipVisible(){const t=this.opts.tooltip??{};return t.visible!=null?t.visible:t.text!=null||t.renderer!=null?"always":"auto"}getTooltipContent(t){const e=je(this.text),i=this.opts.tooltip??{};if(i.renderer!=null){const s={text:e},r=tn(t.chartService,i.renderer,s);if(r==="")return;if(r!=null)return{type:"raw",rawHtmlString:$e(r)}}return{type:"structured",title:i.text??e}}showTooltip(t,e,i){if(!this.enabled)return;const n=this.getEffectiveTooltipVisible();if(n==="never"||n==="auto"&&!this.truncated)return;const s=this.getTooltipContent(t);s!=null&&t.tooltipManager.updateTooltip(this.id,{canvasX:e,canvasY:i,showArrow:!1},[s])}handleMouseMove(t,e){if(e==null)return;const{x:i,y:n}=Oe.toCanvas(this.node),s=e.sourceEvent.offsetX+i,r=e.sourceEvent.offsetY+n;this.showTooltip(t,s,r)}handleFocus(t){const e=Oe.toCanvas(this.node);if(!e)return;const i=e.x+e.width/2,n=e.y+e.height/2;this.showTooltip(t,i,n)}handleTooltipHide(t){t.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const t of this.proxyTextListeners??[])t();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};Sg.className="ChartCaption";var vF=class{constructor(t){this.title=new Sg(t,"title"),this.subtitle=new Sg(t,"subtitle"),this.footnote=new Sg(t,"footnote")}positionCaptions({layoutBox:t}){const{title:e,subtitle:i,footnote:n}=this,s=t.height/10;for(const r of[e,i,n])r.applyToNode();e.enabled&&(this.positionCaption("top",e,t,s),this.shrinkLayoutByCaption("top",e,t)),i.enabled&&(this.positionCaption("top",i,t,s),this.shrinkLayoutByCaption("top",i,t)),n.enabled&&(this.positionCaption("bottom",n,t,s),this.shrinkLayoutByCaption("bottom",n,t))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:n}=this,{rect:s}=t.series;for(const r of[e,i,n]){const o=r.opts;if((o.layoutStyle??"block")!=="overlay")continue;const a=o.textAlign??"center";if(a==="left")r.node.x=s.x+r.padding;else if(a==="right"){const l=r.node.getBBox();r.node.x=s.x+s.width-l.width-r.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,n){const s=e.opts,r=Yy(s),o=s.text;if(e.node.x=this.computeX(s.textAlign??"center",i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,!o)return;const{lineMetrics:a}=ue(o)?Ws(o,r):Zt(r).measureLines($e(o)),l=Math.max(a[0].height,n);e.computeTextWrap(i.width,l)}shrinkLayoutByCaption(t,e,i){const n=e.opts;if((n.layoutStyle??"block")!=="block")return;const s=e.node.getBBox().clone(),r=n.spacing??0;s.height===0&&(s.height=Zt(Yy(n)).lineHeight(),t==="bottom"&&(s.y-=s.height)),t==="bottom"&&ue(n.text)&&(s.y-=s.height),i.shrink(Math.ceil(t==="top"?s.y-i.y+s.height+r:i.y+i.height-s.y+r),t)}},xF=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],SF=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t??(t="candlestick"),t}guardMemento(t){return t==null||xF.includes(t)}restoreMemento(t,e,i){if(i==null)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch(s=>B.error("error restoring state",s))}},UD=Symbol("previous-memento-not-found"),MF=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=re.create(!0,"history"),this.cleanup=new it,this.cleanup.register(t.eventsHub.on("series:undo",this.undo.bind(this)),t.eventsHub.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}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 n of e){if(!this.originators.has(n.mementoOriginatorKey))throw new Error(`Originator [${n.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(n.mementoOriginatorKey,n.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===UD)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):UD}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(Qe,Qe,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},IF=class{constructor(){this.caretaker=new uf(Qe),this.state=new Map}setState(t,e){st(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 n=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:n},t)}},DF=`.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-background{position:absolute}.ag-charts-canvas-center{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{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.ag-charts-style-sensors{visibility:hidden;position:absolute}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-color: #e4f2fe;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: "IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: "IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border-color: #dddddd;--ag-charts-button-border-radius: 4px;--ag-charts-button-border-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-color: #dddddd;--ag-charts-input-border-radius: 4px;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-color: #dddddd;--ag-charts-menu-border-radius: 4px;--ag-charts-menu-border-width: 1px;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border-color: #dddddd;--ag-charts-tooltip-border-radius: 4px;--ag-charts-tooltip-border-width: 1px;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-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-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-width: 1px;--ag-charts-border: var(--ag-charts-border-width) solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-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-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.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-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-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-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-color:var(--ag-charts-button-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);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-input-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-input-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-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);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-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.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[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border-color:var(--ag-charts-tooltip-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-button-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-button-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);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,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:calc(-1 * var(--toolbar-button-border-width));&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button:hover+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-button-border-radius);border-start-end-radius:var(--ag-charts-button-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-button-border-radius);border-end-end-radius:var(--ag-charts-button-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.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-toolbar__button:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--hover)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--active)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-button-border-radius);border-start-start-radius:var(--ag-charts-button-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
`,Zy=class{constructor(){this.cleanup=new it,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},CF=class bp{constructor(e,i,n){this.element=e,this.topTabGuard=i,this.bottomTabGuard=n,this.cleanup=new it,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",s=>this.onBlur(s),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(e,i){this.cleanup.register(rt(e,"focus",()=>this.onTab(e,i)))}setGuardIndices(e){const i=e;Ce(this.topTabGuard,"tabindex",i),Ce(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:n}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==n&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let n;e.tabIndex===0?(n=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):n=this.findEnterTarget(i),n?.focus()}}static queryFocusable(e,i){const n=e.ownerDocument.defaultView;return Array.from(e.querySelectorAll(i)).filter(s=>{if(Da(s)){const r=n.getComputedStyle(s);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(e){const i=bp.queryFocusable(this.element,'[tabindex="0"]'),n=e?i.length-1:0;return i[n]}findExitTarget(e){const i=bp.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter(r=>r.tabIndex>0).sort((r,o)=>r.tabIndex-o.tabIndex),{before:n,after:s}=bp.findBeforeAndAfter(i,this.guardTabIndex);return e?n:s}static findBeforeAndAfter(e,i){let n=0,s=e.length-1,r,o;for(;n<=s;){const a=Math.floor((n+s)/2),l=e[a].tabIndex;if(l===i){r=e[a-1]||void 0,o=e[a+1]||void 0;break}else l<i?(r=e[a],n=a+1):(o=e[a],s=a-1)}return{before:r,after:o}}},Xy=re.create(!0,"perf","opts");function KD(t,e,i="PerWindowRegistry"){const n=new Map;return{subscribe(s,r){let o=n.get(s);return o==null?(o=t(s),n.set(s,o),Xy(`[REGISTRY] ${i}`,"first-subscribe")):Xy(`[REGISTRY] ${i}`,"shared-subscribe"),o.subscribers.add(r),()=>{const a=n.get(s);a!=null&&(a.subscribers.delete(r),a.subscribers.size===0&&(n.delete(s),e(a),Xy(`[REGISTRY] ${i}`,"last-unsubscribe")))}},snapshot(s){return[...s.subscribers]},get(s){return n.get(s)}}}function qy(t){const e=t.window.matchMedia?.(`(resolution: ${t.pixelRatio}dppx)`);t.mediaQuery=e,e?.addEventListener("change",t.mediaQueryListener)}function Jy(t){t.mediaQuery?.removeEventListener("change",t.mediaQueryListener),t.mediaQuery=void 0}var Qy=KD(t=>{const e={window:t,pixelRatio:t.devicePixelRatio,mediaQuery:void 0,subscribers:new Set,mediaQueryListener:function(n){if(!n.matches){e.pixelRatio=t.devicePixelRatio,Jy(e),qy(e);for(const s of Qy.snapshot(e))s(e.pixelRatio)}}};return qy(e),e},Jy,"PixelRatioObserver.shared");function AF(t,e,i){const n=Qy.get(t);return n!=null&&n.pixelRatio!==e&&(n.pixelRatio=e,Jy(n),qy(n)),Qy.subscribe(t,i)}var wF=class{constructor(t,e,i=!1){this.agDocument=t,this.callback=e,this.shared=i,this.devicePixelRatioMediaQuery=void 0,this.sharedUnsubscribe=void 0,this.devicePixelRatioListener=n=>{n.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=t.devicePixelRatio}get pixelRatio(){return this.devicePixelRatio}observe(){this.shared?this.observeShared():this.registerDevicePixelRatioListener()}disconnect(){this.shared?(this.sharedUnsubscribe?.(),this.sharedUnsubscribe=void 0):this.unregisterDevicePixelRatioListener()}observeShared(){if(this.sharedUnsubscribe!=null)return;const{window:t}=this.agDocument;this.sharedUnsubscribe=AF(t,this.devicePixelRatio,e=>{this.devicePixelRatio=e,this.callback(e)})}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},kF=class{constructor(t,e="normal"){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[n,s,r]of this.queuedObserveRequests)this.observe(n,s,r);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=t.createResizeObserver(n=>{for(const{target:s,contentRect:{width:r,height:o}}of n){const a=this.elements.get(s);this.checkSize(a,s,r,o)}});let i;this.pixelRatioObserver=new wF(t,()=>{clearTimeout(i),i=setTimeout(()=>this.checkPixelRatio(),0)},e==="minimal"),this.documentReady=t.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=t.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,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:n,height:s}=i.size;i.size={width:n,height:s,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,n){if(t&&(i!==t.size?.width||n!==t.size?.height)){const s=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:n,pixelRatio:s},t.cb(t.size,e)}}observe(t,e,i){if(!this.documentReady){this.queuedObserveRequests.push([t,e,i]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const n={cb:e};this.elements.set(t,n),i?.skipInitialRead||this.readSize(n,t)}readSize(t,e){const i=e.ownerDocument.defaultView?.getComputedStyle(e),n=e.clientWidth-(Number.parseFloat(i?.paddingLeft??"0")+Number.parseFloat(i?.paddingRight??"0")),s=e.clientHeight-(Number.parseFloat(i?.paddingTop??"0")+Number.parseFloat(i?.paddingBottom??"0"));(n>0||s>0)&&this.checkSize(t,e,n,s)}refresh(t){const e=this.elements.get(t);e&&this.readSize(e,t)}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)}},Mg=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),e!==void 0&&super.set(t,e),delete this.cachedState,delete this.cachedValue,this}delete(t){return delete this.cachedState,delete this.cachedValue,super.delete(t)}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},TF=["translate"],LF=new Set(["updatePending","animating","sceneRenders","animationTimeMs"]),Ig=class{constructor(t,e){this.element=t,this.cache={},this.pendingWrites=new Map,this.deferredMode=e?.deferredMode,this.sizeMonitor=e?.sizeMonitor,this.skipInitialRead=e?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(t){return this.element.contains(t)}addEventListener(t,e,i){this.element.addEventListener(t,e,i)}removeEventListener(t,e,i){this.element.removeEventListener(t,e,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(t,e){return this.cache[t]===e?!1:(this.cache[t]=e,!0)}invalidate(t){delete this.cache[t]}setProperty(t,e){const i=`p:${t}`;if(this.changed(i,e)){if(TF.includes(t)){this.element.style.setProperty(t,e);return}this.pendingWrites.set(i,()=>{this.element.style.setProperty(t,e)}),this.scheduleFlush()}}toggleClass(t,e){const i=`c:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{this.element.classList.toggle(t,e)}),this.scheduleFlush())}setAttr(t,e){const i=`a:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{e==null?this.element.removeAttribute(t):this.element.setAttribute(t,e)}),this.scheduleFlush())}setData(t,e){const i=`d:${t}`;if(this.changed(i,e)){if(LF.has(t)){this.element.dataset[t]=e;return}this.pendingWrites.set(i,()=>{this.element.dataset[t]=e}),this.scheduleFlush()}}getData(t){const e=`d:${t}`;return this.pendingWrites?this.cache[e]:this.element.dataset[t]}setInnerHTML(t){return this.changed("innerHTML",t)?(this.pendingWrites.set("innerHTML",()=>{this.element.innerHTML=t}),this.scheduleFlush(),this.invalidate("contentStyles"),!0):!1}setContentStyles(t){if(this.changed("contentStyles",JSON.stringify(t))){const e=()=>{const i=this.element.firstElementChild??this.element;Object.assign(i.style,t)};this.pendingWrites.set("contentStyles",e),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const t of this.pendingWrites.values())t();this.pendingWrites.clear()}}flushKey(t){const e=this.pendingWrites.get(t);e&&(e(),this.pendingWrites.delete(t))}togglePopover(t){t?this.changed("popover",!0)&&(this.pendingWrites.set("popover",()=>{this.element.togglePopover(!0)}),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}appendChild(t){this.element.appendChild(t)}set innerText(t){this.element.innerText=t,this.invalidate("innerHTML")}addResizeListener(t){const{sizeMonitor:e,element:i,skipInitialRead:n}=this;if(e==null)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return e.observe(i,s=>t(s),{skipInitialRead:n}),()=>e.unobserve(i)}reset(){this.cache={}}},NF='<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-background" aria-hidden="true"></div><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 class="ag-charts-style-sensors"></div></div>',OF=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container","style-sensors"],EF=new Set(["styles","canvas-container","canvas","tooltip-container"]),YD={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},RF=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 PF(t,e,i){const n=t.createIntersectionObserver(s=>{for(const r of s)r.target===e&&i(r.intersectionRatio)},{root:e});return n?.observe(e),n}var eb={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return eb}};function ZD(t,e){const i=ye("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var tb=KD(t=>{const{document:e}=t,i={window:t,document:e,subscribers:new Set,onScrollResize:function(){for(const s of tb.snapshot(i))s.invalidateRects()},onFullscreen:function(){for(const s of tb.snapshot(i))s.invalidateAll()}};return t.addEventListener("scroll",i.onScrollResize,{capture:!0,passive:!0}),t.addEventListener("resize",i.onScrollResize,{capture:!0,passive:!0}),e.addEventListener("fullscreenchange",i.onFullscreen),i},t=>{t.window.removeEventListener("scroll",t.onScrollResize,{capture:!0}),t.window.removeEventListener("resize",t.onScrollResize,{capture:!0}),t.document.removeEventListener("fullscreenchange",t.onFullscreen)},"DOMManager.globalListeners"),Dg=class Ma extends Zy{constructor(e,i,n,s,r,o,a="normal",l){super(),this.eventsHub=e,this.styleNonce=i,this.agDocument=n,this.styleContainer=r,this.skipCss=o,this.mode=a,this.cssVariables=l,this.anchorName=`--${xn(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.shadowDocumentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.cursorState=new Mg("default"),this._lastCursor="default",this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this._isRtl=!1,this._deferring=!1,this.onAttachTransition=()=>{this.container?.isConnected===!0&&this.updateStylesLocation()},this.sizeMonitor=new kF(n,a),this.element=this.initDOM(),this.element.style.cursor="default",this.elementProxy=new Ig(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,()=>this.invalidateRectCaches(),{skipInitialRead:this.mode==="minimal"});let c=!1;if(this.observer=PF(n,this.element,h=>{h===0&&!c&&this.eventsHub.emit("dom:hidden",null),c=h===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",DF),this.setContainer(s),this.cleanup.register(ES(this.element)),this.setupGlobalListeners(),this.updateCSSVariableWatchers(l),this.mode==="normal"){const h=this.rootElements["canvas-center"].element;if(h==null)throw new Error("Error initializing tab guards");const u=ZD(h,"beforebegin"),d=ZD(h,"afterend");this.tabGuards=new CF(h,u,d)}}initDOM(){if(this.mode==="normal"){const n=ye("div");return n.innerHTML=NF,n.firstChild}const e=ye("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const i=ye("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:i}=this,n={};for(const s of OF){const r=`ag-charts-${s}`;let o;if(e==="normal"?o=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:EF.has(s)?o=i:o=i.getElementsByClassName(r)[0]??ye("div"),o==null)throw new Error(`AG Charts - unable to find DOM element ${r}`);n[s]={element:o,children:new Map,listeners:[]}}return n}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.disconnectAttachObservers(),this.sizeMonitor.unobserve(this.rootElements.canvas.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const e of Object.values(this.rootElements)){for(const i of e.children.values())i.parentNode===e.element&&i.remove();e.element.remove()}this.element.remove()}scheduleFlush(){this._deferring||this._pendingFlush==null&&(this._pendingFlush=setTimeout(()=>{this._pendingFlush=void 0,!this._deferring&&this.flushDeferredProxies()}))}flushDeferredProxies(){this._pendingFlush!=null&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const e of this.deferredProxies.values())e.flush();this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Ma.batchedUpdateContainer.length===0&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Ma.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of Ma.batchedUpdateContainer)e.destroyed||e.updateContainer();Ma.batchedUpdateContainer.splice(0)}disconnectAttachObservers(){this.attachObserver?.disconnect(),this.attachObserver=void 0,this.attachIntersectionObserver?.disconnect(),this.attachIntersectionObserver=void 0}observeAttachTransition(e){this.disconnectAttachObservers(),!(this.mode==="minimal"||this.initiallyConnected!==!1)&&(this.attachObserver=this.agDocument.createMutationObserver(this.onAttachTransition),this.attachObserver?.observe(e.ownerDocument.documentElement,{childList:!0,subtree:!0}),this.attachIntersectionObserver=this.agDocument.createIntersectionObserver(i=>{i.some(n=>n.isIntersecting)&&this.onAttachTransition()}),this.attachIntersectionObserver?.observe(e))}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.disconnectAttachObservers(),this.shadowDocumentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);for(const[e,i]of this.styles)this.addStyles(e,i);this.container!=null&&this.sizeMonitor.refresh(this.container)}}setSizeOptions(e=300,i=300,n,s){const{style:r}=this.element;this.minWidth=n??e,this.minHeight=s??i,r.minWidth=`${this.minWidth}px`,r.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const e=this.containerSize==null?"hidden":"",i=this.containerSize?`${Math.floor(this.containerSize.width??0)}px`:"",n=this.containerSize?`${Math.floor(this.containerSize.height??0)}px`:"",s=this._lastCenterSize;if(s?.visibility!==e||s?.width!==i||s?.height!==n){this._lastCenterSize={visibility:e,width:i,height:n};const{style:r}=this.rootElements["canvas-center"].element;r.visibility=e,r.width=i,r.height=n}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.element.remove(),this.sizeMonitor.unobserve(this.container)),this.shadowDocumentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e,this.pendingContainer=void 0,this.agDocument.setContainer(e),this.shadowDocumentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=e.isConnected,this.observeAttachTransition(e);for(const[i,n]of this.styles)this.addStyles(i,n);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)},{skipInitialRead:this.mode==="minimal"}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(e){const i="ag-charts-theme-";for(const n of Array.from(this.element.classList))n.startsWith(i)&&n!==e&&this.element.classList.remove(n);this.element.classList.add(e)}setThemeParameters(e){const i={};for(const[n,s]of ut(e)){if(!ce(s)){i[n]=s;continue}for(const[r,o]of ut(s))i[`${n}${r[0].toUpperCase()}${r.slice(1)}`]=o}this.setCSSVariables("--ag-charts",void 0,void 0,i)}setModuleCSSVariables(e,i,n,s,r){this.setCSSVariables(`--ag-charts-${e}`,i,n,s,r)}setCSSVariables(e,i,n,s,r){for(const[o,a]of ut(s)){let l=`${a}`;if(!Number.isNaN(Number(a))&&(o.endsWith("Size")||o.endsWith("Radius")||o.endsWith("Width")||r?.includes(o)))l=`${a}px`;else if(o.endsWith("Border")&&typeof a=="boolean"){this.element.style.setProperty(this.formatCSSVariableKey(e,i,`${o}Color`,n),a?"var(--ag-charts-border-color)":"none"),this.element.style.setProperty(this.formatCSSVariableKey(e,i,`${o}Width`,n),a?"var(--ag-charts-border-width)":"0");continue}this.element.style.setProperty(this.formatCSSVariableKey(e,i,o,n),l)}}formatCSSVariableKey(e,i,n,s){return`${e}${i?"__":""}${i??""}-${Ux(n)}${s?"--":""}${s??""}`}updateCanvasLabel(e){Ce(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,n){const s=this.getEventElement(this.element,e);return rt(s,e,i,n)}removeEventListener(e,i,n){this.getEventElement(this.element,e).removeEventListener(e,i,n)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getCanvasScale(){if(this._cachedCanvasScale!=null)return this._cachedCanvasScale;const e=this.getBoundingClientRect(),i=this.rootElements.canvas.element,n=i.clientWidth,s=i.clientHeight,r=n>0&&e.width>0?e.width/n:1,o=s>0&&e.height>0?e.height/s:1;return this._cachedCanvasScale={scaleX:r,scaleY:o},this._cachedCanvasScale}getOverlayClientRect(){const{innerWidth:e,innerHeight:i}=this.agDocument,n=new $(0,0,e,i),s=this.getRawOverlayClientRect();return n.intersection(s)?.toDOMRect()??eb}getVisibleChartRect(){if(this._cachedVisibleChartRect!==void 0)return this._cachedVisibleChartRect;const e=this.findScrollableContainer();if(e==null)return this._cachedVisibleChartRect=null,null;const i=$.fromObject(this.getBoundingClientRect()),n=$.fromObject(e.getBoundingClientRect());return this._cachedVisibleChartRect=i.intersection(n)?.toDOMRect()??eb,this._cachedVisibleChartRect}findScrollableContainer(){if(this._cachedScrollableContainer!==void 0)return this._cachedScrollableContainer;let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let n;if(i!=null&&e===i)n=!0;else{const r=e.computedStyleMap?.()?.get("overflow-y")?.toString();n=r==="auto"||r==="scroll"}if(n)return this._cachedScrollableContainer=e,e;e=e.parentElement}return this._cachedScrollableContainer=null,null}popoverSupported(){return typeof this.agDocument.window.HTMLElement?.prototype?.togglePopover=="function"}getRawOverlayClientRect(){if(this._cachedRawOverlayRect!=null)return this._cachedRawOverlayRect;const e=this.popoverSupported()?null:this.findScrollableContainer();if(e!=null)return this._cachedRawOverlayRect=$.fromObject(e.getBoundingClientRect()),this._cachedRawOverlayRect;if(this.shadowDocumentRoot!=null)return this._cachedRawOverlayRect=$.fromObject(this.shadowDocumentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:i,innerHeight:n}=this.agDocument;return this._cachedRawOverlayRect=new $(0,0,i,n),this._cachedRawOverlayRect}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??this.agDocument.body;for(;e!=null;){if(e===i)return;if(lx(e.parentNode))return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],n=[];for(const s of i.values())n.push($.fromObject(s.getBoundingClientRect()));return $.merge(n)}isManagedChildDOMElement(e,i,n){const{children:s}=this.rootElements[i],r=s?.get(n);return r!=null&&e.contains(r)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const n="data-ag-charts";if(this.styles.set(e,i),this.container==null||this.skipCss)return;const s=a=>a.getAttribute(n)===e,r=a=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const d of a.children){if(c&&l.has(d.tagName)){h=d;continue}if(c=!1,s(d))return;d.hasAttribute(n)&&(h=d)}const u=ye("style");return this.styleNonce!=null&&(u.nonce=this.styleNonce),h==null?a.prepend(u):a.insertBefore(u,h.nextSibling),u};let o;this.styleContainer?o=r(this.styleContainer):this.initiallyConnected===!1?o=this.addChild("styles",e):this.shadowDocumentRoot==null&&!Ma.headStyles.has(e)?(o=r(this.agDocument.head),Ma.headStyles.add(e)):this.shadowDocumentRoot!=null&&(o=this.addChild("styles",e)),!(o==null||s(o))&&(o.setAttribute(n,e),o.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i);const n=this.cursorState.stateValue();n!==this._lastCursor&&(this._lastCursor=n,this.element.style.cursor=n)}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(e){this.enableRtl=e,this.updateRtl()}updateRtl(){const e=this.enableRtl??(this.mode==="minimal"?!1:Na(this.container??this.pendingContainer));e!==this._isRtl&&(this._isRtl=e,this.element.dir=e?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(e,i,n,s){const{element:r,children:o,listeners:a}=this.rootElements[e];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(i))return o.get(i);const{childElementType:l="div"}=RF.get(e)??{};if(n&&n.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=n??ye(l);for(const[h,u,d]of a)c.addEventListener(h,u,d);if(o.set(i,c),l==="style"&&this.styleNonce!=null&&(c.nonce=this.styleNonce),s){const h=r.querySelector(s.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);h.insertAdjacentElement(s.where,c)}else r?.appendChild(c);return c}addProxyChild(e,i){const n=this.addChild(e,i),s=this.mode==="minimal";return new Ig(n,{sizeMonitor:this.sizeMonitor,skipInitialRead:s})}addDeferredProxyChild(e,i){const n=this.addChild(e,i),s=this.mode==="minimal",r=new Ig(n,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:s});return this.deferredProxies.set(`${e}:${i}`,r),r}setDeferring(e){this.mode!=="minimal"&&(this._deferring=e,e||this.flushDeferredProxies())}removeChild(e,i){const{children:n}=this.rootElements[e];n&&(n.get(i)?.remove(),n.delete(i),this.deferredProxies.delete(`${e}:${i}`))}incrementDataCounter(e){const i=this.elementProxy.getData(e)??"0";this.elementProxy.setData(e,String(Number(i)+1))}setDataBoolean(e,i){this.elementProxy.setData(e,String(i))}setDataNumber(e,i){this.elementProxy.setData(e,String(i))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedCanvasScale=void 0,this._cachedRawOverlayRect=void 0,this._cachedVisibleChartRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const e=this.element.ownerDocument,i=e.defaultView;if(i==null)return;if(this.mode==="minimal"){const o=tb.subscribe(i,{invalidateRects:()=>this.invalidateRectCaches(),invalidateAll:()=>this.invalidateAllCaches()});this.cleanup.register(o);return}const n=()=>this.invalidateRectCaches();this.element.addEventListener("pointerenter",n),this.cleanup.register(()=>this.element.removeEventListener("pointerenter",n));const s=()=>this.invalidateRectCaches(),r=()=>this.invalidateAllCaches();i.addEventListener("scroll",s,{capture:!0,passive:!0}),i.addEventListener("resize",s,{capture:!0,passive:!0}),e.addEventListener("fullscreenchange",r),this.cleanup.register(()=>{i.removeEventListener("scroll",s,{capture:!0}),i.removeEventListener("resize",s,{capture:!0}),e.removeEventListener("fullscreenchange",r)})}updateCSSVariableWatchers(e){if(!e)return;if(this.shadowDocumentRoot){this.updateCSSVariableWatchersShadowDOM(e);return}const i=new Set;for(let n=0;n<this.element.children.length;n++){const s=this.element.children.item(n);s?.dataset.variableName!=null&&i.add(s.dataset.variableName)}for(const n of hs(e)){const s=n.slice(4,-1);if(i.has(s))continue;const r=ye("style");r.dataset.variableName=s,r.textContent=`@property ${s} { syntax: '<color>'; inherits: true; initial-value: transparent; }`,this.element.prepend(r);const o=ye("div");o.style.setProperty("transition",`${s} 1ms`,"important"),this.rootElements["style-sensors"].element.appendChild(o);const a=()=>{this.eventsHub.emit("chart:request-refresh",null)};o.addEventListener("transitionend",a),this.cleanup.register(()=>{o.removeEventListener("transitionend",a),o.remove(),r.remove()})}}updateCSSVariableWatchersShadowDOM(e){const i=this.shadowDocumentRoot?.getRootNode();if(!i||!("addEventListener"in i))return;const n=new Set;for(let s=0;s<i.children.length;s++){const r=i.children.item(s);r?.dataset.variableName!=null&&n.add(r.dataset.variableName)}if(n.size===0){const s=()=>{this.eventsHub.emit("chart:request-refresh",null)};i.addEventListener("transitionend",s),this.cleanup.register(()=>{i.removeEventListener("transitionend",s)})}for(const s of hs(e)){const r=s.slice(4,-1);if(n.has(r))continue;const o=ye("div");o.style.color=s,o.style.setProperty("transition","color 1ms","important"),o.dataset.variableName=r,i.prepend(o)}}updateContainerClassName(){const{element:e,containerSize:i,minWidth:n,minHeight:s}=this;e.classList.toggle(YD.safeHorizontal,n>=(i?.width??1/0)),e.classList.toggle(YD.safeVertical,s>=(i?.height??1/0))}};Dg.className="DOMManager",Dg.batchedUpdateContainer=[],Dg.headStyles=new Set;var XD=Dg;function _l(t,e,i){const{offsetX:n,offsetY:s,clientX:r,clientY:o}=e,{currentX:a,currentY:l}=Yr.calcCurrentXY(i,e);return{type:t,device:"mouse",offsetX:n,offsetY:s,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:e}}function Cg(t,e,i){return{type:t,sourceEvent:e}}function VG(){}var qD={change:{isNative:!0,allocator(t,e){return{type:"change",sourceEvent:t}}},blur:{isNative:!0,allocator(t,e){return{type:"blur",sourceEvent:t}}},focus:{isNative:!0,allocator(t,e){return{type:"focus",sourceEvent:t}}},keydown:{isNative:!0,allocator(t){return{type:"keydown",sourceEvent:t}}},keyup:{isNative:!0,allocator(t){return{type:"keyup",sourceEvent:t}}},contextmenu:{isNative:!0,allocator(t,e){return _l("contextmenu",t,e)}},click:{isNative:!0,allocator(t,e){return _l("click",t,e)}},dblclick:{isNative:!0,allocator(t,e){return _l("dblclick",t,e)}},mouseenter:{isNative:!0,allocator(t,e){return _l("mouseenter",t,e)}},mousemove:{isNative:!0,allocator(t,e){return _l("mousemove",t,e)}},mouseleave:{isNative:!0,allocator(t,e){return _l("mouseleave",t,e)}},wheel:{isNative:!0,allocator(t,e){const{offsetX:i,offsetY:n,clientX:s,clientY:r}=t,o=t.deltaMode===0?.01:1;let a=t.deltaX*o,l=t.deltaY*o;return Math.abs(t.deltaX)===0&&t.shiftKey&&([a,l]=[l,a]),{type:"wheel",offsetX:i,offsetY:n,clientX:s,clientY:r,deltaX:a,deltaY:l,sourceEvent:t}}},touchstart:{isNative:!0,allocator(t,e){return Cg("touchstart",t,e)}},touchmove:{isNative:!0,allocator(t,e){return Cg("touchmove",t,e)}},touchend:{isNative:!0,allocator(t,e){return Cg("touchend",t,e)}},touchcancel:{isNative:!0,allocator(t,e){return Cg("touchcancel",t,e)}},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0},Yr=class{static alloc(t,e,i){const n=qD[t].allocator;return n(e,i)}static isHTMLEvent(t){return qD[t]?.isNative===!0}static calcCurrentXY(t,e){const i=t.getBoundingClientRect(),n=t.clientWidth,s=t.clientHeight,r=i.width>0&&n>0?n/i.width:1,o=i.height>0&&s>0?s/i.height:1;return{currentX:(e.clientX-i.x)*r,currentY:(e.clientY-i.y)*o}}},FF=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 n=r=>{const o=Yr.alloc(t,r,e.getElement());this.dispatch(t,e,o)},s={};(t.startsWith("touch")||t==="wheel")&&(s.passive=!1),this.initSourceHandler(t,n),e.getElement().addEventListener(t,n,s)}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 n=this.lazyGetWidgetListeners(t,e),s=n.indexOf(i);s>-1&&n.splice(s,1)}destroy(t){if(this.widgetListeners=void 0,this.sourceListeners){for(const[e,i]of ut(this.sourceListeners))t.getElement().removeEventListener(e,i);this.sourceListeners=void 0}}dispatch(t,e,i){for(const n of this.widgetListeners?.[t]??[])n(i,e)}},VF=class{constructor(t,e,i,n){this.glob=t,this.self=e,this.cleanup=new it,this.mousemove=a=>{this.glob.globalMouseDragCallbacks?.mousemove(a)},this.mouseup=a=>{a.button===0&&(this.glob.globalMouseDragCallbacks?.mouseup(a),this.destroy())};const{mousemove:s,mouseup:r}=this,o=n.view;this.cleanup.register(rt(o,"mousemove",s,{capture:!0}),rt(o,"mouseup",r,{capture:!0})),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(n)}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function BF(t,e,i,n){if(t.globalMouseDragCallbacks==null)return new VF(t,e,i,n)}var _F=500,zF=100;function GF(t,e){const i=t.clientX-e.clientX,n=t.clientY-e.clientY;return i*i+n*n}var ib=!1,jF=class{constructor(t,e,i,n,s){this.glob=t,this.self=e,this.initialTouch=n,this.target=s,this.cleanup=new it,this.longTapInterrupted=!1,this.longtap=()=>{const{target:a,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new it;a.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),ib=!0;const h=f=>f.preventDefault(),u=f=>{ib=!1,f.preventDefault(),c.flush()};c.register(rt(a,"touchmove",h,{passive:!1}),rt(a,"touchend",u,{passive:!1}),rt(a,"touchcancel",u,{passive:!1}));const{clientX:d,clientY:g}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:a.ownerDocument.defaultView,clientX:d,clientY:g,pointerType:"touch"});a.dispatchEvent(p)}},this.touchmove=a=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(a.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||GF(h,u)>zF,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(a,u))},this.touchend=a=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(a.changedTouches,a.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(a,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,_F);const{touchmove:r,touchend:o}=this;this.cleanup.register(rt(s,"touchmove",r,{passive:!1}),rt(s,"touchstart",o,{passive:!1}),rt(s,"touchend",o,{passive:!1}),rt(s,"touchcancel",o,{passive:!1})),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.flatMap(i=>Array.from(i));return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function HF(t,e,i,n,s){if(!(t.globalTouchDragCallbacks!=null||ib))return new jF(t,e,i,n,s)}function nb(t,e,i,n){const{currentX:s,currentY:r}=Yr.calcCurrentXY(t.getElement(),n),o=n.pageX-i.pageX,a=n.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+a,clientX:n.clientX,clientY:n.clientY,currentX:s,currentY:r,originDeltaX:o,originDeltaY:a,sourceEvent:n}}function $F(t,e){const i=t.getElement(),n=i.getBoundingClientRect(),s=i.clientWidth,r=i.clientHeight,o=n.width>0&&s>0?s/n.width:1,a=n.height>0&&r>0?r/n.height:1;return{offsetX:(e.clientX-n.x)*o,offsetY:(e.clientY-n.y)*a}}function sb(t,e,i,n,s){const{currentX:r,currentY:o}=Yr.calcCurrentXY(t.getElement(),s),a=s.pageX-i.pageX,l=s.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+a,offsetY:i.offsetY+l,clientX:s.clientX,clientY:s.clientY,currentX:r,currentY:o,originDeltaX:a,originDeltaY:l,sourceEvent:n}}var JD={},QD=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(t){this.listeners??(this.listeners=new Map);let e=this.listeners.get(t);return e===void 0&&(e=new Set,this.listeners.set(t,e)),e}add(t,e,i){switch(this.getListenerSet(t).add(i),t){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(e);break}}}remove(t,e,i){this.getListenerSet(t).delete(i)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=t.getElement(),i=new it;i.register(rt(e,"mousedown",n=>this.triggerMouseDrag(t,n)),rt(e,"touchstart",n=>this.triggerTouchDrag(t,n),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(t,e){if(e.button===0){if(e.view==null){const i=t.getElement().ownerDocument.defaultView;e=new i.MouseEvent(e.type,{...e,view:i})}this.startMouseDrag(t,e)}}startMouseDrag(t,e){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};tf(["pageX","pageY","offsetX","offsetY"],i,e);const n={mousedown:s=>{const r=nb(t,"drag-start",i,s);this.dispatch("drag-start",t,r)},mousemove:s=>{const r=nb(t,"drag-move",i,s);this.dispatch("drag-move",t,r)},mouseup:s=>{const r=nb(t,"drag-end",i,s);this.dispatch("drag-end",t,r),this.endDrag(t,r)}};this.mouseDragger=BF(JD,this,n,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:n}){const s=t.getElement(),r=s.getBoundingClientRect();tl(r,i,n)||(s.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 n={pageX:Number.NaN,pageY:Number.NaN,...$F(t,i)};tf(["pageX","pageY"],n,i);const s={touchmove:(a,l)=>{const c=sb(t,"drag-move",n,a,l);this.dispatch("drag-move",t,c)},touchend:(a,l)=>{const c=sb(t,"drag-end",n,a,l);this.dispatch("drag-end",t,c)}},r=t.getElement();this.touchDragger=HF(JD,this,s,i,r);const o=sb(t,"drag-start",n,e,i);this.dispatch("drag-start",t,o)}dispatch(t,e,i){for(const n of this.getListenerSet(t))n(i,e);this.dispatchCallback(t,i)}},WF=class{constructor(t){this.elem=t}setBounds(t){gu(this.elemContainer??this.elem,t)}getBounds(){return Ex(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();gu(e,i),gS(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Zr=class extends WF{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(t){Ce(this.elem,"id",t)}get id(){return Do(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.remove();for(const t of this.children)t.parent=void 0,t.destroy();this.children.length=0,this.destructor(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove(),this.parent?.removeChildWidget(this)}setHidden(t){Gn(this.elem,"display",t?"none":void 0)}isHidden(){const{defaultView:t}=this.elem.ownerDocument;return t?.getComputedStyle(this.elem).display==="none"}setCursor(t){Gn(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){Ce(this.elem,"aria-describedby",t)}setAriaHidden(t){Ce(this.elem,"aria-hidden",t)}setAriaLabel(t){Ce(this.elem,"aria-label",t)}setAriaExpanded(t){Ce(this.elem,"aria-expanded",t)}setAriaControls(t){Ce(this.elem,"aria-controls",t)}setAriaHasPopup(t){Ce(this.elem,"aria-haspopup",t)}setInnerHTML(t){this.elem.innerHTML=t}setPointerEvents(t){Gn(this.elem,"pointer-events",t)}setTouchAction(t){t==null?this.elem.style.touchAction="":this.elem.style.touchAction=t}setCSSVariable(t,e){this.elem.style.setProperty(t,e)}isDisabled(){return Do(this.elem,"aria-disabled",!1)}hasPopup(){const t=Do(this.elem,"aria-haspopup");return t!==void 0&&t!=="false"}parseFloat(t){return t===""?0:Number.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(t){this.elem.focus(t)}setFocusOverride(t){Ce(this.elem,"data-focus-override",t)}setPreventsDefault(t){Ce(this.elem,"data-preventdefault",t)}setTabIndex(t){Ce(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)}removeChildWidget(t){const e=this.children.indexOf(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){t.getElement().remove()}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 Yr.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new FF),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new QD(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){Yr.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new QD(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:n}=i;if(n!=null){const s={...e,...Yr.calcCurrentXY(i.getElement(),e)};n.dispatch(t,i,s)}i=i.parent}}},UF=class extends Zr{constructor(){super(ye("div")),this.textElement=pt("text"),this.textElement.role="presentation",this.svgElement=pt("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(){}},KF=class{constructor(t,e){this.getDispatcher=e,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const n={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,n)}},this.onCollapsed=i=>{this.controller.setAriaExpanded(!1),i.mode==="0"&&this.controller.focus()},t.setAriaExpanded(!1),this.controller=t}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(t){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=t,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(t){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:t?.overrideFocusVisible})}};function YF(t){return Jf(t.sourceEvent)}var rb=class extends Zr{constructor(t,e){super(t),Ce(this.elem,"role",e),this.setEnabled(!0),this.addKeyboardClickBinding(YF)}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new KF(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}addKeyboardClickBinding(t){this.addListener("keydown",e=>{const{sourceEvent:i}=e;t(e)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}setEnabled(t){Ce(this.elem,"aria-disabled",!t)}setControlled(t){return this.lazyControllerImpl().setControlled(t)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(t){return this.lazyControllerImpl().expandControlled(t)}addListener(t,e){return super.addListener(t,(i,n)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,n)})}},Ag=class extends rb{constructor(){super(ye("button"))}},eC=class extends Zr{constructor(){super(ye("div")),Ce(this.elem,"role","group")}destructor(){}},ob=class extends Zr{constructor(t,e){super(ye("div")),this.focusedChildIndex=0,this.onChildFocus=(i,n)=>{const s=this.children[this.focusedChildIndex];this.focusedChildIndex=n.index,s?.setTabIndex(-1),n.setTabIndex(0)},this.onChildKeyDown=(i,n)=>{const s=this.orientation,r=Na(this.elem);let o,a;s==="both"?(o=Uc("horizontal",r),a=Uc("vertical")):(o=Uc(s,r),a=void 0);let l=-1;if(wo(i.sourceEvent)){const c=i.sourceEvent.key;c===o.nextKey||c===a?.nextKey?l=n.index+1:(c===o.prevKey||c===a?.prevKey)&&(l=n.index-1)}this.children[l]?.focus()},Ce(this.elem,"role",e),this.orientation=t}get orientation(){return Do(this.elem,"aria-orientation")??"both"}set orientation(t){Ce(this.elem,"aria-orientation",t==="both"?void 0:t)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const t of this.children)this.removeChildListeners(t),t.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown)}removeChildListeners(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}onChildAdded(t){this.addChildListeners(t),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){this.removeChildListeners(t);const{focusedChildIndex:e,children:i}=this,n=e===t.index;for(let s=0;s<i.length;s++){const r=i[s];r.index===e&&(this.focusedChildIndex=s),r.index=s}if(n){const s=i[e]??i[e-1];s?(this.focusedChildIndex=s.index,s.setTabIndex(0)):this.focusedChildIndex=0}}};function tC(t){const e=t.getElement();e.parentElement?e.parentElement.remove():e.remove()}var ZF=class extends ob{constructor(){super("both","list"),this.setHidden(!0)}destructor(){for(const t of this.children)tC(t)}addChildToDOM(t,e){const i=ye("div");Ce(i,"role","listitem"),Gn(i,"position","absolute"),Zr.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){tC(t),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}},zl=class extends Zr{constructor(t){super(t)}destructor(){}},ab=class eu extends Zr{constructor(){super(ye("input")),this._step=eu.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,n=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:n,onBlur:n},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Do(this.elem,"aria-orientation")??"both"}set orientation(e){Ce(this.elem,"aria-orientation",e==="both"?void 0:e),eu.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const n=this.getValueRatio(),s=J(e,n,i);return s!==n&&this.setValueRatio(s),s}setValueRatio(e,i){const{divider:n}=this.step,s=Math.round(e*1e4)/n,{ariaValueText:r=bS(s/n)}=i??{},o=this.getElement();o.value=`${s}`,o.ariaValueText=r,o.ariaValueNow=`${s}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",eu.onKeyDown):e.addListener("keydown",eu.onKeyDown)}static onKeyDown(e,i){let n=[];const{orientation:s}=i;s==="horizontal"?n=["ArrowUp","ArrowDown"]:s==="vertical"&&(n=["ArrowLeft","ArrowRight"]),n.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};ab.STEP_ONE={attributeValue:"1",divider:1},ab.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var lb=ab,XF=class extends Ag{constructor(){super(),Ce(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){Ce(this.elem,"aria-checked",t)}},wg=class extends ob{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function Gl(t,e){return e.params?.type===t}function qF(t){if(t==="button")return new Ag;if(t==="slider")return new lb;if(t==="toolbar")return new wg;if(t==="group")return new eC;if(t==="list")return new ZF;if(t==="region")return new zl(ye("div"));if(t==="text")return new UF;if(t==="listswitch")return new XF;throw new Error("AG Charts - error allocating meta")}function iC(t){const e={params:t,result:void 0};return e.result=qF(e.params.type),e}var JF=class{constructor(t){this.ctx=t,this.cleanup=new it}destroy(){this.cleanup.flush()}addLocalisation(t){t(),this.cleanup.register(this.ctx.eventsHub.on("locale:change",t))}createProxyContainer(t){const e=iC(t),{params:i,result:n}=e,s=n.getElement();this.ctx.domManager.addChild("canvas-proxy",i.domManagerId,s),s.classList.add(...i.classList,"ag-charts-proxy-container"),s.role=i.role??i.type,Gl("toolbar",e)&&(e.result.orientation=e.params.orientation);const{ariaLabel:r}=i;return r&&this.addLocalisation(()=>{s.ariaLabel=this.ctx.localeManager.t(r.id,r.params)}),n}createProxyElement(t){const e=iC(t);if(Gl("button",e)){const{params:i,result:n}=e,s=n.getElement();if(this.initInteract(i,n),typeof i.textContent=="string")s.textContent=i.textContent;else{const{textContent:r}=i;this.addLocalisation(()=>{s.textContent=this.ctx.localeManager.t(r.id,r.params)})}this.setParent(e.params,e.result)}if(Gl("slider",e)){const{params:i,result:n}=e,s=n.getElement();this.initInteract(i,n),s.type="range",s.role=i.role??"presentation",s.style.margin="0px",this.addLocalisation(()=>{s.ariaLabel=this.ctx.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(Gl("text",e)){const{params:i,result:n}=e;this.initElement(i,n),this.setParent(e.params,e.result)}if(Gl("listswitch",e)){const{params:i,result:n}=e;this.initInteract(i,n),n.setTextContent(i.textContent),n.setChecked(i.ariaChecked),n.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(Gl("region",e)){const{params:i,result:n}=e,s=n.getElement();this.initInteract(i,n),s.role=i.role??"region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return Gn(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),t.classList?.length&&i.classList.add(...t.classList),i}initInteract(t,e){const{tabIndex:i,domIndex:n}=t,s=this.initElement(t,e);i!==void 0&&(s.tabIndex=i),n!==void 0&&(e.domIndex=n)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.ctx.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i),e.destroyListener=()=>{this.ctx.domManager.removeChild("canvas-proxy",t.domManagerId)}}}},nC={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceSelectedItem:"selected",ariaAnnounceUnselectedItem:"unselected",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",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}",ariaAnnounceOrgChartLeaf:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number]",ariaAnnounceOrgChartParent:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, ${childCount}[number] children, press Enter or Space to toggle",ariaAnnounceOrgChartParentSingular:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, 1 child, press Enter or Space to toggle",ariaOrgChartCollapsed:"collapsed",ariaOrgChartExpanded:"expanded",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",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",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",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",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},QF=/\$\{(\w+)}(?:\[(\w+)])?/gi,cb={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"})},eV=({defaultValue:t,variables:e})=>t?.replaceAll(QF,(i,n,s)=>{const r=e[n],o=s==null?null:cb[s];return s!=null&&o==null&&B.warnOnce(`Format style [${s}] is not supported`),o!=null?o.format(r):typeof r=="number"?cb.number.format(r):r instanceof Date?cb.datetime.format(r):String(r)}),tV=class{constructor(t){this.eventsHub=t,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.eventsHub.emit("locale:change",null))}t(t,e={}){const{localeText:i=nC,getLocaleText:n}=this,s=i[t];return String(n?.({key:t,defaultValue:s,variables:e})??eV({key:t,defaultValue:s,variables:e})??t)}},iV=class{constructor(t){this.width=600,this.height=300,this.direction="ltr";const{width:e,height:i,willReadFrequently:n=!1}=t;this.element=t.canvasElement,this.pixelRatio=t.pixelRatio,this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Po(this.pixelRatio,e??this.width),this.element.height=Po(this.pixelRatio,i??this.height),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.context.direction=this.direction,this.resize(e??this.width,i??this.height,this.pixelRatio),zM(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:n,context:s}=this;n.width=Po(i,t),n.height=Po(i,e),s.setTransform(i,0,0,i,0,0),n.style.width=t+"px",n.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}setDirection(t){this.direction=t?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){_M(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.(),this.context.direction=this.direction}},nV=class extends Os{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0,this.destroyed=!1}loadImage(t,e,i){const n=sV(t,i),s=this.cache.get(n);if(s?.image)return s.image;if(s!=null&&e){s.nodes.add(e);return}if(!e)return;const r={image:void 0,nodes:new Set([e]),blobUrl:void 0};this.cache.set(n,r),this.imageLoadingCount++;const o=()=>{r.blobUrl!=null&&(URL.revokeObjectURL(r.blobUrl),r.blobUrl=void 0)},a=c=>{if(this.destroyed){o();return}r.image=c;for(const h of r.nodes)h.markDirty();r.nodes.clear(),this.imageLoadingCount--,o(),this.emit("image-loaded",{uri:t})},l=()=>{if(this.destroyed){o();return}this.imageLoadingCount--,r.nodes.clear(),o(),this.cache.delete(n),this.emit("image-error",{uri:t})};this.resolveSource(t,i).then(c=>{if(this.destroyed){c.blobUrl!=null&&URL.revokeObjectURL(c.blobUrl);return}c.blobUrl!=null&&(r.blobUrl=c.blobUrl);const h=rx(),u=new h;u.onload=()=>a(u),u.onerror=l,u.src=c.src}).catch(l)}unregisterNode(t){for(const e of this.cache.values())e.nodes.delete(t)}async resolveSource(t,e){if(!e||typeof fetch!="function"||typeof Blob>"u")return{src:t};const i=rV(t,".svg"),n=t.startsWith("data:image/svg");if(!i&&!n)return{src:t};try{const s=await fetch(t,{mode:"cors"}),r=s.headers.get("content-type")??"",o=r.startsWith("image/")||r.startsWith("application/"),a=r.includes("svg");if(o&&!a)return{src:t};const l=await s.text();if(!a&&!aV(l))return{src:t};const c=cV(l,e.width,e.height);if(!c)return{src:t};const h=new Blob([c],{type:"image/svg+xml"}),u=URL.createObjectURL(h);return{src:u,blobUrl:u}}catch{return{src:t}}}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.destroyed=!0;for(const t of this.cache.values())t.nodes.clear(),t.blobUrl!=null&&(URL.revokeObjectURL(t.blobUrl),t.blobUrl=void 0);this.cache.clear()}};function sV(t,e){return e?`${t}@${e.width}x${e.height}`:t}function rV(t,e){const i=t.search(/[?#]/);return(i>=0?t.slice(0,i):t).toLowerCase().endsWith(e)}var oV=/^\uFEFF?\s{0,32}(?:<\?xml[^>]{0,256}\?>\s{0,32})?(?:<!DOCTYPE[^>]{0,256}>\s{0,32})?<svg[\s>]/i;function aV(t){return oV.test(t)}var lV=/^\s{0,8}\+?(\d{1,6}(?:\.\d{1,6})?(?:e[+-]?\d{1,3})?)\s{0,8}(?:px|pt|cm|mm|in|pc|q)?\s{0,8}$/i;function sC(t,e){const i=t.getAttribute(e);if(i==null)return!1;const n=lV.exec(i);return n?Number.parseFloat(n[1])>0:!1}function cV(t,e,i){if(!(typeof DOMParser>"u"||typeof XMLSerializer>"u"))try{const s=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;if(s?.tagName.toLowerCase()!=="svg")return;const r=sC(s,"width"),o=sC(s,"height");return r&&o?void 0:(r||s.setAttribute("width",String(e)),o||s.setAttribute("height",String(i)),new XMLSerializer().serializeToString(s))}catch{return}}var hV=class{constructor(t){this.canvas=t,this.debug=re.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);for(const{canvas:n}of this.layersMap.values())n.resize(t,e,i)}addLayer(t){const{width:e,height:i,pixelRatio:n}=this.canvas,{name:s}=t,r=new Hm({width:e,height:i,pixelRatio:n});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}},kg=class extends Os{constructor(t){super(),this.debug=re.create(!0,"scene"),this.id=xn(this),this.imageLoader=new nV,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new it,this.updateDebugFlags(),this.canvas=new iV(t),this.layersManager=new hV(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{B.warnOnce(`Unable to load image ${e}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}get isRtl(){return this.direction==="rtl"}setContainer(t){const{element:e}=this.canvas;return e.remove(),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?.setScene(),this.root=t,t&&(t.visible=!0,t.setScene(this)),this)}updateDebugFlags(){re.inDevelopmentMode(()=>bs._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>t.remove()}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return t.remove(),this}download(t,e){zS(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}setDirection(t){this.direction=t?"rtl":"ltr",this.canvas.setDirection(t)}updateBaseFont(){const t=this.root?.resolveFont();t==null||t===this._contextFont||(this._baseFont=t,!this.pendingSize&&(this.canvas.context.font=t,this._contextFont=t))}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._contextFont=void 0,this._baseFont!=null&&(this.canvas.context.font=this._baseFont,this._contextFont=this._baseFont),!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:n,debugColors:s}=t??{},{canvas:r,canvas:{context:o}={},root:a,width:l,height:c,pixelRatio:h}=this;if(!o)return;const u=re.check("scene:stats","scene:stats:verbose");u&&this.ensureDebugStatsRegistration();const d=performance.now(),g=this.applyPendingResize();if(a&&!a.visible){this.isDirty=!1;return}let p;if(a instanceof se&&(p=a.dirty),a!=null&&p===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:Xd(a,"console")}),u&&eI(this.layersManager,e,o,void 0,i,n,s);return}const f={ctx:o,direction:this.direction,width:l,height:c,devicePixelRatio:h,debugNodes:{},currentFont:this._contextFont};re.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),UO(f);let m=!1;if((p!==!1||g)&&(m=!0,r.clear()),a&&re.check("scene:dirtyTree")){const{dirtyTree:y,paths:b}=tI(a);re.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:y,paths:b})}if(a&&m){if(a.visible&&a.preRender(f),this.debug.check()){const y=Xd(a,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:y})}if(a.visible)try{o.save(),a.render(f),o.restore()}catch(y){throw this.canvas.reset(),y}}e["\u270D\uFE0F"]=performance.now()-d,o.verifyDepthZero?.(),this.isDirty=!1,u&&eI(this.layersManager,e,o,f.stats,i,n,s),KO(o,f.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:Xd(a,"console"),canvasCleared:m})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const t=HO(),e=()=>{t(),this.releaseDebugStats=void 0};this.releaseDebugStats=e,this.cleanup.register(e)}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return bs.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,this.clear()}destroy(){this.canvas!=null&&(this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),nI(),Object.assign(this,{canvas:void 0}))}};kg.className="Scene";var uV=class{constructor(t,e){this.eventsHub=t,this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new se({name:"Axes-Grids",zIndex:2}),this.axisGroup=new se({name:"Axes",zIndex:3}),this.axisLabelGroup=new se({name:"Axes-Labels",zIndex:15}),this.axisOverlayLowGroup=new se({name:"Axes-Overlay-Low",zIndex:6}),this.axisOverlayMidGroup=new se({name:"Axes-Overlay-Mid",zIndex:10}),this.axisOverlayHighGroup=new se({name:"Axes-Overlay-High",zIndex:15}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisOverlayLowGroup),this.sceneRoot.appendChild(this.axisOverlayMidGroup),this.sceneRoot.appendChild(this.axisOverlayHighGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,overlayLowNode:this.axisOverlayLowGroup,overlayMidNode:this.axisOverlayMidGroup,overlayHighNode:this.axisOverlayHighGroup};for(const n of t)e.includes(n)||(n.detachAxis(i),n.destroy());for(const n of e)t?.includes(n)||n.attachAxis(i);this.axes.clear();for(const n of e){const s=n.createAxisContext();this.axes.has(s.direction)?this.axes.get(s.direction)?.push(s):this.axes.set(s.direction,[s])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(t){for(const[,e]of this.axes)for(const i of e)if(i.axisId===t)return i}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}};function rC(t){return Array.isArray(t)&&t.length>0}var hb=class{constructor(t,e,i){this.eventsHub=t,this.caller=e,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.isForcedLoadingData=void 0,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.lastDispatchedData=void 0,this.debug=re.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle),this._secondaryLoaders=[]}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(t,e){const{pendingData:i}=this;if(i!=null&&(i.params.windowStart==null&&i.params.windowEnd==null||i.params.windowStart?.valueOf()===t.windowStart?.valueOf()&&i.params.windowEnd?.valueOf()===t.windowEnd?.valueOf())){const n=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(n,i.data,e);return}this.isLoadingData=!0,this.eventsHub.emit("chart:request-update",{type:5}),this.throttledFetch(t,e)}registerSecondaryLoader(t,e,i){return this._secondaryLoaders.push({source:t,triggers:e,callback:i}),()=>{this._secondaryLoaders=this._secondaryLoaders.filter(n=>n.callback!==i)}}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isForcedLoadingData!=null?this.isForcedLoadingData:this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}setForcedLoading(t){this.isForcedLoadingData=t}async getData(){const{latestRequest:t}=this;if(t)return await t.fetchRequest,this.lastDispatchedData}restoreData(t){this.pendingData=t}createThrottledFetch(t){return Fp((e,i)=>this.fetch(e,i).catch(n=>B.error("callback failed",n)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return Fp((e,i,n)=>this.dispatch(e,i,n),t,{leading:!0,trailing:!0})}dispatch(t,e,i){this.debug(`DataService - dispatching 'data-load' | ${t}`),this.eventsHub.emit("data:load",{data:e,requestId:i})}async fetch(t,e){"context"in this.caller&&(t.context=this.caller.context);const i=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const a=this.requestCounter++;this.debug(`DataService - requesting | ${a}`);const{response:l,threw:c}=await this.performFetch(t,a);this.isLoadingInitialData=!1;const h=this.freshRequests.indexOf(i);return h===-1||this.dispatchOnlyLatest&&h!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${a}`),{id:a,response:l,threw:c}):(this.freshRequests=this.freshRequests.slice(h+1),this.freshRequests.length===0&&(this.isLoadingData=!1),{id:a,response:l,threw:c})}),n=[];if(t.source!=null&&this.dataSourceCallback)for(const a of this._secondaryLoaders)a.triggers.includes(t.source)&&n.push(this.performFetch({...t,source:a.source},a.source).then(({response:l})=>{rC(l)&&a.callback(l)}));this.latestRequest={params:t,fetchRequest:i},this.freshRequests.push(i),await Promise.all(n);const{id:s,response:r,threw:o}=await i;rC(r)?(this.lastDispatchedData={params:t,data:r},this.throttledDispatch(s,r,e)):(!o&&!Array.isArray(r)&&B.warnOnce(`DataService - [dataSource.getData] returned an invalid value \`${Ic(r,50)}\`; expecting an array, ignoring.`),this.eventsHub.emit("data:error",{requestId:e}))}async performFetch(t,e){if(!this.dataSourceCallback)return{response:void 0,threw:!1};let i,n=!1;try{const s=performance.now();i=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-s}ms | ${e}`)}catch(s){n=!0,this.debug(`DataService - request failed | ${e}`),B.warnOnce(`DataService - request failed | [${s}]`)}return{response:i,threw:n}}};x([gi({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],hb.prototype,"dispatchThrottle",2),x([gi({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],hb.prototype,"requestThrottle",2);var dV=class{constructor(t){this.ctx=t,this.observers=[],this.destroyed=!1}updateFonts(t){if(!(!t||t.size===0)){this.loadFonts(t);for(const e of t)this.observeFontStatus(e)}}waitForFonts(t){if(!t||t.size===0)return;const e=rr("fonts");if(e==null)return;const i=[];for(const n of t)try{e.check(n)||i.push(e.load(n))}catch{}i.length!==0&&Promise.allSettled(i).then(()=>{this.destroyed||(Zt.clear(),this.ctx.eventsHub.emit("font:load",null))})}destroy(){this.destroyed=!0;for(const t of this.observers)t.disconnect();this.observers=[]}loadFonts(t){const e=Array.from(t).map(r=>encodeURIComponent(r)),i=":wght@100;200;300;400;500;600;700;800;900",n=`${i}&family=`,s=`@import url('https://fonts.googleapis.com/css2?family=${e.join(n)}${i}&display=swap');
`;this.ctx.domManager.addStyles(`google-font-${e.join("-")}`,s)}observeFontStatus(t){const e=ox();if(e===void 0)return;const n=this.ctx.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:t,fontSize:"16px",whiteSpace:"nowrap"});n.textContent="UVWxyz",this.ctx.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(t)}`,n);const s=new e(r=>{const o=r?.at(0)?.contentBoxSize.at(0)?.inlineSize;o!=null&&o>0&&(Zt.clear(),this.ctx.eventsHub.emit("font:load",null))});s.observe(n),this.observers.push(s)}},oC={activeItem:{type:Z(vu()("series-node","legend")),seriesId:O,itemId:Z(te(O,w))},frozen:L},Lh={mode:Q(V("integrated","standalone")),withinStudio:Q(L),loading:L,container:_p,context:()=>!0,theme:he,series:ls,annotations:he,navigator:he,scrollbar:he,initialState:{active:oC,chartType:O,collapsed:ne(O),annotations:he,legend:ct({visible:L,seriesId:O,itemId:O,legendItemName:O},"legend state array"),zoom:he}},gV={...oe,...Lh,axes:hr,data:ls,dataIdKey:O},pV={...oe,...Lh,axes:hr,data:ls,dataIdKey:O},fV={...oe,...Lh,data:ls,dataIdKey:O,topology:DS},mV={...oe,...Lh,data:ls,dataIdKey:O},yV=class{constructor(t){this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0,this.ctx=t;const e=t.eventsHub.on("update:pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:i}=this;i&&(this.restoreMemento(i.version,i.mementoVersion,i.memento),this.pendingMemento=void 0,t.chartState.flushChanges("activeItem")),e()})}isFrozen(){return this.ctx.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(t,e){return this.performUpdate("user-interaction",t,e,!1)}performUpdate(t,e,i,n){if(!this.updateable)return!1;const s=this.currentItem;let r=!1;if(n||!st(s,e)){const{frozen:o,activeItem:a}=this.createMementoWithItem(e),{datum:l,datums:c,itemType:h,totalValue:u}=i??{};this.ctx.fireEvent({type:"activeChange",source:t,frozen:o,activeItem:a,datum:l,...c===void 0?{}:{datums:c},...h===void 0?{}:{itemType:h},...u===void 0?{}:{totalValue:u},dataIdKey:i?.series.data?.dataIdKey,preventDefault:()=>{r=!0}})}return r||(this.currentItem=e,this.ctx.chartState.setValue("activeItem",e)),r}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(t){const e=this.isFrozen();switch(t?.type){case"series-node":case"legend":{const{type:i,seriesId:n,itemId:s}=t;return{frozen:e,activeItem:{type:i,seriesId:n,itemId:s}}}default:return t?.type,{frozen:e}}}guardMemento(t,e){if(t==null)return!0;const i=$t(t,Lh.initialState.active);return e.push(...i.invalid.map(n=>n.toString())),i.invalid.length===0}restoreMemento(t,e,i){if(!this.didLayout){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.updateable=!1;const[n,s]=this.performRestoration(i?.activeItem);this.updateable=!0;const r=this.isFrozen(),o=i?.frozen,a=o===void 0?!1:r!==o;o===!0?this.ctx.interactionManager.pushState(1):o===!1&&this.ctx.interactionManager.popState(1),this.performUpdate("state-change",n,s,a)}performRestoration(t){let e=!1;const i=()=>e=!0;let n;const s=a=>n=a,r=this.pendingMemento!==void 0,o=this.ctx.chartService.id;return this.ctx.eventsHub.emit("active:load-memento",{initialState:r,chartId:o,activeItem:t,reject:i,setDatum:s}),e?[void 0,void 0]:[t,n]}},aC=class{constructor(t){this.maxAnimationTime=t,this.debug=re.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(xh.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(xh[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(xh.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=xh[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Sh[c]}};let{phase:n,phaseControllers:s,phaseMeta:r}=i();const o=()=>xh[this.currentPhase]==null,a=()=>{for({phase:n,phaseControllers:s,phaseMeta:r}=i();!o()&&s.length===0;)this.currentPhase++,{phase:n,phaseControllers:s,phaseMeta:r}=i(),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:e},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${n} with ${s?.length} of ${l}`);do{const c=e,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of s)h?d.stop():e=Math.min(d.update(c),e),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${s.length} controllers; ${u} completed`,s),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(e>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&Sh[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){B.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(){for(const t of this.stoppedCbs)t();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(t){if(!this.isActive())return 0;let e=0;for(const[i,n]of this.phases)n.length!==0&&(t!=null&&t!==i||(e+=Math.max(...n.map(s=>s.isComplete?0:s.delay+s.duration-(s.elapsed??0)))));return e}destroy(){this.stop(),this.controllers.clear()}};function lC(t){return t==null?!0:!Number.isNaN(t)&&t>=0&&t<=2}var bV=class{constructor(t,e,i){this.agDocument=t,this.interactionManager=e,this.chartUpdateMutex=i,this.defaultDuration=1e3,this.maxAnimatableItems=ID,this.batch=new aC(this.defaultDuration*1.5),this.debug=re.create(!0,"animation"),this.events=new Os,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(a){this.failsafeOnError(a);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const n=this.isSkipped()&&!t.forceAnimation||t.phase==="none";n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:r}=t;if(!lC(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);if(!lC(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new ZE({...t,id:i,skip:n,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(t){return this.batch.getRemainingTime(t)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=this.agDocument.requestAnimationFrame(e=>{t(e).catch(i=>B.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const n=()=>{const s=i-(t??i);t=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:s}),this.interactionManager.pushState(4);try{this.batch.progress(s),this.cumulativeAnimationTime+=s}catch(r){this.failsafeOnError(r)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:s})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(n):await this.chartUpdateMutex.acquire(n),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&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){B.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 aC(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},vV=class{constructor(t){this.eventsHub=t,this.mementoOriginatorKey="collapsed",this.collapsedIds={}}createMemento(){return Object.keys(this.collapsedIds)}guardMemento(t){return t==null||Array.isArray(t)}restoreMemento(t,e,i){i&&this.collapse(i),this.eventsHub.emit("collapsed:restore",{collapsed:this.createMemento()})}collapse(t){let e=!1;const i={};for(const n of t)e||(e=!this.collapsedIds[n]),i[n]=!0;if(!e){for(const n of Object.keys(this.collapsedIds))if(!i[n]){e=!0;break}}return this.collapsedIds=i,e&&this.eventsHub.emit("collapsed:change",null),e}collapseAppend(t){let e=!1;for(const i of t)e||(e=!this.collapsedIds[i]),this.collapsedIds[i]=!0;return e&&this.eventsHub.emit("collapsed:change",null),e}expand(t){let e=!1;for(const i of t)e||(e=!!this.collapsedIds[i]),delete this.collapsedIds[i];return e&&this.eventsHub.emit("collapsed:change",null),e}isCollapsed(t){return!!this.collapsedIds[t]}},cC=class lT{constructor(e){this.ctx=e,this.highlightStates=new Mg,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(e,i,n=!1,s){const r=this.getActiveHighlight();if(i==null&&n&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(e)){const a=Ky(()=>{this.applyPendingUnhighlight(e)});this.pendingUnhighlights.set(e,{scheduler:a}),a.schedule(this.unhighlightDelay)}return}const o=this.pendingUnhighlights.get(e);o&&(o.scheduler.cancel(),this.pendingUnhighlights.delete(e)),i?this.highlightStates.set(e,i):this.highlightStates.delete(e),this.maybeEmitChange(e,r,s)}maybeEmitChange(e,i,n){const s=this.getActiveHighlight(),r=!this.isEqual(s,i),o=n??(r?!0:this.highlightInViewport);if(r||this.highlightInViewport!==o){const a=s?.series?.isHighlightEnabled()===!1;this.highlightInViewport=o,this.ctx.chartState.setValue("highlight",s),this.ctx.eventsHub.emit(lT.HIGHLIGHT_CHANGE_EVENT,{callerId:e,currentHighlight:s,previousHighlight:i,highlightSuppressed:a,highlightInViewport:o})}}applyPendingUnhighlight(e){if(!this.pendingUnhighlights.has(e))return;this.pendingUnhighlights.delete(e);const i=this.getActiveHighlight();this.highlightStates.delete(e),this.maybeEmitChange(e,i,!0)}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:e}of this.pendingUnhighlights.values())e.cancel();this.pendingUnhighlights.clear()}isEqual(e,i){return e===i?!0:e!=null&&e.series===i?.series&&this.idsMatch(e,i)&&this.pointsMatch(e,i)&&e.datum===i.datum}idsMatch(e,i){return e.itemId!=null&&i.itemId!=null&&e.itemId===i.itemId||e.datumIndex!=null&&i.datumIndex!=null&&st(e.datumIndex,i.datumIndex)}pointsMatch(e,i){return this.pointsAreEqual(e.point,i.point)&&this.pointsAreEqual(e.midPoint,i.midPoint)&&this.pointsAreEqual(e.xBar?.lowerPoint,i.xBar?.lowerPoint)&&this.pointsAreEqual(e.xBar?.upperPoint,i.xBar?.upperPoint)&&this.pointsAreEqual(e.yBar?.lowerPoint,i.yBar?.lowerPoint)&&this.pointsAreEqual(e.yBar?.upperPoint,i.yBar?.upperPoint)}pointsAreEqual(e,i){return e===i||e!==void 0&&e.x===i?.x&&e.y===i.y}};cC.HIGHLIGHT_CHANGE_EVENT="highlight:change";var hC=cC,Tg=class{constructor(t,e,i,n){this.domManager=i,this.tooltip=n,this.stateTracker=new Mg,this.suppressState=new Mg(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new it,this.cleanup.register(n.setup(e,i),t.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:t}of this.pendingRemovals.values())t.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(t,e,i,n){const s=this.pendingRemovals.get(t);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(t)),i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:n}),this.applyStates()}removeTooltip(t,e,i=!1){if(i&&this.removeDelay>0){const s=this.pendingRemovals.get(t);if(s){e&&(s.lastMeta=e);return}const r=Ky(()=>{this.applyPendingRemoval(t)});this.pendingRemovals.set(t,{scheduler:r,lastMeta:e}),r.schedule(this.removeDelay);return}const n=this.pendingRemovals.get(t);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(t)),this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyPendingRemoval(t){this.pendingRemovals.has(t)&&(this.pendingRemovals.delete(t),this.stateTracker.delete(t),this.applyStates())}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(),n=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(st(this.appliedState?.content,e?.content)&&st(this.appliedState?.pagination,e?.pagination)){const s=this.tooltip.isVisible();this.tooltip.show(n,i,e?.meta,null,void 0,s)}else this.tooltip.show(n,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,n){const{canvasX:s,canvasY:r}=t,o=e.properties.tooltip,{placement:a,anchorTo:l,xOffset:c,yOffset:h,offset:u}=o.position,d=By(e,i,n);return{canvasX:s,canvasY:r,nodeCanvasX:d?.canvasX??s,nodeCanvasY:d?.canvasY??r,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,anchorTo:l,xOffset:c,yOffset:h,offset:u}}}},uC=3,xV=505,dC=30;function ub(t,e){const{device:i,offsetX:n,offsetY:s,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=e;return{type:t,device:i,offsetX:n,offsetY:s,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function gC(t,e){const i=t*t+e*e,n=uC*uC;return i>=n}function SV(t,e){const i=t.clientX-e.clientX,n=t.clientY-e.clientY,s=i*i+n*n,r=dC*dC;return s<r}var MV=class{constructor(t){this.cleanup=new it,this.events=new Os,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(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.cleanup.flush()}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.events.emit("mousemove",t)}onDblClick(t){this.events.emit("dblclick",t)}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&gC(t.originDeltaX,t.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",t)}onDragEnd(t){if(this.isDragging){this.events.emit("drag-end",t),this.isDragging=!1;return}if(t.device==="mouse"){const e=ub("click",t);this.events.emit("click",e)}else if(t.sourceEvent.type==="touchend"){if(gC(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=ub("click",t);this.events.emit("click",e);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=xV&&SV(this.lastClick,t)){const n=ub("dblclick",t);this.events.emit("dblclick",n),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},db=class extends zl{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},IV=class{constructor(t,e){this.seriesWidget=new db(t.getParent("series-area")),this.chartWidget=new db(t.getParent("canvas-proxy")),this.containerWidget=new db(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),e.withDragInterpretation&&(this.seriesDragInterpreter=new MV(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},DV=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=$.zero){const n={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},s=new Set(t.map(o=>o.id));for(const o of this.labelData.keys())s.has(o)||this.labelData.delete(o);for(const o of t){const a=o.getLabelData();a.every(cM)&&this.labelData.set(o.id,a)}const r=hM(this.labelData,n,5);for(const o of t)o.updatePlacedLabelData?.(r.get(o.id)??[])}},CV=class{updateCallback(t){this.resolvePartialCallback=t}resolvePartial(t,e,i,n){return this.resolvePartialCallback?.(t,e,i,n)}},AV=class extends Hn{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(t){this._domain!==t&&(t.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=t)}get domain(){return this._domain}get bands(){return this.domain}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}addBand(t,e,i){this._domain.push(this.getDomainValue(t,e)),this._bandRanges.has(t)||this._bandRanges.set(t,new Map),this._bandRanges.get(t).set(e,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(t,e){return`${t}-${e}`}findIndex(t){let e=0;for(const i of this._bandRanges.keys()){if(i===t)return e;e++}}convert(t){const{_bandwidth:e,_bandRanges:i,_inset:n,_paddingInnerWidth:s}=this;let r=n;const o=t.split("-"),a=Number(o[0]);if(!this._hasFixedWidth)return super.convert(a);for(let l=0;l<a;l++){const c=i.get(l);if(!c){r+=s;continue}let h=0;for(const u of c.values())h=Math.max(h,u??e);r+=h+s}return r}invert(t,e){}getBandCountForUpdate(){return this._bandRanges.size}update(){if(!this._hasFixedWidth)return super.update();const[t,e]=this.range;let{paddingInner:i}=this;const n=this.getBandCountForUpdate();if(n===0)return;let s=0,r=n,o=n;for(const f of this._bandRanges.values()){let m=0,y=!1;for(const b of f.values()){if(b==null){y=!0;continue}m=Math.max(m,b)}y?o-=1:(r-=1,s+=m)}n===1&&(i=0);const a=e-t,l=a/n*i,c=s+l*(n-1),h=a-c;let u=t,d=r>0&&h>=0?h/r:a/n,g=d;o===n&&h>0&&(u+=h/2),this.round&&Math.floor(g)>0&&(u=Math.round(u),g=Math.round(g)),h<0&&(d=0,g=0),this._inset=u,this._bandwidth=g,this._rawBandwidth=d,this._paddingInnerWidth=l}normalizeDomains(...t){return{domain:[],animatable:!1}}toDomain(t){}},wV=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:t,seriesGrouping:e,visible:i,width:n,type:s}){if(!e)return;let r=this.groups.get(s);r==null&&(r=new Map,this.groups.set(s,r)),r.set(t,{grouping:e,visible:i,width:n})}updateSeries({internalId:t,seriesGrouping:e,visible:i,width:n,type:s}){if(!e)return;const r=this.groups.get(s)?.get(t);r&&(r.grouping=e,r.width=n,r.visible=i)}deregisterSeries({internalId:t,type:e}){const i=this.groups.get(e);i!=null&&(i.delete(t),i.size===0&&this.groups.delete(e))}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,s=new Set,r=this.groups.get(t);for(const a of r?.values()??[])a.visible&&(n.add(a.grouping.groupIndex),a.grouping.groupIndex===e.groupIndex&&s.add(a.grouping.stackIndex));const o=Array.from(n);return o.sort((a,l)=>a-l),{visibleGroupCount:o.length,visibleSameStackCount:s.size,index:o.indexOf(e.groupIndex)}}updateGroupScale({type:t},e,i){const n=this.groupScales.get(t)??new AV;this.groupScales.set(t,n),n.domain=[];const s=this.groups.get(t);for(const r of s?.values()??[])r.visible&&n.addBand(r.grouping.groupIndex,r.grouping.stackIndex,r.width);n.domain.length===0&&n.addBand(0,0,void 0),n.range=[0,e],i.type==="grouped-category"?n.paddingInner=i.options.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(n.paddingInner=i.options.groupPaddingInner,n.round=n.padding!==0):n.padding=0,n.update()}getGroupScale({type:t}){return this.groupScales.get(t)}getGroupBandWidth(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const n=this.groups.get(t.type);if(!n)return i.bandwidth;let s=0;for(const r of n.values())r.visible&&r.grouping.groupIndex===e.groupIndex&&(s=Math.max(s,r.width??i.bandwidth));return s||i.bandwidth}getGroupOffset(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const n=i.getDomainValue(e.groupIndex,e.stackIndex);return i.convert(n)}getStackOffset(t,e){const{seriesGrouping:i}=t;if(!i)return 0;const n=this.groups.get(t.type);if(!n)return 0;const s=this.getGroupScale(t);if(!s||(i.stackCount??0)<1)return 0;let o=0;for(const a of n.values())a.visible&&a.grouping.groupIndex===i.groupIndex&&(o=Math.max(o,a.width??s.bandwidth));return o===0?0:o/2-e/2}getDatumOffset(t,e,i,n){const s=this.groups.get(t.type);if(!t.visible||!t.seriesGrouping||!s||e.get(t.internalId)?.[n]||i.get(t.internalId)?.[n])return 0;const r=new Set;for(const[d,g]of s)g.visible&&!e.get(d)?.[n]&&!i.get(d)?.[n]&&r.add(g.grouping.groupIndex);if(r.size===t.seriesGrouping?.groupCount)return 0;const o=this.groupScales.get(t.type),a=new Map,l=new Map;for(const[d,g]of s)d!==t.internalId&&g.visible&&(r.has(g.grouping.groupIndex)||(t.seriesGrouping.groupIndex<g.grouping.groupIndex?l.set(g.grouping.groupIndex,Math.max(g.width??o?.bandwidth??0,l.get(g.grouping.groupIndex)??0)):t.seriesGrouping.groupIndex>g.grouping.groupIndex&&a.set(g.grouping.groupIndex,Math.max(g.width??o?.bandwidth??0,a.get(g.grouping.groupIndex)??0))));let c=0;for(const[,d]of l)c+=d;for(const[,d]of a)c-=d;c/=2;const h=(o?.paddingInnerWidth??0)/2,u=(l.size-a.size)*h;return c+u}};function kV(t,e){const i=kp(),n=new Os,s=new G0;s.setValue("activeItem",void 0),s.setValue("highlight",void 0),s.setValue("legendData",{}),s.setValue("legendVisible",!0);const r=new XD(n,e.styleNonce,e.agDocument,e.container,e.styleContainer,e.skipCss,e.domMode,e.cssVariables),o=r.addChild("canvas","scene-canvas",e.scene?.canvas.element),a=e.scene??new kg({canvasElement:o,pixelRatio:e.agDocument.window.devicePixelRatio??1});a.setRoot(e.root),i.constant("eventsHub",n).constant("agDocument",e.agDocument).ref("chartService",t).ref("annotationRoot",t.annotationRoot).constant("fireEvent",e.fireEvent).constant("syncManager",e.syncManager).constant("chartState",s).constant("domManager",r).ref("scene",a),i.service("callbackCache",()=>new hS).service("formatManager",()=>new Fr).service("seriesStateManager",()=>new wV).service("stateManager",()=>new IF).service("seriesLabelLayoutManager",()=>new DV).service("interactionManager",()=>new mI).service("optionsGraphService",()=>new CV).service("chartTypeOriginator",()=>new SF(t)).service("widgets",l=>new IV(l.domManager,{withDragInterpretation:e.withDragInterpretation})).service("axisManager",l=>new uV(l.eventsHub,e.root)).service("highlightManager",l=>new hC(l)).service("layoutManager",l=>new xE(l.eventsHub)).service("localeManager",l=>new tV(l.eventsHub)).service("historyManager",l=>new MF(l)).service("collapsedManager",l=>new vV(l.eventsHub)).service("animationManager",l=>new bV(l.agDocument,l.interactionManager,e.updateMutex)).service("activeManager",l=>new yV(l)).service("proxyInteractionService",l=>new JF(l)).service("fontManager",l=>new dV(l)).service("tooltipManager",l=>new Tg(l.eventsHub,l.localeManager,l.domManager,t.tooltip)).service("dataService",l=>new hb(l.eventsHub,t,l.animationManager));for(const l of ee.listModulesByType("plugin"))(!l.chartType||l.chartType===e.chartType)&&l.register?.(i);return i}var Lg=class extends Fe{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.drawingMode="cutout"}};x([C],Lg.prototype,"enabled",2),x([C],Lg.prototype,"range",2),x([C],Lg.prototype,"drawingMode",2);function TV(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function LV(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,n]of t){const s=e.get(i);if(s==null||!TV(n,s))return!1}return!0}function NV(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:n,idsMap:s,scopes:r,data:o,...a}=t[i],{type:l,idsMap:c,scopes:h,data:u,...d}=e[i];if(n!==l||r&&h&&!es(r,h)||o&&u&&o!==u||!st(a,d)||!LV(s,c))return!1}return!0}function OV(t,e){const{props:i,...n}=t,{props:s,...r}=e;return st(n,r)&&NV(i,s)}function EV(t,e,i,n){return e!==t.dataSet?!1:es(i,t.ids)&&OV(n,t.opts)}function pC(t){return t.filter(e=>e.type==="key").map(e=>e.property).join(";")}var gb=class Tn{constructor(e,i,n){this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=re.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,n){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,r)=>{this.requested.push({id:e,opts:n,dataSet:i,resolve:s,reject:r})})}execute(e,i){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const n=new Map;for(const l of this.requested)l.dataSet.hasPendingTransactions()&&n.set(l.dataSet,l.dataSet.getChangeDescription()),l.dataSet.commitPendingTransactions(i);this.debug("DataController.execute() - requested",this.requested);const s=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",s);const r=this.mergeRequested(s);this.debug("DataController.execute() - merged",r),this.debug.check()&&(ts().processedData=[]);const o=[];for(const{dataSet:l,ids:c,opts:h,resolves:u,rejects:d}of r){let g=function(S){return EV(S,l,c,h)};var a=g;const p=e?.find(g),f=(S,M)=>{if(this.debug.check()&&ts("processedData").push(M),M==null){for(const D of d)D(new Error("AG Charts - no processed data generated"));return}o.push({opts:h,dataSet:l,dataLength:l.data.length,ids:c,dataModel:S,processedData:M});for(const D of u)D({dataModel:S,processedData:M})},m=()=>{try{const S=new Oy(h,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(s.map(I=>[I.id,I.dataSet])),D=S.processData(M);return f(S,D),S}catch(S){for(const M of d)M(S)}};if(p==null){m();continue}const{dataModel:y,processedData:b}=p,v=n.get(l);if(b&&v&&y.isReprocessingSupported(b)){if(this.debug("DataController.execute() - reprocessing data",b,l),y.reprocessData(b,n,i),re.check("data-model:reprocess-diff")){const S=new Oy(h,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(s.map(T=>[T.id,T.dataSet])),D=S.processData(M),I=JSON.parse(JSON.stringify(b,Tn.jsonReplacer)),A=JSON.parse(JSON.stringify(D,Tn.jsonReplacer));delete I.time,delete I.optimizations,delete A.time,delete A.optimizations;const k=ps(A,I);k?(B.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),B.log("Difference between incremental update and full reprocess:"),B.log(""),B.log("BASELINE (full reprocess):"),B.log(JSON.stringify(A,null,2)),B.log(""),B.log("REPROCESSED (incremental update):"),B.log(JSON.stringify(I,null,2)),B.log(""),B.log("DIFF (what changed):"),B.log(JSON.stringify(k,null,2))):B.log("\u2705 Data-model reprocess matches baseline (no diff)")}f(y,b);continue}m()}return o}validateRequests(e){const i=[];for(const[n,s]of e.entries())n>0&&s.dataSet.data.length!==e[0].dataSet.data.length&&s.opts.groupByData===!1&&s.opts.groupByKeys===!1?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(s);return i}mergeRequested(e){const i=[];for(const n of e){const s=i.find(Tn.groupMatch(n));s?s.push(n):i.push([n])}return i.map(Tn.mergeRequests)}static groupMatch({dataSet:e,opts:i}){const{groupByData:n,groupByKeys:s=!1,groupByFn:r,props:o}=i,a=pC(o);return([l])=>(n===!1||l.dataSet===e)&&(l.opts.groupByKeys??!1)===s&&l.opts.groupByFn===r&&pC(l.opts.props)===a}static mergeRequests(e){const i={ids:[],rejects:[],resolves:[],dataSet:e[0].dataSet,opts:{...e[0].opts,props:[]}},n=new Map,s=new Map;let r=0;for(const o of e){const{id:a,dataSet:l,resolve:c,reject:h,opts:{props:u,...d}}=o;i.ids.push(a),i.rejects.push(h),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...d,props:[]});for(const g of u){const p={...g,scopes:[a],data:l.data};Tn.createIdsMap(a,p);let f;Tn.crossScopeMergableTypes.has(p.type)?f=-1:s.has(l.data)?f=s.get(l.data):(f=r++,s.set(l.data,f));const m=`${p.type}-${f}-${p.groupId}`,y=n.get(m),b=y?.find(v=>Tn.deepEqual(v,p));if(y==null){i.opts.props.push(p),n.set(m,[p]);continue}else if(b==null){i.opts.props.push(p),y.push(p);continue}p.scopes!=null&&(b.scopes??(b.scopes=[]),b.scopes.push(...p.scopes)),(b.type==="key"||b.type==="value")&&p.idsMap?.size&&(b.idsMap??(b.idsMap=new Map),Tn.mergeIdsMap(p.idsMap,b.idsMap))}}return i}static mergeIdsMap(e,i){for(const[n,s]of e){const r=i.get(n);if(r==null)i.set(n,new Set(s));else for(const o of s)r.add(o)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let n,s;if(Array.isArray(e)){if(s=e.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!Tn.deepEqual(e[n],i[n]))return!1;return!0}const r=Object.keys(e);if(s=r.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const o=r[n];if(!Tn.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!Tn.deepEqual(e[o],i[o])))return!1}return!0}return!1}static jsonReplacer(e,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};gb.crossScopeMergableTypes=new Set(["key","group-value-processor"]),gb.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var fC=gb;function mC(t,e){const i=new Fl([...e.data],e.dataIdKey);return t?.transferDataSet(i,e),i}function yC(t,e,i,n){const s=new Fl(i,n);return e&&t?.transferDataSet(s,e),s}var pb=class sr{constructor(e){this.chart=e}subscribe(e=sr.DEFAULT_GROUP){let i=this.get(e);return i||(i={members:new Set},sr.chartsGroups.set(e,i)),i.members.add(this.chart),this}unsubscribe(e=sr.DEFAULT_GROUP){const i=this.get(e);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(e=sr.DEFAULT_GROUP){return this.get(e)}getGroupMembers(e=sr.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i.members):[]}getGroupSiblings(e=sr.DEFAULT_GROUP){return this.getGroupMembers(e).filter(i=>i!==this.chart)}getGroupSyncMode(e=sr.DEFAULT_GROUP){return this.getGroupMembers(e).some(i=>i.series.length>1)?"multi-series":"single-series"}get(e){return sr.chartsGroups.get(e)}};pb.chartsGroups=new Map,pb.DEFAULT_GROUP=Symbol("sync-group-default");var RV=pb,bC=["right","top","left","bottom"];function PV(t){return typeof t=="string"&&bC.includes(t)}function FV(t){const e=[],i=[],n=[...bC];for(const s of t)s instanceof Mh&&(PV(s.position)?i.push(s.position):e.push(s));for(const s of e){let r;do r=n.pop();while(r&&i.includes(r));if(r==null)break;s.position=r}}var vC=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function VV(t,e,i){const n=new Map,s=u=>{if(u===void 0)return vC;if(n.has(u))return n.get(u);const d=ee.getSeriesModule(u)?.matchingKeys??vC;return n.set(u,d),d},r=(u,d,g)=>{const p=s(u),f=[u];for(const m of p)m in d&&d[m]!=null&&f.push(`${m}=${d[m]}`);return g?.seriesGrouping&&f.push(`seriesGrouping.groupId=${g?.seriesGrouping.groupId}`),f.join(";")},o=new Map;let a=0;for(const u of t){const d=r(u.type,u.properties,i?.[a]);o.has(d)||o.set(d,[]),o.get(d)?.push([u,a++])}const l=new Map;a=0;for(const u of e){const d=r(u.type,u,u);l.has(d)||l.set(d,[]),l.get(d)?.push([u,a++])}if(![...o.keys()].some(u=>l.has(u)))return{status:"no-overlap",oldKeys:o.keys(),newKeys:l.keys()};const h=[];for(const[u,d]of l.entries())for(const[g,p]of d){const f=o.get(u);if(f==null||f.length<1){h.push({opts:g,targetIdx:p,idx:p,status:"add"}),o.delete(u);continue}const[m,y]=f.shift(),b=i?.[y]??{},v=ps(b,g??{}),{groupIndex:S,stackIndex:M}=v?.seriesGrouping??{};S!=null||M!=null?h.push({opts:g,series:m,diff:v,targetIdx:p,idx:y,status:"series-grouping"}):v?h.push({opts:g,series:m,diff:v,targetIdx:p,idx:y,status:"update"}):h.push({opts:g,series:m,targetIdx:p,idx:y,status:"no-op"}),f.length===0&&o.delete(u)}for(const u of o.values())for(const[d,g]of u)h.push({series:d,idx:g,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}var BV=class extends uy{*legends(){for(const t of ee.listModulesByType("plugin"))(t.name==="legend"||t.name==="gradientLegend")&&(yield{legendType:t.name==="legend"?"category":"gradient",legend:this.getModule(t.name)})}selection(){return this.getModule("selection")}},fb="ag-charts-overlay",_V="ag-charts-dark-overlay";function zV(t){switch(t){case"top":return"top";case"bottom":return"bottom";case"baseline":return"baseline";case"middle":default:return"middle"}}function GV(t){const{top:e,right:i,bottom:n,left:s}=wd(t.padding);return{boxSizing:"border-box",objectFit:"contain",width:`${t.width}px`,height:`${t.height}px`,padding:`${e}px ${i}px ${n}px ${s}px`,verticalAlign:zV(t.verticalAlign),backgroundColor:t.backgroundFill??"",borderRadius:t.cornerRadius==null?"":`${t.cornerRadius}px`}}var ea=class extends Fe{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return ue(this.text)?je(this.text):this.rendererAsText?this.rendererAsText:t.t($e(this.text)||this.defaultMessageId)}getElement(t,e,i,n){this.content?.remove(),this.rendererAsText=void 0,this.focusBox=n;const s={},r=this.renderer?tn(t,this.renderer,s):void 0,o=_x(r);if(typeof o=="string"||Da(o)){if(Da(o))this.content=o;else{const a=ye("div");a.innerHTML=o;const{firstElementChild:l}=a;Da(l)&&a.childElementCount===1?this.content=l:this.content=a}this.rendererAsText=this.content?.textContent?.trim()}else{const a=ye("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)"});if(ue(this.text)){const l=ye("div");for(const c of this.text){if(c.type==="image"){this.appendImageSegment(l,c);continue}const h=ye("span",{color:c.color,fontSize:`${c.fontSize}px`,fontFamily:c.fontFamily??"inherit",fontWeight:String(c.fontWeight),fontStyle:c.fontStyle});h.innerText=$e(c.text),l.appendChild(h)}a.appendChild(l)}else a.innerText=this.getText(i);this.content=a,this.content.classList.add(this.className),e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(l){a.style.opacity=String(l)},onStop(){a.style.opacity="1"}})}return this.content}appendImageSegment(t,e){const i=ye("img",GV(e));i.src=e.url,i.alt=e.alt??"",t.appendChild(i)}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(n){i.style.opacity=String(n)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};x([C],ea.prototype,"enabled",2),x([C],ea.prototype,"text",2),x([C],ea.prototype,"renderer",2);var jl=class extends Fe{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new ea("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new ea("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new ea("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new ea("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()}};x([C],jl.prototype,"darkTheme",2),x([C],jl.prototype,"loading",2),x([C],jl.prototype,"noData",2),x([C],jl.prototype,"noVisibleSeries",2),x([C],jl.prototype,"unsupportedBrowser",2);function jV(t,e,i){const{animationDuration:n}=Sh.add,s=n*i,r=t.createElement("div",`${fb}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:'13px "IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),o=t.createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),a=t.createElement("p",{marginTop:"1em"});a.innerText=e;const l=t.createElement("div",`${fb}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=t.createElement("style");return c.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(" "),r.replaceChildren(c,o,a,l),r}var Nh=class extends Fe{constructor(t){super(),this.ctx=t,this.rectNode=new Pt,this.border=new el(this.rectNode),this.cornerRadius=0,this.padding=new rl(0),this.cleanup=new it,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.cleanup.flush()}getPadding(){const{border:t,padding:e}=this,i=t.enabled?t.strokeWidth:0;return{top:e.top+i,right:e.right+i,bottom:e.bottom+i,left:e.left+i}}createNode(){return new se({name:"series-area-container",zIndex:4})}onLayoutComplete(t){const{x:e,y:i,width:n,height:s}=t.series.paddedRect;this.rectNode.x=e,this.rectNode.y=i,this.rectNode.width=n,this.rectNode.height=s}};x([C],Nh.prototype,"border",2),x([C],Nh.prototype,"clip",2),x([Yt("rectNode","cornerRadius"),C],Nh.prototype,"cornerRadius",2),x([C],Nh.prototype,"padding",2);var HV=class{constructor(t){this.swapChain=t,this.focusVisibleStyle=!1,this.hasFocus=!1,this.div=ye("div"),this.svg=pt("svg"),this.outerPath=pt("path"),this.innerPath=pt("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=ye("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 Rt){const n=(r,o)=>{let{x:a,y:l}=Oe.toCanvasPoint(t,r,o);return a-=e.x??0,l-=e.y??0,{x:a,y:l}},s=t.svgPathData(n);this.outerPath.setAttribute("d",s),this.innerPath.setAttribute("d",s),this.show(this.svg)}else{let n;if(i){const s=Math.max(t.x-e.x,0),r=Math.max(t.y-e.y,0),o=Math.min(t.x+t.width-e.x,e.width),a=Math.min(t.y+t.height-e.y,e.height);n=new $(s,r,o-s,a-r)}else n=new $(t.x-e.x,t.y-e.y,t.width,t.height);gu(this.div,n),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.element.innerHTML="",this.element.append(t)}focus(t){this.focusVisible=t.focusVisible,this.hasFocus||(t.focusVisible!==void 0&&(this.hasFocus=!0),this.swapChain.focus(t))}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(){return this.focusVisible??this.focusVisibleStyle}onFocus(){if(this.hasFocus)return this.isFocusVisible();this.overrideFocusVisible(void 0);const t=this.element.parentElement,e=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=t!=null&&e.getComputedStyle(t).opacity==="1",this.hasFocus=!0,this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1,this.hasFocus=!1}},$V=class{constructor(t,e,i,n){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=s=>(Gn(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>(Gn(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),Ce(this.label1,"id",Kc()),Ce(this.label2,"id",Kc()),Gn(this.label1,"display","none"),Gn(this.label2,"display","none"),this.label1.textContent=n,this.label2.textContent=n,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Ce(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(n)}createAnnouncer(t){const e=ye("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);for(const i of this.listeners[t])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],Io(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Io(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},WV={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},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},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function UV(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 KV(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:n}]of ut(WV))if(UV(t,n))return{name:e,activatesFocusIndicator:i}}function YV(t,e){for(const i of t)if(Oe.toCanvas(i.node).intersectsWith(e))return!0;return!1}function ZV(t){switch(t.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}var xC=class extends Zy{constructor(t){super(),this.chart=t,this.id=xn(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new lF(t.ctx.activeManager,t.tooltip);const e=t.ctx.localeManager.t("ariaInitSeriesArea"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),n=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new $V(i,n,"img",e),this.swapChain.addListener("blur",a=>this.onBlur(a)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new HV(this.swapChain),this.focusIndicator.overrideFocusVisible(t.ctx.chartState.getValue("options","mode")==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:r,containerWidget:o}=t.ctx.widgets;r.setTabIndex(-1),this.cleanup.register(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),r.addListener("focus",()=>this.focusIndicator?.focus({preventScroll:!0})),r.addListener("mousemove",a=>this.onHover(a,r)),r.addListener("wheel",a=>this.onWheel(a)),r.addListener("mouseleave",a=>this.onLeave(a)),r.addListener("keydown",a=>this.onKeyDown(a)),r.addListener("contextmenu",(a,l)=>this.onContextMenu(a,l)),o.addListener("contextmenu",(a,l)=>this.onContextMenu(a,l)),o.addListener("click",(a,l)=>this.onClick(a,l)),o.addListener("dblclick",(a,l)=>this.onClick(a,l)),t.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),t.ctx.eventsHub.on("active:load-memento",a=>this.onActiveLoadMemento(a)),t.ctx.chartState.observe(a=>{a("activeItem")?.type==="legend"&&(this.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")}),t.ctx.eventsHub.on("dom:resize",()=>this.onResize()),t.ctx.eventsHub.on("dom:container-change",()=>this.resetHoverScheduler()),t.ctx.eventsHub.on("highlight:change",a=>this.changeHighlightDatum(a)),t.ctx.eventsHub.on("highlight:selection-updated",a=>this.onHighlightSelectionUpdate(a)),t.ctx.eventsHub.on("layout:complete",a=>this.layoutComplete(a)),t.ctx.eventsHub.on("update:pre-scene-render",()=>this.preSceneRender()),t.ctx.eventsHub.on("update:complete",()=>this.updateComplete()),t.ctx.eventsHub.on("zoom:change-complete",a=>this.onZoomChangeComplete(a)),t.ctx.eventsHub.on("collapsed:change",()=>{this.focusIndicator?.isFocusVisible()&&(this.announceMode="always")}),t.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll()),t.ctx.eventsHub.on("legend:item-hover",a=>this.onLegendHover(a))),s&&this.cleanup.register(s.events.on("drag-move",a=>this.onDragMove(a,r)),s.events.on("click",a=>this.onClick(a,r)),s.events.on("dblclick",a=>this.onClick(a,r)))}get bbox(){return(this.seriesRect??$.zero).clone()}setHoverDevice(t){(t==="setState"||!this.isState(1))&&(this._device=t)}getHoverDevice(){return this._device}initFocus(t){if(!this.focus.initialized)switch(this.focus.initialized=!0,t){case"data-end":{this.focus.datumIndex=Number.MAX_VALUE;break}case"viewport-start":case"viewport-end":{this.focus.pendingViewportFocus=t;break}default:}}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){if(t.device!=="touch"||t.type==="click")return!1;const{dragAction:e}=this.chart.ctx.chartState.getValue("options","touch");return!(e==="hover"||e==="drag"&&this.isState(18))}dataChanged(){var t;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.getHoverDevice()!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.getHoverDevice()==="setState"&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:t}=this.focus;t&&this.focus.series!==void 0?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.refreshFocus())}update(t,e){this.chart.ctx.eventsHub.emit("chart:request-update",{type:t,opts:e})}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let n=e.properties.focusPriority??1/0,s=i.properties.focusPriority??1/0;return n===s&&([n,s]=[e.declarationOrder,i.declarationOrder]),n<s?-1:n>s?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onAnimationStart(){this.getHoverDevice()!=="setState"&&this.activeState.lastActive!=="legend"&&this.clearAll()}onResize(){const t=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&t!==void 0&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:Th(t),seriesId:t.series.id})}onZoomChangeComplete(t){this.clearAll(),this.focus.pendingViewportFocus=ZV(t)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(e!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=t;this.chart.ctx.contextMenuRegistry?.dispatchContext("always",{widgetEvent:t,canvasX:c,canvasY:h},void 0)}return}let n,s;if(this.focusIndicator?.isFocusVisible())n=this.chart.ctx.highlightManager.getActiveHighlight(),n&&this.seriesRect&&n.midPoint&&(s=Oe.toCanvasPoint(n.series.contentGroup,n.midPoint.x,n.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");c&&(this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id)}),n=c.matches[0])}const r=n?.series;this.clearAll();const o=t.currentX+e.cssLeft(),a=t.currentY+e.cssTop(),{datumIndex:l}=n??{};r&&n&&l!=null?this.chart.ctx.contextMenuRegistry?.dispatchContext("series-node",{widgetEvent:t,canvasX:o,canvasY:a},{pickedSeries:r,pickedNode:{...n,datumIndex:l}},s):this.chart.ctx.contextMenuRegistry?.dispatchContext("series-area",{widgetEvent:t,canvasX:o,canvasY:a},void 0,s)}onLeave(t){!this.isState(82)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.getHoverDevice()!=="keyboard"&&this.clearAll(!0))}onWheel(t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(t,e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e))}onHover(t,e){this.isState(83)&&this.onHoverLikeEvent(t,e)}onHoverLikeEvent(t,e){if(this.isIgnoredTouch(t)||(t.device==="touch"&&this.chart.ctx.chartState.getValue("options","touch").dragAction==="hover"&&t.sourceEvent.preventDefault(),e!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=t,this.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule();let i;if(this.isState(65)){const{currentX:s,currentY:r}=t;i=this.pickNodes({x:s,y:r},"event");const o=i?.matches,a=o?.[0];a?.series.isSelectionEnabled()&&a?.series.isDatumSelectable(a.datumIndex)||a?.series.hasEventListener("seriesNodeClick")||a?.series.hasEventListener("seriesNodeDoubleClick")||o!=null&&o.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const n=!!i?.matches.length;this.emitSeriesAreaHoverEvent(t,n)}onClick(t,e){if(t.device==="keyboard"||(e===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.focusIndicator?.focus({preventScroll:!0,focusVisible:!1}),!this.isState(83)))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e);const i=e===this.chart.ctx.widgets.seriesWidget;if(this.isState(18)){i&&this.emitSeriesAreaClickEvent(t,!1);return}if(i){const s=this.checkSeriesNodeClick(t);if(s){this.emitSeriesAreaClickEvent(t,!0,s),this.update(7),t.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(t,!1)}const n={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(n)}emitSeriesAreaHoverEvent(t,e){const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s={canvasX:i,canvasY:n,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",s)}emitSeriesAreaClickEvent(t,e,i){const{type:n,sourceEvent:s}=t,r={type:n,consumed:e,sourceEvent:s,clickedNode:i},{datum:o}=this.focus,a=o?.series.getDataSelectionState(o.datumIndex);this.chart.ctx.eventsHub.emit("series-area:click",r);const l=o?.series.getDataSelectionState(o.datumIndex);a!==l&&this.announceDataSelectionChange()}toCanvasCoordinates(t){return{canvasX:t.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:t.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.ctx.chartState.getValue("options","keyboard").initialFocus);const t=this.focusIndicator.onFocus();this.setHoverDevice(t?"keyboard":"pointer");const{pendingViewportFocus:e}=this.focus;this.refreshFocus()===4&&e&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e))}onBlur(t){this.isState(69)&&(this.setHoverDevice("pointer"),!this.isState(1)&&!this.maybeEnterInteractiveTooltip(t)&&this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(t){if(!this.isState(87))return;const e=KV(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.getHoverDevice()==="keyboard"),e?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:t});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:t});case"panxleft":return this.onPage(-1,t);case"panxright":return this.onPage(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"home":return this.onHome(t);case"end":return this.onEnd(t);case"submit":return this.onSubmit(t);case"delete":return;default:e?.name}}onPage(t,e){if(!this.chart.hasPgUpPgDownSupport()||!this.onNav(e))return;const i=this.focus.series?.axes.x?.options.reverse===!0;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:t,reverse:i,widgetEvent:e})}onNav(t){return this.isState(69)?(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),t.sourceEvent.preventDefault(),!0):!1}onArrow(t,e,i){this.onNav(i)&&(this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocusFromUserInput({datumIndexDelta:e,otherIndexDelta:t}))}onHome(t){if(this.chart.hasViewportSupport())return this.onPage("home",t);this.onNav(t)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(t){if(this.chart.hasViewportSupport())return this.onPage("end",t);if(!this.onNav(t))return;const e=this.focus.series?.data?.data.length;e!==void 0&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:e-1})}onSubmit(t){if(!this.onNav(t))return;const{series:e,datum:i}=this.focus,n=t.sourceEvent;if(e!=null&&i!=null){if(e.fireNodeClickEvent(n,i)){const r={type:"click",device:"keyboard",sourceEvent:n};this.emitSeriesAreaClickEvent(r,!0,i),this.update(7)}}else this.chart.fireEvent({type:"click",event:n})}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event"),n=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||n.active===void 0)return;const s=n.paginationState==null?i.distance:0;if(t.type==="click"){if(n.active.series.fireNodeClickEvent(t.sourceEvent,n.active)){const o=this.pickManager.nextCandidate();if(o.active!==void 0){const{active:a}=o,{canvasX:l,canvasY:c}=this.toCanvasCoordinates(t);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:a,defaultCb:()=>{this.showTooltip(a,l,c,o.paginationState)}})}}return n.active}if(t.type==="dblclick")return t.preventZoomDblClick=s===0,n.active.series.fireNodeDoubleClickEvent(t.sourceEvent,n.active),n.active}handleFocusFromUserInput(t){this.handleFocus(t),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(t){const e=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(e==null){const i=this.handleSeriesFocus(t);return i===0?this.announceMode="when-changed":this.announceMode="always",i}else return this.focusIndicator?.update(e.rect,this.seriesRect,!1),this.swapChain.update(e.text),this.announceMode="always",0}handleSeriesFocus(t){return"datumIndexDelta"in t?this.handleSeriesFocusDeltas(t):this.handleSeriesFocusIndices(t)}makeUpdateFocusParamsFromDeltas(t){const{otherIndexDelta:e,datumIndexDelta:i}=t;if(this.chart.chartType==="standalone"){this.focus.series=this.focus.sortedSeries[0];const c=this.focus.datumIndex,h=this.focus.seriesIndex,u=this.focus.datumIndex-i,d=this.focus.seriesIndex-e;return{datumIndex:c,datumIndexDelta:i,oldDatumIndex:u,otherIndex:h,otherIndexDelta:e,oldOtherIndex:d}}const{focus:n}=this,s=n.sortedSeries.filter(c=>c.visible&&c.focusable);if(s.length===0)return 1;const r=n.datumIndex-i,o=n.seriesIndex-e;n.seriesIndex=J(0,n.seriesIndex,s.length-1),n.series=s[n.seriesIndex];const a=this.focus.datumIndex,l=this.focus.seriesIndex;return{datumIndex:a,datumIndexDelta:i,oldDatumIndex:r,otherIndex:l,otherIndexDelta:e,oldOtherIndex:o}}handleSeriesFocusDeltas(t){const e=this.makeUpdateFocusParamsFromDeltas(t);return e===1?1:this.pickFocus(e)}handleSeriesFocusIndices(t){const{datumIndex:e,otherIndex:i}=t,n=this.focus.datumIndex,s=this.focus.seriesIndex;return this.pickFocus({datumIndex:e,datumIndexDelta:e-n,oldDatumIndex:n,otherIndex:i,otherIndexDelta:i-s,oldOtherIndex:s})}pickFocus(t){const{datumIndex:e,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s}=t,{focus:r,hoverRect:o,seriesRect:a}=this;if(r.series==null||o==null)return 1;const l={datumIndex:e,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s,seriesRect:a},c=r.series.pickFocus(l);return c?this.updatePickedFocus(t,c):2}pickViewportFocus(t){const{focus:e,hoverRect:i}=this;if(e.series==null||i==null)return 1;const n=e.series.pickViewportFocus({where:t,hoverRect:i,otherIndex:e.seriesIndex});if(!n)return 2;const s={datumIndex:n.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:n.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(s,n)}updatePickedFocus(t,e){const{datumIndexDelta:i,oldDatumIndex:n,otherIndexDelta:s,oldOtherIndex:r}=t,{focus:o,hoverRect:a}=this;if(o.series==null||a==null)return 1;if(o.pendingViewportFocus!==void 0)return 4;const{datum:l}=e;if(o.datum=l,o.datumIndex=e.datumIndex,e.otherIndex!=null&&(o.seriesIndex=e.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const u=Gy(e),{x:d,y:g}=u.computeCenter();if(!a.containsPoint(d,g)){const D=o.series.mapFocusBBoxToPanTarget(a,u);if(this.chart.ctx.zoomManager?.panToBBox(a,D))return 3}const{x1:p,x2:f,y1:m,y2:y}=No.from(u),b=a.containsPoint(p,m),v=a.containsPoint(f,m),S=a.containsPoint(p,y),M=a.containsPoint(f,y);if(!(b||v||S||M)){const D=No.from(a);e.movedBounds=u.clone(),p<D.x1&&f<D.x1?(e.movedBounds.x=D.x1-2,e.movedBounds.width=4):p>D.x2&&f>D.x2&&(e.movedBounds.x=D.x2-2,e.movedBounds.width=4),m<D.y1&&y<D.y1?(e.movedBounds.y=D.y1-2,e.movedBounds.height=4):m>D.y2&&y>D.y2&&(e.movedBounds.y=D.y2-2,e.movedBounds.height=4)}}this.focusIndicator?.update(e.movedBounds??e.bounds,this.seriesRect,e.clipFocusBox);const c=this.getTooltipContent(l,"aria-label"),h=rF(o.series,a,e);if(h!=null&&this.getHoverDevice()==="keyboard"&&(this.clearCachedEvents(),!this.isState(1))){const u=Tg.makeTooltipMeta(h,o.series,l,e.movedBounds);this.pickManager.maybeActivate(l,({series:d})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l),this.isTooltipEnabled(d)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,u,c)},{defaultCbArg:{series:o.series}})}return this.maybeAnnouncePickedFocus(i,n,s,r,e,c),0}maybeAnnouncePickedFocus(t,e,i,n,s,r){const{focus:o}=this;let a;this.announceMode==="when-changed"?t===0&&i===0||e!==s.datumIndex||n!==(s.otherIndex??o.seriesIndex)?a="always":a="never":a=this.announceMode,a==="always"&&this.swapChain.update(this.getDatumAriaText("keynav",s.datum,r))}announceDataSelectionChange(){const{datum:t}=this.focus;if(t!==void 0){const e=this.getTooltipContent(t,"aria-label");this.swapChain.update(this.getDatumAriaText("selectionChange",t,e))}}getDatumAriaText(t,e,i){const n=i==null?"":RE(i),s=this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,n)??n}),r=this.getSelectedStateAriaText(e);if(r===void 0)return s;switch(t){case"keynav":return[s,r].join(", ");case"selectionChange":return[r,s].join(", ");default:return t}}getSelectedStateAriaText(t){const e=t.series.getDataSelectionState(t.datumIndex);switch(e){case 1:return this.chart.ctx.localeManager.t("ariaAnnounceSelectedItem");case 0:case 2:return this.chart.ctx.localeManager.t("ariaAnnounceUnselectedItem");case 3:case void 0:return;default:return e}}clearHighlight(t=!1){this.pickManager.maybeActivate(void 0,()=>{this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,t)})}clearTooltip(t=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,t),this.tooltip.lastHover=void 0}clearAll(t=!1){this.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(t),this.pickManager.wasActivationPrevented()||this.clearTooltip(t),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){this.getHoverDevice()==="setState"&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id),this.chart.ctx.tooltipManager.removeTooltip(this.id))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return mF(this.chart.ctx.domManager.getDocument(),()=>{if(this.getHoverDevice()==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=7){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}})}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:t,paginationState:e}=this.pickManager.onPickedNodesAPIDebounced();t!==void 0&&this.pickManager.maybeActivate(t,()=>{const i=By(t.series,t,void 0);if(this.chart.tooltip.enabled){if(!t.series.visible)this.clearStaleHighlightTooltip();else if(i){const{canvasX:n,canvasY:s}=i,r=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,t,!1,r),r?this.showTooltip(t,n,s,e):this.clearTooltip()}}})}handleHoverHighlight(t,e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:n,canvasY:s}=this.toCanvasCoordinates(i);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,s)){this.clearHighlight();return}const{range:r}=this.chart.highlight,o=r==="tooltip"?"highlight-tooltip":"highlight",a=e?.active??this.pickManager.onPickedNodesHighlight(this.pickNodes({x:i.currentX,y:i.currentY},o));a===void 0?this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),e?.defaultCb()}):this.pickManager.maybeActivate(a,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,a,!1),e?.defaultCb()})}handleHoverTooltip(t,e){if(!this.isState(82))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,n)){this.getHoverDevice()=="pointer"&&this.clearTooltip();return}if(s&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(s,"canvas-overlay",Jt))return;const r=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip"),{active:o,paginationState:a}=this.pickManager.onPickedNodesTooltip(r);this.pickManager.wasActivationPrevented()||(o===void 0?this.getHoverDevice()=="pointer"&&this.clearTooltip(!0):this.showTooltip(o,i,n,a))}showTooltip(t,e,i,n){const s=this.getTooltipContent(t,"tooltip");if(s!=null&&s.length>0){const{series:o}=t,a=Tg.makeTooltipMeta({type:"pointermove",canvasX:e,canvasY:i},o,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,a,s,n)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(t){return this.chart.tooltip.maybeEnterInteractiveTooltip(t,()=>{this.pickManager.maybeActivate(void 0,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})})}changeHighlightDatum(t){const e=t.previousHighlight?.series,i=t.currentHighlight?.series;e?.properties.cursor&&t.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(e.id),i?.properties.cursor&&i.properties.cursor!=="default"&&t.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor);const n=e?.isHighlightEnabled()??!1;if(t.highlightSuppressed&&!n)return;const s=t.highlightSuppressed!==!n;this.getHoverDevice()==="setState"||i==null||e==null||s?this.update(7,{clearCallbackCache:!0}):this.update(7,{seriesToUpdate:new Set([e,i].filter(Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(t){if(!this.isState(1)||!this.seriesRect){this.activeState.highlightInViewport=!0;return}if(t.highlightSelection.length===0)return;const e=YV(t.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=e}pickNodes(t,e,i){const n=[...this.series].reverse(),s=e==="event"||e==="context-menu",r=e==="tooltip"||e==="highlight-tooltip",o=d=>{if(s)return d.properties.nodeClickRange;if(r)return d.properties.tooltip.range},{x:a,y:l}=t,c=new Set;for(const d of n)d.visible&&d.contentGroup.visible&&o(d)==="area"&&d.isPointInArea?.(a,l)&&c.add(d);const h=c.size>0;let u;for(const d of n){if(!d.visible||!d.contentGroup.visible||h&&!(o(d)==="area"&&c.has(d)))continue;const g=d.pickNodes(t,e,i);if(g==null||g.datums.length===0)continue;const{datums:p,distance:f}=g;if(g.datums.length!==0)if(f===0){u?.distance!==0&&(u={matches:[],distance:0});for(const m of p)u.matches.push(m)}else(u==null||u.distance>f)&&(u={matches:p,distance:f})}return u}isTooltipEnabled(t){return t.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(t,e){const{series:i,datumIndex:n}=t;let s;if(e==="aria-label"||this.isTooltipEnabled(i)){const{cachedTooltipContent:r}=this;if(r?.series===i&&r.datumIndex===n)s=r.content;else{const o=this.chart.getTooltipContent(i,n,t,e);this.cachedTooltipContent={series:i,datumIndex:n,content:o},s=o}}else this.cachedTooltipContent=void 0;return s}onLegendHover(t){this.isState(82)&&(this.setHoverDevice("pointer"),this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id),this.chart.ctx.tooltipManager.removeTooltip(this.id))}onActiveLoadMemento(t){switch(t.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(t.activeItem,t);default:return t.activeItem?.type}}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if(this.activeState.lastActive!=="legend"){const{seriesId:t,itemId:e}=this.activeState.lastActive,i=this.findPickedNodes(t,e);i===void 0?this.clearUnpreventable():i==="series-hidden"?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id),this.chart.ctx.tooltipManager.removeTooltip(this.id)}):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(t,e){const{seriesId:i,itemId:n}=t,s=this.findPickedNodes(i,n);if(s===void 0)e.reject(),this.onActiveClear();else{if(s!=="series-hidden"){const r=this.pickManager.onPickedNodesAPI(s);e.setDatum(r)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:n},e.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(t,e){const i=this.series.find(s=>s.id===t);if(i==null){B.warn(`Cannot find seriesId: "${t}"`);return}if(!i.visible)return"series-hidden";const n=i.findNodeDatum(e);if(n==null){B.warn(`Cannot find itemId: ${JSON.stringify(e)}`);return}return{matches:[n],distance:0}}};xC.className="SeriesAreaManager";var SC=30,XV=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}getGroupIndex(t){const{internalId:e,seriesGrouping:i}=t;return i?.groupIndex??e}getGroupType(t,e){return e?"top":t.type}requestGroup(t){const{internalId:e,contentGroup:i}=t,n=t.bringToFront(),s=this.getGroupType(t,n),r=this.getGroupIndex(t),o=this.series.get(e);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=SC?"aggressive-grouping":"normal");let a=this.groups.get(s);a==null&&(a=new Map,this.groups.set(s,a));const l=this.lookupIdx(r);let c=a.get(l);return c==null&&(c={type:s,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new se({name:`${t.contentGroup.name??s}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t,bringToFront:n}),c.seriesIds.push(e),c.group.appendChild(i),c.group}changeGroup(t){const{internalId:e,contentGroup:i}=t,n=t.bringToFront(),s=this.getGroupType(t,n),r=this.series.get(e),o=r?this.getGroupType(r.seriesConfig,r.bringToFront):void 0,a=this.getGroupIndex(t),l=this.lookupIdx(a),c=this.groups.get(s)?.get(l);if(!(o===s&&c?.seriesIds.includes(e)===!0))return this.series.has(e)&&this._releaseGroup({internalId:e,contentGroup:i,type:o}),this.requestGroup(t)}releaseGroup(t){const{internalId:e,contentGroup:i}=t,n=this.getGroupType(t,t.bringToFront());this._releaseGroup({internalId:e,contentGroup:i,type:n})}_releaseGroup(t){const{internalId:e,contentGroup:i,type:n}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const s=this.series.get(e)?.layerState;s&&(s.seriesIds=s.seriesIds.filter(r=>r!==e),i.remove()),s?.seriesIds.length===0?(s.group.remove(),this.groups.get(s.type)?.delete(s.id),this.groups.get(n)?.delete(e)):s!=null&&s.seriesIds.length>0&&(s.group.zIndex=this.getLowestSeriesZIndex(s.seriesIds)),this.series.delete(e)}updateLayerCompositing(){for(const t of this.groups.values())for(const e of t.values()){const{group:i,seriesIds:n}=e;let s;n.length===0?s=!1:n.length>1?s=!0:s=this.series.get(n[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=s,i.zIndex=this.getLowestSeriesZIndex(n)}}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!Number.isFinite(t))?0:Math.floor(J(0,t/this.expectedSeriesCount,1)*SC)}destroy(){for(const t of this.groups.values())for(const e of t.values())e.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){let e;for(const i of t){const s=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(e==null||s==null){e=s;continue}e=jM(e,s)<=0?e:s}return e??1}},qV={min:0,max:1},JV=class{constructor(t,e){this.chart=t,this.ctx=e,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.requestCounter=0,this.errorRollbacks=new Map,this.cleanup=new it,this.cleanup.register(e.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),e.eventsHub.on("data:load",()=>this.onDataLoad()),e.eventsHub.on("data:error",i=>this.onDataError(i)),e.eventsHub.on("data:render-verdict",i=>this.onRenderVerdict(i)),e.eventsHub.on("update:complete",i=>this.onUpdateComplete(i)),e.eventsHub.on("zoom:change-complete",i=>this.onZoomChange(i)))}destroy(){this.cleanup.flush()}onDataLoad(){this.ctx.animationManager.skip(),this.ctx.eventsHub.emit("chart:request-update",{type:1})}onDataError(t){this.applyRollback(t?.requestId),this.discardRollbacksUpTo(t?.requestId),this.ctx.eventsHub.emit("chart:request-update",{type:5})}onRenderVerdict({requestId:t,rendered:e}){e||this.applyRollback(t),this.discardRollbacksUpTo(t)}applyRollback(t){const e=t==null?void 0:this.errorRollbacks.get(t);e&&t===this.latestRequestId&&(this.lastWindow=e.window,e.axisId!=null&&(e.axisZoom?this.lastAxisZooms.set(e.axisId,e.axisZoom):this.lastAxisZooms.delete(e.axisId)))}discardRollbacksUpTo(t){if(t!=null)for(const e of this.errorRollbacks.keys())e<=t&&this.errorRollbacks.delete(e)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(t){!t.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||t.wasShortcut||this.updateWindow(t)}onZoomChange(t){this.dirtyZoom=!0,this.zoomSource=t.source}updateWindow(t){if(!this.ctx.dataService.isLazy())return;const e=this.chart.axes.find(({direction:l})=>l==="x"),i=this.lastWindow,n=e?this.lastAxisZooms.get(e.id):void 0;let s,r=!0;if(e){const l=sh(this.ctx.chartState.getValue("zoom"),e.direction)??qV;s=this.getAxisWindow(e,l),r=this.shouldRefresh(t,e,l,s)}const o=this.dirtyZoom&&this.zoomSource?this.zoomSource:"chart-update";if(this.dirtyZoom=!1,this.dirtyDataSource=!1,this.zoomSource=void 0,this.lastWindow=s,!r)return;const a=this.requestCounter++;this.latestRequestId=a,this.errorRollbacks.set(a,{window:i,axisId:e?.id,axisZoom:n}),this.ctx.dataService.load({windowStart:s?.windowStart,windowEnd:s?.windowEnd,source:o},a)}shouldRefresh(t,e,i,n){const{lastAxisZooms:s,lastWindow:r}=this;if(t.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const o=s.get(e.id);return!(i.min===o?.min&&i.max===o?.max||(s.set(e.id,i),n&&r&&n.windowStart?.valueOf()===r.windowStart?.valueOf()&&n.windowEnd?.valueOf()===r.windowEnd?.valueOf()))}getAxisWindow(t,e){const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i;let r,o;return n<=s?(r=t.scale.invert(0,!0),o=t.scale.invert(n+(s-n)*e.max,!0)):(r=t.scale.invert(n-(n-s)*e.min,!0),o=t.scale.invert(0,!0)),{windowStart:r,windowEnd:o}}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!Be(e)||!Be(i)))return[e,i]}},QV=/^((?!chrome|android).)*safari/i,e2=/Version\/(\d+(\.\d+)?)/,t2=/Chrome/,i2=/Chrome\/(\d+)/,n2=/Edg/,s2=/OPR/;function r2(){const{userAgent:t}=ts("navigator");if(QV.test(t)){const e=e2.exec(t);if(e==null)return!1;const i=Number.parseFloat(e[1]),n=Math.floor(i)>16;return n||B.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!n}else if(t2.test(t)&&!n2.test(t)&&!s2.test(t)){const e=i2.exec(t);if(e==null)return!1;const i=Number.parseInt(e[1],10),n=i>126;return n||B.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!n}return!1}var o2=new Set(["map-shape-background","map-line-background"]),a2=class{constructor(t,e,i,n,s,r,o){this.chartLike=t,this.overlays=e,this.eventsHub=i,this.dataService=n,this.localeManager=s,this.animationManager=r,this.domManager=o,this.cleanup=new it,this.overlayState=void 0,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","false"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass(fb,!0),this.cleanup.register(this.eventsHub.on("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(o=>o.hasData),n=this.chartLike.series.some(o=>o.visible&&!o2.has(o.type));this.overlayElem.toggleClass(_V,this.overlays.darkTheme),this.overlayElem.setProperty("left",`${t.x}px`),this.overlayElem.setProperty("top",`${t.y}px`),this.overlayElem.setProperty("width",`${t.width}px`),this.overlayElem.setProperty("height",`${t.height}px`);let s;if(e?s="loading":i?n?this.overlays.unsupportedBrowser.enabled&&r2()&&(s="unsupported-browser"):s="no-visible-series":s="no-data",s!==this.overlayState){const o=this.getOverlayFromState(this.overlayState);o&&this.hideOverlay(o),this.overlayState=s}const r=this.getOverlayFromState(this.overlayState);r&&(r.enabled?this.showOverlay(r,t):this.hideOverlay(r)),this.overlayElem.setAttr("aria-hidden",String(this.overlayState==null))}getOverlayFromState(t){switch(t){case"loading":return this.overlays.loading;case"no-data":return this.overlays.noData;case"no-visible-series":return this.overlays.noVisibleSeries;case"unsupported-browser":return this.overlays.unsupportedBrowser}}showOverlay(t,e){const i=t.getElement(this.chartLike,this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Kn=re.create(!0,"opts"),l2=new Set(["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"]),c2=new Set(["top","bottom"]),h2=new Set(["time","unit-time","ordinal-time"]);function u2(t,e){const i=e.context;i!==void 0?t.context=i:"context"in t&&delete t.context}var d2=new Set(["thickness","title","crosshair","depthOptions"]),g2=["step","values","minSpacing","maxSpacing"];function p2(t,e){const i={...e,...t??{}};for(const n of g2)i[n]=t?.[n];return i}function f2(t){const e=t,i={};for(const n of Object.keys(e))d2.has(n)||(i[n]=e[n]);return i}function m2(t){return!Array.isArray(t)||t.length===0?[{label:{enabled:!0}}]:t.map((e,i)=>i===0?e:de({label:{enabled:!1}},e))}function y2(t){const e=t.axes;if(e==null)return t;const i=t.navigator?.miniChart?.label,n={};for(const o of Object.keys(i??{}))l2.has(o)||(n[o]=i[o]);const s=i?.interval,r={};for(const[o,a]of ut(e)){const l=c2.has(a.position??""),c=l&&a.type==="grouped-category",h=l?n:{},u=l?{enabled:!c,...c?{rotation:0}:{}}:{enabled:!1},d=l?{enabled:!1}:void 0,g=l&&h2.has(a.type??"")?{enabled:!1}:void 0,p=a.depthOptions,f=c?m2(p):void 0,y={...f2(a),label:de(u,h,a.label),gridLine:de({enabled:!1},a.gridLine),tick:de({enabled:!1},a.tick),line:de(d,a.line),interval:l?p2(s,a.interval):a.interval,title:{enabled:!1}};if(g!=null){const b=a.parentLevel;y.parentLevel=de(g,b)}f!=null&&(y.depthOptions=f),r[o]=y}return{...t,axes:r}}var dn=class cT extends zD{constructor(e,i){var n;super(),this.id=xn(this),this.seriesRoot=new qt({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new qt({name:`${this.id}-annotation-root`,zIndex:11}),this.selectionRoot=new qt({name:`${this.id}-selection-root`,zIndex:11}),this.titleGroup=new se({name:"titles",zIndex:15,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.debug=re.create(!0,"chart"),this.extraDebugStats={},this.data=Fl.empty(),this.pendingDataRetain=void 0,this.loading=void 0,this._firstAutoSize=!0,this._autoSizeNotify=new Wf,this._requiredRange=0,this._requiredRangeDirection="x",this.destroyed=!1,this.cleanup=new it,this.chartAnimationPhase="initial",this.modulesManager=new BV,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=d=>super.fireEvent(d),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new Wf,this.performUpdateType=10,this.runningUpdateType=10,this.currentProcessingUpdateType=10,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new fF,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=Ky(({count:d})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,d)).catch(g=>B.errorOnce(g))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=d=>{this.fireEvent(d)},this.onSeriesNodeDoubleClick=d=>{this.fireEvent(d)},this.onSeriesVisibilityChange=d=>{this.fireEvent(d)},this.seriesGroupingChanged=d=>{if(!(d instanceof Hy))return;const{series:g,seriesGrouping:p}=d;if(g.contentGroup.isRoot())return;const f=this.seriesLayerManager.changeGroup({internalId:g.internalId,type:g.type,contentGroup:g.contentGroup,bringToFront:()=>g.bringToFront(),renderToOffscreenCanvas:()=>g.renderToOffscreenCanvas(),seriesGrouping:p});f!=null&&g.attachSeries(f,this.seriesRoot,this.annotationRoot)},this.chartOptions=e;const s=i?.scene,r=i?.container??e.processedOptions.container??void 0,o=i?.styleContainer??e.specialOverrides.styleContainer,a=e.specialOverrides.skipCss;s&&(this._firstAutoSize=!1,this._lastAutoSize=[s.width,s.height,s.pixelRatio]);const l=new se({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.selectionRoot),l.append(this.titleGroup);const c=new uS(e.specialOverrides.document,e.specialOverrides.window);this.tooltip=new $n(c),this.seriesLayerManager=new XV(this.seriesRoot);const h=this.ctx=kV(this,{chartType:this.getChartType(),scene:s,root:l,container:r,styleContainer:o,styleNonce:e.processedOptions.styleNonce,skipCss:a,agDocument:c,domMode:e.optionMetadata.domMode,withDragInterpretation:e.optionMetadata.withDragInterpretation??!0,syncManager:new RV(this),fireEvent:d=>this.fireEvent(d),updateMutex:this.updateMutex,cssVariables:e.processedCSSVariables});h.chartState.setValue("options",e.processedOptions),this.chartCaptions=new vF(h),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),e.optionMetadata.presetType==="sparkline"&&(h.highlightManager.unhighlightDelay=0,h.tooltipManager.removeDelay=0),this.cleanup.register(h.eventsHub.on("dom:resize",()=>this.parentResize(h.domManager.containerSize)),h.eventsHub.on("font:load",()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(5)}),h.eventsHub.on("rtl:change",()=>{h.scene.setDirection(h.domManager.isRtl),this.update(5)}),h.eventsHub.on("chart:request-update",d=>this.update(d.type,d.opts)),h.scene.on("scene-changed",()=>this.update(9))),h.scene.setDirection(h.domManager.isRtl),this.overlays=new jl,(n=this.overlays.loading).renderer??(n.renderer=()=>jV(h.agDocument,this.overlays.loading.getText(h.localeManager),h.animationManager.defaultDuration)),this.processors=[new JV(this,h),new a2(this,this.overlays,h.eventsHub,h.dataService,h.localeManager,h.animationManager,h.domManager)],this.highlight=new Lg,this.container=r;const u=this.getModuleContext();this.background=ar.createBackground?.(u)??new WD(u),this.foreground=ar.createForeground?.(u),this.seriesArea=new Nh(u),h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new xC(this.initSeriesAreaDependencies()),this.cleanup.register(h.chartState.observe(d=>{const g=d("options","tooltip");g!=null&&this.tooltip.set(g)}),h.chartState.observe(d=>{const g=d("options","highlight");g!=null&&this.highlight.set(g)}),h.chartState.observe(d=>{const g=d("options","seriesArea");g!=null&&this.seriesArea.set(g)}),h.chartState.observe(d=>{const g=d("options","overlays");g!=null&&this.overlays.set(g)}),h.layoutManager.registerElement(0,d=>{d.layoutBox.shrink(h.chartState.getValue("options","padding")),this.chartCaptions.positionCaptions(d)}),h.eventsHub.on("layout:complete",d=>this.chartCaptions.positionAbsoluteCaptions(d)),h.eventsHub.on("data:load",d=>{this.pendingDataRetain={snapshot:this.data,requestId:d.requestId},this.data=this.createDataSet(d.data)}),h.eventsHub.on("update:complete",()=>this.resolveDataRetain()),this.title.registerInteraction(u,"beforebegin"),this.subtitle.registerInteraction(u,"beforebegin"),this.footnote.registerInteraction(u,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),this.ctx.agDocument.attachListener("pagehide",d=>{d.persisted||this.destroy()}),h.animationManager.addListener("animation-frame",()=>{this.update(9),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.animationManager.addListener("animation-start",()=>h.domManager.setDataBoolean("animating",!0)),h.animationManager.addListener("animation-stop",()=>{h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.eventsHub.on("zoom:change-complete",()=>{const d=this.chartAnimationPhase==="initial";for(const g of this.series)g.animationState?.transition("updateData");if(d)for(const g of this.axes)g.resetAnimation(this.chartAnimationPhase);this.update(5,{forceNodeDataRefresh:!0,skipAnimations:!d})})),this.parentResize(h.domManager.containerSize)}static getInstance(e){return cT.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()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}get title(){return this.chartCaptions.title}get subtitle(){return this.chartCaptions.subtitle}get footnote(){return this.chartCaptions.footnote}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}createDataSet(e){const i=this.ctx.chartState.getValue("options","dataIdKey");return yC(this.ctx.dataSelectionService,this.data,e,i)}resolveDataRetain(){const e=this.pendingDataRetain;if(e==null)return;this.pendingDataRetain=void 0;const i=this.series.some(n=>n.hasData);this.ctx.eventsHub.emit("data:render-verdict",{requestId:e.requestId,rendered:i}),!i&&(this.data=e.snapshot,this.ctx.eventsHub.emit("chart:request-update",{type:1,opts:{forceNodeDataRefresh:!0}}))}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}fireEvent(e){tn(this,this.fireEventWrapper,e)}hasListener(e){return this.hasEventListener(e)}callListener(e){this.fireEvent(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:n,overlays:s,seriesRoot:r}=this,o=this.getChartType(),a=()=>this.hasViewportSupport(),l=()=>this.hasPgUpPgDownSupport(),c=this.fireEvent.bind(this);return{hasViewportSupport:a,hasPgUpPgDownSupport:l,fireEvent:c,getUpdateType:()=>this.performUpdateType,getTooltipContent:(d,g,p,f)=>this.getTooltipContent(d,g,p,f),chartType:o,ctx:e,tooltip:i,highlight:n,overlays:s,seriesRoot:r}}getModuleContext(){return this.ctx}getTooltipContent(e,i,n,s){const o=s==="aria-label"||e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,n):void 0,a=o==null?[]:[o];if(this.tooltip.mode!=="shared"||this.series.length===1)return a;const l=e.getCategoryValue(i);return l==null?a:this.series.flatMap(c=>{if(c===e)return a;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const h=c.datumIndexForCategoryValue(l),u=h==null?void 0:c.getTooltipContent(h,void 0);return u==null?[]:[u]})}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})}refreshSeriesUserVisibility(e,i){for(let n=0;n<this.series.length;n++){const s=this.series[n],r=e.processedOptions.series?.[n];(i.identifiers.has(s.id)||i.indices.has(n))&&r!==void 0&&"visible"in r&&(r.visible=s.visible)}}getSelection(){return this.modulesManager.selection()?.getSelection()}setSelection(e){return this.modulesManager.selection()?.setSelection(e)}clearSelection(){return this.modulesManager.selection()?.clearSelection()}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.clearCanvas()}setRequestRefreshListener(e){this.requestRefreshListener&&this.ctx.eventsHub.off("chart:request-refresh",this.requestRefreshListener),this.ctx.eventsHub.on("chart:request-refresh",e),this.requestRefreshListener=e}destroy(e){if(this.destroyed)return;this.destroyed=!0;const i=e?.keepTransferableResources;let n;return i&&(this.ctx.scene.strip(),n={container:this.container,scene:this.ctx.scene}),this.updateMutex.acquire(()=>this.performTeardown(!!i)).catch(s=>B.errorOnce(s)),n}performTeardown(e){this.performUpdateType=10,this.cleanup.flush();for(const i of this.processors)i.destroy();this.overlays.destroy(),this.modulesManager.destroy(),this.background.destroy(),this.foreground?.destroy(),this.seriesArea.destroy(),e||(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.destroy(),this.animationRect=void 0,this.ctx.destroy(),Object.freeze(this)}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>B.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:n=!1,skipAnimations:s,seriesToUpdate:r=this.series,newAnimationBatch:o,apiUpdate:a=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=a,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.ctx.chartState.getValue("options","touch").dragAction!=="none"),n)for(const c of this.series)c.markNodeDataDirty();for(const c of r)this.seriesToUpdate.add(c);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(e===0||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let c=new Error("Stack trace for update tracking").stack??"<unknown>";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=e,this.currentProcessingUpdateType!==10&&this.currentProcessingUpdateType>=e&&this.debug.group(`Chart.update() - \u26A0\uFE0F received update for earlier update stage ${_n[e]} \u26A0\uFE0F`,()=>{this.debug(`Current processing update type: ${_n[this.currentProcessingUpdateType]}`),this.debug("Update from: ",c)})}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}updateSplits(e){const i=this._performUpdateSplits;i[e]??(i[e]=0),i[e]+=performance.now()-this._previousSplit,this._previousSplit=performance.now()}async tryPerformUpdate(e){try{const i=`${_n[this.performUpdateType]} ${this.updateShortcutCount>0?"\u26A0\uFE0F redo #"+this.updateShortcutCount+" \u26A0\uFE0F ":""}`;await this.debug.group(`Chart.performUpdate() ${i}`,async()=>{await this.performUpdate(e)})}catch(i){B.error("update error",i,i.stack),this.runningUpdateType=10,this._performUpdateNotify.notify()}}async performUpdate(e){const{performUpdateType:i,extraDebugStats:n,_performUpdateSplits:s,ctx:r}=this,o=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=10,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.currentProcessingUpdateType=i,r.chartState.flushChanges(),this.updateShortcutCount===0&&i<9&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",_n[i]),this._previousSplit=performance.now(),s.start??(s.start=this._previousSplit),r.domManager.setDeferring(!0),i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.eventsHub.emit("update:pre-dom",null),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),this.updateSplits("\u{1F4CA}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case 4:if(this.checkUpdateShortcut(4))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case 5:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(5))break;r.chartState.flushChanges("legendData"),await this.processLayout(),this.updateSplits("\u2316");case 6:if(this.checkUpdateShortcut(6))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case 7:{if(this.checkUpdateShortcut(7))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(o),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case 8:if(this.checkUpdateShortcut(8))break;r.eventsHub.emit("update:pre-scene-render",{apiUpdate:this.apiUpdate}),r.scene.updateBaseFont(),this.updateSplits("\u2196");case 9:if(this.checkUpdateShortcut(9))break;r.animationManager.endBatch(),n.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:s,extraDebugStats:n,seriesRect:this.seriesRect,debugColors:re.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const l of Object.keys(s))delete s[l];this.ctx.domManager.incrementDataCounter("sceneRenders");case 10:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=10,this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.eventsHub.emit("update:complete",{apiUpdate:this.apiUpdate,wasShortcut:this.updateShortcutCount>0}),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=10,this.syncStatus="ready"),this._performUpdateNotify.notify(),r.domManager.setDeferring(!1);const a=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:uu(a-s.start),count:e,performUpdateType:_n[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let n=i[0],s=!1,{theme:r}=this.chartOptions.processedOptions;for(;typeof r!="string"&&r!=null;)r=r.baseTheme;typeof r=="string"&&(n=r.replace("ag-",e),s=r.includes("-dark")),i.includes(n)||(n=s?i[1]:i[0]),this.ctx.domManager.setThemeClass(n)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.ctx.chartState.getValue("options","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?(B.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",_n[e]," BY REQUEST FOR: ",_n[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",_n[e]),this.currentProcessingUpdateType=e,!1)}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}createChartAxes(){return new xg}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const n=i?.filter(s=>!e.includes(s))??[];this.destroySeries(n),this.seriesLayerManager?.setSeriesCount(e.length);for(const s of e){if(i?.includes(s))continue;const r=this.seriesLayerManager.requestGroup(s);s.attachSeries(r,this.seriesRoot,this.annotationRoot),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>this.ctx.chartState.getValue("options","mode")}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(s)}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){if(e)for(const i of e)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 i of this.axes){let n=function(s){return s.axes[i.direction]===i};var e=n;i.boundSeries=this.series.filter(n)}}assignAxesToSeries(){for(const e of this.series)for(const i of e.directions){const n=e.getKeyAxis(i)??i,s=this.axes.findById(n);if(!s){B.warnOnce(`no matching axis for direction [${i}] and id [${n}]; check series and axes configuration.`);return}e.axes[i]=s}}parentResize(e){if(this.destroyed||e==null||this.width!=null&&this.height!=null)return;let{width:i,height:n}=e;const{pixelRatio:s}=e;if(i=Math.floor(i),n=Math.floor(n),i===0&&n===0)return;const[r=0,o=0,a=1]=this._lastAutoSize??[];r===i&&o===n&&a===s||(this._lastAutoSize=[i,n,s],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:n,animationManager:s}=this.ctx,{inWidth:r,inHeight:o,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,r??this.width,o??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=o??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:u,pixelRatio:d,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||u==null||!Be(h)||!Be(u))&&n.resize(h,u,d)){s.reset();let g=!0;(this.width==null||this.height==null)&&this._firstAutoSize?(g=!1,this._firstAutoSize=!1):this.chartAnimationPhase==="initial"&&(g=!1);let p=5;for(const f of this.axes){const m=f.getUpdateTypeOnResize();m<p&&(p=m)}this.update(p,{forceNodeDataRefresh:!0,skipAnimations:g}),this._autoSizeNotify.notify()}}updateData(){this.ctx.eventsHub.emit("data:update",this.data)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new fC(this.ctx.chartState.getValue("options","mode"),this.ctx.chartState.getValue("options","suppressFieldDotNotation"),this.ctx.eventsHub),i=[];for(const n of this.series)i.push(n.processData(e)??Promise.resolve());for(const n of this.modulesManager.modules())n?.processData&&i.push(n.processData(e)??Promise.resolve());this._cachedData=e.execute(this._cachedData,this.ctx.dataSelectionService),this.updateSplits("\u{1F3ED}"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}processRanges(){var e;const i={},n={},s=new Map;this._requiredRangeDirection="x";for(const r of this.series)r.visible&&(i[e=r.type]??(i[e]=[]),r.getMinimumRangeSeries(i[r.type]),r.resolveKeyDirection("x")==="y"&&(this._requiredRangeDirection="y"),s.has(r.type)||s.set(r.type,r));for(const[r,o]of s)n[r]=o.getMinimumRangeChart(i[r]);Object.keys(n).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(n)));for(const r of this.axes)r.requiredRange=this._requiredRange}updateLegends(e){for(const i of ee.listModulesByType("plugin"))switch(i.name){case"legend":this.setCategoryLegendData(e);break;case"gradientLegend":const n=this.modulesManager.getModule("gradientLegend");n.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData("gradient"));break}}setCategoryLegendData(e){const{legendManager:i,stateManager:n}=this.ctx;if(e)for(const r of this.series){const o=e.find(a=>a.seriesId===r.id);r.onLegendInitialState("category",o)}const s=this.series.flatMap(r=>{const o=r.getLegendData("category");return i?.updateData(r.id,o),o});if(e&&i){n.setStateAndRestore(i,e);return}if(this.ctx.chartState.getValue("options","mode")!=="integrated"){const r={},o=new Map(this.series.map(a=>[a.id,a]));for(const{seriesId:a,symbol:{marker:l},label:c}of s.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=o.get(a);if(!h?.hasData)continue;const u=h.type,d=r[u]??(r[u]=new Map);d.has(c.text)?d.get(c.text)!==l.fill&&B.warnOnce(`legend item '${je(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):d.set(c.text,l.fill)}}}async processLayout(){const e=this.animationRect,{width:i,height:n}=this.ctx.scene,s=this.ctx.layoutManager.createContext(i,n);await this.performLayout(s),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const e=this.ctx.chartState.getValue("options","background").fill;if(e)try{const i=De.fromString(e),[n]=De.RGBtoOKLCH(i.r,i.g,i.b);return{background:e,foreground:n>.5?"black":"white"}}catch{return{background:e}}}preSeriesUpdate(){const{_requiredRange:e,seriesRect:i}=this;if(i==null)return;const n=this._requiredRangeDirection==="x"?i.width:i.height,s=e/n||0;this.ctx.eventsHub.emit("update:pre-series",{requiredRangeRatio:s,requiredRangeDirection:this._requiredRangeDirection,requiredRange:e})}async updateSeries(e){const{seriesRect:i}=this;function n(s){return s.update({seriesRect:i})}await Promise.all(e.map(n).filter(s=>s!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.ctx.chartState.getValue("options","padding"),this.seriesRect)}async waitForUpdate(e,i){const n=ts("agChartsDebugTimeout");n==null?(e??(e=1e4),i??(i=!1)):(e=n,i??(i=!0));const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==10||this.runningUpdateType!==10||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==10||this.runningUpdateType!==10||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-s>e){const r=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(r);B.warnOnce(r)}Rx()&&await Uf(),this.ctx.scene.waitingForUpdate()&&await Uf(50)}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){e.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,e.seriesWithUserVisibility);const i=5,n=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(n==null||Object.keys(n).length===0){Kn("Chart.applyOptions() - no delta, forcing re-layout",n),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const s=this.firstApply?{}:this.chartOptions.processedOptions,r=e.processedOptions;Kn("Chart.applyOptions() - applying delta",n),this.ctx.chartState.setValue("options",e.processedOptions);const o=this.applyModules();"listeners"in n&&this.registerListeners(this,n.listeners),"enableRtl"in n&&this.ctx.domManager.setEnableRtl(n.enableRtl),"container"in n&&(this.container=n.container??void 0),"height"in n&&(this.height=n.height),"minHeight"in n&&(this.minHeight=n.minHeight),"minWidth"in n&&(this.minWidth=n.minWidth),"overrideDevicePixelRatio"in n&&(this.overrideDevicePixelRatio=n.overrideDevicePixelRatio),"width"in n&&(this.width=n.width),"loading"in n&&(this.loading=n.loading),"context"in n&&(this.context=n.context);let a=!1,l="no-op";n.series!=null&&(l=this.applySeries(this,n.series,s?.series),a=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,r,s,l)&&(a=!0);const{userDeltaKeys:c}=e,h=c===void 0||c.has("data");let u=!1;if(n.data&&h){const y=n.data,b=e.userOptions.data,S=Array.isArray(y)&&y!==b?y.slice():y;this.data=this.createDataSet(S),u=!0}"dataIdKey"in n&&!(n.data&&h)&&this.data.dataIdKey!==this.ctx.chartState.getValue("options","dataIdKey")&&(this.data=this.createDataSet(this.data.data),u=!0),l==="replaced"&&!u&&(this.data=this.createDataSet(this.data.data)),this.chartOptions=e;const d=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager?.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1},y:{min:0,max:1}});const g=d?.miniChart,p=r.navigator?.miniChart?.series??r.series;g?.enabled===!0&&p!=null?this.applyMiniChartOptions(g,p,r,s):g?.enabled===!1&&(g.series=[],g.axes=[]),this.ctx.annotationManager?.setAnnotationStyles(e.annotationThemes),a||(a=this.shouldForceNodeDataRefresh(n,l));const m=a||o?0:i;if(this.maybeResetAnimations(l),this.shouldClearLegendData(r,s,l)&&this.ctx.legendManager?.clearData(),this.applyInitialState(r),this.ctx.formatManager.setFormatter(r.formatter),Kn("Chart.applyOptions() - update type",_n[m],{seriesStatus:l,forceNodeDataRefresh:a}),e.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=e.optionsProcessingTime;const y=performance.now()-e.optionsProcessingTime;this._performUpdateSplits.start=y}this.update(m,{apiUpdate:!0,forceNodeDataRefresh:a,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(e){const{activeManager:i,annotationManager:n,chartTypeOriginator:s,historyManager:r,stateManager:o,zoomManager:a}=this.ctx,{initialState:l}=e;if("annotations"in e&&e.annotations?.enabled&&l?.annotations!=null&&n){const c=l.annotations.map(h=>{const u=n.getAnnotationTypeStyles(h.type);return de(h,u)});o.setState(n,c)}l?.chartType!=null&&o.setState(s,l.chartType),this.needsViewportSupport(e)&&l?.zoom!=null&&a&&o.setState(a,l.zoom),l?.active!=null&&o.setState(i,l.active),l?.collapsed!=null&&o.setState(this.ctx.collapsedManager,l.collapsed),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&r.clear()}maybeResetAnimations(e){if(this.ctx.chartState.getValue("options","mode")==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const n=!!e.data||i==="data-change"||i==="replaced",s=["legend","gradientLegend"].some(o=>e[o]!=null),r=e.title!=null&&e.subtitle!=null||e.formatter!=null;return n||s||r}shouldClearLegendData(e,i,n){const s=n==="replaced"||n==="series-count-changed"||n==="series-grouping-change"||n==="updated"&&(e.series?.length!==i.series?.length||!e.series?.every((o,a)=>o.type===i.series?.[a].type)),r=i.legend!=null&&i.legend.enabled!==!1&&(e.legend==null||e.legend.enabled===!1);return s||r}applyMiniChartOptions(e,i,n,s){const r=s?.navigator?.miniChart?.series??s?.series,o=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r)),a=y2(n);this.applyAxes(e,a,s,o);const l=e.series;for(const d of l)d.properties.id=void 0;const c=e.axes,h=this.series.some(d=>d.visible&&d.resolveKeyDirection("x")==="y")?"y":"x",u=this.axes.find(d=>d.direction===h);for(const d of c)d.nice=d.direction===h?u?.nice??!0:!1,d.interactionEnabled=!1}applyModules(){const{type:e}=this.constructor;let i=!1;for(const n of ee.listModulesByType("plugin")){const s=!n.chartType||n.chartType===e;if(s!==this.modulesManager.isEnabled(n.name)){if(s){n.register?.(this.getModuleContext());const r=n.create(this.getModuleContext());this.modulesManager.addModule(n.name,r)}else this.modulesManager.removeModule(n.name);i=!0}}return i}initSeriesDeclarationOrder(e){for(let i=0;i<e.length;i++)e[i].setSeriesIndex(i)}applySeries(e,i,n){if(!i)return"no-change";const s=VV(e.series,i,n);if(s.status==="no-overlap"){Kn(`Chart.applySeries() - creating new series instances, status: ${s.status}`,s);const u=i.map(d=>this.createSeries(d));return this.initSeriesDeclarationOrder(u),e.series=u,"replaced"}Kn("Chart.applySeries() - matchResult",s);const r=[];let o=!1,a=!1,l=!1,c=!1;const h=s.changes.toSorted((u,d)=>u.targetIdx-d.targetIdx);for(const u of h)switch(a||(a=u.status==="series-grouping"),o||(o=u.diff?.data!=null),l||(l=u.status!=="no-op"),c||(c=u.status==="add"||u.status==="remove"),u.status){case"add":{const d=this.createSeries(u.opts);r.push(d),Kn("Chart.applySeries() - created new series",d);break}case"remove":Kn(`Chart.applySeries() - removing series at previous idx ${u.idx}`,u.series);break;case"no-op":r.push(u.series),Kn(`Chart.applySeries() - no change to series at previous idx ${u.idx}`,u.series);break;case"series-grouping":case"update":default:{const{series:d,diff:g,idx:p}=u;Kn(`Chart.applySeries() - applying series diff previous idx ${p}`,g,d),this.applySeriesValues(d,g),d.markNodeDataDirty(),r.push(d)}}return this.initSeriesDeclarationOrder(r),Kn("Chart.applySeries() - final series instances",r),e.series=r,a?"series-grouping-change":c?"series-count-changed":o?"data-change":l?"updated":"no-op"}applyAxes(e,i,n,s){if(!("axes"in i)||!i.axes)return!1;const r=i.axes;if(!(s==="replaced")&&e.axes.matches(r)){for(const l of e.axes){const c=r[l.id];l.applyOptions(c),u2(l,c),this.applyAxisModules(l,c)}return!0}return Kn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),e.axes=this.createAxes(r),!0}createSeries(e){const n=ee.getSeriesModule(e.type).create(this.getModuleContext());return this.applySeriesOptionModules(n,e),this.applySeriesValues(n,e),n}applySeriesOptionModules(e,i){const n=e.createModuleContext(),s=e.getModuleMap();for(const r of ee.listModulesByType("series:plugin"))r.name in i&&(r.seriesTypes?.includes(e.type)??!0)&&s.addModule(r.name,r.create(n))}applySeriesValues(e,i){const n=e.getModuleMap(),{type:s,data:r,listeners:o,seriesGrouping:a,showInMiniChart:l,...c}=i;for(const h of ee.listModulesByType("series:plugin"))if(h.name in c){const u=n.getModule(h.name);if(u){const d=c[h.name];u.properties.set(d),delete c[h.name]}}c.visible!=null&&(e.visible=c.visible),e.properties.set(c),"data"in i&&e.setOptionsData(r==null?void 0:Fl.wrap(r)),"listeners"in i&&(this.registerListeners(e,o),this.series.includes(e)&&this.addSeriesListeners(e)),"seriesGrouping"in i&&(a==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...a})}createAxes(e){const i=this.createChartAxes(),n=this.getModuleContext();for(const[s,r]of ut(e)){const o=ee.getAxisModule(r.type).create(n,s,r);this.applyAxisModules(o,r),i.push(o)}return FV(i),i}applyAxisModules(e,i){const n=e.createModuleContext(),s=e.getModuleMap(),{type:r}=this.constructor;for(const o of ee.listModulesByType("axis:plugin")){if(o.chartType&&o.chartType!==r)continue;const a=o.optionsKey??o.name,l=i[a],c=l!=null,h=s.isEnabled(o.name);if(!c){h&&s.removeModule(o.name);continue}h||(o.register?.(n),s.addModule(o.name,o.create(n))),s.getModule(o.name).applyOptions(l)}}registerListeners(e,i){if(e.clearEventListeners(),i&&typeof i=="object")for(const[n,s]of ut(i))s!=null&&e.addEventListener(n,s)}async applyTransaction(e){await this.updateMutex.acquire(()=>{this.data.addTransaction(e),this.update(1,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}needsViewportSupport(e){return!!e.navigator?.enabled||!!e.zoom?.enabled||!!e.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};dn.className="Chart",dn.chartsInstances=new WeakMap,x([gi({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),dn.chartsInstances.set(t,this))},oldValue(t){dn.chartsInstances.delete(t)}})],dn.prototype,"container",2),x([gi({newValue(t){this.resize("width option",{inWidth:t})}})],dn.prototype,"width",2),x([gi({newValue(t){this.resize("height option",{inHeight:t})}})],dn.prototype,"height",2),x([gi({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],dn.prototype,"minWidth",2),x([gi({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],dn.prototype,"minHeight",2),x([gi({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],dn.prototype,"overrideDevicePixelRatio",2),x([gi({changeValue(t,e){this.onAxisChange(t,e)}})],dn.prototype,"axes",2),x([gi({changeValue(t,e){this.onSeriesChange(t,e)}})],dn.prototype,"series",2);var Ng=dn;function mb(t){const e=t.getModuleMap().getModule("crossLines");return e instanceof ey?e:void 0}var b2=["top","right","bottom","left"],Oh=class hT extends Ng{constructor(e,i){super(e,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new yF}onAxisChange(e,i){super.onAxisChange(e,i),this.syncAxisChanges(e,i),this.ctx!=null&&this.ctx.zoomManager?.setAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:n}=this;i.setClipRect(e),n.setClipRect(e)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.eventsHub.emit("update:process-data",{series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const i=await this.getSyncedDomain(e);i!=null&&e.setDomains({domain:i})}}performLayout(e){const{seriesRoot:i,annotationRoot:n}=this,{clipSeries:s,seriesRect:r,visible:o}=this.updateAxes(e);this.seriesRoot.visible=o,this.seriesRect=r,this.animationRect=e.layoutBox;const{x:a,y:l}=r;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const p of[i,n])p.translationX=Math.floor(a),p.translationY=Math.floor(l);else{const{translationX:p,translationY:f}=i;Zs(this.id,"seriesRect",this.ctx.animationManager,[i,n],{translationX:p,translationY:f},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=r.clone().grow(this.seriesArea.getPadding()),d=this.series.some(p=>p.alwaysClip)||(this.seriesArea.clip??!1)||s?c:void 0,{lastUpdateClipRect:g}=this;this.lastUpdateClipRect=d,this.ctx.animationManager.isActive()&&g!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:g,to:c,onUpdate:p=>this.setRootClipRects(p),onStop:()=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(d)}):this.setRootClipRects(d),this.ctx.layoutManager.emitLayoutComplete(e,{axes:T0(this.axes.map(p=>[p.id,p.getLayoutState()])),series:{visible:o,rect:r,paddedRect:c},clipSeries:s,layoutBox:e.layoutBox}),HD(this.series)}updateAxes(e){const{layoutBox:i,scrollbars:n}=e,{clipSeries:s,seriesRect:r,overflows:o}=this.resolveAxesLayout(i,n);for(const a of this.axes)a.update(),mb(a)?.setVisible(!o),this.clipAxis(a,r,i);return{clipSeries:s,seriesRect:r,visible:!o}}resolveAxesLayout(e,i){let n,s,r=0;const o=10,a=this.axes.filter(l=>l.options.crossAt?.value!=null);do if(s=n??this.getDefaultState(),n=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone(),a,i),r++>o){B.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(n,s));return this.lastAreaWidths=n.axisAreaWidths,n}updateAxesPass(e,i,n,s){const r=new Map,o={};let a=!1,l=!1;const c=this.seriesArea.getPadding();for(const M of b2){const D=c[M]??0,I=this.axes.findLast(A=>A.position===M);I?I.seriesAreaPadding=D:i.shrink(D,M)}const h=(e.get("left")??0)+(e.get("right")??0),u=(e.get("top")??0)+(e.get("bottom")??0),d=this.buildCrossLinePadding(e),g=d.left+d.right,p=d.top+d.bottom;i.width<=h+g||i.height<=u+p?a=!0:i.shrink(d);const{scene:f}=this.ctx,m=i.clone().shrink(Object.fromEntries(e));for(const M of this.axes){const{position:D="left",direction:I}=M,A=I==="y";let k;this.sizeAxis(M,m,D);const{thickness:T,maxThicknessRatio:R}=M.options;T==null?k=MC(A,f)*R:k=T;const E={sizeLimit:k-M.options.label.spacing,padding:this.ctx.chartState.getValue("options","padding"),scrollbars:s},{primaryTickCount:F,bbox:N}=M.calculateLayout(M.nice?o[I]:void 0,E);o[I]??(o[I]=F),l||(l=M.dataDomain.clipped||M.visibleRange[0]>0||M.visibleRange[1]<1),M.options.thickness==null&&(k=Math.min(MC(A,N)??0,k)),r.set(M.id,Math.ceil(k))}let y;n.length>0&&(y=this.calculateAxesCrossPositions(r,m,n));const b=uc(this.axes,M=>M.position??"left"),v=new Map,S=new Map;for(const[M,D]of ut(b)){const A=M==="top"||M==="bottom"?i.y:i.x;let k=f.pixelRatio%1===0?0:A%f.pixelRatio,T=0;for(const R of D??[]){S.set(R.id,k);const E=r.get(R.id)??0;T=Math.max(T,k+E),R.layoutConstraints.stacked&&(k+=E+hT.AxesPadding)}v.set(M,Math.ceil(T))}for(const[M,D]of ut(b))this.positionAxes({axes:D??[],position:M,axisWidths:r,axisOffsets:S,axisAreaWidths:v,axisBound:i,seriesRect:m});return y!=null&&this.applyAxisCrossing(m,y),{clipSeries:l,seriesRect:m,axisAreaWidths:v,overflows:a}}calculateAxesCrossPositions(e,i,n){const s=new Map;for(const r of n){const{crossPosition:o,visible:a}=this.calculateAxisCrossPosition(r);r.setAxisVisible(a),this.adjustAxisWidth(r,e,o,i,a),o!=null&&s.set(r.id,o)}return s}calculateAxisCrossPosition(e){const i=this.axes.perpendicular(e),{scale:{domain:n,bandwidth:s},range:r}=i,o=(s??0)/2,{crossAt:a}=e.options,l=i.scale.convert(a?.value,{clamp:!1})+o;return i.inRange(l)?{crossPosition:l,visible:!0}:a?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(l)?r[n[0]]:Ha(l,r),visible:!0}}adjustAxisWidth(e,i,n,s,r){if(e.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager?.createMemento().some(u=>{switch(u.type){case"vertical-line":return e.direction==="x";case"horizontal-line":return e.direction==="y"}}))return;const c=i.get(e.id)??0,h=r?this.calculateAxisBleedingWidth(e,c,n,s):0;i.set(e.id,h)}calculateAxisBleedingWidth(e,i,n,s){if(n==null)return i;switch(e.position){case"left":case"top":return Math.max(0,i-n);case"right":return Math.max(0,n+i-s.width);case"bottom":return Math.max(0,n+i-s.height);default:return i}}applyAxisCrossing(e,i){for(const n of this.axes){const s=i.get(n.id);if(s==null){n.crossAxisTranslation.x=0,n.crossAxisTranslation.y=0;continue}const r=n.direction==="x";n.crossAxisTranslation.x=r?0:e.x+s-n.translation.x,n.crossAxisTranslation.y=r?e.y+s-n.translation.y:0}}buildCrossLinePadding(e){var i;const n={top:0,right:0,bottom:0,left:0};for(const s of this.axes){const{position:r}=s,o=mb(s)?.getInstances();if(o)for(const a of o)a instanceof mi&&(a.position=r??"top",(i=a.label).parallel??(i.parallel=s.parallel)),a.calculatePadding?.(n)}for(const[s,r=0]of ut(n))n[s]=Math.max(r-(e.get(s)??0),0);return n}clampToOutsideSeriesRect(e,i,n,s){const r=n==="x"?e.x:e.y,o=n==="x"?e.width:e.height;return s===1?Math.min(i,r+o):Math.max(i,r)}async getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(e)}syncAxisChanges(e,i){const n=this.modulesManager.getModule("sync");if(!n?.enabled)return;const s=new Set(i??[]);for(const r of e)s.delete(r);for(const r of s)n.removeAxis(r)}sizeAxis(e,i,n){const s=e instanceof Xs,r=n==="left"||n==="right",{width:o,height:a}=i,l=r?a:o;let c=0,h=l,{min:u,max:d}=e.getZoom();const{width:g,unit:p,align:f}=e.layoutConstraints;p==="px"?h=c+g:h=h*g/100;const m=h-c;if(f==="end")c=l-m,h=l;else if(f==="center"){const y=c+(l-c)/2;c=y-m/2,h=y+m/2}else f==="justify"&&(h=l);r&&(s?[c,h]=[h,c]:[u,d]=[1-d,1-u]),e.range=[c,h],e.visibleRange=[u,d],e.gridLength=r?o:a,e.lineRange=r?[a,0]:[0,o]}positionAxes(e){const{axes:i,axisBound:n,axisWidths:s,axisOffsets:r,axisAreaWidths:o,seriesRect:a,position:l}=e,c=o.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let g=n[h];(l==="right"||l==="bottom")&&(d=-1,g+=h==="x"?n.width:n.height);for(const p of i){const f=o.get(u==="x"?"left":"top")??0,m=s.get(p.id)??0,y=r.get(p.id)??0;p.gridPadding=c-y-m,p.translation[u]=n[u]+f,p.translation[h]=this.clampToOutsideSeriesRect(a,g+d*(y+m),h,d)}}shouldFlipXY(){return this.series.every(e=>e instanceof Kr&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const n=this.lastAreaWidths.get(i);n!=null&&e.set(i,n)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const n of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(n))return!1;for(const[n,s]of i.axisAreaWidths.entries()){const r=e.axisAreaWidths.get(n);if((s!=null||r!=null)&&s!==r)return!1}return!0}clipAxis(e,i,n){const s=Math.ceil(e.options.gridLine.width),r=Math.ceil(e.options.line.width);let{width:o,height:a}=i;switch(o+=e.direction==="x"?s:r,a+=e.direction==="y"?s:r,e.clipGrid(i.x,i.y,o,a),e.position){case"left":case"right":e.clipTickLines(n.x,i.y-s,n.width+s,i.height+s*2);break;case"top":case"bottom":e.clipTickLines(i.x-s,n.y,i.width+s*2,n.height+s);break}}};Oh.className="CartesianChart",Oh.type="cartesian",Oh.AxesPadding=15,x([gi({changeValue(t,e){this.onAxisChange(t,e)}})],Oh.prototype,"axes",2);var v2=Oh;function MC(t,e){return t?e?.width:e?.height}var yb={mode:"standalone",suppressFieldDotNotation:!1,keyboard:{initialFocus:"data-start"},touch:{dragAction:"drag"}},x2=new Set(["number","log","time"]),S2=t=>ce(t)&&t.type!=null&&!x2.has(t.type),gn={type:"chart",name:"cartesian",version:Qe,options:gV,themeTemplate:yb,create(t,e){return new v2(t,e)},validate(t,e,i,n){const s=[];t?.series?.[0]?.type==="histogram"&&Object.values(t?.axes??{}).some(S2)&&(s.push(new Ps("invalid","only continuous axis types when histogram series is used",t.axes,i,"axes")),t=q(t,["axes"]));const r=$t(t,e,i,n);return r.invalid.push(...s),r}},ta={title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:br.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"always",truncate:!0}},bb={parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},ia={reverse:!1,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},line:{enabled:!0,width:1,stroke:{$ref:"axisLineColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisLineColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}}},IC={type:"axis",name:"category",chartType:"cartesian",version:Qe,dependencies:[gn],options:Al,themeTemplate:de({groupPaddingInner:.1,maxThicknessRatio:.3,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},ta,ia),create:(t,e,i)=>new El(t,e,new Yo,i)},M2=1e3,DC=class uT extends Yo{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(e){return e instanceof uT}set domain(e){if(e.length<=M2){const i=JSON.stringify(e);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=e}get domain(){return super.domain}normalizeDomains(...e){const{domain:i}=super.normalizeDomains(...e);return{domain:i,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const i=JSON.stringify(e),n=this._domain.find(s=>JSON.stringify(s)===i);if(n!=null)return super.findIndex(n)}},I2=class dT{constructor(e="",i,n){this.label=e,this.parent=i,this.refId=n,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.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.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=i?i.depth+1:0}insertTick(e,i){let n=this,s;for(let r=0;r<e.length;r++){const o=e[r],a=r!==e.length-1,{children:l}=n,c=l.find(h=>h.label===o);if(c&&a)n=c,s=c;else{const h=new dT(o,n,i);h.index=l.length,l.push(h),a&&(n=h),s=h}}return s}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 D2(t){const e=t.reduce((s,r)=>Math.max(s,r.length),0),i=new I2,n=new Map;for(let s=0;s<t.length;s++){const r=t[s];for(;r.length<e;)r.push("");const o=i.insertTick(r,s);o!=null&&n.set(r,o)}return{root:i,tickNodes:n}}function C2(t,e,i){const n=e.index-t.index,s=i/n;e.change-=s,e.shift+=i,t.change+=s,e.prelim+=i,e.mod+=i}function A2(t,e,i){return e.getSiblings().includes(t.ancestor)?t.ancestor:i}function w2({children:t}){let e=0,i=0;for(let n=t.length-1;n>=0;n--){const s=t[n];s.prelim+=e,s.mod+=e,i+=s.change,e+=s.shift+i}}function k2(t,e){const i=t.getLeftSibling();if(i){let n=t,s=t,r=i,o=s.getLeftmostSibling(),a=s.mod,l=n.mod,c=r.mod,h=o.mod;for(;r.nextRight()&&s.nextLeft();){r=r.nextRight(),s=s.nextLeft(),o=o.nextLeft(),n=n.nextRight(),n.ancestor=t;const u=r.prelim+c-(s.prelim+a)+1;u>0&&(C2(A2(r,t,e),t,u),a+=u,l+=u),c+=r.mod,a+=s.mod,h+=o.mod,l+=n.mod}r.nextRight()&&!n.nextRight()?n.mod+=c-l:(s.nextLeft()&&!o.nextLeft()&&(o.mod+=a-h),e=t)}return e}function CC(t){const{children:e}=t;if(e.length){let[i]=e;for(const r of e)CC(r),i=k2(r,i);w2(t);const n=(e[0].prelim+e.at(-1).prelim)/2,s=t.getLeftSibling();s?(t.prelim=s.prelim+1,t.mod=t.prelim-n):t.prelim=n}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function AC(t,e,i){t.position=t.prelim+e,t.separatorDepth=t.index===0?1+(t.parent?.separatorDepth??0):0,i.insertNode(t);for(const n of t.children)AC(n,e+t.mod,i)}function wC(t){const{children:e}=t;let i=0;for(const n of e)wC(n),n.children.length?i+=n.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e.at(-1).subtreeRight,t.position=(t.subtreeLeft+t.subtreeRight)/2,t.leftmostLeaf=e[0].leftmostLeaf):(t.subtreeLeft=t.position,t.subtreeRight=t.position)}function T2(t){const e=new L2,{root:i,tickNodes:n}=D2(t);return CC(i),AC(i,-i.prelim,e),wC(i),{layout:e,tickNodes:n}}var L2=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(t){this.depth<t.depth&&(this.depth=t.depth),t.position<this.minPosition&&(this.minPosition=t.position),t.position>this.maxPosition&&(this.maxPosition=t.position),this.nodes.push(t)}scaling(t,e){let i=1;return t>0&&this.maxPosition!==this.minPosition&&(i=t/(this.maxPosition-this.minPosition)),e&&(i*=-1),i}resize(t,e,i,n){const s=Math.abs(t[1]-t[0])-e,r=this.scaling(s,t[0]>t[1]),o=i+n/2;let a=0;for(const l of this.nodes){const c=l.position*r;a>c&&(a=c),l.screen=c+o}for(const l of this.nodes)l.screen-=a}},na=5,Og=class extends El{constructor(t,e,i){super(t,e,new DC,i),this.tickScale=new DC,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(t){const e=[],i=this.options.depthOptions??[],n=this.options.label,s=this.horizontal?0:-90;for(let r=0;r<t;r++){const o=i[r]?.label;e.push(o?.enabled??n?.enabled??!0?{enabled:!0,spacing:o?.spacing??n?.spacing??5,wrapping:o?.wrapping??n?.wrapping,truncate:o?.truncate??n?.truncate,rotation:o?.rotation??(r?s:n?.rotation),avoidCollisions:o?.avoidCollisions??n?.avoidCollisions??!0}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1})}return e}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((t,e)=>{t.fill=e.color,t.text=e.text,t.textBaseline=e.textBaseline,t.textAlign=e.textAlign??"center",t.pointerEvents=e.textUntruncated==null?1:0,t.setFont(e),t.setBoxing(e)})}updateAxisLine(){if(!this.computedLayout)return;const{line:t}=this.options;this.lineNode.visible=t.enabled,this.lineNode.stroke=t.stroke,this.lineNode.strokeWidth=t.width}computeLayout(){this.updateDirection(),this.updateScale();const{step:t}=this.scale,{range:e,horizontal:i}=this,n=this.options.depthOptions??[],s=this.options.line,r=this.options.label,o=this.options.title,a=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(a),c=this.getTickSpacing();if(this.lineNode.datum=i?{x1:e[0],x2:e[1],y1:0,y2:0}:{x1:0,x2:0,y1:e[0],y2:e[1]},this.lineNode.setProperties({stroke:s.stroke,strokeWidth:s.enabled?s.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return{bbox:$.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:h,nodes:u}=this.tickTreeLayout,d=gh(this.mirrored),g=i?-d:d,p=[],f=new Map,m=new xl,y=this.getDepthOptionsMap(h),b=g*(y[0].spacing+l+c),v=this.tickFormatter(this.scale.domain,this.scale.domain,!1),S=new Map,M={};for(const[ge,ae]of u.entries()){const le=h-ae.depth;if(M[le]??(M[le]=0),!ae.children.length&&t<na||!y[le]?.enabled||!Mx(ae.screen,e))continue;let pe=(ae.leafCount||1)*t;if(pe<na)continue;const jt=v(ae.label,ge-1);let di=jt;const fe=this.getLabelStyles({value:ae.index,formattedValue:di,depth:le},n[le]?.label);if(r?.avoidCollisions??!0){const me=y[le].rotation;let He=this.options.thickness;if(me!=null){const Ei=jf(me,pe,He);pe=Ei.width,He=Ei.height}const Me={font:fe,textWrap:y[le].wrapping,overflow:y[le].truncate?"ellipsis":"hide",maxWidth:pe,maxHeight:He};di=kd(di,Me)||di}const Ns=di!==jt&&jx(di)?je(jt):void 0;if(m.x=i?ae.screen:b,m.y=i?b:ae.screen,m.rotation=0,m.fill=fe.color,m.text=di,m.textAlign="center",m.textBaseline=this.parallel?"top":"bottom",m.setFont(fe),m.setBoxing(fe),!m.getBBox())continue;S.set(ge,{text:di,styles:fe,truncatedText:Ns}),f.set(ge,m.getBBox()),m.rotation=$s(y[le]?.rotation);const{width:wn,height:Jn}=m.getBBox(),tt=i?Jn:wn;M[le]<tt&&(M[le]=tt)}const D=[0],I=[(M[0]??0)+(y[0]?.spacing??0)];let A=M[0]??0,k=y[0]?.spacing??0,T=0;for(let ge=1;ge<h;ge++)T+=y[ge]?.spacing??0,D[ge]=A+T,A+=M[ge]??0,k+=y[ge]?.spacing??0,I[ge]=A+k;const R=Sm();for(const[ge,ae]of u.entries()){if(ge===0)continue;const le=S.get(ge);if(!le)continue;const xt=!ae.children.length,pe=h-ae.depth;if(xt&&t<na)continue;const jt=$s(y[pe].rotation),di=f.get(ge);if(!di)continue;const{width:fe,height:Ns}=di,wn=D[pe]??0;if(m.x=i?ae.screen:b,m.y=i?b:ae.screen,m.fill=le.styles.color,m.text=le.text,m.setFont(le.styles),m.setBoxing(le.styles),m.textAlign="center",m.textBaseline="middle",m.rotation=jt,i?(m.y+=(wn+$f(fe/2,Ns/2,jt))*g,m.rotationCenterX=ae.screen,m.rotationCenterY=m.y):(m.x+=wn*g+$f((y[pe].spacing*g+fe)/2,this.mirrored?fe:0,jt)-fe/2,m.rotationCenterX=m.x,m.rotationCenterY=ae.screen),y[pe].avoidCollisions){const{width:me,height:He}=m.getBBox(),Me=i?me:He,Ei=xt?t:ae.leafCount*t;if(Me>Ei){f.delete(ge);continue}}const Jn=m.getPlainText(),tt=m.getBoxingProperties();p.push({text:Jn,textUntruncated:le.truncatedText,visible:!0,tickId:R(Jn),range:this.scale.range,border:tt.border,color:m.fill,cornerRadius:tt.cornerRadius,fill:tt.fill,fontFamily:m.fontFamily,fontSize:m.fontSize,fontStyle:m.fontStyle,fontWeight:m.fontWeight,padding:tt.padding,rotation:m.rotation,rotationCenterX:m.rotationCenterX,rotationCenterY:m.rotationCenterY,textAlign:m.textAlign,textBaseline:m.textBaseline,x:m.x,y:m.y}),f.set(ge,Oe.toCanvas(m))}const F=(I[h-1]??0)+l+c,N=[this.lineNodeBBox(),$.merge(f.values()),new $(0,0,F*g,0)],P=$.merge(N),z=i?P.height:P.width,{spacing:Y,scrollbarLayout:j}=this.applyScrollbarLayout(N,z,a);this.layout.labelThickness=z,this.layout.scrollbar=j,o.enabled&&N.push(this.titleBBox(this.scale.domain,Y));const ie=$.merge(N);return this.notifyAxisPlugins("onAxisLayout"),{bbox:ie,spacing:Y,tickSizeAtDepth:I,tickLabelLayout:p}}buildDepthsMap(t){const{tickNodes:e,tickScale:i,tickTreeLayout:n}=this;if(!n||!e)return new Map;const s=n.depth,r=new Map;for(const o of t){const a=e.get(o),l=a==null?s-1:Math.min(a.separatorDepth,s-1);r.set(o,l)}if(i.step<na&&t.length>1){const o=t.at(-1);if(o&&!e.has(o)){const a=t.at(-2),l=a?r.get(a):void 0;l!=null&&r.set(o,l)}}return r}filterTicksTopDown(t,e){const{tickScale:i,tickTreeLayout:n,tickNodes:s,leafNodeToKey:r}=this;if(!n||s==null||r==null)return{ticks:t,depthsMap:new Map};const o=i.range,a=i.step,l=i.inset,c=i.bandwidth,h=e?.[0]??0,u=e?.[1]??1,d=this.filterTickCache;if(d?.range0===o[0]&&d.range1===o[1]&&d.step===a&&d.inset===l&&d.bandwidth===c&&d.vr0===h&&d.vr1===u)return d.result;const g=N=>(this.filterTickCache={range0:o[0],range1:o[1],step:a,inset:l,bandwidth:c,vr0:h,vr1:u,result:N},N);if(i.step>=na)return g({ticks:t,depthsMap:this.buildDepthsMap(t)});const p=this.ftdPositions;p.clear();const f=this.ftdCandidates;f.clear();const m=this.ftdKept;m.clear();const y=this.ftdStack;y.length=0;const b=N=>(p.has(N)||p.set(N,i.convert(N)),p.get(N)),v=N=>{let P=0;for(const z of N)if(Number.isFinite(b(z))&&(P+=1,P>1))break;return P};let S=t;if(e!=null&&(e[0]!==0||e[1]!==1)){const N=i.domain,P=N.length;if(P>0){const z=Math.max(0,Math.floor(e[0]*P)-1),Y=Math.min(P-1,Math.ceil(e[1]*P));if(t.length===0)S=N.slice(z,Y+1);else{const j=N[z],ie=N[Y],ge=t[0],ae=t.at(-1),le=j!=null&&j!==ge,xt=ie!=null&&ie!==ae;if(le||xt){const pe=le?[j]:[];pe.push(...t),xt&&pe.push(ie),S=pe}}}}if(v(S)<=1)return g({ticks:S,positions:p,depthsMap:this.buildDepthsMap(S)});for(const N of S)f.add(N);for(const N of S){let z=s.get(N)?.parent;for(;z?.parent;){const Y=r.get(z.leftmostLeaf);Y!=null&&f.add(Y),z=z.parent}}const M=Math.max(0,n.depth-1),D=N=>Math.min(M,n.depth-N.depth),I=n.nodes[0];if(!I?.children.length)return g({ticks:S,positions:p,depthsMap:this.buildDepthsMap(S)});const A=this.ftdByDepth;for(const N of A)N.positions.length=0,N.ticks.length=0;const k=(N,P)=>{const z=N.at(-1);return z!=null&&P-z<na},T=(N,P)=>{for(let z=P+1;z<=M;z++)if(k(A[z].positions,N))return!1;return!k(A[P].positions,N)},R=(N,P,z)=>{const Y=A[z];Y.positions.push(N),Y.ticks.push(P)},E=(N,P)=>{if(P!==0)for(let z=0;z<P;z++){const Y=A[z];for(;Y.positions.length>0&&N-Y.positions.at(-1)<na;)m.delete(Y.ticks.at(-1)),Y.positions.pop(),Y.ticks.pop()}};for(let N=I.children.length-1;N>=0;N--){const P=I.children[N],z=r.get(P.leftmostLeaf);z!=null&&f.has(z)&&y.push(P)}for(;y.length;){const N=y.pop(),P=r.get(N.leftmostLeaf);if(P==null||!f.has(P))continue;const z=b(P);if(z==null||!Number.isFinite(z))continue;if(m.has(P)){for(let j=N.children.length-1;j>=0;j--)y.push(N.children[j]);continue}const Y=D(N);if(T(z,Y)){m.add(P),R(z,P,Y),E(z,Y);for(let j=N.children.length-1;j>=0;j--)y.push(N.children[j])}}for(const N of S){if(s.has(N))continue;const P=b(N);if(P==null||!Number.isFinite(P)||m.has(N))continue;const z=0;T(P,z)&&(m.add(N),R(P,N,z),E(P,z))}const F=S.filter(N=>m.has(N));return g({ticks:F,positions:p,depthsMap:this.buildDepthsMap(F)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,gridLength:e,visibleRange:i,tickTreeLayout:n}=this,{tick:s,gridLine:r}=this.options;if(!n)return;const{tickSizeAtDepth:o,spacing:a}=this.computedLayout,{depth:l}=n,c=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(c),u=this.getTickSpacing(),{position:d,horizontal:g,gridPadding:p}=this,f=d==="bottom"||d==="right"?-1:1,m=p,y=f*e-p,b={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:v}=t.ticks(b,void 0,i);const S=this.filterTicksTopDown(v,i);v=S.ticks;const{depthsMap:M}=S,D=A=>M.get(A)??l-1,I=v.map((A,k)=>({index:t.findIndex(A),tickId:ei(k,...A),translation:Math.round(S.positions?.get(A)??t.convert(A))}));this.gridLineGroupSelection.update(r.enabled&&e?this.calculateGridLines(I,m,y):[]),this.gridFillGroupSelection.update(r.enabled&&e?this.calculateGridFills(I,m,y):[]),this.tickLineGroupSelection.update(s.enabled?v.map((A,k)=>{const{tickId:T,translation:R}=I[k],E=D(A),F=(this.options.depthOptions??[])[E]?.tick,N=o[E]??0,P=F?.stroke??s.stroke,z=F?.enabled===!1?0:F?.width??s.width,Y=-f*N,j=-f*(h+u),[ie,ge,ae,le]=g?[R,j,R,j+Y]:[j,R,j+Y,R];return{tickId:T,offset:R,x1:ie,y1:ge,x2:ae,y2:le,stroke:P,strokeWidth:z,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,a),this.notifyAxisPlugins("onAxisUpdate"),this.resetSelectionNodes()}calculateLayout(t,e){this.chartLayout=e;const{tickSizeAtDepth:i,tickLabelLayout:n,spacing:s,bbox:r}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:n,spacing:s},{bbox:r,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),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(l=>l.visible).flatMap(l=>lc(l.getDomain(t)));this.dataDomain={domain:Or(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(kC),{layout:n,tickNodes:s}=T2(i);this.tickTreeLayout=n,this.tickNodes=s,this.leafNodeToKey=new Map;for(const[l,c]of s)this.leafNodeToKey.set(c,l);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,n.depth-1)+1},()=>({positions:[],ticks:[]}));const r=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||r.push(this.dataDomain.domain[l.refId]);const o=Qv(this.dataDomain.domain,r);this.scale.domain=o;const a=o.map(kC);a.push([""]),this.tickScale.domain=a}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const n=ue(i)?JSON.stringify(i):i;return e.has(n)?!1:(e.add(n),!0)})}};Og.className="GroupedCategoryAxis",Og.type="grouped-category";function kC(t){return hc(ce(t)&&"value"in t?t.value:t)}var TC={type:"axis",name:"grouped-category",chartType:"cartesian",version:Qe,dependencies:[gn],options:wl,themeTemplate:de({tick:{enabled:!0,stroke:{$ref:"groupedCategoryLineColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},ta,ia),create:(t,e,i)=>new Og(t,e,i)},Hl=class extends Xs{getVisibleDomain(t){const e=ka(t[0]),i=ka(t[1]),[n,s]=this.visibleRange;if(t.length<2)return[e,i];const r=Math.min(e,i),o=Math.max(e,i);if(r>=0){const a=Math.log(e),c=Math.log(i)-a;return[Math.exp(a+n*c),Math.exp(a+s*c)]}if(o<=0){const a=-Math.log(-e),c=-Math.log(-i)-a;return[-Math.exp(-(a+n*c)),-Math.exp(-(a+s*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:o}=xd(t.domain,e,i,n,s,void 0,t.sortMetadata?.sortOrder);return r[0]<0&&r[1]>0||t.domain[0]<0&&t.domain[1]>0?(B.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:o}):r[0]===co(r[0])||r[1]===co(r[1])||t.domain[0]===co(t.domain[0])||t.domain[1]===co(t.domain[1])?(B.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:o}):{domain:r,clipped:o}}get base(){return this.optionsBase??this.scale.base}get optionsBase(){return this.options.base}constructor(t,e,i){super(t,e,new yy,i),this.syncScaleBase()}syncScaleBase(){const t=this.optionsBase;t!=null&&(this.scale.base=t)}updateScale(){this.syncScaleBase(),super.updateScale()}};Hl.className="LogAxis",Hl.type="log";var LC={type:"axis",name:"log",chartType:"cartesian",version:Qe,dependencies:[gn],options:Tl,themeTemplate:de({base:10,maxThicknessRatio:.3,line:{enabled:!1}},ta,ia),create:(t,e,i)=>new Hl(t,e,i)},NC={type:"axis",name:"number",chartType:"cartesian",version:Qe,dependencies:[gn],options:kl,themeTemplate:de({maxThicknessRatio:.3,line:{enabled:!1}},ta,ia),create:(t,e,i)=>new Xs(t,e,void 0,i)},OC={type:"axis",name:"time",chartType:"cartesian",version:Qe,dependencies:[gn],options:Ll,themeTemplate:de({maxThicknessRatio:.3,gridLine:{enabled:!1}},ta,bb,ia),create:(t,e,i)=>new lg(t,e,i)},EC=class extends El{calculateGridLine({index:t,tickId:e,translation:i},n,s,r,o){const{horizontal:a,range:l}=this,c=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridLine({index:t,tickId:e,translation:i},n,s,r,o);const h=o[n-1],u=h?i-(i-h.translation)/2:l[0],[d,g,p,f]=a?[u,Math.max(s,r),u,Math.min(s,r)]:[Math.min(s,r),u,Math.max(s,r),u],{style:m}=c,{stroke:y,strokeWidth:b=0,lineDash:v}=m[t%m.length]??{};return{tickId:e,offset:u,x1:d,y1:g,x2:p,y2:f,stroke:y,strokeWidth:b,lineDash:v}}calculateGridFills(t,e,i){return this.options.interval?.placement!=="between"?super.calculateGridFills(t,e,i):t.map((n,s)=>this.calculateGridFill(n,s,n.index,e,i,t))}calculateGridFill({tickId:t,translation:e},i,n,s,r,o){const{horizontal:a,range:l}=this,c=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridFill({tickId:t,translation:e},i,n,s,r,o);const h=o[i-1],u=o[i+1],d=h?e-(e-h.translation)/2:l[0],g=u?e+(u.translation-e)/2:l[1],[p,f,m,y]=a?[d,Math.max(s,r),g,Math.min(s,r)]:[Math.min(s,r),d,Math.max(s,r),g],{fill:b,fillOpacity:v}=c.style[n%c.style.length]??{};return{tickId:t,x1:p,y1:f,x2:m,y2:y,fill:b,fillOpacity:v}}calculateTickLine({isPrimary:t,tickId:e,translation:i},n,s,r,o=0){const{horizontal:a,primaryTick:l,range:c}=this,h=this.options.tick;if(this.options.interval?.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:e,translation:i},n,s,r,o);const u=t&&l?.enabled?l:h,d=-s*this.getTickSize(u),g=r[n-1],p=g?i-(i-g.translation)/2:c[0],f=-s*(o+this.getTickSpacing(u)),[m,y,b,v]=a?[p,f,p,f+d]:[f,p,f+d,p],{stroke:S,width:M}=u;return{tickId:e,offset:p,x1:m,y1:y,x2:b,y2:v,stroke:S,strokeWidth:M,lineDash:void 0}}},vb=class extends EC{constructor(t,e,i){super(t,e,new zr,i,!1),this.defaultTickMinSpacing=20,this.defaultUnit=void 0}get primaryLabel(){const t=this.options.parentLevel;return t?.enabled?t.label:void 0}get primaryTick(){const t=this.options.parentLevel;return t?.enabled?t.tick:void 0}getLabelFormat(){const t=this.options.label.format;return t}getPrimaryLabelFormat(){const t=this.primaryLabel?.format;return t}hasDefinedDomain(){const{min:t,max:e}=this.options;return t!=null&&e!=null&&t<e}isCategoryLike(){return!0}processData(){super.processData();let t;const{domain:e}=this.dataDomain;if(e.length===2&&e[0].valueOf()===e[1].valueOf())t=qu(e[0]);else{const{boundSeries:i,direction:n}=this,{min:s,max:r}=this.options;t=rD(i,n,Mn(s),Mn(r))}st(this.defaultUnit,t)||(this.defaultUnit=t)}updateScale(){super.updateScale(),this.scale.interval=this.options.unit??this.defaultUnit}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:o}=Sd(t,Mn(e),Mn(i),Mn(n),Mn(s));return{domain:r,clipped:o}}tickFormatParams(t,e,i,n){n??(n=xf(e));const s=Sf(t),r=zs(n),o=Ir(n),a=Vc(n);return{type:"date",unit:r,step:o,epoch:a,truncateDate:s}}datumFormatParams(t,e,i,n,s){const r=this.options.unit??this.defaultUnit??"millisecond";n??(n=r);const{datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g}=e,p=zs(n),f=Ir(n),m=Vc(n);return{type:"date",value:_i(r,t),datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g,unit:p,step:f,epoch:m,style:s}}};vb.className="UnitTimeAxis",vb.type="unit-time";var RC={type:"axis",name:"unit-time",chartType:"cartesian",version:Qe,dependencies:[gn],options:Nl,themeTemplate:de({groupPaddingInner:.1,maxThicknessRatio:.3,label:{autoRotate:!1},gridLine:{enabled:!1},parentLevel:{enabled:!0},interval:{placement:"between"}},ta,bb,ia),create:(t,e,i)=>new vb(t,e,i)},PC=[NC,LC,OC,IC,TC,RC];function Eg(t,e,i,n,s){const r=(u,d,g,p)=>{i.animate({id:`${t}_${e}_${d.id}_${u}`,groupId:t,from:g?1:0,to:1,ease:rh,collapsable:g,onUpdate(f,m){m&&u!=="removed"||(d.path.clear(!0),p(f,d),d.checkPathDirty())},onStop(){u==="added"&&(d.path.clear(!0),p(1,d),d.checkPathDirty())},phase:Wn[u]})},o=new Rt,a=u=>(o.resetPathDirty(),u(0,o),o.resetPathDirty(),u(1,o),o.checkPathDirty(),o.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=s;for(const u of n)i.isSkipped()||(r("removed",u,!a(h),h),r("updated",u,!a(c),c)),r("added",u,!a(l),l)}function sa(t,e,i,n,s,r,o=["series",`${t.declarationOrder}`,"label"]){if(t.visible&&n.itemStyler){const a=t.getHighlightStateString(r,s||e!=null&&r?.series===e.series&&r?.datumIndex===e.datumIndex,e?.datumIndex),l=e?Th(e,t.data?.dataIdKey):void 0,c={border:n.border,color:n.color,cornerRadius:n.cornerRadius,datum:e?.datum,enabled:n.enabled,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,itemId:l,itemType:e?.itemType,seriesId:t.id,padding:n.padding,highlightState:a,selectionState:t.getSelectionStateString(e?.datumIndex),candidateState:t.getCandidateStateString(e?.datumIndex)},h=t.ctx.optionsGraphService.resolvePartial(o,t.cachedCallWithContext(n.itemStyler,{...i,...c}),{pick:!1})??{};return de(h,c)}return n}function FC(t,e,i,n,s,r,o){const{isHighlight:a,activeHighlight:l}=r;if(t.visible&&n.enabled&&s){const c=sa(t,e.datum,i,n,a,l,o);e.visible=!0,e.x=s.x,e.y=s.y,e.text=s.text,e.fill=c.color,e.setAlign(s),e.setFont(c),e.setBoxing(c)}else e.visible=!1}var N2={"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 VC({isUpward:t,isVertical:e,placement:i,spacing:n=0,rect:s}){let r=s.x+s.width/2,o=s.y+s.height/2,a="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:u}=N2[i],d=(h+1)*.5;if(e){const g=t?s.y+s.height:s.y,p=s.height*c;o=g+p*d+n*u*c,l=u===c?"top":"bottom"}else{const g=t?s.x:s.x+s.width,p=s.width*c;r=g+p*d+n*u*c,a=u===c?"left":"right"}}return{x:r,y:o,textAlign:a,textBaseline:l}}var O2=class{constructor(t){this.minimumDelay=t?.minimumDelay??50,this.timeout=t?.timeout??100}schedule(t,e){this.cancel(),this.pending={computation:t,onComplete:e},this.minimumDelay>0?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()},this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return this.pending!=null}scheduleIdleCallback(){const t=Math.max(0,this.timeout-this.minimumDelay);typeof requestIdleCallback=="function"?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:t}):this.idleCallbackId=setTimeout(()=>this.execute(),t)}cancelScheduled(){this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId!=null&&(typeof cancelIdleCallback=="function"?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:t}=this;if(!t)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const e=t.computation();return t.onComplete(e),e}},Rg=class{constructor(){this._dataLength=0,this.executor=new O2,this.events=new Os}get filters(){return this._filters}aggregate(t){if(this.executor.cancel(),t.targetRange>1&&t.computePartial){const e=t.computePartial(this._filters);if(e){const{immediate:i,computeRemaining:n}=e;return n&&this.executor.schedule(n,s=>{this.mergeFilters(s),this.events.emit("filtersChanged",void 0)}),this._filters=i,this.events.emit("filtersChanged",void 0),i}}return this._filters=t.computeFull(this._filters),this.events.emit("filtersChanged",void 0),this._filters}ensureLevelForRange(t){!this._filters?.some(i=>i.maxRange>t)&&this.executor.isPending()&&this.executor.demand()}getFilterForRange(t){return this._filters?.find(e=>e.maxRange>t)}cancel(){this.executor.cancel()}markStale(t){const e=this._dataLength>0?t/this._dataLength:0,i=e>=2||e<=.5||this._dataLength===0;if(i)this._filters=void 0;else if(this._filters)for(const n of this._filters)n.stale=!0;this._dataLength=t,this.executor.cancel(),i&&this.events.emit("filtersChanged",void 0)}mergeFilters(t){if(!this._filters||t.length===0)return;const e=[...this._filters,...t];e.sort((i,n)=>i.maxRange-n.maxRange),this._filters=e}},E2=class{has(t,e){return this.processedData===t&&this.filter===e&&this.selectedReader!==void 0}set(t,e,i,n){this.processedData=t,this.filter=e,this.selectedReader=i,this.rangeReader=n}clear(){this.processedData=void 0,this.filter=void 0,this.selectedReader=void 0,this.rangeReader=void 0}};function xb(t,e,i,n,s){const r=i.getDomain(t,"xValue",s,n),o=s==="key"?i.resolveKeysById(t,"xValue",n):i.resolveColumnById(t,"xValue",n,"object"),a=s==="key"?!1:i.resolveColumnNeedsValueOf(t,"xValue",n),[l,c]=td(e.scale.type,r);return{xValues:o,d0:l,d1:c,xNeedsValueOf:a}}var BC=class{constructor(t){this.opts=t,this.selectionEpoch=0,this.populatedEpochs=new WeakMap,this.cache=new E2,t.aggregationManager.events.on("filtersChanged",()=>this.populateStaleFilters())}setActiveFilter(t,e){if(e===void 0){this.cache.clear();return}const i=e;if(this.cache.has(t,i))return;const n=this.opts.getDataModel(),s=this.opts.getXAxis();!n||!s||this.populateCache(i,n,t,s)}refresh(){this.selectionEpoch+=1;const t=this.opts.dataSelectionService?.getDataSetSelection(this.opts.series)?.getSelection();this.sparseSelection=t?rS(t):void 0,this.populateStaleFilters()}populateStaleFilters(){const t=this.opts.aggregationManager.filters;if(!t||t.length===0){this.invalidateCache();return}const e=this.opts.getXAxis(),i=this.opts.getDataModel(),n=this.opts.getProcessedData();if(!e||!i||!n)return;const s=this.sparseSelection;if(s===void 0){for(const o of t)this.populatedEpochs.get(o)!==this.selectionEpoch&&(this.clearSelectedSlot(o),this.populatedEpochs.set(o,this.selectionEpoch));return}const r=xb(this.opts.series,e,i,n,this.opts.domainKey);for(const o of t)this.populatedEpochs.get(o)!==this.selectionEpoch&&(this.populateFilter(o,s,r),this.populatedEpochs.set(o,this.selectionEpoch))}isBucketSelected(t){return(this.cache.selectedReader??this.ensureReaders()?.selectedReader)?.(t)}getRangeReader(){return this.cache.rangeReader??this.ensureReaders()?.rangeReader}getIndexSet(t){}ensureReaders(){const t=this.opts.getXAxis(),e=this.opts.getProcessedData(),i=this.opts.getDataModel();if(!t||!e||!i)return;const[n,s]=t.scale.range,r=this.opts.aggregationManager.getFilterForRange(Math.abs(s-n));if(!r){this.cache.clear();return}return this.cache.has(e,r)?this.cache:this.populateCache(r,i,e,t)}invalidateCache(){this.cache.clear()}},Sb=class extends BC{clearSelectedSlot(t){const{indexData:e,maxRange:i}=t;for(let n=0;n<i;n++)e[n*Di+Kt]=0}populateFilter(t,e,i){oS(e,t.indexData,t.maxRange,i.xValues,i.d0,i.d1,i.xNeedsValueOf)}populateCache(t,e,i,n){const{xValues:s,d0:r,d1:o,xNeedsValueOf:a}=xb(this.opts.series,n,e,i,this.opts.domainKey),l=s.length,{indexData:c,maxRange:h}=t,u=this.opts.canonicalExtremaSlots;function d(p){const f=jc(s,r,o,h,p,{xNeedsValueOf:a,xValuesLength:l});if(f<0||c[f+Kt]!==1)return!1;if(u===void 0)return!0;for(let m=0;m<u.length;m++)if(c[f+u[m]]===p)return!0;return!1}function g(p){const f=jc(s,r,o,h,p,{xNeedsValueOf:a,xValuesLength:l});if(!(f<0))return[c[f+dt],c[f+St]]}return this.cache.set(i,t,d,g),this.cache}},_C=[dt,St,Et,gt],zC=class extends BC{constructor(t){super(t),this.splitOpts=t}clearSelectedSlot(t){const{positiveIndexData:e,negativeIndexData:i,maxRange:n}=t;for(let s=0;s<n;s++){const r=s*Di+Kt;e[r]=0,i[r]=0}}populateFilter(t,e,i){const n=this.splitOpts.getDataModel(),s=this.splitOpts.getProcessedData(),r=this.splitOpts.getYColumnId(n,s),o=n.resolveColumnById(this.splitOpts.series,r,s,"mixed-numeric"),a=n.resolveColumnNeedsValueOf(this.splitOpts.series,r,s);aS(e,t.positiveIndexData,t.negativeIndexData,t.maxRange,i.xValues,o,i.d0,i.d1,i.xNeedsValueOf,a)}populateCache(t,e,i,n){const{xValues:s,d0:r,d1:o,xNeedsValueOf:a}=xb(this.splitOpts.series,n,e,i,this.splitOpts.domainKey),l=this.splitOpts.getYColumnId(e,i),c=e.resolveColumnById(this.splitOpts.series,l,i,"mixed-numeric"),h=e.resolveColumnNeedsValueOf(this.splitOpts.series,l,i),u=s.length,{positiveIndexData:d,negativeIndexData:g,maxRange:p}=t,f=this.splitOpts.canonicalExtremaSlots;function m(b){const v=jc(s,r,o,p,b,{xNeedsValueOf:a,xValuesLength:u});if(v<0)return!1;const S=c[b];if(S==null)return!1;const D=(h?S.valueOf():S)>=0?d:g;if(D[v+Kt]!==1)return!1;if(f===void 0)return!0;for(let I=0;I<f.length;I++)if(D[v+f[I]]===b)return!0;return!1}function y(b){const v=jc(s,r,o,p,b,{xNeedsValueOf:a,xValuesLength:u});if(v<0)return;let S;if(Af(d,v,b,_C)?S=d:Af(g,v,b,_C)&&(S=g),!!S)return[S[v+dt],S[v+St]]}return this.cache.set(i,t,m,y),this.cache}},GC=class{constructor(t){this.opts=t}isBucketSelected(t){const e=this.opts.getIndexSetMap();if(e===void 0)return;const i=e.get(t);if(i===void 0)return;const n=this.opts.dataSelectionService?.getDataSetSelection(this.opts.series)?.getSelection();if(n===void 0)return!1;for(let s=0;s<i.length;s++)if(n[i[s]]===1)return!0;return!1}getRangeReader(){}getIndexSet(t){return this.opts.getIndexSetMap()?.get(t)}refresh(){}setActiveFilter(){}};function mt({id:t},e,i,...n){for(const s of n)s.cleanup();Zs(t,e,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function Pg({id:t},e,i,...n){Zs(t,e,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function ra(t){return{opacity:1}}var R2=10;function Fg(t,e,i,n,s,r,o){const a=t[r];if(a===void 0)return-1;const l=Number.isFinite(e)?bn(a,e,i,o):Ja(r,t.length),c=id(l,s);return r===n[c+dt]||r===n[c+St]||r===n[c+Et]||r===n[c+gt]?c:-1}function jC(t,e,i,n,s,r,o,a,l){let c=0,h=0,u=-1;for(let m=0;m<o;m++){const y=Fg(t,e,i,n,s,m,r);y!==-1&&(c++,y!==u&&(h++,u=y))}h++;const d=a?.length===c?a:new Uint32Array(c),g=l?.length===h?l:new Uint32Array(h);let p=0,f=0;u=-1;for(let m=0;m<o;m++){const y=Fg(t,e,i,n,s,m,r);y!==-1&&(y!==u&&(g[f++]=p,u=y),d[p++]=m)}return g[f]=c-1,{indices:d,metaIndices:g}}function Mb(t,e,i,n){const s=e.length;if(s<Gs)return;const[r,o]=t,{xNeedsValueOf:a,yNeedsValueOf:l,existingFilters:c}=n;let h=js(e,r,o,{xNeedsValueOf:a});const u=c?.find(y=>y.maxRange===h);let{indexData:d,valueData:g}=Hs(e,i,i,r,o,h,{xNeedsValueOf:a,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),{indices:p,metaIndices:f}=jC(e,r,o,d,h,a,s,u?.indices,u?.metaIndices);const m=[{maxRange:h,metaIndices:f,indices:p,indexData:d,valueData:g}];for(;p.length>R2&&h>Dr;){const y=h,b=Math.trunc(y/2),v=c?.find(F=>F.maxRange===b),S=So(d,g,y,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=S.maxRange,d=S.indexData,g=S.valueData;const M=p;let D=0,I=0,A=-1;for(const F of M){const N=Fg(e,r,o,d,h,F,a);N!==-1&&(D++,N!==A&&(I++,A=N))}I++;const k=v?.indices?.length===D?v.indices:new Uint32Array(D),T=v?.metaIndices?.length===I?v.metaIndices:new Uint32Array(I);let R=0,E=0;A=-1;for(const F of M){const N=Fg(e,r,o,d,h,F,a);N!==-1&&(N!==A&&(T[E++]=R,A=N),k[R++]=F)}T[E]=D-1,p=k,f=T,m.push({maxRange:h,metaIndices:f,indices:p,indexData:d,valueData:g})}return m.reverse(),m}function P2(t,e,i,n){const s=e.length;if(s<Gs)return;const[r,o]=t,{xNeedsValueOf:a,yNeedsValueOf:l,targetRange:c,existingFilters:h}=n,u=js(e,r,o,{xNeedsValueOf:a}),d=Math.min(u,$a(Math.max(c,Dr))),g=h?.find(S=>S.maxRange===d),{indexData:p,valueData:f}=Hs(e,i,i,r,o,d,{xNeedsValueOf:a,yNeedsValueOf:l,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),{indices:m,metaIndices:y}=jC(e,r,o,p,d,a,s,g?.indices,g?.metaIndices),b={maxRange:d,indices:m,metaIndices:y,indexData:p,valueData:f};function v(){return Mb([r,o],e,i,{xNeedsValueOf:a,yNeedsValueOf:l,existingFilters:h})?.filter(M=>M.maxRange!==d)??[]}return{immediate:[b],computeRemaining:v}}function F2(t,e,i,n,s,r){return Mb([i,n],t,e,{xNeedsValueOf:s,yNeedsValueOf:r})}var V2=Zc(F2);function B2(t,e,i,n,s,r){const o=e.resolveKeysById(s,"xValue",i),a=e.resolveColumnById(s,n,i,"mixed-numeric"),l=e.getDomain(s,"xValue","key",i),c=e.resolveColumnNeedsValueOf(s,"xValue",i),h=e.resolveColumnNeedsValueOf(s,n,i),{values:u,needsValueOf:d}=Cr(t,o,c),{xValues:g,domain:p}=wr(t,u,l),f=h?a:Gc(a);return r?Mb(p,g,f,{xNeedsValueOf:d,yNeedsValueOf:h,existingFilters:r}):V2(g,f,p[0],p[1],d,h)}function _2(t,e,i,n,s,r,o){const a=e.resolveKeysById(s,"xValue",i),l=e.resolveColumnById(s,n,i,"mixed-numeric"),c=e.getDomain(s,"xValue","key",i),h=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,n,i),{values:d,needsValueOf:g}=Cr(t,a,h),{xValues:p,domain:f}=wr(t,d,c),m=u?l:Gc(l);return P2(f,p,m,{xNeedsValueOf:g,yNeedsValueOf:u,targetRange:r,existingFilters:o})}var Cs=class extends Lm{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};x([C,H()],Cs.prototype,"enabled",2),x([C,H()],Cs.prototype,"color",2),x([C,H()],Cs.prototype,"xOffset",2),x([C,H()],Cs.prototype,"yOffset",2),x([C,H()],Cs.prototype,"blur",2);function z2(t,e){if(t!=null)return{enabled:t.enabled??!0,stroke:t.stroke??e?.stroke??"transparent",strokeWidth:t.strokeWidth??e?.strokeWidth??1,strokeOpacity:t.strokeOpacity??e?.strokeOpacity??1,lineDash:t.lineDash??e?.lineDash??[]}}var HC=class extends Fe{constructor(){super(...arguments),this.enabled=!1}};x([C],HC.prototype,"enabled",2);var Qs=class extends Fe{constructor(){super(...arguments),this.interaction=new HC,this.position=new Wo,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const n=this.renderer==null?void 0:tn(t,this.renderer,i);if(nt(n)||Nn(n)||pn(n))return{type:"raw",rawHtmlString:$e(n)};if(n!=null){const s=de(n.symbol?.marker,e.symbol?.marker),r=n.symbol?.line??e.symbol?.line?de(n.symbol?.line,e.symbol?.line):void 0,o=e.symbol||n.symbol?{marker:s,line:z2(r,s)}:void 0;return{type:"structured",...e,...n,symbol:o}}return{type:"structured",...e}}};x([C],Qs.prototype,"enabled",2),x([C],Qs.prototype,"showArrow",2),x([C],Qs.prototype,"renderer",2),x([C],Qs.prototype,"interaction",2),x([C],Qs.prototype,"position",2),x([C],Qs.prototype,"range",2),x([C],Qs.prototype,"class",2);function oa(){return new Qs}var Dt=class extends Un{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new ja,this.shadow=new Cs,this.marker=new Ni,this.label=new ln,this.tooltip=oa(),this.connectMissingData=!1}};x([C],Dt.prototype,"xKey",2),x([C],Dt.prototype,"xName",2),x([C],Dt.prototype,"yKey",2),x([C],Dt.prototype,"yName",2),x([C],Dt.prototype,"selectedKey",2),x([C],Dt.prototype,"stackGroup",2),x([C],Dt.prototype,"normalizedTo",2),x([C],Dt.prototype,"fill",2),x([C],Dt.prototype,"fillOpacity",2),x([C],Dt.prototype,"stroke",2),x([C],Dt.prototype,"strokeWidth",2),x([C],Dt.prototype,"strokeOpacity",2),x([C],Dt.prototype,"lineDash",2),x([C],Dt.prototype,"lineDashOffset",2),x([C],Dt.prototype,"interpolation",2),x([C],Dt.prototype,"styler",2),x([C],Dt.prototype,"shadow",2),x([C],Dt.prototype,"marker",2),x([C],Dt.prototype,"label",2),x([C],Dt.prototype,"tooltip",2),x([C],Dt.prototype,"connectMissingData",2);function Vt(t,e,i){return(e-t)*i+t}function $C(t,e){const{x0:i,y0:n,x1:s,y1:r}=t,a=(r-n)/(s-i)*(e-i)+n;return{leftCp1x:i,leftCp1y:n,leftCp2x:e,leftCp2y:a,stepX:e,stepY0:a,stepY1:a,rightCp1x:e,rightCp1y:a,rightCp2x:s,rightCp2y:r}}function G2(t,e){const{cp0x:i,cp0y:n,cp1x:s,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=t,h=Bd(i,s,o,l,e),[u,d]=th(i,n,s,r,o,a,l,c,h),g=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:e,stepY0:g,stepY1:g,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function j2(t){const{x0:e,y0:i,x1:n,y1:s,stepX:r}=t;return{leftCp1x:(e+r)/2,leftCp1y:i,leftCp2x:(e+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:s,rightCp1x:(r+n)/2,rightCp1y:s,rightCp2x:(r+n)/2,rightCp2y:s}}function WC(t,e){return t.type==="linear"?$C(t,e):t.type==="cubic"?G2(t,e):t.type==="step"?j2(t):$C(t,e)}function UC(t,e,i,n,s,r,o){switch(e){case 0:o?t.moveTo(s,r):t.moveTo(i,n);break;case 1:o?t.lineTo(s,r):t.lineTo(i,n);break;case 2:break}}function KC(t,e,i,n,s,r){r?t.lineTo(e,i):t.lineTo(n,s)}function YC(t,e,i,n,s,r,o,a,l,c){c?t.cubicCurveTo(r,o,n,s,e,i):t.cubicCurveTo(n,s,r,o,a,l)}function ZC(t,e,i,n,s,r,o){o?(t.lineTo(r,s),t.lineTo(r,i),t.lineTo(e,i)):(t.lineTo(r,i),t.lineTo(r,s),t.lineTo(n,s))}function H2(t,e,i,n,s,r,o){if(o){for(let a=r.length-1;a>=0;a--){const{x:l,y:c}=r[a];t.lineTo(l,c)}t.lineTo(e,i)}else{for(const{x:a,y:l}of r)t.lineTo(a,l);t.lineTo(n,s)}}function Eh(t,e,i,n){const[s,r]=Ai(e);switch(UC(t,i,s.x,s.y,r.x,r.y,n),e.type){case"linear":KC(t,e.x0,e.y0,e.x1,e.y1,n);break;case"cubic":YC(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,n);break;case"step":ZC(t,e.x0,e.y0,e.x1,e.y1,e.stepX,n);break;case"multi-line":H2(t,e.x0,e.y0,e.x1,e.y1,e.midPoints,n);break}}function XC(t,e,i){const[n,s]=Ai(t),[r,o]=Ai(e),a=Vt(n.x,r.x,i),l=Vt(n.y,r.y,i),c=Vt(s.x,o.x,i),h=Vt(s.y,o.y,i);return[{x:a,y:l},{x:c,y:h}]}function Ib(t,e,i,n,s,r){const[{x:o,y:a},{x:l,y:c}]=XC(e,i,n);if(UC(t,s,o,a,l,c,r),e.type==="cubic"&&i.type==="cubic"){const h=Vt(e.cp1x,i.cp1x,n),u=Vt(e.cp1y,i.cp1y,n),d=Vt(e.cp2x,i.cp2x,n),g=Vt(e.cp2y,i.cp2y,n);YC(t,o,a,h,u,d,g,l,c,r)}else if(e.type==="step"&&i.type==="step"){const h=Vt(e.stepX,i.stepX,n);ZC(t,o,a,l,c,h,r)}else if(e.type==="linear"&&i.type==="linear")KC(t,o,a,l,c,r);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const u=WC(e,h),d=WC(i,h),g=Vt(u.leftCp1x,d.leftCp1x,n),p=Vt(u.leftCp1y,d.leftCp1y,n),f=Vt(u.leftCp2x,d.leftCp2x,n),m=Vt(u.leftCp2y,d.leftCp2y,n),y=Vt(u.stepX,d.stepX,n),b=Vt(u.stepY0,d.stepY0,n),v=Vt(u.stepY1,d.stepY1,n),S=Vt(u.rightCp1x,d.rightCp1x,n),M=Vt(u.rightCp1y,d.rightCp1y,n),D=Vt(u.rightCp2x,d.rightCp2x,n),I=Vt(u.rightCp2y,d.rightCp2y,n);r?(t.cubicCurveTo(D,I,S,M,y,v),t.lineTo(y,b),t.cubicCurveTo(f,m,g,p,o,a)):(t.cubicCurveTo(g,p,f,m,y,b),t.lineTo(y,v),t.cubicCurveTo(S,M,D,I,l,c))}}var qC=1e3,JC=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(JC||{});function $2(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 yi(t){return Pd(t).valueOf()}function ri(t,e){if(!e)return Number.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 Number.NaN;if(Er(e)){if(typeof t=="number"){const{firstBandTime:s,intervalMs:r,bandCount:o,inset:a,step:l}=e,c=Math.round((t-s)/r);if(c>=0&&c<o)return a+l*c}return Number.NaN}const i=yi(t);let n=e.domain.findIndex(s=>yi(s)===i);return n===-1&&(n=e.domain.findIndex(s=>$2(t,s))),n>=0?e.inset+e.step*n:Number.NaN}function QC({data:t},e){return t.map((i,n)=>({xValue0Index:e.indexOf(yi(i.xValue0)),xValue1Index:e.indexOf(yi(i.xValue1)),datumIndex:n}))}function eA(t){return Object.values(t.scales).every(e=>e.type==="category"?Er(e)?e.bandCount<qC:e.domain.length<qC:!0)}function W2(t,e){const i=e.scales.x,n=t.scales.x;if(i?.type!=="category"||n?.type!=="category"||Er(i)||Er(n))return!0;let s=-1/0;for(const r of i.domain){const o=ri(r,n);if(Number.isFinite(o)){if(o<s)return!1;s=o}}return!0}function U2(t,e){let i=-1/0;for(const n of t){const s=ri(n.value,e.scales.x);if(Number.isFinite(s)){if(s<i)return!1;i=s}}return!0}function K2(t,e){const i=new Map;for(const{xValue0:h,xValue1:u}of t.data){const d=yi(h),g=yi(u);i.set(d,h).set(g,u)}const n=Array.from(i,([h,u])=>({axisValue:h,value:u}));n.sort((h,u)=>ri(h.value,t.scales.x)-ri(u.value,t.scales.x));const s=[];for(const{xValue0:h,xValue1:u}of e.data){const d=yi(h),g=yi(u);i.has(d)||(i.set(d,h),s.push({axisValue:d,value:h})),i.has(g)||(i.set(g,u),s.push({axisValue:g,value:u}))}s.sort((h,u)=>ri(h.value,e.scales.x)-ri(u.value,e.scales.x));const r=n;let o=0;for(const h of s){for(let u=r.length-1;u>=o;u-=1){const d=ri(h.value,e.scales.x),g=ri(r[u].value,e.scales.x);if(d>g){o=u+1;break}}r.splice(o,0,h),o+=1}if(!U2(r,e))return;const a=r.map(h=>h.axisValue),l=QC(e,a),c=QC(t,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function tA(t,e,i,n,s){if(s.xValue1Index===s.xValue0Index+1)return t;const r=Ai(t);let o,a;if(e.scales.x?.type==="category"){const l=(r[1].x-r[0].x)/(s.xValue1Index-s.xValue0Index);o=r[0].x+(n-s.xValue0Index)*l,a=o+l}else{const l=i[n],c=i[n+1];o=ri(l,e.scales.x),a=ri(c,e.scales.x)}return wm(t,o,a)}function iA(t,e){const[i,n]=Ai(t),s=ri(0,e.scales.y);return gl(t,{x:i.x,y:s},{x:n.x,y:s})}function nA(t){const[e,i]=Ai(t);return _d(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function sA(t,e,i,n,s,r){let o,a;if(s.xValue0Index>=r.xValue1Index){const u=n.findLast(g=>g.xValue1Index<=r.xValue1Index)?.datumIndex,d=u==null?void 0:i.data[u];o=d?.xValue1,a=d?.yValue1}else if(s.xValue0Index<=r.xValue0Index){const u=n.find(g=>g.xValue0Index>=r.xValue0Index)?.datumIndex,d=u==null?void 0:i.data[u];o=d?.xValue0,a=d?.yValue0}if(o==null||a==null)switch(e){case 0:return iA(t,i);case 1:return nA(t)}const l=ri(o,i.scales.x),c=ri(a,i.scales.y),h={x:l,y:c};return gl(t,h,h)}function Db(t,e){if(e==null)return;const i=yi(t.xValue0),n=yi(t.xValue1);return e.find(s=>yi(s.xValue0)===i&&yi(s.xValue1)===n)?.span}function rA(t,e,i,n,s,r,o){const a=t.data[n.datumIndex],l=a.span,c=Db(a,s);if(c==null){const h=sA(l,e,t,i,n,r);o.added.push({from:h,to:l})}else o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l})}function oA(t,e,i,n,s,r,o){const a=t.data[n.datumIndex],l=a.span,c=Db(a,s);if(c==null){const h=sA(l,e,t,i,n,r);o.removed.push({from:l,to:h})}else o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c})}function aA(t,e,i,n,s){const r=n.scales.x,o=e[s.xValue0Index],a=e[s.xValue1Index];let l,c;if(r?.type==="continuous"||r?.type==="log"?(l=i.data.findLast(y=>yi(y.xValue0)<=o),c=i.data.find(y=>yi(y.xValue1)>=a)):(l=i.data.find(y=>yi(y.xValue0)===o),c=i.data.find(y=>yi(y.xValue1)===a)),l==null||c==null)return;const[{x:h},{x:u}]=Ai(t),d=ri(l.xValue0,i.scales.x),g=ri(l.yValue0,i.scales.y),p=ri(c.xValue1,i.scales.x),f=ri(c.yValue1,i.scales.y);let m=n.data[s.datumIndex].span;return m=gl(m,{x:d,y:g},{x:p,y:f}),m=wm(m,h,u),m}function Y2(t,e,i,n,s,r,o,a,l){const c=s+1,h=o.find(v=>v.xValue0Index<=s&&v.xValue1Index>=c),u=r.find(v=>v.xValue0Index<=s&&v.xValue1Index>=c),d=e.zeroData,g=t.zeroData;if(h==null&&u!=null){rA(t,i,r,u,d,a,l);return}else if(h!=null&&u==null){oA(e,i,o,h,g,a,l);return}else if(h==null||u==null)return;let p;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?p=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?p=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?p=1:p=0;const f=e.data[h.datumIndex],m=tA(f.span,e,n,s,h),y=t.data[u.datumIndex],b=tA(y.span,t,n,s,u);if(p===1){const v=aA(m,n,e,t,u);v==null?oA(e,i,o,h,g,a,l):(l.removed.push({from:m,to:v}),l.moved.push({from:v,to:b}),l.added.push({from:b,to:b}))}else if(p===-1){const v=aA(b,n,t,e,h);v==null?rA(t,i,r,u,d,a,l):(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:v}),l.added.push({from:v,to:b}))}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:b}),l.added.push({from:b,to:b})}function Z2(t,e,i,n){const s={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:o,newDataAxisIndices:a}=t,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let c=0;c<r.length-1;c+=1)Y2(e,i,n,r,c,a,o,l,s);return s}function X2(t,e){const i=[],n=[],s=[],r=Math.min(e.data.length,t.data.length);for(let o=0;o<r;o+=1){const a=e.data[o].span,l=t.data[o].span;i.push({from:a,to:a}),n.push({from:a,to:l}),s.push({from:l,to:l})}if(e.data.length>t.data.length&&t.data.length>0){const o=t.data.at(-1).span,[,a]=Ai(o),l=_d(o,a);for(let c=r;c<e.data.length;c+=1){const h=e.data[c].span;i.push({from:h,to:h}),n.push({from:h,to:l})}}if(t.data.length>e.data.length&&e.data.length>0){const o=e.data.at(-1).span,[,a]=Ai(o),l=_d(o,a);for(let c=r;c<t.data.length;c+=1){const h=t.data[c].span;n.push({from:l,to:h}),s.push({from:h,to:h})}}return{removed:i,moved:n,added:s}}function lA(t,e,i){const{span:n}=e;switch(i){case 0:return Db(e,t.zeroData)??iA(n,t);case 1:return nA(n)}}function q2(t,e,i){const n=[],s=[];for(const r of e.data){const o=r.span,a=lA(e,r,i);s.push({from:o,to:a})}for(const r of t.data){const o=r.span,a=lA(t,r,i);n.push({from:a,to:o})}return{removed:s,moved:[],added:n}}function Rh(t,e,i){if(!eA(t)||!eA(e)||!W2(t,e))return;const n=K2(t,e);return n==null?q2(t,e,i):n.axisValues.length===n.oldDataAxisIndices.length+n.newDataAxisIndices.length+2?X2(t,e):Z2(n,t,e,i)}function Ph(t,e){const i=t.map(s=>s.point);let n=fM(i);switch(e.type){case"linear":break;case"smooth":n=yM(i,e.tension);break;case"step":n=mM(i,e.position);break}return n.map(function(r,o){return{span:r,xValue0:t[o].xDatum,yValue0:t[o].yDatum,xValue1:t[o+1].xDatum,yValue1:t[o+1].yDatum}})}function Vg(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function Cb({path:t},e){let i;for(const{span:n}of e){const[s,r]=Ai(n),o=i!=null&&Vg(i,s)?2:0;Eh(t,n,o,!1),i=r}}function Bg(t,e,i){let n;for(const s of i){const[r,o]=XC(s.from,s.to,t),a=n!=null&&Vg(n,r)?2:0;Ib(e.path,s.from,s.to,t,a,!1),n=o}}function cA(t,e,i,n=1){const s=(l,c)=>Bg(l,c,e.removed),r=(l,c)=>Bg(l,c,e.moved),o=(l,c)=>Bg(l,c,e.added),a=Ab(t,i,n);return{status:t,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:s},pathProperties:a}}function Ab(t,e,i=1){const n=e==="none"?"updated":t,s={fromFn(r,o){const a={phase:Wn[n]},l=r.previousDatum??o;return l!=null&&(a.segments=l),t==="removed"?a.finish={visible:!1}:t==="added"&&(a.start={visible:!0}),a},toFn(r,o){const a={phase:Wn[n]},l=o;return l!=null&&(a.segments=l),a}};return e==="fade"?{fromFn(r,o){const a=t==="added"?0:i,l=t==="removed"?r.previousDatum??o:o;return{...s.fromFn(r,o),opacity:a,segments:l}},toFn(r,o){const a=t==="removed"?0:i,l=t==="removed"?r.previousDatum??o:o;return{...s.toFn(r,o),opacity:a,segments:l}}}:s}function J2(t,e,i,n=1){const s=t.scales.x?.type==="category",r=e.scales.x?.type==="category";if(s!==r||!ih(t.scales.x)||!ih(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=Rh({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(a==null)return;const l=cA(o,a,"fade",n),c=(i?.changed??!0)||!Eo(t.scales.x,e.scales.x)||!Eo(t.scales.y,e.scales.y)||o!=="updated";return{status:o,stroke:l,hasMotion:c}}function hA({path:t},{spans:e,phantomSpans:i}){let n=0,s={x:Number.NaN,y:Number.NaN},r={x:Number.NaN,y:Number.NaN};for(let o=0;o<e.length;o+=1){const{span:a}=e[o],{span:l}=i[o],{0:c,1:h}=Ai(a),{0:u,1:d}=Ai(l);if(Vg(s,c)&&Vg(r,u))Eh(t,a,2,!1);else{for(let g=o-1;g>=n;g-=1)Eh(t,i[g].span,1,!0);t.closePath(),Eh(t,a,0,!1),n=o}s=h,r=d}for(let o=e.length-1;o>=n;o-=1)Eh(t,i[o].span,1,!0);t.closePath()}function wb(t,{path:e},i,n){for(let s=0;s<i.length;s+=1){const r=i[s],o=n[s];Ib(e,r.from,r.to,t,0,!1),Ib(e,o.from,o.to,t,1,!0),e.closePath()}}function uA(t,e,i,n){const s=(l,c)=>wb(l,c,e.removed,i.removed),r=(l,c)=>wb(l,c,e.moved,i.moved),o=(l,c)=>wb(l,c,e.added,i.added),a=Ab(t,n);return{status:t,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:s},pathProperties:a}}function Q2(t,e){const i=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(i!==n||!ih(t.scales.x)||!ih(e.scales.x))return;let s="updated";e.visible&&!t.visible?s="removed":!e.visible&&t.visible&&(s="added");const r=Rh({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(r==null)return;const o=Rh({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(o==null)return;const a=Rh({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(a==null)return;const l="none",c=uA(s,r,o,l),h=cA(s,a,l);return{status:s,fill:c,stroke:h}}function Fh({id:t},e,i,n,...s){const r={...n,phase:n?.phase??(i?Wn[i]:"trailing")};Zs(t,"markers",e,s,{opacity:0},{opacity:1},r);for(const o of s)o.cleanup()}function eB({id:t},e,...i){Zs(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const n of i)n.cleanup()}function kb({id:t,nodeDataDependencies:e},i,n,...s){const r=e.seriesRectWidth;wt(t,"markers",i,s,{fromFn:(l,c)=>{const h=c.midPoint?.x??r;let u=J(0,DM(h/r),1);return Number.isNaN(u)&&(u=0),{scalingX:0,scalingY:0,delay:n?.delay??u,duration:n?.duration??ly,phase:n?.phase??"initial",start:n?.start,finish:n?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function _g(t){return{opacity:1,scalingX:1,scalingY:1}}function zg(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const r=s.datum;if(r?.point==null)continue;const{x:o,y:a}=r.point;!Number.isFinite(o)||!Number.isFinite(a)||s.resetAnimationProperties(o,a,s.size,1,1,1)}e.cleanup()})}}function Vh(t,e){return{x:e.point?.x??Number.NaN,y:e.point?.y??Number.NaN,scalingCenterX:e.point?.x??Number.NaN,scalingCenterY:e.point?.y??Number.NaN}}function Gg(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const n=i[e],{point:s}=n??{};if(n==null||s==null)return;const r=t.getFormattedMarkerStyle(n),o=Mt.anchor(r.shape),a=s.focusSize??r.size,l=4+a,c=l/2,h=(o.x-.5)*a,u=(o.y-.5)*a,d=n.point.x-c-h,g=n.point.y-c-u;return Oe.toCanvas(t.contentGroup,new $(d,g,l,l))}function tB(t,e,i,n){if(!(n.enabled??i.enabled))return!1;const r=1;return(e.step??bo(e.range)/Math.max(1,t))>r}function Tb(t,e,i,n,s,r=s,o=!1){const a=e?.crossFiltering===!0||tB(i.input.count,n.x.scale,s,r);return t.selection.enabled&&!o?{needsNodeData:!0,hideWithSize0:!a}:{needsNodeData:a,hideWithSize0:!1}}function jg(t,e,i,n){return n??(n={stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}),Fy.reduce((s,r)=>(s[r]=t.getMarkerStyle(i,{},void 0,{highlightState:r},void 0,n),s),{})}function Lb({id:t,visible:e,nodeDataDependencies:i},n,...s){const{seriesRectWidth:r,seriesRectHeight:o}=i;Zs(t,"path_properties",n,s,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:e},finish:{clip:!1,visible:e}})}function Nb({id:t},e,i,n="add",...s){Zs(t,e,i,s,{opacity:0},{opacity:1},{phase:n})}function Ob(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function Hg({nodeDataDependencies:t},e){const i=n=>Number.isFinite(n)?n:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}function dA(t){return t.isReversed()!==t.range[1]<t.range[0]}function $g(t,e,i,n,s,r=!0){if(e.scale.domain.length===0||i.scale.domain.length===0)return;const o=t.key==="x"?e:i,{scale:a,direction:l}=o,c=l==="x",h=a.bandwidth??0,u=r?((a.step??0)-h)/2:0,d=Math.max(n.x,s.width-(n.x+n.width)),g=Math.max(n.y,s.height-(n.y+n.height)),p=()=>dA(c?e:i)?c?n.width+d:n.height+g:c?-d:-g,f=()=>dA(c?e:i)?c?-d:-g:c?n.width+d:n.height+g;return(y=>{const b=[];let v=-1;for(let S=0;S<y.length;S++){const M=y[S];if(xc(M))continue;const{start:D,stop:I,...A}=y[S],k=y[v]?.stop,T=y.slice(S+1).find(P=>P.start!=null)?.start;let R=a.convert(D??k)-u,E=a.convert(I??T)+2*u;const F=D!=null&&Number.isNaN(R),N=I!=null&&Number.isNaN(E);F||N||(Number.isNaN(R)&&(R=p()),Number.isNaN(E)&&(E=f()),I!=null&&(v=S),b.push({start:R,stop:E,...A}))}return b})(t.segments).map(({stop:y,start:b,...v})=>{const S=c?b:-d,M=c?-g:b,D=c?y+h:n.width+d,I=c?n.height+g:y+h;return{clipRect:{x0:S,y0:M,x1:D,y1:I},...v}})}var gA=new Set(["time","timestamp","date","datetime"]);function Eb(t,e,i,{allowPrimitiveTypes:n=!0}={}){if(t!=="x"&&t!=="y"||!ce(e))return;const s=pA(t,i);if(s==null||!(s in e))return;const r=e[s],o=fA(t,i),a=nB(r);if(a)return{type:a,position:o};const l=sB(s,r);if(l)return{type:l,position:o};if(n)return typeof r=="number"?{type:"number",position:o}:{type:"category",position:o}}function Bh(t,e,i){return Eb(t,e,i,{allowPrimitiveTypes:!1})}function iB(t,e,i){if(t!=="x"||!ce(e))return;const n=pA(t,i);if(n==null||!(n in e))return;const s=e[n],r=fA(t,i),o=rB(n,s);if(o)return{type:o,position:r};if(nt(s))return{type:"category",position:r}}function nB(t){if(ue(t)&&t.every(e=>nt(e)||e===null))return"grouped-category"}function sB(t,e){if(pn(e)||gA.has(t)&&(Zi(e)||ms(e)))return"time"}function rB(t,e){if(pn(e)||gA.has(t)&&(Zi(e)||ms(e)))return"ordinal-time"}function pA(t,e){if(t==="x"&&"xKey"in e)return e.xKey;if(t==="y"&&"yKey"in e)return e.yKey}function fA(t,e){return"direction"in e&&e.direction==="horizontal"?t==="x"?"left":"bottom":t==="x"?"bottom":"left"}var $l=class vp extends Kr{constructor(e){super({moduleCtx:e,propertyKeys:Vl,propertyNames:Bl,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:Ob({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:ra,datum:(i,n)=>({..._g(i),...Vh(i,n)})},clipFocusBox:!1}),this.properties=new Dt,this.connectsToYAxis=!0,this.aggregationManager=new Rg,this.hideWithSize0=!1,this.backgroundGroup=new se({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const e=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||e&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Uy||this.contextNodeData.strokeData.spans.length>Uy)}attachSeries(e,i,n){super.attachSeries(e,i,n),e.appendChild(this.backgroundGroup)}detachSeries(e,i,n){super.detachSeries(e,i,n),this.backgroundGroup.remove()}attachPaths([e,i]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(i),i.zIndex=-1}detachPaths([e,i]){e.remove(),i.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(e){const n=this.isStacked()===this._isStacked;return this._isStacked=n,super.setSeriesIndex(e,n)}setZIndex(e){super.setZIndex(e),this.isStacked()?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1])}async processData(e){if(this.data==null)return;const{data:i,visible:n,seriesGrouping:{groupIndex:s=this.id,stackCount:r=1}={}}=this,{xKey:o,yKey:a,selectedKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,g=this.axes.y?.scale,{xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:g}),m=r>1||h!=null,y={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},b={invalidValue:null};(rs(h)||c)&&r>1&&(b.invalidValue=0),n||(b.forceValue=0);const v=this.properties.allowNullKeys??!1,S=[jr(o,p,{id:"xValue",allowNullKey:v}),et(a,f,{id:"yValueRaw",...b}),...l==null?[]:[et(l,"category",{id:"selectedRaw"})]];m&&S.push(...Qo(a,"normal",{id:"yValueCumulative",...b,groupId:y.marker},f)),rs(h)&&S.push(et(a,f,{id:"yValue",...b,groupId:y.value}),gg(Object.values(y),h)),u&&S.push(wh());const{dataModel:M,processedData:D}=await this.requestDataModel(e,i,{props:S,groupByKeys:m,groupByData:!m});this.aggregateData(M,D),this.animationState.transition("updateData")}xCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.x.scale.convert(e),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}yCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.y.scale.convert(e[0]),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(e){const{dataModel:i,processedData:n,axes:s}=this;if(!i||!n)return{domain:[]};const r=s.y;if(e==="x"){const a=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","key",n);return a?.def.type==="key"&&a.def.valueType==="category"?l:{domain:Li(Or(l.domain))}}const o=this.domainForClippedRange("y",[this.yCumulativeKey(n)],"xValue");return r instanceof Xs&&!(r instanceof Hl)?{domain:Li(My(o))}:{domain:Li(o)}}getSeriesRange(e,i){const[n,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",i);return[Ze(Es(n,0)),Ze(ss(s,0))]}getZoomRangeFittingItems(e,i,n){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}getVisibleItems(e,i,n){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}createBucketLookupFeature(){return new Sb({series:this,getXAxis:()=>this.axes.x,getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key",canonicalExtremaSlots:[gt]})}aggregateData(e,i){if(this.aggregationManager.markStale(i.input.count),In(i))return;const n=this.axes.x;if(n==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>_2(n.scale.type,e,i,this.yCumulativeKey(i),this,s,o),computeFull:o=>B2(n.scale.type,e,i,this.yCumulativeKey(i),this,o),targetRange:s});const r=this.aggregationManager.filters;r&&r.length>0&&or.record(`${this.type}:aggregation`,r.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[i,n]=e.scale.range;return Math.abs(n-i)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(e){const{indices:i,metaIndices:n}=e,{visible:s,axes:r,dataModel:o,processedData:a,seriesBelowStackContext:l}=this,c=r.x,h=r.y;if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],l;if(c==null||h==null||o==null||a==null)return;const{scale:u}=c,{scale:d}=h,g=(u.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,f=a.invalidData?.get(this.id),m=o.resolveKeysById(this,"xValue",a),y=o.resolveColumnById(this,this.yCumulativeKey(a),a,"mixed-numeric");let[b,v]=kh(1,n.length-1,c.range,A=>{const k=n[A],T=n[A+1],R=i[k],E=i[T],F=m[R],N=m[E],{0:P}=this.xCoordinateRange(F,0),{1:z}=this.xCoordinateRange(N,0);return[P,z]});b=Math.max(b-1,0),v=Math.min(v+1,n.length-1);let S=[];if(l?.fillSpans)S=l?.fillSpans;else for(let A=b;A<v;A+=1){const k=n[A],T=n[A+1],R=i[k],E=i[T],F=m[R],N=m[E],P={type:"linear",moveTo:!1,x0:u.convert(F)+g,y0:d.convert(0),x1:u.convert(N)+g,y1:d.convert(0)};S.push({span:P,xValue0:F,xValue1:N,yValue0:0,yValue1:0})}this.phantomSpans=S;const M=[],D=[];let I=0;for(let A=b;A<v;A+=1){const k=n[A],T=n[A+1],R=i[k],E=i[T],F=!p&&this.hasInvalidDatumsInRange(f,y,R,E),N=S[I++];if(F){M.push(N),D.push(N);continue}const P=[];for(let ae=k;ae<=T;ae++){const le=i[ae];if(f?.[le])continue;const xt=y[le];if(!jn(xt))continue;const pe=m[le];P.push({point:{x:u.convert(pe)+g,y:d.convert(xt)},xDatum:pe,yDatum:xt})}if(P.length<2){M.push(N),D.push(N);continue}const z=P[0],Y=P.at(-1),j=P.slice(1,-1).map(ae=>ae.point),ge={span:{type:"multi-line",moveTo:!1,x0:z.point.x,y0:z.point.y,x1:Y.point.x,y1:Y.point.y,midPoints:j},xValue0:z.xDatum,xValue1:Y.xDatum,yValue0:z.yDatum,yValue1:Y.yDatum};M.push(ge),D.push(ge)}return this.fillSpans=M,this.strokeSpans=D,{stack:[],fillSpans:M,strokeSpans:D}}hasInvalidDatumsInRange(e,i,n,s){const r=Math.min(n,s),o=Math.max(n,s);for(let a=r;a<=o;a++){if(e?.[a])return!0;const l=i[a];if(!jn(l))return!0}return!1}stackYValueData(){const{visible:e,axes:i,dataModel:n,processedData:s,seriesBelowStackContext:r,properties:o}=this,a=i.x,l=i.y;if(a==null||l==null||n==null||s==null)return;const{interpolation:c}=o,{scale:h}=a,{scale:u}=l,d=(h.bandwidth??0)/2;let g=n.resolveKeysById(this,"xValue",s),p=n.resolveColumnById(this,this.yValueKey(),s,"mixed-numeric");const f=!this.isStacked()&&this.properties.connectMissingData,m=s.invalidKeys?.get(this.id),b=(f?s.invalidData?.get(this.id):void 0)??m;b!=null&&(g=g.filter((E,F)=>b[F]===!1),p=p.filter((E,F)=>b[F]===!1));let[v,S]=kh(1,g.length,a.range,E=>this.xCoordinateRange(g[E],0));v=Math.max(v-2,0),S=Math.min(S+2,g.length);let M;if(r?.fillSpans)M=r?.fillSpans;else{const E=[];for(let F=v;F<S;F+=1){const N=g[F];E.push({point:{x:h.convert(N)+d,y:u.convert(0)},xDatum:N,yDatum:0})}M=Ph(E,{type:"linear"})}if(this.phantomSpans=M,!e)return this.fillSpans=M,this.strokeSpans=[],r;let D=r?.stack;if(D==null){D=[];for(let E=v;E<S-1;E+=1)D.push({leading:0,trailing:0,dataValid:!0,breakBefore:!1})}const I=D.slice();let A=!1;for(let E=0;E<I.length;E+=1){const F=v+E,N=v+E+1;let{leading:P,trailing:z,breakBefore:Y}=D[E];const j=p[F],ie=p[N],ge=!jn(j),ae=!jn(ie),le=!ge&&!ae;le&&(P=Ti(P,j),z=Ti(z,ie)),E!==0&&le!==A&&(Y=!0),A=le,I[E]={leading:P,trailing:z,dataValid:le,breakBefore:Y}}const k=[],T=[],R=[];for(let E=0;E<I.length;E+=1){const{leading:F,dataValid:N,breakBefore:P}=I[E],z=v+E;if(P){if(R.length!==0){const Y=I[E-1],j={point:{x:h.convert(g[z])+d,y:u.convert(Y.trailing)},xDatum:g[z],yDatum:Y.trailing};R.push(j);const ie=Ph(R,c);k.push(...ie),T.push(...ie)}R.length=0}if(N){const Y={point:{x:h.convert(g[z])+d,y:u.convert(F)},xDatum:g[z],yDatum:F};R.push(Y)}else k.push(M[E])}if(R.length!==0){const E=I.at(-1),F=v+I.length,N={point:{x:h.convert(g[F])+d,y:u.convert(E.trailing)},xDatum:g[F],yDatum:E.trailing};R.push(N);const P=Ph(R,c);k.push(...P),T.push(...P),R.length=0}return this.fillSpans=k,this.strokeSpans=T,{stack:I,fillSpans:k,strokeSpans:T}}createStackContext(){const e=this.axes.x;if(e==null)return;const{scale:i}=e,[n,s]=i.range,r=Math.abs(s-n);this.aggregationManager.ensureLevelForRange(r);const o=this.aggregationManager.getFilterForRange(r),{processedData:a}=this;return a&&this.ensureBucketLookupFeature()?.setActiveFilter(a,o),o?this.stackAggregatedData(o):this.stackYValueData()}createNodeDatumContext(e,i){const{dataModel:n,processedData:s}=this;if(!n||!s)return;const{xKey:r,xName:o,selectedKey:a,yKey:l,yName:c,legendItemName:h,marker:u,label:d,fill:g,stroke:p,normalizedTo:f}=this.properties,m=e.scale,y=i.scale,{isContinuousY:b}=this.getScaleInformation({xScale:m,yScale:y}),v=s.type==="grouped",[S,M]=m.range,D=Math.abs(M-S);this.aggregationManager.ensureLevelForRange(D);const I=this.aggregationManager.getFilterForRange(D);this.ensureBucketLookupFeature()?.setActiveFilter(s,I);const A=this.contextNodeData?.nodeData,k=A!=null&&this.canIncrementallyUpdateNodes(I!=null);return{xAxis:e,yAxis:i,rawData:s.dataSources.get(this.id)?.data??[],xValues:n.resolveKeysById(this,"xValue",s),yRawValues:n.resolveColumnById(this,"yValueRaw",s,"mixed-numeric"),yCumulativeValues:v?n.resolveColumnById(this,"yValueCumulative",s,"mixed-numeric"):n.resolveColumnById(this,"yValueRaw",s,"mixed-numeric"),crossFilterSelectedValues:a==null?void 0:n.resolveColumnById(this,"selectedRaw",s,"boolean"),invalidData:s.invalidData?.get(this.id),xScale:m,yScale:y,xOffset:(m.bandwidth??0)/2,yOffset:0,indices:I?.indices,isContinuousY:b,labelsEnabled:d.enabled,normalizedTo:f,canIncrementallyUpdate:k,animationEnabled:!this.ctx.animationManager.isSkipped(),xKey:r,yKey:l,xName:o,yName:c,legendItemName:h,markerSize:u.size,markerFill:u.fill??g,markerStroke:u.stroke??p,markerStrokeWidth:u.strokeWidth??this.properties.strokeWidth,yDomain:this.getSeriesDomain("y").domain,nodes:k?A:[],labelData:[],nodeIndex:0}}computeMarkerCoordinate(e,i){let n;(rs(e.normalizedTo)?e.isContinuousY&&jn(i.yDatum):!Number.isNaN(i.yDatum))&&(n=i.yCumulative),i.x=e.xScale.convert(i.xDatum)+e.xOffset,i.y=e.yScale.convert(n),Number.isFinite(i.x)||(i.validPoint=!1)}handleDatum(e,i,n){if(i.xDatum=e.xValues[n],!(i.xDatum===void 0&&!this.properties.allowNullKeys)){if(i.datum=e.rawData[n],i.yDatum=e.yRawValues[n],i.yCumulative=e.yCumulativeValues[n],i.validPoint=jn(i.yDatum)&&e.invalidData?.[n]!==!0,this.computeMarkerCoordinate(e,i),i.crossFilterSelected=e.crossFilterSelectedValues?.[n],i.validPoint){if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const r=e.nodes[e.nodeIndex];r.datum=i.datum,r.datumIndex=n,r.midPoint={x:i.x,y:i.y},r.cumulativeValue=Number(i.yCumulative),r.cumulativeValueExact=i.yCumulative,r.yValue=i.yDatum,r.xValue=i.xDatum,r.point={x:i.x,y:i.y,size:e.markerSize},r.crossFilterSelected=i.crossFilterSelected}else e.nodes.push({series:this,datum:i.datum,datumIndex:n,midPoint:{x:i.x,y:i.y},cumulativeValue:Number(i.yCumulative),cumulativeValueExact:i.yCumulative,yValue:i.yDatum,xValue:i.xDatum,yKey:e.yKey,xKey:e.xKey,point:{x:i.x,y:i.y,size:e.markerSize},fill:e.markerFill,stroke:e.markerStroke,strokeWidth:e.markerStrokeWidth,crossFilterSelected:i.crossFilterSelected});e.nodeIndex++}if(e.labelsEnabled&&i.validPoint){const s=this.getLabelText(i.yDatum,i.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:i.yDatum,datum:i.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName});e.labelData.push({series:this,datum:i.datum,datumIndex:n,x:i.x,y:i.y,labelText:s})}}}populateNodeData(e){const i={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,crossFilterSelected:void 0,x:0,y:0,validPoint:!1};let[n,s]=this.visibleRangeIndices("xValue",e.xAxis.range,e.indices);n=Math.max(n-2,0),s=Math.min(s+2,e.indices?.length??e.xValues.length),this.processedData.input.count<1e3&&(n=0,s=this.processedData.input.count);for(let r=n;r<s;r+=1){const o=e.indices?.[r]??r;this.handleDatum(e,i,o)}}initializeResult(e){const{visibleSameStackCount:i}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return{itemId:e.yKey,fillData:{spans:this.fillSpans,phantomSpans:this.phantomSpans},strokeData:{spans:this.strokeSpans},labelData:e.labelData,nodeData:e.nodes,scales:this.calculateScaling(),visible:this.visible,stackVisible:i>0,crossFiltering:this.properties.selectedKey!=null,styles:jg(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,i){const n=this.chart?.seriesRect;return n==null||(i.segments=$g(this.properties.segmentation,e.xAxis,e.yAxis,n,this.ctx.scene,!1)),i}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[i,n],visible:s,animationEnabled:r}=e,o=this.contextNodeData?.segments,a=this.getHighlightStyle(),l=this.getSelectionStyle(),c=this.getStyle(void 0),h=de(l,a,c),{strokeWidth:u,stroke:d,strokeOpacity:g,lineDash:p,lineDashOffset:f,fill:m,fillOpacity:y,opacity:b}=h;n.setProperties({segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:d,strokeWidth:u,strokeOpacity:g,lineDash:p,lineDashOffset:f,opacity:b,visible:s||r}),n.datum=o,i.setStyleProperties({fill:m,stroke:void 0,fillOpacity:y},this.getShapeFillBBox()),i.setProperties({segments:o,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:b,visible:s||r}),i.datum=o,Hg(this,n),Hg(this,i)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,i){for(const n of e)n.visible=i.visible;if(i.visible)this.updateFillPath(e,i),this.updateStrokePath(e,i);else for(const n of e)n.path.clear(),n.markDirty("AreaSeries")}updateFillPath(e,i){const[n]=e;n.path.clear(),hA(n,i.fillData),n.markDirty("AreaSeries")}updateStrokePath(e,i){const{spans:n}=i.strokeData,[,s]=e;s.path.clear(),Cb(s,n),s.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:i,datumSelection:n}=e,{contextNodeData:s,processedData:r,axes:o,properties:a}=this,{marker:l,styler:c}=a,h=c?this.getStyle(void 0).marker:void 0,u=Tb(a,s,r,o,l,h,this.chart?.isMiniChart);this.hideWithSize0=u.hideWithSize0,l.isDirty()&&(n.clear(),n.cleanup());const d=u.needsNodeData?i:[];return In(this.processedData)?n.update(d,void 0,g=>ei(g.xValue)):n.update(d)}updateDatumStyles(e){const{hideWithSize0:i}=this,{datumSelection:n,isHighlight:s}=e,{marker:r}=this.properties,{itemStyler:o}=r;if(o==null){this.runMarkerStylePass(n,s,{marker:r,hideWithSize0:i,isHighlight:s},{compute:vp.computeNoStylerMarkerStyle,apply:Ur.assignCachedStyle});return}const a={marker:r,hideWithSize0:i,isHighlight:s,dataModel:this.dataModel,processedData:this.processedData};this.runMarkerStylePass(n,s,a,{compute:vp.computeStylerStyle,apply:vp.applyStylerDatum})}updateDatumNodes(e){const{contextNodeData:i,hideWithSize0:n}=this;if(!i)return;const{datumSelection:s,isHighlight:r}=e,o=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),l=this.getDrawingMode(r,e.drawingMode),c=l==="cutout"?void 0:l;s.each((h,u)=>{const d=this.getHighlightState(a,r,u.datumIndex),g=u.style??i.styles[d];this.applyMarkerStyle(g,h,u.point,o,{crossFilterSelected:u.crossFilterSelected,hideWithSize0:n});const p=c??this.resolveMarkerDrawingModeForState(l,g);h.__drawingMode!==p&&(h.drawingMode=p)}),r||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((r,o)=>{const a=sa(this,o,s,this.properties.label,i,n),{enabled:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:g}=a;l&&o?.labelText?(r.fontStyle=c,r.fontWeight=h,r.fontSize=u,r.fontFamily=d,r.textAlign="center",r.textBaseline="bottom",r.text=o.labelText,r.x=o.x,r.y=o.y-10,r.fill=g,r.visible=!0,r.fillOpacity=this.getHighlightStyle(i,o.datumIndex).opacity??1,r.setBoxing(a)):r.visible=!1})}makeStylerParams(e,i,n){const{id:s}=this,{marker:r,fill:o,fillOpacity:a,lineDash:l,lineDashOffset:c,stroke:h,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:p}=this.properties,f=Hr(e??0),m=un(i),y=un(n);return{marker:{fill:r.fill,fillOpacity:r.fillOpacity,size:r.size,shape:r.shape,stroke:r.stroke,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset},highlightState:f,selectionState:m,candidateState:y,fill:o,fillOpacity:a,lineDash:l,lineDashOffset:c,seriesId:s,stroke:h,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:p}}makeItemStylerParams(e,i,n,s){const{xKey:r,yKey:o}=this.properties,a=e.resolveKeysById(this,"xValue",i)[n],l=e.resolveColumnById(this,"yValueRaw",i,"mixed-numeric")[n],c=e.getDomain(this,"xValue","key",i).domain,h=e.getDomain(this,this.yCumulativeKey(i),"value",i).domain,u=this.filterItemStylerFillParams(s.fill)??s.fill;return{...yg(a,l,r,o,c,h),xValue:a,yValue:l,...s,fill:u}}makeLabelFormatterParams(){const{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}=this.properties;return{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}}getTooltipContent(e){const{id:i,dataModel:n,processedData:s,axes:r,properties:o}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=o,g=o.allowNullKeys??!1,p=r.x,f=r.y;if(!n||!s||!p||!f)return;const m=s.dataSources.get(this.id)?.data?.[e],y=n.resolveKeysById(this,"xValue",s)[e],b=n.resolveColumnById(this,"yValueRaw",s,"mixed-numeric")[e];if(y===void 0&&!g)return;const v=this.getStyle(void 0),S=this.makeItemStylerParams(n,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:m},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",y,m,a,d,g),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:c,value:this.getAxisValueText(f,"tooltip",b,m,c,d),missing:$o(b)}]},{seriesId:i,datum:m,title:h,xKey:a,xName:l,yKey:c,yName:h,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,marker:a}=this.getStyle(void 0),l=!a.enabled||a.fill==null,c=l?e:a.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:a.size,shape:a.shape,fill:c,fillOpacity:l?n:a.fillOpacity,stroke:a.stroke}),enabled:a.enabled||r<=0},line:{enabled:!0,stroke:i,strokeOpacity:s,strokeWidth:r,lineDash:o}}}getLegendData(e){if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:e,id:i,itemId:r,legendItemName:a,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:a??o??r},symbol:this.legendItemSymbol(),hideInLegend:!l}]}resetDatumAnimation(e){zg([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:i,labelSelection:n,contextData:s,paths:r}=e,{animationManager:o}=this.ctx;this.updateAreaPaths(r,s),Lb(this,o,...r),Qt([i],Vh),kb(this,o,{...this.getAnimationDrawingModes(),phase:"initial"},i),mt(this,"labels",o,n)}animateReadyResize(e){const{contextData:i,paths:n}=e;this.updateAreaPaths(n,i),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:i}=this.ctx,{datumSelection:n,labelSelection:s,contextData:r,paths:o,previousContextData:a}=e,[l,c]=o;if(r.visible===!1&&a?.visible===!1||l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateAreaPaths(o,r)},u=()=>{i.skipCurrentBatch(),h()};if(r==null||a==null){h(),Fh(this,i,"added",this.getAnimationDrawingModes(),n),Nb(this,"fill_path_properties",i,"add",l),Nb(this,"stroke_path_properties",i,"add",c),mt(this,"labels",i,s);return}if(r.crossFiltering!==a.crossFiltering){u();return}const d=Q2(r,a);if(d===void 0){u();return}else if(d.status==="no-op")return;Fh(this,i,void 0,this.getAnimationDrawingModes(),n),wt(this.id,"fill_path_properties",i,[l],d.fill.pathProperties),Eg(this.id,"fill_path_update",i,[l],d.fill.path),wt(this.id,"stroke_path_properties",i,[c],d.stroke.pathProperties),Eg(this.id,"stroke_path_update",i,[c],d.stroke.path),mt(this,"labels",i,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,r)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mt}getStyle(e){const{styler:i,marker:n,fill:s,fillOpacity:r,lineDash:o,lineDashOffset:a,stroke:l,strokeOpacity:c,strokeWidth:h}=this.properties,{size:u,shape:d,fill:g="transparent",fillOpacity:p}=n;let f={};if(i){const m=this.getDataSelectionState(void 0),y=this.getDataCandidacyState(void 0),b=this.makeStylerParams(e,m,y),v=this.cachedCallWithContext(i,b)??{};f=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],v,{pick:!1})??{}}return f.marker??(f.marker={}),{fill:f.fill??s,fillOpacity:f.fillOpacity??r,lineDash:f.lineDash??o,lineDashOffset:f.lineDashOffset??a,stroke:f.stroke??l,strokeOpacity:f.strokeOpacity??c,strokeWidth:f.strokeWidth??h,marker:{enabled:f.marker.enabled??n.enabled,fill:f.marker.fill??g,fillOpacity:f.marker.fillOpacity??p,shape:f.marker.shape??d,size:f.marker.size??u,lineDash:f.marker.lineDash??n.lineDash??o,lineDashOffset:f.marker.lineDashOffset??n.lineDashOffset??a,stroke:f.marker.stroke??n.stroke??l,strokeOpacity:f.marker.strokeOpacity??n.strokeOpacity??c,strokeWidth:f.marker.strokeWidth??n.strokeWidth??h}}}getFormattedMarkerStyle(e){const i=this.getStyle(void 0),n=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,i.marker);return this.getMarkerStyle(this.properties.marker,e,n,{isHighlight:!0},void 0,i)}isPointInArea(e,i){let n;for(const s of this.backgroundGroup.children())if(s instanceof Rt){n=s;break}return n?.getBBox().containsPoint(e,i)?n.isPointInPath(e,i):!1}computeFocusBounds(e){return Gg(this,e)}hasItemStylers(){return this.properties.selection.enabled||this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};$l.className="AreaSeries",$l.type="area",$l.computeNoStylerMarkerStyle=(t,e,i,n,s)=>{const r=t.getStyle(i);return t.getMarkerStyle(e.marker,s,void 0,{isHighlight:e.isHighlight,highlightState:i,selectionState:n,hideWithSize0:e.hideWithSize0},r.marker,{stroke:r.stroke,strokeWidth:r.strokeWidth,strokeOpacity:r.strokeOpacity})},$l.computeStylerStyle=(t,e,i)=>t.getStyle(i),$l.applyStylerDatum=(t,e,i,n,s,r)=>{const{stroke:o,strokeWidth:a,strokeOpacity:l}=r,c=t.makeItemStylerParams(e.dataModel,e.processedData,i.datumIndex,r.marker);i.style=t.getMarkerStyle(e.marker,i,c,{isHighlight:e.isHighlight,highlightState:n,selectionState:s,hideWithSize0:e.hideWithSize0},r.marker,{stroke:o,strokeWidth:a,strokeOpacity:l})};var oB=$l,aB={series:{nodeClickRange:{$if:[{$path:"/selection/enabled"},10,"nearest"]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",vr],["image",_s],["pattern",Qi]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Oc],["pattern",Qi]]},stroke:{$palette:"stroke"}},label:{...us,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:cf,selection:xr,segmentation:Wu}},mA={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:Qe,dependencies:[gn],options:Rm,predictAxis:Bh,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:aB,create:t=>new oB(t)},lB=.001,Rb=class extends Pt{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(t,e,i,n,s,r,o,a,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(t,e,i,n,s,r,o,a)}get feathered(){return Math.abs(this.featherRatio)>lB}isPointInPath(t,e){return this.feathered?this.getBBox().containsPoint(t,e):super.isPointInPath(t,e)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:t,borderPath:e,__direction:i,__featherRatio:n,__x:s,__y:r,__width:o,__height:a}=this;if(t.clear(),e.clear(),i==="x"){const l=Math.abs(n)*o;n>0?(t.moveTo(s,r),t.lineTo(s+o-l,r),t.lineTo(s+o,r+a/2),t.lineTo(s+o-l,r+a),t.lineTo(s,r+a),t.closePath()):(t.moveTo(s+l,r),t.lineTo(s+o,r),t.lineTo(s+o,r+a),t.lineTo(s+l,r+a),t.lineTo(s,r+a/2),t.closePath())}else{const l=Math.abs(n)*a;n>0?(t.moveTo(s,r+l),t.lineTo(s+o/2,r),t.lineTo(s+o,r+l),t.lineTo(s+o,r+a),t.lineTo(s,r+a),t.closePath()):(t.moveTo(s,r),t.lineTo(s+o,r),t.lineTo(s+o,r+a-l),t.lineTo(s+o/2,r+a),t.lineTo(s,r+a-l),t.closePath())}}renderStroke(t){if(!this.feathered){super.renderStroke(t);return}const{__stroke:e,__strokeWidth:i,__lineDash:n,__lineDashOffset:s,__lineCap:r,__lineJoin:o,path:a}=this;if(e&&i){const{globalAlpha:l}=t;this.applyStrokeAndAlpha(t),t.lineWidth=i,n&&t.setLineDash(n),s&&(t.lineDashOffset=s),r&&(t.lineCap=r),o&&(t.lineJoin=o),t.stroke(a.getPath2D()),t.globalAlpha=l}}};x([Xe()],Rb.prototype,"direction",2),x([Xe()],Rb.prototype,"featherRatio",2);function Wg(t,e){for(const i of e){const n=i.datum;n===void 0?B.error("undefined datum"):t.addValue(i,n)}}function Ug(t,e){const{x:i,y:n}=e,{nearest:s,distanceSquared:r}=t.getQuadTree().find(i,n);if(s!==void 0)return{datum:s.value,distance:Math.sqrt(r)}}var _h=class extends Un{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};x([C],_h.prototype,"direction",2),x([C],_h.prototype,"width",2),x([C],_h.prototype,"widthRatio",2);var yA=class extends Kr{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,n=this.smallestDataInterval==null?Number.NaN:Number(this.smallestDataInterval),s=Be(n)?n*i:0,r=Or(t);if(r==null)return Li([Number.NaN,Number.NaN]);const o=[r[0],r[1]];if(typeof e=="boolean"){const a=e?0:1;o[a]=fc(o[a],(e?1:-1)*s)}else o[0]=fc(o[0],s),o[1]=cu(o[1],s);return Li(o)}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]}getMinimumRangeSeries(t){const{width:e}=this.properties;if(e==null||!this.getCategoryAxis())return;const{index:n}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);t[n]=Math.max(t[n]??0,e)}getMinimumRangeChart(t){if(t.length===0)return 0;const e=this.getCategoryAxis();if(!(e instanceof Og||e instanceof El))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const n=this.getBandScalePadding(),{paddingInner:s=n.inner,paddingOuter:r=n.outer,groupPaddingInner:o}=e.options,a=t.reduce((d,g)=>d+g,0),l=a/t.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=a+o*l*(c-1),u=(i-s+r*2)/(1-s);return h*u}validateCreateNodeDataPreconditions(){const t=this.getCategoryAxis(),e=this.getValueAxis();if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getBandwidth(t,e){return Ge.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval,e):t.scale.bandwidth??0}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,n=this.getBandwidth(e,0),s=Ge.is(i)?n*-.5:0,r=i.convert(t)+s;return[r,r+n]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,n=t.map(s=>i.convert(s));if(n.length===1){const s=i.convert(0);return[Math.min(n[0],s),Math.max(n[0],s)]}return Ot(n)}getBarDimensions(){const t=this.getCategoryAxis(),e=this.getBandwidth(t);this.ctx.seriesStateManager.updateGroupScale(this,e,t);const i=this.getBarWidth(),n=this.getBarOffset(i);let s=this.getGroupOffset();if(this.ctx.domManager.isRtl&&this.seriesGrouping!=null){const r=this.ctx.seriesStateManager.getGroupBandWidth(this);s=e-s-r}return{groupOffset:s,barOffset:n,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(t){const e=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let n=0;Ge.is(i.scale)?n=-t/2:this.seriesGrouping==null&&e?n=(this.getGroupScaleRangeWidth(e)-t)/2:e&&this.properties.widthRatio!=null&&(n=(e.bandwidth-t)/2);const s=this.ctx.seriesStateManager.getStackOffset(this,t);return n+s}getBarWidth(){const{seriesGrouping:t}=this,{width:e}=this.properties;let{widthRatio:i}=this.properties;const n=this.ctx.seriesStateManager.getGroupScale(this),s=n?.bandwidth??0;if(t==null&&(i??(i=1)),i!=null){let r=e;return t==null&&r==null&&n&&(r=this.getGroupScaleRangeWidth(n)),r==null&&s<1&&n?n.rawBandwidth:(r??s)*i}return e??(s<1&&n?n.rawBandwidth:s)}getGroupScaleRangeWidth(t){let e=t.range[1]-t.range[0];return t.round&&e>0&&(e=Math.floor(e)),e}getDatumOffset(t){const e=this.getCategoryAxis();if(!this.processedData?.invalidData||!this.processedData?.missingData||!(e instanceof El&&e.options.skipNullBars))return 0;const i=this.ctx.seriesStateManager.getDatumOffset(this,this.processedData.invalidData,this.processedData.missingData,t);return this.ctx.domManager.isRtl?-i:i}resolveKeyDirection(t){return this.getBarDirection()==="x"?t==="x"?"y":"x":t}initQuadTree(t){Wg(t,this.datumNodesIter())}pickNodeClosestDatum(t){return Ug(this,t)}};function Pb(t,e,i,n,s){if(e.length<Gs)return;const[r,o]=t,{smallestKeyInterval:a,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=s;let u=js(e,r,o,{smallestKeyInterval:a,xNeedsValueOf:l});const d=h?.find(S=>S.maxRange===u);let{indexData:g,valueData:p,negativeIndexData:f,negativeValueData:m}=Hs(e,n,i??n,r,o,u,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.positiveIndexData,reuseValueData:d?.positiveValueData,reuseNegativeIndexData:d?.negativeIndexData,reuseNegativeValueData:d?.negativeValueData});if(!f||!m)throw new Error("Negative aggregation data missing in split mode");let y=gs(u,g,d?.positiveIndices),b=gs(u,f,d?.negativeIndices);const v=[{maxRange:u,positiveIndices:y,positiveIndexData:g,positiveValueData:p,negativeIndices:b,negativeIndexData:f,negativeValueData:m}];for(;u>64;){const S=u,M=Math.trunc(S/2),D=h?.find(k=>k.maxRange===M),I=So(g,p,S,{reuseIndexData:D?.positiveIndexData,reuseValueData:D?.positiveValueData}),A=So(f,m,S,{reuseIndexData:D?.negativeIndexData,reuseValueData:D?.negativeValueData});u=I.maxRange,g=I.indexData,p=I.valueData,y=I.midpointData??gs(u,g,D?.positiveIndices),f=A.indexData,m=A.valueData,b=A.midpointData??gs(u,f,D?.negativeIndices),v.push({maxRange:u,positiveIndices:y,positiveIndexData:g,positiveValueData:p,negativeIndices:b,negativeIndexData:f,negativeValueData:m})}return v.reverse(),v}function cB(t,e,i,n,s){if(e.length<Gs)return;const[r,o]=t,{smallestKeyInterval:a,xNeedsValueOf:l,yNeedsValueOf:c,targetRange:h,existingFilters:u}=s,d=js(e,r,o,{smallestKeyInterval:a,xNeedsValueOf:l}),g=Math.min(d,$a(Math.max(h,Dr))),p=u?.find(M=>M.maxRange===g),{indexData:f,valueData:m,negativeIndexData:y,negativeValueData:b}=Hs(e,n,i??n,r,o,g,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:p?.positiveIndexData,reuseValueData:p?.positiveValueData,reuseNegativeIndexData:p?.negativeIndexData,reuseNegativeValueData:p?.negativeValueData});if(!y||!b)throw new Error("Negative aggregation data missing in split mode");const v={maxRange:g,positiveIndices:gs(g,f,p?.positiveIndices),positiveIndexData:f,positiveValueData:m,negativeIndices:gs(g,y,p?.negativeIndices),negativeIndexData:y,negativeValueData:b};function S(){return Pb([r,o],e,i,n,{smallestKeyInterval:a,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:u})?.filter(D=>D.maxRange!==g)??[]}return{immediate:[v],computeRemaining:S}}function hB(t,e,i,n,s,r,o,a){return Pb([n,s],t,e,i,{smallestKeyInterval:r,xNeedsValueOf:o,yNeedsValueOf:a})}var uB=Zc(hB);function dB(t,e,i,n,s){const r=e.resolveKeysById(n,"xValue",i),o=e.hasColumnById(n,"yValue-start"),a=o?e.resolveColumnById(n,"yValue-start",i,"mixed-numeric"):void 0,l=o?e.resolveColumnById(n,"yValue-end",i,"mixed-numeric"):e.resolveColumnById(n,"yValue-raw",i,"mixed-numeric"),c=e.getDomain(n,"xValue","key",i),h=e.resolveColumnNeedsValueOf(n,"xValue",i),u=e.resolveColumnNeedsValueOf(n,o?"yValue-end":"yValue-raw",i),{values:d,needsValueOf:g}=Cr(t,r,h),{xValues:p,domain:f}=wr(t,d,c),m=u||a==null?a:Ar(a),y=u?l:Ar(l);return s?Pb(f,p,m,y,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:g,yNeedsValueOf:u,existingFilters:s}):uB(p,m,y,f[0],f[1],i.reduced?.smallestKeyInterval,g,u)}function gB(t,e,i,n,s,r){const o=e.resolveKeysById(n,"xValue",i),a=e.hasColumnById(n,"yValue-start"),l=a?e.resolveColumnById(n,"yValue-start",i,"mixed-numeric"):void 0,c=a?e.resolveColumnById(n,"yValue-end",i,"mixed-numeric"):e.resolveColumnById(n,"yValue-raw",i,"mixed-numeric"),h=e.getDomain(n,"xValue","key",i),u=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,a?"yValue-end":"yValue-raw",i),{values:g,needsValueOf:p}=Cr(t,o,u),{xValues:f,domain:m}=wr(t,g,h),y=d||l==null?l:Ar(l),b=d?c:Ar(c);return cB(m,f,y,b,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:p,yNeedsValueOf:d,targetRange:s,existingFilters:r})}var Fb=class extends ln{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};x([C],Fb.prototype,"placement",2),x([C],Fb.prototype,"spacing",2);var ot=class extends _h{constructor(){super(...arguments),this.fill="#c16068",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 Cs,this.label=new Fb,this.tooltip=oa(),this.sparklineMode=!1}};x([C],ot.prototype,"xKey",2),x([C],ot.prototype,"xName",2),x([C],ot.prototype,"yKey",2),x([C],ot.prototype,"yName",2),x([C],ot.prototype,"yFilterKey",2),x([C],ot.prototype,"stackGroup",2),x([C],ot.prototype,"normalizedTo",2),x([C],ot.prototype,"fill",2),x([C],ot.prototype,"fillOpacity",2),x([C],ot.prototype,"stroke",2),x([C],ot.prototype,"strokeWidth",2),x([C],ot.prototype,"strokeOpacity",2),x([C],ot.prototype,"lineDash",2),x([C],ot.prototype,"lineDashOffset",2),x([C],ot.prototype,"cornerRadius",2),x([C],ot.prototype,"crisp",2),x([C],ot.prototype,"styler",2),x([C],ot.prototype,"itemStyler",2),x([C],ot.prototype,"simpleItemStyler",2),x([C],ot.prototype,"shadow",2),x([C],ot.prototype,"label",2),x([C],ot.prototype,"tooltip",2),x([C],ot.prototype,"sparklineMode",2);function bA(t,e,i,n){if(e!=null){const[s,r]=e;if(s!==0||r!==1)return!1}if(Ge.is(t)){const s=t.calcBandwidth(n)-t.calcBandwidth(i);if(s>0&&s<1)return!1}if(Hn.is(t)){const{bandwidth:s,step:r}=t;if(s>0&&s<1)return!1;const o=r-s;if(o>0&&o<1)return!1}return!0}var Vb=t=>Ta(t.yValue??0);function zh(t,e,i){const{startingX:n,startingY:s}=fB(t,e);return{isVertical:t,calculate:(o,a)=>{let l=t?o.x:n,c=t?s:o.y,h=t?o.width:0,u=t?0:o.height;const{opacity:d=1}=o;a&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=a,h=t?a.width:0,u=t?0:a.height,t&&!Vb(a)?c+=a.height:!t&&Vb(a)&&(l+=a.width));let g;return o.clipBBox==null?g=void 0:Vb(o)?g=t?new $(l,c-u,h,u):new $(l-h,c,h,u):g=new $(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:g,opacity:d}},mode:i}}function pB(t,e){return{isVertical:t,calculate:(i,n)=>{let s=t?i.x:i.x+i.width/2,r=t?i.y+i.height/2:i.y,o=t?i.width:0,a=t?0:i.height;return n&&(Number.isNaN(s)||Number.isNaN(r))&&(s=t?n.x:n.x+n.width/2,r=t?n.y+n.height/2:n.y,o=t?n.width:0,a=t?0:n.height),{x:s,y:r,width:o,height:a,clipBBox:i.clipBBox,opacity:i.opacity??1}},mode:e}}function Gh(t,e){const i=o=>o==null||Number.isNaN(o.x)||Number.isNaN(o.y);return{toFn:(o,a,l)=>l==="removed"&&o.datum==null&&t.mode==="fade"?{...jh(o,a),opacity:0}:l==="removed"||i(o.unsafeDatum)?t.calculate(o.unsafeDatum,o.unsafePreviousDatum):{x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1},fromFn:(o,a,l)=>{l==="updated"&&i(o.unsafeDatum)?l="removed":l==="updated"&&i(o.unsafePreviousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(o.previousDatum==null&&t.mode==="fade"?c={...jh(o,a),opacity:0}:c=t.calculate(o.unsafeDatum,o.unsafePreviousDatum),l==="unknown"&&(l=e)):c={x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1};const h=Wn[l];return{...c,phase:h}},applyFn:(o,a,l)=>{o.resetAnimationProperties(a.x,a.y,a.width,a.height,a.opacity??1,a.clipBBox),o.crisp=l==="end"&&(o.datum?.crisp??!1)}}}function fB(t,e){const i=e[t?"y":"x"];let n=1/0,s=0;return i?(t?s=i.scale.convert(Ge.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(Ge.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}function jh(t,{x:e,y:i,width:n,height:s,clipBBox:r,opacity:o=1}){return{x:e,y:i,width:n,height:s,clipBBox:r,opacity:o,crisp:t.datum?.crisp??!1}}function Kg(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const r=s.datum;r!=null&&(s.resetAnimationProperties(r.x,r.y,r.width,r.height,r.opacity??1,r.clipBBox),s.crisp=r.crisp??!1)}e.cleanup()})}}function Bb(t,e){if(e===void 0)return;const{x:i,y:n,width:s,height:r}=e;return Oe.toCanvas(t.contentGroup,new $(i,n,s,r))}function vA(t,e,i,n,s,r,o){let a=r?.reduced?.diff?.[t];if(a?.changed)return a;if(!o)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=mB(n,s);return a==null&&r?.reduced?.diff!=null?(a={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?a.updated=new Set(Array.from(e,({datum:c})=>i(c))):a.added=new Set(Array.from(e,({datum:c})=>i(c)))):l&&(a={changed:!0,added:new Set,updated:new Set(Array.from(e,({datum:c})=>i(c))),removed:new Set,moved:new Set}),a}function xA(t){return typeof t=="object"&&t!==null&&"groupScale"in t}function mB(t,e){if(!e)return!1;const i=t.scales,n=e.scales;if(!Eo(i.x,n.x)||!Eo(i.y,n.y))return!0;if(!xA(t)||!xA(e))return!1;const s=t.groupScale,r=e.groupScale;return!Eo(s,r)}var _b=class extends yA{constructor(t){super({moduleCtx:t,propertyKeys:Vl,propertyNames:Bl,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:jh,label:ra}}),this.properties=new ot,this.connectsToYAxis=!0,this.aggregationManager=new Rg,this.phantomGroup=this.contentGroup.appendChild(new se({name:"phantom",zIndex:-1})),this.phantomSelection=At.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new se({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=At.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(t){if(!this.data)return;const{xKey:e,yKey:i,yFilterKey:n,normalizedTo:s}=this.properties,{seriesGrouping:{groupIndex:r=this.id}={},data:o}=this,l=(this.seriesGrouping?.stackCount??0)>1||s!=null,c=l,h=!this.ctx.animationManager.isSkipped(),u=this.getCategoryAxis()?.scale,d=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),m=this.visible?{}:{forceValue:0},y=this.properties.allowNullKeys??!1,b=[jr(e,p,{id:"xValue",allowNullKey:y}),et(i,f,{id:"yValue-raw",invalidValue:null,...m})],v=[];if(l){const D=`bar-stack-${r}-yValues`,I=`${D}-trailing`;v.push(D,I),b.push(...Qo(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f),...Qo(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:I,separateNegative:!0,...m},f))}if(n!=null&&(b.push(et(n,f,{id:"yFilterValue-raw",invalidValue:null,...m})),l)){const D=`bar-stack-${r}-yFilterValues`,I=`${D}-trailing`;v.push(D,I),b.push(...Qo(n,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f),...Qo(n,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:I,separateNegative:!0,...m},f),$P(this.id,"yValue-raw","yFilterValue-raw"))}g&&b.push(ND,OD),Be(s)&&b.push(gg(v,Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&b.push(fg(this.id,this.processedData)),(h||!c)&&b.push(wh());const{dataModel:S,processedData:M}=await this.requestDataModel(t,o,{props:b,groupByKeys:c,groupByData:!c});this.aggregateData(S,M),this.smallestDataInterval=M.reduced?.smallestKeyInterval,this.largestDataInterval=M.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(t){return t.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return{domain:[]};if(t===this.getCategoryDirection()){const r=i.resolveProcessedDataDefById(this,"xValue"),o=i.getDomain(this,"xValue","key",e);return r?.def.type==="key"&&r.def.valueType==="category"?o:{domain:this.padBandExtent(o.domain)}}let n;if(e.reduced?.filteredValueExceedUnfiltered===!0)n=this.domainForClippedRange(t,["yFilterValue-end"],"xValue");else{const r=this.yCumulativeKey(i);n=this.domainForClippedRange(t,[r],"xValue");const o=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",e).domain:void 0;o!=null&&(n=[Es(n[0],o[0]),ss(n[1],o[1])])}const s=this.getValueAxis();return s instanceof Xs&&!(s instanceof Hl)?{domain:Li(My(n))}:{domain:Li(n)}}getSeriesRange(t,e){if((this.properties.direction==="horizontal"?"x":"y")!==t)return[];const n=this.yCumulativeKey(this.dataModel),[s,r]=this.domainForVisibleRange("y",[n],"xValue",e);return[Ze(Es(s,0)),Ze(ss(r,0))]}getZoomRangeFittingItems(t,e,i){const n=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[n],t,e,i)}getVisibleItems(t,e,i){const n=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[n],t,e,i)}createBucketLookupFeature(){return new zC({series:this,getXAxis:()=>this.axes.x,getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"key",getYColumnId:t=>this.yCumulativeKey(t),canonicalExtremaSlots:[gt]})}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),In(e))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>gB(i.scale.type,t,e,this,n,r),computeFull:r=>dB(i.scale.type,t,e,this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&or.record(`${this.type}:aggregation`,s.map(r=>r.maxRange))}estimateTargetRange(){const t=this.axes.x;if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources?.get(this.id);if(s==null)return;const r=t.scale,o=e.scale,a=Math.abs(r.range[1]-r.range[0]);this.aggregationManager.ensureLevelForRange(a);const l=this.aggregationManager.getFilterForRange(a);this.ensureBucketLookupFeature()?.setActiveFilter(n,l);const c=n.reduced?.filteredValueExceedUnfiltered??!1,h=i.hasColumnById(this,"yValue-start"),{label:u}=this.properties,d=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:g,barOffset:p,barWidth:f}=this.getBarDimensions();let m,y,b;if(c)m=i.resolveColumnById(this,"yFilterValue-start",n,"mixed-numeric"),y=i.resolveColumnById(this,"yFilterValue-end",n,"mixed-numeric"),b=void 0;else{const v=i.hasColumnById(this,"yFilterValue-raw");m=h?i.resolveColumnById(this,"yValue-start",n,"mixed-numeric"):void 0,y=h?i.resolveColumnById(this,"yValue-end",n,"mixed-numeric"):void 0,b=v?i.resolveColumnById(this,"yFilterValue-raw",n,"mixed-numeric"):void 0}return{dataSource:s,rawData:s.data,xValues:i.resolveKeysById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValue-raw",n,"mixed-numeric"),yStartValues:m,yEndValues:y,yFilterValues:b,xScale:r,yScale:o,xAxis:t,yAxis:e,groupOffset:g,barOffset:p,barWidth:f,range:a,yReversed:e.isReversed(),bboxBottom:o.convert(0n),labelSpacing:u.spacing+(typeof u.padding=="number"?u.padding:0),crisp:l==null&&(this.properties.crisp??bA(t?.scale,t?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:h,filteredValueExceedUnfiltered:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:d,phantomNodes:d?this.contextNodeData.phantomNodeData??[]:[],nodes:d?this.contextNodeData.nodeData:[],labels:d?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()==="x",shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:u,yDomain:this.getSeriesDomain("y").domain}}computeXPosition(t,e){const i=t.xScale.convert(t.xValues[e]);return Number.isFinite(i)?i+t.groupOffset+t.barOffset+this.getDatumOffset(e):Number.NaN}prepareNodeDatumState(t,e,i,n,s){if(!jn(s))return;const r=t.xValues[i];if(r===void 0&&!this.properties.allowNullKeys)return;const o=t.dataSource?.data[i],a=t.yRawValues[i],l=t.yFilterValues==null?void 0:Number(t.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=t.label.enabled&&a!=null?this.getLabelText(l??a,o,t.yKey,"y",t.yDomain,t.label,{datum:o,value:l??a,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0,h=a>=0&&!Object.is(a,-0);return e.datum=o,e.xValue=r,e.yRawValue=a,e.yFilterValue=l,e.labelText=c,e.inset=l!=null&&l>a,e.isPositive=h,e.precomputedBottomY=l==null?void 0:t.yScale.convert(n),e.precomputedIsUpward=l==null?void 0:h!==t.yReversed,e}createSkeletonNodeDatum(t,e,i){const n=e.nodeDatumScratch;return{series:this,datum:n.datum,datumIndex:e.datumIndex,cumulativeValue:0,phantom:i,xValue:n.xValue??"",yValue:0,yKey:t.yKey,xKey:t.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:e.opacity,featherRatio:e.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:t.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(t,e){const i=this.prepareNodeDatumState(t,e.nodeDatumScratch,e.datumIndex,e.yStart,e.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const n=this.createSkeletonNodeDatum(t,e,!1);this.updateNodeDatum(t,n,e,i);let s;return i.yFilterValue!=null&&(s=this.createSkeletonNodeDatum(t,e,!0),this.updateNodeDatum(t,s,e)),{nodeData:n,phantomNodeData:s}}updateNodeDatum(t,e,i,n){if(n??(n=this.prepareNodeDatumState(t,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!n)return;const s=e,r=e.phantom,o=i.yStart,a=r?n.yFilterValue:n.yFilterValue??n.yRawValue,l=r?n.yFilterValue:n.yFilterValue??Number(i.yEnd),c=r?n.yFilterValue:n.yFilterValue??i.yEnd,h=r?void 0:n.labelText;let u;r||n.yFilterValue==null?u=i.yEnd:u=Number(i.yStart)+n.yFilterValue;let d;r||n.yFilterValue==null?d=i.yRange:d=Math.max(Number(i.yStart)+n.yFilterValue,Number(i.yRange));let g;r?g=void 0:n.inset?g=.6:g=void 0;const p=n.precomputedIsUpward??n.isPositive!==t.yReversed,f=t.yScale.convert(u),m=n.precomputedBottomY??t.yScale.convert(o),y=t.yScale.convert(d),b=i.width*.5*(1-(g??1)),v=t.barAlongX?Math.min(f,m):i.x+b,S=t.barAlongX?i.x+b:Math.min(f,m),M=t.barAlongX?Math.abs(m-f):i.width*(g??1),D=t.barAlongX?i.width*(g??1):Math.abs(m-f),I=t.barAlongX?Math.min(t.bboxBottom,y):i.x+b,A=t.barAlongX?i.x+b:Math.min(t.bboxBottom,y),k=t.barAlongX?Math.abs(t.bboxBottom-y):i.width*(g??1),T=t.barAlongX?i.width*(g??1):Math.abs(t.bboxBottom-y);s.datum=n.datum,s.datumIndex=i.datumIndex,s.cumulativeValue=l,s.cumulativeValueExact=c,s.xValue=n.xValue,s.yValue=a,s.x=I,s.y=A,s.width=k,s.height=T;const R=s.midPoint;R.x=v+M/2,R.y=S+D/2;const E=t.shouldFlipXY?D:M;s.capDefaults.lengthRatioMultiplier=E,s.capDefaults.lengthMax=E,s.opacity=i.opacity,s.featherRatio=i.featherRatio,s.topLeftCornerRadius=t.barAlongX!==p,s.topRightCornerRadius=p,s.bottomRightCornerRadius=t.barAlongX===p,s.bottomLeftCornerRadius=!p;const F=s.clipBBox;if(F?(F.x=v,F.y=S,F.width=M,F.height=D):s.clipBBox=new $(v,S,M,D),s.crisp=t.crisp,h==null)s.label=void 0;else{const N=VC({isUpward:p,isVertical:!t.barAlongX,placement:t.label.placement,spacing:t.labelSpacing,rect:{x:v,y:S,width:M,height:D}}),P=s.label;P?(P.text=h,P.x=N.x,P.y=N.y,P.textAlign=N.textAlign,P.textBaseline=N.textBaseline):s.label={text:h,...N}}s.missing=$o(a)}createNodeDataWithAggregation(t,e,i){const n=t.yReversed?-1:1;for(let s=0;s<2;s+=1){const r=s===0,o=r?t.dataAggregationFilter.positiveIndices:t.dataAggregationFilter.negativeIndices,a=r?t.dataAggregationFilter.positiveIndexData:t.dataAggregationFilter.negativeIndexData,l=r?Et:gt,c=r?gt:Et,h=this.visibleRangeIndices("xValue",t.xAxis.range,o),u=h[0],d=h[1];for(let g=u;g<d;g+=1){const p=g*Di,f=a[p+dt],m=a[p+St],y=a[p+l],b=a[p+c];if(f===zc||t.xValues[b]==null||t.xValues[y]==null)continue;const v=e(Math.trunc((f+m)/2)),S=Math.abs(e(m)-e(f))+t.barWidth;if(v-S<0||v>t.range)continue;const M=Math.abs(m-f)+1,D=Hn.is(t.xScale)?Math.min(t.xScale.bandwidth*Math.max(M-1,1)/(t.xScale.step*M),1):1;if(i.datumIndex=b,i.x=v,i.width=S,i.opacity=D,t.isStacked)i.yStart=t.yStartValues[y],i.yEnd=t.yEndValues[b],i.featherRatio=0;else{const I=t.yRawValues[b],A=t.yRawValues[y];i.yStart=0,i.yEnd=I,i.featherRatio=(r?1:-1)*n*(1-Ze(A)/Ze(I))}i.yRange=i.yEnd,this.upsertNodeDatum(t,i)}}}createNodeDataGrouped(t,e,i){const n=this.processedData,s=n.invalidData?.get(this.id),r=t.barWidth;let o;t.filteredValueExceedUnfiltered?o=this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):t.isStacked?o=this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):o=-1;const a=n.columnScopes.findIndex(d=>d.has(this.id)),l=n.groups,c=kh(1,l.length,t.xAxis.range,d=>{const p=l[d].keys[0];return this.xCoordinateRange(p)}),h=c[0],u=c[1];for(let d=h;d<u;d+=1){const g=l[d],p=g.aggregation,f=g.datumIndices[a];if(f!=null)for(const m of f){const y=d+m,b=e(y);if(s?.[y]===!0)continue;const v=t.yRawValues[y];if(v==null)continue;const S=v>=0&&!Object.is(v,-0),M=co(v),D=t.isStacked?t.yStartValues?.[y]??M:M,I=t.isStacked?t.yEndValues?.[y]:v;let A=I;t.isStacked&&(A=p[o][S?1:0]),i.datumIndex=y,i.x=b,i.width=r,i.yStart=D,i.yEnd=I,i.yRange=A,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}}createNodeDataSimple(t,e,i){const n=this.processedData.invalidData?.get(this.id),s=t.barWidth,r=this.visibleRangeIndices("xValue",t.xAxis.range);let o=r[0],a=r[1];this.processedData.input.count<1e3&&(o=0,a=this.processedData.input.count);for(let l=o;l<a;l+=1){if(n?.[l]===!0)continue;const c=t.yRawValues[l];if(c==null)continue;const h=e(l),u=c;i.datumIndex=l,i.x=h,i.width=s,i.yStart=co(u),i.yEnd=u,i.yRange=u,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}upsertNodeDatum(t,e){const i=t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length,n=t.yFilterValues!=null,s=n&&t.canIncrementallyUpdate&&t.phantomIndex<t.phantomNodes.length;let r,o;if(i)r=t.nodes[t.nodeIndex],this.updateNodeDatum(t,r,e),t.nodeIndex>=t.labels.length&&t.labels.push(r);else{const a=this.createNodeDatum(t,e);a.nodeData&&(t.nodes.push(a.nodeData),t.labels.push(a.nodeData)),o=a.phantomNodeData}if(t.nodeIndex++,!n)return{nodeData:t.nodes[t.nodeIndex]};if(s)o=t.phantomNodes[t.phantomIndex],this.updateNodeDatum(t,o,e);else if(o)t.phantomNodes.push(o);else{const a=this.createNodeDatum(t,e);a.phantomNodeData&&t.phantomNodes.push(a.phantomNodeData)}return t.phantomIndex++,{nodeData:r,phantomNodeData:o}}populateNodeData(t){const e=n=>this.computeXPosition(t,n),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};t.dataAggregationFilter!=null?this.createNodeDataWithAggregation(t,e,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(t,e,i):this.createNodeDataSimple(t,e,i)}initializeResult(t){return{itemId:this.properties.yKey,nodeData:t.nodes,phantomNodeData:t.phantomNodes,labelData:t.labels,scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:_y(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(t){t.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(t.nodes,t.nodeIndex),this.trimIncrementalNodeArray(t.phantomNodes,t.phantomIndex),this.trimIncrementalNodeArray(t.labels,t.nodes.length))}assembleResult(t,e){const i=this.chart?.seriesRect;return i==null||(e.segments=$g(this.properties.segmentation,t.xAxis,t.yAxis,i,this.ctx.scene)),e}nodeFactory(){return new Rb}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(t){const e=super.updateHighlightSelectionItem(t),i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:s?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],s)??[]:[],datumSelection:this.phantomHighlightSelection}),e}updateNodes(t,e){super.updateNodes(t,e),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(t,e){const i=t.find(n=>n.datum===e.datum);return i==null?void 0:[{...i}]}updateDatumSelection(t){return In(this.processedData)?t.datumSelection.update(t.nodeData,void 0,this.getDatumId.bind(this)):t.datumSelection.update(t.nodeData)}makeStylerParams(t,e,i){const{id:n}=this,{cornerRadius:s,fill:r,fillOpacity:o,lineDash:a,lineDashOffset:l,stackGroup:c,stroke:h,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:p}=this.properties,f=Hr(t??0),m=un(e),y=un(i);return{cornerRadius:s,fill:r,fillOpacity:o,highlightState:f,selectionState:m,candidateState:y,lineDash:a,lineDashOffset:l,seriesId:n,stackGroup:c,stroke:h,strokeOpacity:u,strokeWidth:d,xKey:g,yKey:p}}makeItemStylerParams(t,e,i,n,s,r){const{id:o}=this,{xKey:a,yKey:l,stackGroup:c}=this.properties,h=e.dataSources.get(o)?.data?.[i],u=t.resolveColumnById(this,"yValue-raw",e,"mixed-numeric")[i],d=t.getDomain(this,"xValue","key",e).domain,g=t.getDomain(this,this.yCumulativeKey(t),"value",e).domain,p=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(p,s,i),m=this.getSelectionStateString(i),y=this.getCandidateStateString(i),b=this.filterItemStylerFillParams(r.fill)??r.fill;return{seriesId:o,...yg(n,u,a,l,d,g),datum:h,xValue:n,yValue:u,stackGroup:c,highlightState:f,selectionState:m,candidateState:y,...r,fill:b}}getStyle(t,e,i,n){const{cornerRadius:s,fill:r,fillOpacity:o,lineDash:a,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:u,styler:d}=this.properties;let g={};if(!t&&d){const p=this.makeStylerParams(e,i,n);g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(d,p)??{},{pick:!1})??{}}return{cornerRadius:g.cornerRadius??s,fill:g.fill??r,fillOpacity:g.fillOpacity??o,lineDash:g.lineDash??a,lineDashOffset:g.lineDashOffset??l,opacity:1,stroke:g.stroke??c,strokeOpacity:g.strokeOpacity??h,strokeWidth:g.strokeWidth??u}}getItemStyle(t,e,i,n,s){const{properties:r,dataModel:o,processedData:a}=this,{itemStyler:l,simpleItemStyler:c}=r,h=this.getHighlightStyle(e,t,i),u=this.getSelectionStyle(t,n,s);if(c&&a!=null&&t!=null){const g=a.dataSources.get(this.id)?.data?.[t],p=c(g);return de(p,u,h,this.getStyle(!1,i,n,s))}let d=de(h,u,this.getStyle(t===void 0,i,n,s));if(l&&o!=null&&a!=null&&t!=null){const g=o.resolveKeysById(this,"xValue",a)[t],p=this.cachedDatumCallback(ei(this.getDatumId({xValue:g,phantom:!1}),e?"highlight":"node"),()=>{const f=this.makeItemStylerParams(o,a,t,g,e,d);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(l,f))});p&&(d=de(p,d))}return d}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight(),i=this;function n(s,r){if(!t.datumSelection.isGarbage(s)){const o=i.getHighlightState(e,t.isHighlight,r.datumIndex),a=i.getDataSelectionState(r.datumIndex),l=i.getDataCandidacyState(r.datumIndex);r.style=i.getItemStyle(r.datumIndex,t.isHighlight,o,a,l)}}t.datumSelection.each(n)}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getCategoryDirection()==="x",r=this.getShapeFillBBox(),o=this.getBarDirection(),{drawingMode:a,isHighlight:l}=t,c=this,h=e.styles;function u(d,g){const p=g.style??h[c.getHighlightState(i,l,g.datumIndex)];d.setStyleProperties(p,r);const f=p.cornerRadius??0,m=s?(g.clipBBox?.width??g.width)>0:(g.clipBBox?.height??g.height)>0;d.setStaticProperties(a,g.topLeftCornerRadius?f:0,g.topRightCornerRadius?f:0,g.bottomRightCornerRadius?f:0,g.bottomLeftCornerRadius?f:0,m,g.crisp,n,o,g.featherRatio)}t.datumSelection.each(u)}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey},n=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((s,r)=>{s.fillOpacity=this.getHighlightStyle(e,r?.datumIndex).opacity??1,FC(this,s,i,this.properties.label,r.label,{isHighlight:e,activeHighlight:n})})}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=s,d=s.allowNullKeys??!1,g=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!n||!g||!p)return;const f=n.dataSources.get(this.id)?.data?.[t],m=i.resolveKeysById(this,"xValue",n)[t],y=i.resolveColumnById(this,"yValue-raw",n,"mixed-numeric")[t];if(m===void 0&&!d)return;const b=this.getItemStyle(t,!1,void 0,void 0,void 0);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",m,f,r,c,d),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:this.getAxisValueText(p,"tooltip",y,f,a,c),missing:$o(y)}]},{seriesId:e,datum:f,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:r,lineDashOffset:o}=this.getStyle(!1,0,void 0,void 0);return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:r,lineDashOffset:o}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:o,legendItemName:a}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:a??o??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!e}]}resetDatumAnimation(t){Kg([t.datumSelection,this.phantomSelection])}animateReadyHighlight(t){Kg([t,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const{phantomSelection:n}=this,s=Gh(zh(this.isVertical(),this.axes,"normal"),"unknown");wt(this.id,"nodes",this.ctx.animationManager,[t,n],s),mt(this,"labels",this.ctx.animationManager,e),mt(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{phantomSelection:e}=this,{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:r,previousContextData:o}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=vA(this.id,i,this.getDatumId.bind(this),t.contextData,o,this.processedData,this.processedDataUpdated),l=o==null?"fade":"normal",c=Gh(zh(this.isVertical(),this.axes,l),"added");wt(this.id,"nodes",this.ctx.animationManager,[i,e],c,h=>this.getDatumId(h.unsafeDatum),a),(!a||a?.changed||!Eo(r.groupScale,o?.groupScale))&&(mt(this,"labels",this.ctx.animationManager,n),mt(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return ei(t.xValue,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return Bb(this,e)}hasItemStylers(){return this.properties.selection.enabled||this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};_b.className="BarSeries",_b.type="bar";var yB={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",vr],["image",_s],["pattern",Qi]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...us,padding:{$isUserOption:["./spacing",0,8]},enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},highlight:Ec,selection:xr,segmentation:Wu}},SA={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:Qe,dependencies:[gn],options:ml,predictAxis:Bh,defaultAxes:B0,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:yB,create:t=>new _b(t)};function zb(t,e,i){if(i.length<2||e.fills.length===0)return;const n=[i[0],i.at(-1)],s=e.domain??n,{domain:r,range:o}=Ax(e.fills,s,e.mode);t.mode=e.mode,t.domain=r,t.range=o,t.displayDomain=s,t.update()}function bB(t,e){const{domain:i,range:n,mode:s,displayDomain:r}=t;if(n.length===0)return;const[o,a]=r?[Ze(r[0]),Ze(r[1])]:[i[0],i.at(-1)],l=a-o||1,c=[];for(let h=0;h<n.length;h++){const u=e[h]?.name;if(u==null)continue;const g=((s==="discrete"?(i[h]+i[h+1])/2:i[h])-o)/l;g<0||g>1||c.push({position:g,label:u})}return c.length>0?c:void 0}function vB(t,e,i){if(t.length===0)return t;const n=t[0],s=t.at(-1);if(n.stop>=0&&s.stop<=1)return t;const r=[{stop:0,color:e}];for(const o of t)o.stop>0&&o.stop<1&&r.push(o);return r.push({stop:1,color:i}),r}function Gb(t,e,i,n,s){const{domain:r,displayDomain:o,mode:a}=t,l=o?[Ze(o[0]),Ze(o[1])]:[r[0],r.at(-1)],c=wx(t),h=a==="continuous"?vB(c,t.convert(l[0]),t.convert(l[1])):c;return{legendType:"gradient",enabled:n,seriesId:i,series:s,colorStops:h,axisDomain:l,namedLabels:bB(t,e)}}function jb(t){return{formatManager:t.ctx.formatManager,formatInContext:t.callWithContext.bind(t),key:"colorKey"in t.properties?t.properties.colorKey:void 0,legendItemName:"legendItemName"in t.properties?t.properties.legendItemName:void 0,boundSeries:t.getFormatterContext("color")}}function xB(t,e,{formatManager:i,formatInContext:n,key:s,legendItemName:r,boundSeries:o}){const{domain:a}=t;return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:e,legendItemName:r,key:s,source:"gradient-legend",property:"color",domain:a,boundSeries:o,fractionDigits:c,visibleDomain:void 0};return i.format(n,h)??i.defaultFormat(h)}}function Hb(t,e,i,n,s,r="square"){const{domain:o,range:a}=t;if(a.length===0)return[];const l=xB(t,i,s);return a.map((c,h)=>{const u=o[h],d=o[h+1],g=e[h]?.name;return{legendType:"category",id:i,itemId:h,seriesId:i,enabled:n,symbol:{marker:{shape:r,fill:c,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1}},label:{text:g??Lp(u,d,h,a.length,l)},isFixed:!0,hideToggleOtherSeries:!0,suppressHighlight:!0}})}var Yg=3,SB=5,MA=.05;function MB(t,e,i){const{xValues:n,yValues:s,xDomain:r,yDomain:o,xNeedsValueOf:a,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:u,y1:d}=i;let g=0,p=1/0;const f=(c+u)/2,m=(h+d)/2;for(const y of e){const b=n[y],v=s[y];if(b==null||v==null)continue;const S=bn(b,r.min,r.max,a),M=bn(v,o.min,o.max,l),D=(S-f)**2+(M-m)**2;D<p&&(p=D,g=y)}return g}function IB(t,e,i){const{xValues:n,yValues:s,xDomain:r,yDomain:o,xNeedsValueOf:a,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:u,y1:d}=i;let g=0;for(const p of e){const f=n[p],m=s[p];if(f==null||m==null)continue;const y=bn(f,r.min,r.max,a),b=bn(m,o.min,o.max,l);y>=c&&y<=u&&b>=h&&b<=d&&(g+=1)}return g}function DB(t,e,i){const{xValues:n,yValues:s,xDomain:r,yDomain:o,xNeedsValueOf:a,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:u,y1:d}=i,g=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],p=(c+u)/2,f=(h+d)/2;for(const y of e){const b=n[y],v=s[y];if(b==null||v==null)continue;const S=bn(b,r.min,r.max,a),M=bn(v,o.min,o.max,l),D=(S>p?1:0)+(M>f?2:0),I=g[D];I.indices.push(y),I.x0=Math.min(I.x0,S),I.y0=Math.min(I.y0,M),I.x1=Math.max(I.x1,S),I.y1=Math.max(I.y1,M)}const m=[];for(const y of g){const{indices:b,x0:v,x1:S,y0:M,y1:D}=y;if(b.length===0)continue;const I=$b(t,b,{x0:v,y0:M,x1:S,y1:D});m.push(I)}return m}function $b(t,e,i){const{x0:n,y0:s,x1:r,y1:o}=i;let l=e.length<SB&&r-n<MA&&o-s<MA||n===r&&s===o?null:DB(t,e,i);if(l?.length===1)return l[0];l?.length===0&&(l=null);const c=Math.hypot(r-n,o-s),h=MB(t,e,i);return{scale:c,x0:n,y0:s,x1:r,y1:o,indices:e,primaryDatumIndex:h,children:l}}function CB(t,e,i,n,s,r,o){const[a,l]=t,[c,h]=e,[u,d]=r,{xNeedsValueOf:g,yNeedsValueOf:p}=o,f={xValues:i,yValues:n,xDomain:{min:a,max:l},yDomain:{min:c,max:h},xNeedsValueOf:g,yNeedsValueOf:p},m=[];if(s!=null&&d>u){const y=Array.from({length:Yg},()=>[]);for(let b=0;b<s.length;b+=1){const S=(s[b]-u)/(d-u),M=Math.trunc(S*Yg);M>=0&&M<Yg&&y[M].push(b)}for(let b=0;b<y.length;b+=1){const v=y[b],S=$b(f,v,{x0:0,y0:0,x1:1,y1:1});if(S!=null){const M=b/Yg;m.push({sizeRatio:M,node:S})}}}else{const y=i.map((v,S)=>S),b=$b(f,y,{x0:0,y0:0,x1:1,y1:1});b!=null&&m.push({sizeRatio:0,node:b})}return m.length>0?{xValues:i,yValues:n,xd0:a,xd1:l,yd0:c,yd1:h,filters:m,xNeedsValueOf:g,yNeedsValueOf:p}:void 0}function AB(t,e,i,n,s,r,o,a,l){const[c,h]=s,[u,d]=td(t,r);return CB([c,h],[u,d],e,i,n,[o[0],o[1]],{xNeedsValueOf:a,yNeedsValueOf:l})}function wB(t,e,i,n,s,r,o){const a=i.resolveColumnById(o,"xValue",n,"object"),l=i.resolveColumnById(o,"yValue",n,"mixed-numeric"),c=r?Ar(i.resolveColumnById(o,"sizeValue",n,"mixed-numeric")):void 0,h=i.getDomain(o,"xValue","value",n),u=i.getDomain(o,"yValue","value",n),d=r?s.domain:[0,0],g=i.resolveColumnNeedsValueOf(o,"xValue",n),p=i.resolveColumnNeedsValueOf(o,"yValue",n),{values:f,needsValueOf:m}=Cr(t,a,g),{xValues:y,domain:b}=wr(t,f,h),v=p?l:Ar(l);return AB(e,y,v,c,b,u,d,m,p)}function IA(t,e,i,n,s,r){const{xRange:o,yRange:a,xVisibleRange:[l,c],yVisibleRange:[h,u],minSize:d,maxSize:g}=i,{xValues:p,yValues:f,xd0:m,xd1:y,yd0:b,yd1:v,xNeedsValueOf:S,yNeedsValueOf:M}=e,D=1/Math.min(o/(c-l),a/(u-h)),I={xValues:p,yValues:f,xDomain:{min:m,max:y},yDomain:{min:b,max:v},xNeedsValueOf:S,yNeedsValueOf:M};for(const{sizeRatio:A,node:k}of e.filters){const T=.5*(d+A*(g-d)),R=T*D,E=t*R,F=l-T/o,N=c+T/o,P=h-T/a,z=u+T/a,Y=[k];for(;Y.length>0;){const j=Y.pop();if(!(j.x1<F||j.x0>N||j.y1<P||j.y0>z))if(t!==1&&j.scale<=E)n!=null&&(n.count+=1),s?.push({datumIndex:j.primaryDatumIndex,count:j.indices.length,area:(j.x1-j.x0)*(j.y1-j.y0),dilation:J(1,j.scale/R,t),indices:j.indices});else if(j.children==null){const{indices:ie}=j;if(n!=null){const ae=j.x0>=l&&j.x1<=c&&j.y0>=h&&j.y1<=u?ie.length:IB(I,ie,{x0:l,y0:h,x1:c,y1:u});n.count+=ae}r?.push(...ie)}else Y.push(...j.children)}}}function Zg(t,e,i){const n={count:0};return IA(t,e,i,n,void 0,void 0),n.count}var kB=100,TB=12;function LB(t,e,i){if(Zg(1,t,e)<=i)return 1;let n=1,s=2;for(;Zg(s,t,e)>i&&s<kB;)n*=2,s*=2;for(let r=0;r<TB;r+=1){const o=(s+n)/2;Zg(o,t,e)>i?n=o:s=o}return(n+s)/2}function NB(t,e,i){const n=[],s=[];return IA(t,e,i,void 0,n,s),{groupedAggregation:n,singleDatumIndices:s}}var Wb=class extends Ni{constructor(){super(...arguments),this.maxSize=30}};x([C,H()],Wb.prototype,"maxSize",2),x([C,Om()],Wb.prototype,"sizeDomain",2);var DA=class extends ln{constructor(){super(...arguments),this.placement="top"}};x([C],DA.prototype,"placement",2);var Ke=class extends Un{constructor(){super(...arguments),this.colorScale=new Vo,this.label=new DA,this.tooltip=oa(),this.maxRenderedItems=1/0,this.marker=new Wb}};x([C],Ke.prototype,"xKey",2),x([C],Ke.prototype,"yKey",2),x([C],Ke.prototype,"sizeKey",2),x([C],Ke.prototype,"labelKey",2),x([C],Ke.prototype,"colorKey",2),x([C],Ke.prototype,"selectedKey",2),x([C],Ke.prototype,"xName",2),x([C],Ke.prototype,"yName",2),x([C],Ke.prototype,"sizeName",2),x([C],Ke.prototype,"labelName",2),x([C],Ke.prototype,"colorName",2),x([C],Ke.prototype,"colorScale",2),x([C],Ke.prototype,"title",2),x([Hi("marker.shape")],Ke.prototype,"shape",2),x([Hi("marker.fill")],Ke.prototype,"fill",2),x([Hi("marker.fillOpacity")],Ke.prototype,"fillOpacity",2),x([Hi("marker.stroke")],Ke.prototype,"stroke",2),x([Hi("marker.strokeWidth")],Ke.prototype,"strokeWidth",2),x([Hi("marker.strokeOpacity")],Ke.prototype,"strokeOpacity",2),x([Hi("marker.lineDash")],Ke.prototype,"lineDash",2),x([Hi("marker.lineDashOffset")],Ke.prototype,"lineDashOffset",2),x([Hi("marker.itemStyler")],Ke.prototype,"itemStyler",2),x([C],Ke.prototype,"styler",2),x([C],Ke.prototype,"label",2),x([C],Ke.prototype,"tooltip",2),x([C],Ke.prototype,"maxRenderedItems",2);var Xg=class extends Ke{};x([Hi("marker.size")],Xg.prototype,"minSize",2),x([Hi("marker.maxSize")],Xg.prototype,"maxSize",2),x([Hi("marker.sizeDomain")],Xg.prototype,"sizeDomain",2);var CA=class extends Ke{};x([Hi("marker.size")],CA.prototype,"size",2);function Ub(t,e,i,n){const s=t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length;let r;return s?(r=t.nodes[t.nodeIndex],n(t,r,e)):(r=i(t,e),r!=null&&t.nodes.push(r)),t.nodeIndex++,r}var OB=class extends vg{constructor(t,e,i,n,s){super(t,e,i,n,s),this.sizeKey=n.properties.sizeKey,this.colorKey=n.properties.colorKey}},aa=class tu extends Kr{constructor(e){super({moduleCtx:e,propertyKeys:{...Vl,label:["labelKey"],size:["sizeKey"],color:["colorKey"]},propertyNames:{...Bl,label:["labelName"],size:["sizeName"],color:["colorName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:ra,datum:_g},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=OB,this.properties=new Xg,this.dataAggregation=void 0,this.aggregateIndexSet=void 0,this.sizeScale=new Zo,this.colorScale=new Rr,this.colorScaleValid=!1,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(e){if(this.data==null||!this.visible)return;const i=this.axes.x?.scale,n=this.axes.y?.scale,{xScaleType:s,yScaleType:r}=this.getScaleInformation({xScale:i,yScale:n}),o=this.sizeScale.type,a=this.colorScale.type,{xKey:l,yKey:c,sizeKey:h,selectedKey:u,labelKey:d,colorKey:g,marker:p}=this.properties,f=this.properties.allowNullKeys??!1,{dataModel:m,processedData:y}=await this.requestDataModel(e,this.data,{props:[et(l,s,{id:"xValue",allowNullKey:f}),et(c,r,{id:"yValue",allowNullKey:f}),...u==null?[]:[et(u,"category",{id:"selectedValue"})],...h?[et(h,o,{id:"sizeValue"})]:[],...d?[et(d,"category",{id:"labelValue"})]:[],...g?[et(g,a,{id:"colorValue",invalidValue:void 0})]:[]]}),b=h?m.resolveProcessedDataIndexById(this,"sizeValue"):void 0,v=p.sizeDomain?[p.sizeDomain[0],p.sizeDomain[1]]:void 0;if(this.sizeScale.domain=v??(b==null?void 0:y.domain.values[b])??[],this.colorScaleValid=!1,g){const S=m.resolveProcessedDataIndexById(this,"colorValue"),M=y.domain.values[S].filter(I=>I!=null),D=Or(M);D!=null&&(zb(this.colorScale,this.properties.colorScale,D),this.colorScaleValid=!0)}this.dataAggregation=this.aggregateData(m,y),this.animationState.transition("updateData")}isColorScaleValid(){return this.colorScaleValid}resolveScaledSize(e){const{properties:i,sizeScale:n}=this,{sizeKey:s,marker:r}=i;if(s==null)return r.size;const a=this.dataModel.resolveColumnById(this,"sizeValue",this.processedData,"number")[e];return a==null?this.getSizeRange()[0]:n.convertClamped(a)}xCoordinateRange(e,i,n){const s=this.axes.x.scale.convert(e),r=.5*this.resolveScaledSize(n)*i;return[s-r,s+r]}yCoordinateRange(e,i,n){const s=this.axes.y.scale.convert(e[0]),r=.5*this.resolveScaledSize(n)*i;return[s-r,s+r]}getSeriesDomain(e){const{dataModel:i,processedData:n}=this;if(!n||!i)return{domain:[]};const s={x:"xValue",y:"yValue"},r=s[e],o=i.resolveProcessedDataDefById(this,r),a=i.getDomain(this,r,"value",n);if(o?.def.type==="value"&&o?.def.valueType==="category")return{domain:a.domain};const c=s[e==="x"?"y":"x"],h=this.domainForClippedRange(e,[r],c);return{domain:Li(Or(h))}}getSeriesRange(e,i){const[n,s]=this.domainForVisibleRange("y",["yValue"],"xValue",i);return[Ze(n),Ze(s)]}getVisibleItems(e,i,n){const{dataAggregation:s,axes:r}=this,o=r.x,a=r.y;if(s==null||o==null||a==null)return this.countVisibleItems("xValue",["yValue"],e,i,n);const l=this.aggregationOptions(o,a,e,i??[0,1]);return Zg(0,s,l)}createBucketLookupFeature(){return new GC({series:this,dataSelectionService:this.ctx.dataSelectionService,getIndexSetMap:()=>this.aggregateIndexSet})}aggregateData(e,i){if(i.type==="grouped"||i.input.count-this.invalidDataCount()-this.missingDataCount()<=this.properties.maxRenderedItems)return;const s=this.axes.x,r=this.axes.y;if(s==null||r==null)return;const o=s.scale,a=r.scale;if(!(!Ge.is(o)||!Ge.is(a)))return wB(o.type,a.type,e,i,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(e,i,n=e.visibleRange,s=i.visibleRange){const{processedData:r,dataModel:o}=this,{sizeKey:a}=this.properties,[l,c]=this.getSizeRange(),h=Math.abs(e.range[1]-e.range[0]),u=Math.abs(i.range[1]-i.range[0]),d=Math.max(l,1),g=a?Math.max(c,1):d,p=e.scale,f=i.scale;return r!=null&&o!=null&&(Ge.is(p)&&(n=Od(n,p.domain.map(ii),o.getDomain(this,"xValue","value",r).domain.map(ii))),Ge.is(f)&&(s=Od(s,f.domain.map(ii),o.getDomain(this,"yValue","value",r).domain.map(ii)))),{xRange:h,yRange:u,minSize:d,maxSize:g,xVisibleRange:n,yVisibleRange:s}}createNodeDatumContext(e,i){const{dataModel:n,processedData:s,sizeScale:r,visible:o}=this;if(!n||!s)return;const a=s.dataSources.get(this.id)?.data;if(a==null)return;const{xKey:l,yKey:c,sizeKey:h,selectedKey:u,labelKey:d,colorKey:g,xName:p,yName:f,sizeName:m,labelName:y,colorName:b,label:v,legendItemName:S,marker:M}=this.properties,D=e.scale,I=i.scale,A=s.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let k;d?k=[]:h?k=n.getDomain(this,"sizeValue","value",s).domain:k=[];const T=n.resolveColumnById(this,"xValue",s,"object");return{xAxis:e,yAxis:i,rawData:a,xValues:T,xDataValues:T,yDataValues:n.resolveColumnById(this,"yValue",s,"object"),sizeDataValues:h==null?void 0:n.resolveColumnById(this,"sizeValue",s,"number"),labelDataValues:d==null?void 0:n.resolveColumnById(this,"labelValue",s,"object"),crossFilterSelectedDataValues:u==null?void 0:n.resolveColumnById(this,"selectedValue",s,"boolean"),colorDataValues:g==null?void 0:n.resolveColumnById(this,"colorValue",s,"number"),xScale:D,yScale:I,sizeScale:r,xOffset:(D.bandwidth??0)/2,yOffset:(I.bandwidth??0)/2,xKey:l,yKey:c,sizeKey:h,labelKey:d,colorKey:g,xName:p,yName:f,sizeName:m,labelName:y,colorName:b,legendItemName:S,labelsEnabled:v.enabled,labelPlacement:v.placement,labelAnchor:Mt.anchor(M.shape),labelTextDomain:k,labelPadding:Ml(v),labelTextMeasurer:Zt(v),label:v,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:o,canIncrementallyUpdate:A,nodes:A?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(e){this.sizeScale.range=this.getSizeRange();const i={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,colorValue:void 0,x:0,y:0,crossFilterSelected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0};this.aggregateIndexSet=void 0;const{dataAggregation:n}=this;n==null?this.createNodeDataSimple(e,i):this.createNodeDataWithAggregation(e,i,e.xAxis,e.yAxis,n)}initializeResult(e){const{marker:i}=this.properties;return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,styles:jg(this,this.properties,i)}}upsertBubbleNodeDatum(e,i,n){this.prepareNodeDatumState(e,i,n)&&Ub(e,{scratch:i,datumIndex:n},(s,r)=>{const o=this.createSkeletonNodeDatum(s,r.scratch,r.datumIndex);return this.updateNodeDatum(s,o,r.scratch,r.datumIndex),o},(s,r,o)=>this.updateNodeDatum(s,r,o.scratch,o.datumIndex))}createNodeDataSimple(e,i){const n=e.rawData.length;for(let s=0;s<n;s++)i.count=1,i.dilation=1,i.area=0,this.upsertBubbleNodeDatum(e,i,s)}createNodeDataWithAggregation(e,i,n,s,r){const{maxRenderedItems:o}=this.properties,a=this.aggregationOptions(n,s),l=LB(r,a,o),{groupedAggregation:c,singleDatumIndices:h}=NB(l,r,a),u=new Map;for(const{datumIndex:d,count:g,dilation:p,area:f,indices:m}of c)i.count=g,i.dilation=p,i.area=f,u.set(d,m),this.upsertBubbleNodeDatum(e,i,d);this.aggregateIndexSet=u.size>0?u:void 0;for(const d of h)i.count=1,i.dilation=1,i.area=0,this.upsertBubbleNodeDatum(e,i,d)}prepareNodeDatumState(e,i,n){const s=e.rawData[n],r=e.xDataValues[n],o=e.yDataValues[n],a=this.properties.allowNullKeys??!1;if((r===void 0||o===void 0)&&!a)return;const l=e.sizeDataValues?.[n],c=e.xScale.convert(r)+e.xOffset,h=e.yScale.convert(o)+e.yOffset;if(!Number.isFinite(c)||!Number.isFinite(h))return;const u=e.crossFilterSelectedDataValues?.[n];let d;e.labelsEnabled?d=this.computeLabel(e,s,o,l,n):d={text:"",width:0,height:0};const g=l==null?e.sizeScale.range[0]:e.sizeScale.convertClamped(l),p=e.colorDataValues?.[n];return i.datum=s,i.xDatum=r,i.yDatum=o,i.sizeValue=l,i.colorValue=p,i.x=c,i.y=h,i.crossFilterSelected=u,i.nodeLabel=d,i.markerSize=g,i}computeLabel(e,i,n,s,r){let o,a,l;e.labelKey&&e.labelDataValues?(o=e.labelDataValues[r],a=e.labelKey,l="label"):e.sizeKey?(o=s,a=e.sizeKey,l="size"):(o=n,a=e.yKey,l="y");const c=this.getLabelText(o,i,a,l,e.labelTextDomain,e.label,{value:o,datum:i,xKey:e.xKey,yKey:e.yKey,sizeKey:e.sizeKey,labelKey:e.labelKey,xName:e.xName,yName:e.yName,sizeName:e.sizeName,labelName:e.labelName,colorKey:e.colorKey,colorName:e.colorName,legendItemName:e.legendItemName});let{width:h,height:u}=ue(c)?Ws(c,e.label):e.labelTextMeasurer.measureLines(String(c));return h+=e.labelPadding.left+e.labelPadding.right,u+=e.labelPadding.bottom+e.labelPadding.top,{text:c,width:h,height:u}}createSkeletonNodeDatum(e,i,n){return{series:this,yKey:e.yKey,xKey:e.xKey,datum:void 0,datumIndex:0,xValue:void 0,yValue:void 0,sizeValue:void 0,colorValue:void 0,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},point:{x:0,y:0,size:0},midPoint:{x:0,y:0},label:{text:"",width:0,height:0},anchor:e.labelAnchor,placement:e.labelPlacement,count:1,dilation:1,area:0,crossFilterSelected:void 0}}updateNodeDatum(e,i,n,s){const r=i,{x:o,y:a,markerSize:l,dilation:c}=n;r.datum=n.datum,r.datumIndex=s,r.xValue=n.xDatum,r.yValue=n.yDatum,r.sizeValue=n.sizeValue,r.colorValue=n.colorValue,r.crossFilterSelected=n.crossFilterSelected,r.count=n.count,r.dilation=n.dilation,r.area=n.area,r.label=n.nodeLabel,r.anchor=e.labelAnchor,r.placement=e.labelPlacement;const h=r.point;h.x=o,h.y=a,h.size=Math.sqrt(c)*l;const u=r.midPoint;u.x=o,u.y=a}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(e){const{nodeData:i,datumSelection:n}=e;if(this.properties.marker.isDirty()&&(n.clear(),n.cleanup()),!In(this.processedData))return n.update(i);const{sizeKey:s}=this.properties;let r;return s&&(r=o=>ei(o.xValue,o.yValue,o.sizeValue,je(o.label.text))),n.update(i,void 0,r)}updateDatumStyles(e){const{datumSelection:i,isHighlight:n}=e,{xKey:s,yKey:r,sizeKey:o,labelKey:a,colorKey:l,marker:c}=this.properties,h=this.isColorScaleValid(),u={xKey:s,yKey:r,sizeKey:o,labelKey:a,colorKey:l};if(c.itemStyler==null&&!h){this.runMarkerStylePass(i,n,{marker:c,params:u,isHighlight:n},{compute:tu.computeNoStylerMarkerTemplate,apply:tu.applyNoStylerTemplate});return}this.runMarkerStylePass(i,n,{marker:c,params:u,isHighlight:n,colorScaleValid:h,colorKey:l},{cacheable:l==null,compute:tu.computePerDatumStylerStyle,apply:tu.applyPerDatumStyle})}updateDatumNodes(e){const{contextNodeData:i}=this;if(!i)return;const{datumSelection:n,isHighlight:s,drawingMode:r}=e;this.sizeScale.range=this.getSizeRange();const o=this.getShapeFillBBox(),a=this.dataAggregation!=null,l=this.ctx.highlightManager.getActiveHighlight(),c=r==="cutout"?void 0:r;n.each((h,u,d)=>{const{point:{size:g},count:p,area:f,dilation:m}=u,y=this.getHighlightState(l,s,u.datumIndex),b=u.style==null?{...i.styles[y],size:g}:{...u.style};if(m>1){const S=b.fillOpacity??0,M=.269669+683e-6*p+-37.534348*f+.004449*p*f+-0*p**2+44.428603*f**2;b.fillOpacity=J(S/m,S/.1*M,1)}this.applyMarkerStyle(b,h,u.point,o,{crossFilterSelected:u.crossFilterSelected,hideWithSize0:!1});const v=c??this.resolveMarkerDrawingModeForState(r,b);h.__drawingMode!==v&&(h.drawingMode=v),h.zIndex=a?[-p,d]:0}),s||this.properties.marker.markClean()}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection.update(e.map(i=>({...i.datum,point:{x:i.x,y:i.y,size:i.datum.point.size}})),i=>{i.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const e=this.ctx.highlightManager?.getActiveHighlight(),i=this.isSeriesHighlighted(e)&&e?.datum?e:void 0,n=i==null?[]:this.placedLabelData.filter(s=>s.datum.datumIndex===i.datumIndex).map(s=>({...s.datum,point:{x:s.x,y:s.y,size:s.datum.point.size}}));this.highlightLabelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=n.length>0,this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})})}updateLabelNodes(e){const{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((r,o)=>{const a=sa(this,o,s,this.properties.label,i,n);r.text=o.label.text,r.fill=a.color,r.x=o.point?.x??0,r.y=o.point?.y??0,r.fontStyle=a.fontStyle,r.fontWeight=a.fontWeight,r.fontSize=a.fontSize,r.fontFamily=a.fontFamily,r.textBaseline="top",r.fillOpacity=this.getHighlightStyle(i,o.datumIndex).opacity??1,r.setBoxing(a)})}updateLabelSelection(e){const{labelData:i,labelSelection:n}=e;return n.update(i,s=>{s.pointerEvents=1})}makeStylerParams(e,i,n){const{id:s,properties:{marker:r,shape:o,fill:a,fillOpacity:l,lineDash:c,lineDashOffset:h,stroke:u,strokeOpacity:d,strokeWidth:g,xKey:p,yKey:f,sizeKey:m,labelKey:y,colorKey:b}}=this,{size:v,maxSize:S}=r,M=Hr(e??0),D=un(i),I=un(n);return this.type==="bubble"?{highlightState:M,selectionState:D,candidateState:I,minSize:v,maxSize:S,shape:o,fill:a,fillOpacity:l,lineDash:c,lineDashOffset:h,seriesId:s,sizeKey:m,stroke:u,strokeOpacity:d,strokeWidth:g,xKey:p,yKey:f,labelKey:y,colorKey:b}:this.type==="scatter"?{highlightState:M,selectionState:D,candidateState:I,size:v,shape:o,fill:a,fillOpacity:l,lineDash:c,lineDashOffset:h,seriesId:s,stroke:u,strokeOpacity:d,strokeWidth:g,xKey:p,yKey:f,labelKey:y,colorKey:b}:this.type}makeLabelFormatterParams(){const{xKey:e,xName:i,yKey:n,yName:s,sizeKey:r,sizeName:o,labelKey:a,labelName:l,colorKey:c,colorName:h,legendItemName:u}=this.properties;return{xKey:e,xName:i,yKey:n,yName:s,sizeKey:r,sizeName:o,labelKey:a,labelName:l,colorKey:c,colorName:h,legendItemName:u}}getTooltipContent(e){const{id:i,dataModel:n,processedData:s,axes:r,properties:o,ctx:a,colorScale:l}=this,{formatManager:c}=a,{xKey:h,xName:u,yKey:d,yName:g,sizeKey:p,sizeName:f,labelKey:m,labelName:y,colorKey:b,colorName:v,title:S,tooltip:M,marker:D,legendItemName:I}=o,A=r.x,k=r.y;if(!n||!s||!A||!k)return;const T=s.dataSources.get(this.id)?.data?.[e],R=n.resolveColumnById(this,"xValue",s,"object")[e],E=n.resolveColumnById(this,"yValue",s,"object")[e],F=this.properties.allowNullKeys??!1;if(R===void 0&&!F)return;const N=[];if(this.isLabelEnabled()&&m!=null){const j=n.resolveColumnById(this,"labelValue",s,"object")[e],ie=c.format(this.callWithContext.bind(this),{type:"category",value:j,datum:T,seriesId:i,legendItemName:I,key:m,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});N.push({label:y,fallbackLabel:m,value:ie??Co(j)})}N.push({label:u,fallbackLabel:h,value:this.getAxisValueText(A,"tooltip",R,T,h,I,F),missing:$o(R,F)},{label:g,fallbackLabel:d,value:this.getAxisValueText(k,"tooltip",E,T,d,I,F),missing:$o(E,F)});const P=(j,ie,ge,ae)=>{const le=n.resolveColumnById(this,j,s,"number")[e];if(le==null)return;const xt=n.getDomain(this,j,"value",s).domain,pe=c.format(this.callWithContext.bind(this),{type:"number",value:le,datum:T,seriesId:i,legendItemName:I,key:ie,source:"tooltip",property:ae,boundSeries:this.getFormatterContext(ae),domain:xt,fractionDigits:void 0,visibleDomain:void 0});return N.push({label:ge,fallbackLabel:ie,value:pe??Co(le)}),le};p!=null&&P("sizeValue",p,f,"size");let z;if(b!=null&&this.isColorScaleValid()){const j=P("colorValue",b,v,"color");if(j!=null){z=l.convert(j);const ie=kx(l,o.colorScale.fills,j,Co);ie!=null&&(N.at(-1).value=ie)}else o.colorScale.missingDataFill!=null&&(z=o.colorScale.missingDataFill)}const Y=this.getMarkerStyle(D,{datum:T,datumIndex:e},{xKey:h,yKey:d,sizeKey:p,labelKey:m,colorKey:b},{resolveMarkerSubPath:[]});return z!=null&&(Y.fill=z),this.formatTooltipWithContext(M,{title:S,symbol:this.legendItemSymbol(Y),data:N},{seriesId:i,datum:T,title:d,xKey:h,xName:u,yKey:d,yName:g,sizeKey:p,sizeName:f,labelKey:m,labelName:y,colorKey:b,colorName:v,legendItemName:I,...Y,...this.getModuleTooltipParams()})}legendItemSymbol(e){const i=this.getStyle(void 0),n=this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},i);return{marker:e?{...n,...e}:n}}getLegendData(e){if(this.isColorScaleValid()&&this.dataModel){const{colorScale:h}=this.properties;return e==="category"&&h.mode==="discrete"&&h.fills.length>0?Hb(this.colorScale,h.fills,this.id,this.visible,jb(this),this.properties.shape):e==="gradient"&&h.mode!=="discrete"?[{...Gb(this.colorScale,h.fills,this.id,this.visible,this.getFormatterContext("color")),showSeparately:!0}]:[]}if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:o,legendItemName:a,title:l,showInLegend:c}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:a??l??o??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!c}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:i}){eB(this,this.ctx.animationManager,e),mt(this,"labels",this.ctx.animationManager,i)}resetDatumAnimation(e){zg([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mt}getStyle(e){const{properties:i}=this,{marker:n}=i;let s={};if(i.styler){const o=this.getDataSelectionState(void 0),a=this.getDataCandidacyState(void 0),l=this.makeStylerParams(e,o,a),c=this.cachedCallWithContext(i.styler,l)??{};s=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],c,{pick:!1})??{}}const r=this.getSizeFloorOverride(s);return{fill:s.fill??i.fill,fillOpacity:s.fillOpacity??i.fillOpacity,lineDash:s.lineDash??i.lineDash,lineDashOffset:s.lineDashOffset??i.lineDashOffset,shape:s.shape??i.shape,size:r??n.size,maxSize:s.maxSize??n.maxSize,stroke:s.stroke??i.stroke,strokeOpacity:s.strokeOpacity??i.strokeOpacity,strokeWidth:s.strokeWidth??i.strokeWidth}}getSizeFloorOverride(e){return e.minSize}getSizeRange(){const{size:e,maxSize:i}=this.getStyle(void 0);return[e,Math.max(e,i)]}getFormattedMarkerStyle(e){const{xKey:i,yKey:n,sizeKey:s,labelKey:r,colorKey:o,marker:a}=this.properties;return this.getMarkerStyle(a,e,{xKey:i,yKey:n,sizeKey:s,labelKey:r,colorKey:o},{resolveMarkerSubPath:[]})}computeFocusBounds(e){return Gg(this,e)}hasItemStylers(){const{selection:e,styler:i,itemStyler:n,marker:s,label:r}=this.properties;return e.enabled||!!(i??n??s.itemStyler??r.itemStyler)||this.isColorScaleValid()}initQuadTree(e){Wg(e,this.datumNodesIter())}pickNodeDataClosestDatum(e){return Ug(this,e)}};aa.className="BubbleSeries",aa.type="bubble",aa.computeNoStylerMarkerTemplate=(t,e,i,n,s)=>{const r=t.getStyle(i);return t.getMarkerStyle(e.marker,s,e.params,{isHighlight:e.isHighlight,highlightState:i,selectionState:n,resolveMarkerSubPath:[]},{...r,size:s.point.size})},aa.applyNoStylerTemplate=(t,e,i,n,s,r)=>{i.style=r.size===i.point.size?r:{...r,size:i.point.size}},aa.computePerDatumStylerStyle=(t,e,i)=>t.getStyle(i),aa.applyPerDatumStyle=(t,e,i,n,s,r)=>{e.colorScaleValid&&i.colorValue!=null?r.fill=t.colorScale.convert(i.colorValue):e.colorKey!=null&&i.colorValue==null&&t.properties.colorScale.missingDataFill!=null&&(r.fill=t.properties.colorScale.missingDataFill),i.style=t.getMarkerStyle(e.marker,i,e.params,{isHighlight:e.isHighlight,highlightState:n,selectionState:s,resolveMarkerSubPath:[]},{...r,size:i.point.size})};var AA=aa,wA={title:O,sizeDomain:Se(ne(Ne),En(2,2)),minSize:w,maxSize:w,showInMiniChart:L,label:{placement:V("top","right","bottom","left"),...ze},tooltip:ke,styler:Ae({...q(Bn,["size"]),minSize:w,maxSize:w}),maxRenderedItems:G,...Ie,...q(Bn,["enabled","size"]),highlight:ht(We,We),colorScale:ho(Bs)},kA={...wA,...Vn,type:Z(_e("bubble")),xKey:Z(O),yKey:Z(O),sizeKey:Z(O),labelKey:O,colorKey:ho(O),xName:O,yName:O,sizeName:O,labelName:O,colorName:ho(O),legendItemName:O,xKeyAxis:O,yKeyAxis:O,highlight:ht(We,We)};kA.selectedKey=Q(O);var TA={fills:{$if:[{$isPackageType:"enterprise"},{$map:[{color:{$value:"$1"}},{$palette:"divergingColors"}]},void 0]}},LA={enabled:{$some:[{$and:[{$path:"/series/$index/colorKey"},{$path:"/series/$index/colorScale/fills/0"},{$not:{$eq:[{$path:"/series/$index/colorScale/mode"},"discrete"]}}]},{$path:"/series"}]}},EB={series:{shape:"circle",minSize:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Oc],["image",_s],["pattern",Qi]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...us,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Ec,selection:xr,colorScale:TA},gradientLegend:LA},NA={type:"series",name:"bubble",chartType:"cartesian",version:Qe,dependencies:[gn],options:kA,predictAxis:Eb,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:EB,create:t=>new AA(t)},yt=class extends Un{constructor(){super(...arguments),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.getItemId=void 0,this.shadow=new Cs,this.label=new ln,this.tooltip=oa()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,cornerRadius:a}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o,cornerRadius:a,opacity:1}}};x([C],yt.prototype,"xKey",2),x([C],yt.prototype,"yKey",2),x([C],yt.prototype,"xName",2),x([C],yt.prototype,"yName",2),x([C],yt.prototype,"fill",2),x([C],yt.prototype,"fillOpacity",2),x([C],yt.prototype,"stroke",2),x([C],yt.prototype,"strokeWidth",2),x([C],yt.prototype,"strokeOpacity",2),x([C],yt.prototype,"lineDash",2),x([C],yt.prototype,"lineDashOffset",2),x([C],yt.prototype,"cornerRadius",2),x([C],yt.prototype,"styler",2),x([C],yt.prototype,"itemStyler",2),x([C],yt.prototype,"areaPlot",2),x([C],yt.prototype,"bins",2),x([C],yt.prototype,"aggregation",2),x([C],yt.prototype,"binCount",2),x([C],yt.prototype,"getItemId",2),x([C],yt.prototype,"shadow",2),x([C],yt.prototype,"label",2),x([C],yt.prototype,"tooltip",2);var Kb=10;function OA(t){return typeof t=="bigint"||Number.isInteger(t)}var RB=class extends vg{constructor(t,e,i,n,s){super(t,e,i,n,s),this.binIndex=i.binIndex,this.binRange=i.binRange,this.aggregatedValue=i.aggregatedValue,this.frequency=i.frequency}},Yb=class extends Kr{constructor(t){super({moduleCtx:t,propertyKeys:Vl,propertyNames:Bl,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:jh,label:ra}}),this.properties=new yt,this.NodeEvent=RB,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}computeBins(t){const e=t[0],i=t[1],n=(Ea(e)||Ea(i))&&OA(e)&&OA(i);return Nn(this.properties.binCount)?n?qS(BigInt(e),BigInt(i),this.properties.binCount):this.calculateNiceBins([Number(e),Number(i)],this.properties.binCount):this.properties.bins??(n?JS(BigInt(e),BigInt(i),Kb):this.deriveBins([Number(e),Number(i)]))}deriveBins(t){const e=hl(t[0],t[1],Kb).ticks,i=To(t[0],t[1],Kb),[n]=e,s=r=>[r,r+i];return[[n-i,n],...e.map(s)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),n=t[1],s=e||1,{start:r,binSize:o}=this.calculateNiceStart(i,n,s);return this.getBins(r,n,o,s)}getBins(t,e,i,n){const s=[],r=this.calculatePrecision(i);for(let o=0;o<n;o++){const a=Math.round((t+o*i)*r)/r;let l=Math.round((t+(o+1)*i)*r)/r;o===n-1&&(l=Math.max(l,e)),s[o]=[a,l]}return s}calculatePrecision(t){let e=10;if(Number.isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const n=Math.abs(e-t)/i,s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return{start:Math.floor(t/r)*r,binSize:n}}async processData(t){const{visible:e}=this,{xKey:i,yKey:n,areaPlot:s,aggregation:r}=this.properties,o=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:a,xScale:o}),h=e?{}:{forceValue:0},u=[jr(i,l),_P],d=S=>n!=null&&r==="sum"?YR(S,{visible:e}):n!=null&&r==="mean"?qR(S,{visible:e}):XR(S,{visible:e});n==null?u.push(RP("count")):u.push(et(n,c,{invalidValue:void 0,...h}));const g=d("groupAgg");u.push(s?JR("groupAgg",g):g),s&&u.push(d("rawAgg"));let p=[];const f=S=>{const M=Li(S.domain.keys[0]);if(M.length===0)return S.domain.groups=[],()=>[];const D=this.computeBins(M),I=D.length;return p=[...D],A=>{let k=A[0];if(pn(k)&&(k=k.getTime()),!Zi(k))return[];for(let T=0;T<I;T++){const R=D[T];if(k>=R[0]&&k<R[1]||T===I-1&&k<=R[1])return R}return[]}},{dataModel:m,processedData:y}=await this.requestDataModel(t,this.data,{props:u,groupByFn:f}),b=y,v=new Map;for(const[S,M]of b.groups.entries()){const D=M.keys;v.set(ei(...D),{group:M,groupIndex:S})}this.calculatedBins=p.map((S,M)=>{const D=v.get(ei(...S));if(D){const{group:I,groupIndex:A}=D,[k=[0,0],T]=I.aggregation,R=[...m.forEachDatum(this,b,I,A)],E=this.frequency(I),F=Ti(k[0],k[1]),N=T?Ti(T[0],T[1]):F;return{domain:S,datum:R,binIndex:M,frequency:E,total:F,aggregatedValue:N}}else return{domain:S,datum:[],binIndex:M,frequency:0,total:0,aggregatedValue:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return{domain:[]};const n=i.getDomain(this,"groupAgg","aggregate",e).domain,s=this.calculatedBins[0].domain[0],r=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return t==="x"?{domain:Li([s,r])}:{domain:Li(n)}}getSeriesRange(t,[e,i]){const{dataModel:n,processedData:s}=this;if(!n||s?.type!=="grouped")return[Number.NaN,Number.NaN];const r=this.axes.x.scale,o=0;let a=-1/0;for(const{keys:l,aggregation:c}of s.groups){const[[h,u]=[0,0]]=c,[d,g]=l,[p,f]=Ot([r.convert(d),r.convert(g)]);f>=e&&p<=i&&(a=ss(a,cu(h,u)))}return o>a?[Number.NaN,Number.NaN]:[o,Ze(a)]}frequency(t){return t.datumIndices.reduce((e,i)=>e+i.length,0)}createNodeDatumContext(t,e){const{xKey:i,yKey:n,xName:s,yName:r,label:o}=this.properties,{contextNodeData:a,processedData:l}=this,c=a?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:t,yAxis:e,xScale:t.scale,yScale:e.scale,yAxisReversed:e.isReversed(),rawData:[],xValues:[],xKey:i,yKey:n,xName:s,yName:r,label:o,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?a.nodeData:[],nodeIndex:0}}binParams(t){const{datum:e,binIndex:i,domain:n,aggregatedValue:s,frequency:r}=t;return{datum:void 0,datums:e,binIndex:i,binRange:n,aggregatedValue:s,frequency:r}}createLabelData(t,e,i,n,s,r){const{label:o,yKey:a,xKey:l,xName:c,yName:h}=t,{total:u,datum:d}=e;if(!(!o.enabled||Number(u)===0))return{x:i+s/2,y:n+r/2,text:this.getLabelText(u,d,a,"y",[],o,{...this.binParams(e),value:u,xKey:l,yKey:a,xName:c,yName:h})}}createSkeletonNodeDatum(t,e){const{xKey:i,yKey:n}=t,{domain:s,datum:r,binIndex:o,frequency:a,total:l,aggregatedValue:c}=e,[h,u]=s,{getItemId:d}=this.properties,p=(d==null?void 0:this.cachedCallWithContext(d,this.binParams(e),`${this.id}:${h},${u}`))??`bin:${h},${u}`;return{series:this,itemId:p,datumIndex:o,datum:void 0,datums:r,binIndex:o,binRange:s,aggregatedValue:c,cumulativeValue:Number(l),cumulativeValueExact:l,frequency:a,yKey:n,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(t,e,i){const{xScale:n,yScale:s,yAxisReversed:r}=t,{domain:o,datum:a,binIndex:l,frequency:c,total:h,aggregatedValue:u}=i,d=e,[g,p]=o,f=n.convert(g),m=n.convert(p),y=s.convert(0),b=s.convert(h),v=Math.abs(m-f),S=Math.abs(b-y),M=Math.min(f,m),D=Math.min(y,b);d.datumIndex=l,d.datum=void 0,d.datums=a,d.binIndex=l,d.aggregatedValue=u,d.cumulativeValue=Number(h),d.cumulativeValueExact=h,d.frequency=c,d.binRange=o,d.x=M,d.y=D,d.xValue=f,d.yValue=b,d.width=v,d.height=S,d.midPoint?(d.midPoint.x=M+v/2,d.midPoint.y=D+S/2):d.midPoint={x:M+v/2,y:D+S/2},d.topLeftCornerRadius=!r,d.topRightCornerRadius=!r,d.bottomRightCornerRadius=r,d.bottomLeftCornerRadius=r,d.label=this.createLabelData(t,i,M,D,v,S)}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}populateNodeData(t){const{processedData:e}=this;if(e?.type==="grouped")for(const i of this.calculatedBins)Ub(t,i,(n,s)=>this.createNodeDatum(n,s),(n,s,r)=>this.updateNodeDatum(n,s,r))}initializeResult(t){return{itemId:this.properties.yKey??this.id,nodeData:t.nodes,labelData:t.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||t.animationEnabled,styles:_y(this.getItemStyle.bind(this))}}finalizeNodeData(t){super.finalizeNodeData(t),t.nodes.sort((e,i)=>e.x-i.x)}nodeFactory(){return new Pt}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return In(this.processedData)?i.update(e,void 0,n=>ei(...n.binRange)):i.update(e)}resolvedStyle(t){const{fill:e,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:r,lineDash:o,lineDashOffset:a,cornerRadius:l}=t;return{fill:e,fillOpacity:i,stroke:n,strokeWidth:s,strokeOpacity:r,lineDash:o,lineDashOffset:a,cornerRadius:l}}makeStylerParams(t){const{id:e}=this,{xKey:i,yKey:n}=this.properties;return{seriesId:e,xKey:i,yKey:n,...this.resolvedStyle(this.properties.getStyle()),highlightState:Hr(t??0),selectionState:this.getSelectionStateString(void 0),candidateState:this.getCandidateStateString(void 0)}}makeItemStylerParams(t,e,i){const{id:n}=this,{xKey:s,yKey:r}=this.properties,o=this.ctx.highlightManager?.getActiveHighlight();return{seriesId:n,xKey:s,yKey:r,...this.binParams(t),highlightState:this.getHighlightStateString(o,e,t.binIndex),selectionState:this.getSelectionStateString(t.binIndex),candidateState:this.getCandidateStateString(t.binIndex),...this.resolvedStyle(i)}}getStyle(t,e,i,n){const{properties:s}=this,r=this.getHighlightStyle(e,i,n);let o=s.getStyle();const{styler:a}=s;if(!t&&a!=null){const l=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(a,this.makeStylerParams(n))??{},{pick:!1})??{};o=de(l,o)}return de(r,o)}getItemStyle(t,e,i){let n=this.getStyle(t===void 0,e,t,i);const{itemStyler:s}=this.properties;if(s!=null&&t!=null){const r=this.calculatedBins[t];if(r!=null){const o=this.cachedDatumCallback(ei(...r.domain,e?"highlight":"node"),()=>this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(s,this.makeItemStylerParams(r,e,n))));o&&(n=de(o,n))}}return n}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t;e.each((n,s)=>{e.isGarbage(n)||(s.style=this.getItemStyle(s.datumIndex,i))})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getShapeFillBBox();t.datumSelection.each((r,o)=>{const a=o.style??e.styles[this.getHighlightState(i,t.isHighlight,o.datumIndex)],{cornerRadius:l=0}=a,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:u,bottomLeftCornerRadius:d}=o;r.setStyleProperties(a,s),r.topLeftCornerRadius=c?l:0,r.topRightCornerRadius=h?l:0,r.bottomRightCornerRadius=u?l:0,r.bottomLeftCornerRadius=d?l:0,r.crisp=o.crisp,r.fillShadow=n})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,n=>{n.pointerEvents=1,n.textAlign="center",n.textBaseline="middle"})}updateLabelNodes(t){const e=this.isLabelEnabled(),{isHighlight:i=!1}=t,n=this.ctx.highlightManager?.getActiveHighlight(),{xKey:s,yKey:r,xName:o,yName:a}=this.properties;t.labelSelection.each((l,c)=>{const h={datum:void 0,datums:c.datums,binIndex:c.binIndex,binRange:c.binRange,aggregatedValue:c.aggregatedValue,frequency:c.frequency,value:c.cumulativeValue,xKey:s,yKey:r,xName:o,yName:a},u=sa(this,c,h,this.properties.label,i,n),{enabled:d,fontStyle:g,fontWeight:p,fontSize:f,fontFamily:m,color:y}=u;d&&e&&c?.label?(l.text=c.label.text,l.x=c.label.x,l.y=c.label.y,l.fontStyle=g,l.fontWeight=p,l.fontFamily=m,l.fontSize=f,l.fill=y,l.visible=!0,l.fillOpacity=this.getHighlightStyle(i,c.datumIndex).opacity??1,l.setBoxing(u)):l.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e instanceof se&&Wg(t,e.children())}pickNodeClosestDatum(t){return Ug(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:r,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=r,g=s.x,p=s.y;if(!i||n?.type!=="grouped"||!g||!p)return;const f=this.calculatedBins[t];if(f==null)return;const{frequency:m,aggregatedValue:y,datum:b}=f,v=f.domain,[S,M]=v,D=[{label:l,fallbackLabel:a,value:`${this.getAxisValueText(g,"tooltip",S,b,a,d)} - ${this.getAxisValueText(g,"tooltip",M,b,a,d)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(p,"tooltip",m,b,c,d)}];if(c!=null){let I;switch(r.aggregation){case"sum":I=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":I=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":I=o.t("seriesHistogramTooltipCount",{yName:h??c});break}D.push({label:I,value:this.getAxisValueText(p,"tooltip",y,b,c,d)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:D},{seriesId:e,title:h,xKey:a,xName:l,yKey:c,yName:h,...this.binParams(f),...this.getItemStyle(t,!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:o}=this.properties;return{marker:{fill:Ue(t)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:n&&(i?.getItemEnabled({seriesId:e,itemId:s})??!0),label:{text:r??s??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(t){Kg([t.datumSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Gh(zh(!0,this.axes,"normal"),"unknown");wt(this.id,"datums",this.ctx.animationManager,[t],i),mt(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=Gh(zh(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};wt(this.id,"datums",this.ctx.animationManager,[t.datumSelection],e,n=>ei(...n.unsafeDatum.binRange),i),i?.changed&&mt(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Bb(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null||this.properties.selection.enabled}};Yb.className="HistogramSeries",Yb.type="histogram";var EA=Ae({...W,..._,...U,cornerRadius:w}),RA={showInMiniChart:L,cornerRadius:w,styler:EA,itemStyler:EA,label:ze,tooltip:ke,shadow:cs,...Ie,...W,..._,...U,highlight:ht(We,We),areaPlot:L,aggregation:V("count","sum","mean"),bins:ne(ne(G)),binCount:w},PB={...Vn,...RA,type:Z(_e("histogram")),xKey:Z(O),yKey:O,xKeyAxis:O,yKeyAxis:O,xName:O,yName:O,getItemId:ti(O)},FB={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",vr],["image",_s],["pattern",Qi]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...us,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},highlight:Ec}},PA={type:"series",name:"histogram",chartType:"cartesian",version:Qe,dependencies:[gn],options:PB,predictAxis:Bh,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:FB,create:t=>new Yb(t)},VB=10;function qg(t,e,i,n,s,r,o,a){const l=t[r];if(l===void 0)return!1;const c=Number.isFinite(e)?bn(l,e,i,o):Ja(r,a),h=id(c,s);return r===n[h+dt]||r===n[h+St]||r===n[h+Et]||r===n[h+gt]}function FA(t,e,i,n,s,r,o,a){let l=0;for(let u=0;u<o;u++)qg(t,e,i,n,s,u,r,o)&&l++;const c=a?.length===l?a:new Uint32Array(l);let h=0;for(let u=0;u<o;u++)qg(t,e,i,n,s,u,r,o)&&(c[h++]=u);return c}function BB(t,e,i,n,s,r,o,a,l){let c=0;for(const d of t)qg(e,i,n,s,r,d,o,a)&&c++;const h=l?.length===c?l:new Uint32Array(c);let u=0;for(const d of t)qg(e,i,n,s,r,d,o,a)&&(h[u++]=d);return h}function Zb(t,e,i,n){const s=e.length;if(s<Gs)return;const[r,o]=t,{xNeedsValueOf:a,yNeedsValueOf:l,existingFilters:c}=n;let h=js(e,r,o,{xNeedsValueOf:a});const u=c?.find(m=>m.maxRange===h);let{indexData:d,valueData:g}=Hs(e,i,i,r,o,h,{xNeedsValueOf:a,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),p=FA(e,r,o,d,h,a,s,u?.indices);const f=[{maxRange:h,indices:p,indexData:d,valueData:g}];for(;p.length>VB&&h>64;){const m=h,y=Math.trunc(m/2),b=c?.find(S=>S.maxRange===y),v=So(d,g,m,{reuseIndexData:b?.indexData,reuseValueData:b?.valueData});h=v.maxRange,d=v.indexData,g=v.valueData,p=BB(p,e,r,o,d,h,a,s,b?.indices),f.push({maxRange:h,indices:p,indexData:d,valueData:g})}return f.reverse(),f}function _B(t,e,i,n){const s=e.length;if(s<Gs)return;const[r,o]=t,{xNeedsValueOf:a,yNeedsValueOf:l,targetRange:c,existingFilters:h}=n,u=js(e,r,o,{xNeedsValueOf:a}),d=Math.min(u,$a(Math.max(c,Dr))),g=h?.find(v=>v.maxRange===d),{indexData:p,valueData:f}=Hs(e,i,i,r,o,d,{xNeedsValueOf:a,yNeedsValueOf:l,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),m=FA(e,r,o,p,d,a,s,g?.indices),y={maxRange:d,indices:m,indexData:p,valueData:f};function b(){return Zb([r,o],e,i,{xNeedsValueOf:a,yNeedsValueOf:l,existingFilters:h})?.filter(S=>S.maxRange!==d)??[]}return{immediate:[y],computeRemaining:b}}function zB(t,e,i,n,s,r){return Zb([i,n],t,e,{xNeedsValueOf:s,yNeedsValueOf:r})}var GB=Zc(zB);function jB(t,e,i,n,s,r){const o=e.resolveColumnById(s,"xValue",i,"object"),a=e.resolveColumnById(s,n,i,"mixed-numeric"),l=e.getDomain(s,"xValue","value",i),c=e.resolveColumnNeedsValueOf(s,"xValue",i),h=e.resolveColumnNeedsValueOf(s,n,i),{values:u,needsValueOf:d}=Cr(t,o,c),{xValues:g,domain:p}=wr(t,u,l),f=h?a:Gc(a);return r?Zb(p,g,f,{xNeedsValueOf:d,yNeedsValueOf:h,existingFilters:r}):GB(g,f,p[0],p[1],d,h)}function HB(t,e,i,n,s,r,o){const a=e.resolveColumnById(s,"xValue",i,"object"),l=e.resolveColumnById(s,n,i,"mixed-numeric"),c=e.getDomain(s,"xValue","value",i),h=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,n,i),{values:d,needsValueOf:g}=Cr(t,a,h),{xValues:p,domain:f}=wr(t,d,c),m=u?l:Gc(l);return _B(f,p,m,{xNeedsValueOf:g,yNeedsValueOf:u,targetRange:r,existingFilters:o})}var kt=class extends Un{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new ja,this.marker=new Ni,this.label=new ln,this.tooltip=oa(),this.connectMissingData=!1,this.sparklineMode=!1}};x([C],kt.prototype,"xKey",2),x([C],kt.prototype,"yKey",2),x([C],kt.prototype,"xName",2),x([C],kt.prototype,"yName",2),x([C],kt.prototype,"selectedKey",2),x([C],kt.prototype,"stackGroup",2),x([C],kt.prototype,"normalizedTo",2),x([C],kt.prototype,"title",2),x([C],kt.prototype,"stroke",2),x([C],kt.prototype,"strokeWidth",2),x([C],kt.prototype,"strokeOpacity",2),x([C],kt.prototype,"lineDash",2),x([C],kt.prototype,"lineDashOffset",2),x([C],kt.prototype,"interpolation",2),x([C],kt.prototype,"styler",2),x([C],kt.prototype,"marker",2),x([C],kt.prototype,"label",2),x([C],kt.prototype,"tooltip",2),x([C],kt.prototype,"connectMissingData",2),x([C],kt.prototype,"sparklineMode",2);var Wl=class xp extends Kr{constructor(e){super({moduleCtx:e,propertyKeys:Vl,propertyNames:Bl,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:Ob({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:ra,datum:(i,n)=>({..._g(i),...Vh(i,n)})},clipFocusBox:!1}),this.properties=new kt,this.aggregationManager=new Rg,this.hideWithSize0=!1}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return this.properties.normalizedTo!=null}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){if(this.data==null)return;const{data:i,visible:n,seriesGrouping:{groupIndex:s=this.id,stackCount:r=0}={}}=this,{xKey:o,yKey:a,selectedKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:g,xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),m=r>1||h!=null,y={invalidValue:null};c&&m&&(y.invalidValue=0),m&&!n&&(y.forceValue=0);const b={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},v=[],S=this.properties.allowNullKeys??!1;(!g||m)&&v.push(jr(o,p,{id:"xKey",allowNullKey:S})),v.push(et(o,p,{id:"xValue",allowNullKey:S}),et(a,f,{id:"yValueRaw",...y,invalidValue:void 0})),l!=null&&v.push(et(l,"category",{id:"selectedRaw"})),m&&v.push(...Qo(a,"normal",{id:"yValueCumulative",...y,groupId:b.marker},f)),rs(h)&&v.push(et(a,f,{id:"yValue",...y,groupId:b.value}),gg(Object.values(b),h)),this.needsDataModelDiff()&&(v.push(wh(g?["xValue"]:void 0)),this.processedData&&v.push(fg(this.id,this.processedData)));const{dataModel:M,processedData:D}=await this.requestDataModel(e,i,{props:v,groupByKeys:m,groupByData:!m});this.aggregateData(M,D),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.x.scale.convert(e),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}yCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.y.scale.convert(e[0]),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}getSeriesDomain(e){const{dataModel:i,processedData:n,axes:s}=this;if(!i||!n)return{domain:[]};const r=s.y;if(e==="x"){const a=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","value",n);if(a?.def.type==="value"&&a.def.valueType==="category"){const c=i.getKeySortMetadata(this,"xValue",n);return{domain:l.domain,sortMetadata:c}}return{domain:Li(Or(l.domain))}}const o=this.domainForClippedRange("y",[this.yCumulativeKey(n)],"xValue");return this.isNormalized()&&r instanceof Xs&&!(r instanceof Hl)?{domain:Li(My(o))}:{domain:Li(o)}}getSeriesRange(e,i){const[n,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",i);return[Ze(n),Ze(s)]}getZoomRangeFittingItems(e,i,n){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}getVisibleItems(e,i,n){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}aggregateData(e,i){if(this.aggregationManager.markStale(i.input.count),i.type!=="ungrouped"||In(i))return;const n=this.axes.x;if(n==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>HB(n.scale.type,e,i,this.yCumulativeKey(i),this,s,o),computeFull:o=>jB(n.scale.type,e,i,this.yCumulativeKey(i),this,o),targetRange:s});const r=this.aggregationManager.filters;r&&r.length>0&&or.record(`${this.type}:aggregation`,r.map(o=>o.maxRange))}createBucketLookupFeature(){return new Sb({series:this,getXAxis:()=>this.axes.x,getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,dataSelectionService:this.ctx.dataSelectionService,domainKey:"value",canonicalExtremaSlots:[gt]})}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[i,n]=e.scale.range;return Math.abs(n-i)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,i){const{dataModel:n,processedData:s}=this;if(!n||!s)return;const r=e.scale,o=i.scale,a=s.dataSources.get(this.id)?.data??[],[l,c]=r.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const u=this.aggregationManager.getFilterForRange(h);this.ensureBucketLookupFeature()?.setActiveFilter(s,u);const d=this.canIncrementallyUpdateNodes(u!=null);return{xAxis:e,yAxis:i,rawData:a,xValues:n.resolveColumnById(this,"xValue",s,"object"),yRawValues:n.resolveColumnById(this,"yValueRaw",s,"mixed-numeric"),yCumulativeValues:n.resolveColumnById(this,this.yCumulativeKey(s),s,"mixed-numeric"),crossFilterSelectionValues:this.properties.selectedKey?n.resolveColumnById(this,"selectedRaw",s,"boolean"):void 0,xScale:r,yScale:o,xOffset:(r.bandwidth??0)/2,yOffset:(o.bandwidth??0)/2,size:this.properties.marker.enabled?this.properties.marker.size:0,yDomain:this.getSeriesDomain("y").domain,labelsEnabled:this.properties.label.enabled,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:d,dataAggregationFilter:u,range:h,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:d?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(e,i,n){if(i.datum=e.rawData[n],i.xDatum=e.xValues[n],i.yDatum=e.yRawValues[n],i.yCumulative=e.yCumulativeValues[n],i.crossFilterSelected=e.crossFilterSelectionValues?.[n],i.x=e.xScale.convert(i.xDatum)+e.xOffset,i.y=e.yScale.convert(i.yCumulative)+e.yOffset,!!Number.isFinite(i.x)){if(i.yDatum!=null){const s=e.labelsEnabled?this.getLabelText(i.yDatum,i.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:i.yDatum,datum:i.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const o=e.nodes[e.nodeIndex];o.datum=i.datum,o.datumIndex=n,o.point={x:i.x,y:i.y,size:e.size},o.midPoint={x:i.x,y:i.y},o.cumulativeValue=Number(i.yCumulative),o.cumulativeValueExact=i.yCumulative,o.yValue=i.yDatum,o.xValue=i.xDatum,o.labelText=s,o.crossFilterSelected=i.crossFilterSelected}else e.nodes.push({series:this,datum:i.datum,datumIndex:n,yKey:e.yKey,xKey:e.xKey,point:{x:i.x,y:i.y,size:e.size},midPoint:{x:i.x,y:i.y},cumulativeValue:Number(i.yCumulative),cumulativeValueExact:i.yCumulative,yValue:i.yDatum,xValue:i.xDatum,capDefaults:e.capDefaults,labelText:s,crossFilterSelected:i.crossFilterSelected});e.nodeIndex++}this.updateSpanPoints(e,i)}}updateSpanPoints(e,i){const n=e.spanPoints.at(-1);if(i.yDatum!=null){const s={point:{x:i.x,y:i.y},xDatum:i.xDatum,yDatum:i.yCumulative};Array.isArray(n)?n.push(s):n==null?e.spanPoints.push([s]):(n.skip+=1,e.spanPoints.push([s]))}else e.connectMissingData||(Array.isArray(n)||n==null?e.spanPoints.push({skip:0}):n.skip+=1)}populateNodeData(e){const i={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,crossFilterSelected:void 0,x:0,y:0},n=e.dataAggregationFilter?.indices;let[s,r]=this.visibleRangeIndices("xValue",e.xAxis.range,n);s=Math.max(s-1,0),r=Math.min(r+1,n?.length??e.xValues.length),this.processedData.input.count<1e3&&(s=0,r=this.processedData.input.count);for(let o=s;o<r;o+=1)this.handleDatum(e,i,n?.[o]??o)}initializeResult(e){return{itemId:e.yKey,nodeData:e.nodes,labelData:e.nodes,strokeData:{itemId:e.yKey,spans:[]},scales:this.calculateScaling(),visible:this.visible,crossFiltering:!1,styles:jg(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,i){const n=e.spanPoints.flatMap(r=>Array.isArray(r)?Ph(r,this.properties.interpolation):[]);i.strokeData={itemId:e.yKey,spans:n},i.crossFiltering=this.properties.selectedKey!=null;const s=this.chart?.seriesRect;return s==null||(i.segments=$g(this.properties.segmentation,e.xAxis,e.yAxis,s,this.ctx.scene,!1)),i}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[i],visible:n,animationEnabled:s}=e,r=this.getHighlightStyle(),o=this.getSelectionStyle(),a=this.getStyle(void 0),l=de(o,r,a),{strokeWidth:c,stroke:h,strokeOpacity:u,lineDash:d,lineDashOffset:g,opacity:p}=l,f=this.contextNodeData?.segments;i.setProperties({segments:f,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:p,stroke:h,strokeWidth:c,strokeOpacity:u,lineDash:d,lineDashOffset:g}),i.datum=f,s||(i.visible=n),Hg(this,i)}updateDatumSelection(e){let{nodeData:i}=e;const{datumSelection:n}=e,{contextNodeData:s,processedData:r,axes:o,properties:a}=this,{marker:l}=a,c=Tb(a,s,r,o,l,l,this.chart?.isMiniChart);return this.hideWithSize0=c.hideWithSize0,i=c.needsNodeData?i:[],l.isDirty()&&(n.clear(),n.cleanup()),In(this.processedData)?n.update(i,void 0,h=>ei(h.xValue)):n.update(i)}updateDatumStyles(e){const{hideWithSize0:i}=this,{datumSelection:n,isHighlight:s}=e,{marker:r}=this.properties,{itemStyler:o}=r;if(o==null){this.runMarkerStylePass(n,s,{marker:r,hideWithSize0:i,isHighlight:s},{compute:xp.computeNoStylerMarkerStyle,apply:Ur.assignCachedStyle});return}const a=this.dataModel,l=this.processedData,{xKey:c,yKey:h}=this.properties,u={marker:r,hideWithSize0:i,isHighlight:s,xColumn:a.resolveColumnById(this,"xValue",l,"object"),yColumn:a.resolveColumnById(this,"yValueRaw",l,"mixed-numeric"),xDomain:a.getDomain(this,"xValue","key",l).domain,yDomain:a.getDomain(this,this.yCumulativeKey(l),"value",l).domain,xKey:c,yKey:h};this.runMarkerStylePass(n,s,u,{compute:xp.computeStylerStyle,apply:xp.applyStylerDatum})}updateDatumNodes(e){const{contextNodeData:i,hideWithSize0:n}=this;if(!i)return;const{datumSelection:s,isHighlight:r}=e,o=this.ctx.animationManager.isSkipped(),a=this.getShapeFillBBox(),l=this.ctx.highlightManager.getActiveHighlight(),c=this.getDrawingMode(r,e.drawingMode),h=c==="cutout"?void 0:c,u=this;s.each(function(g,p){const f=p.style??i.styles[u.getHighlightState(l,r,p.datumIndex)];u.applyMarkerStyle(f,g,p.point,a,{applyPosition:o,crossFilterSelected:p.crossFilterSelected,hideWithSize0:n});const m=h??u.resolveMarkerDrawingModeForState(c,f);g.__drawingMode!==m&&(g.drawingMode=m)}),r||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((r,o)=>{const a=sa(this,o,s,this.properties.label,i,n),{enabled:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:g}=a;l&&o?.labelText?(r.fontStyle=c,r.fontWeight=h,r.fontSize=u,r.fontFamily=d,r.textAlign="center",r.textBaseline="bottom",r.text=o.labelText,r.x=o.point.x,r.y=o.point.y-10,r.fill=g,r.visible=!0,r.fillOpacity=this.getHighlightStyle(i,o.datumIndex).opacity??1,r.setBoxing(a)):r.visible=!1})}makeStylerParams(e,i,n){const{id:s}=this,{marker:r,lineDash:o,lineDashOffset:a,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:u,yKey:d}=this.properties,g=Hr(e??0),p=un(i),f=un(n);return{marker:{fill:r.fill,fillOpacity:r.fillOpacity,size:r.size,shape:r.shape,stroke:r.stroke,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset},highlightState:g,selectionState:p,candidateState:f,lineDash:o,lineDashOffset:a,seriesId:s,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:u,yKey:d}}makeItemStylerParams(e,i,n,s){const{xKey:r,yKey:o}=this.properties,a=e.resolveColumnById(this,"xValue",i,"object")[n],l=e.resolveColumnById(this,"yValueRaw",i,"mixed-numeric")[n],c=e.getDomain(this,"xValue","key",i).domain,h=e.getDomain(this,this.yCumulativeKey(i),"value",i).domain,u=this.filterItemStylerFillParams(s.fill)??s.fill;return{...yg(a,l,r,o,c,h),xValue:a,yValue:l,...s,fill:u}}makeLabelFormatterParams(){const{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}=this.properties;return{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}}getTooltipContent(e){const{id:i,dataModel:n,processedData:s,axes:r,properties:o}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=o,g=o.allowNullKeys??!1,p=r.x,f=r.y;if(!n||!s||!p||!f)return;const m=s.dataSources.get(this.id)?.data?.[e],y=n.resolveColumnById(this,"xValue",s,"object")[e],b=n.resolveColumnById(this,"yValueRaw",s,"mixed-numeric")[e];if(y===void 0&&!g)return;const v=this.getStyle(void 0),S=this.makeItemStylerParams(n,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:m},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",y,m,a,d,g),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:c,value:this.getAxisValueText(f,"tooltip",b,m,c,d),missing:$o(b)}]},{seriesId:i,datum:m,title:h,xKey:a,xName:l,yKey:c,yName:h,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:e,strokeOpacity:i,strokeWidth:n,lineDash:s,marker:r}=this.getStyle(void 0);return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:r.size,shape:r.shape,fill:r.fill,fillOpacity:r.fillOpacity,stroke:r.stroke,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:n,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:o,title:a,legendItemName:l,showInLegend:c}=this.properties;return[{legendType:e,id:i,itemId:r,legendItemName:l,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:l??a??o??r},symbol:this.legendItemSymbol(),hideInLegend:!c}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,i){const n=i.strokeData.spans,[s]=e;s.path.clear(),Cb(s,n),s.markDirty("LineSeries")}resetDatumAnimation(e){zg([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:r,paths:o}=e,{animationManager:a}=this.ctx;this.updateLinePaths(o,r),Lb(this,a,...o),Qt([i],Vh),kb(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},i),mt(this,"labels",a,n),mt(this,"annotations",a,...s)}animateReadyResize(e){const{contextData:i,paths:n}=e;this.updateLinePaths(n,i),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:i}=this.ctx,{datumSelection:n,labelSelection:s,annotationSelections:r,contextData:o,paths:a,previousContextData:l}=e,[c]=a;if(o.visible===!1&&l?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateLinePaths(a,o)},u=()=>{i.skipCurrentBatch(),h()};if(o==null||l==null){h(),Fh(this,i,"added",this.getAnimationDrawingModes(),n),Zs(this.id,"path_properties",i,[c],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),mt(this,"labels",i,s),mt(this,"annotations",i,...r);return}if(o.crossFiltering!==l.crossFiltering){u();return}const d=J2(o,l,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){u();return}else if(d.status==="no-op")return;wt(this.id,"path_properties",i,[c],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(a,o):d.status==="removed"?this.updateLinePaths(a,l):Eg(this.id,"path_update",i,[c],d.stroke.path),d.hasMotion&&(Fh(this,i,void 0,this.getAnimationDrawingModes(),n),mt(this,"labels",i,s),mt(this,"annotations",i,...r)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(a,o)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Mt}getStyle(e){const{styler:i,marker:n,lineDash:s,lineDashOffset:r,stroke:o,strokeOpacity:a,strokeWidth:l}=this.properties,{size:c,shape:h,fill:u="transparent",fillOpacity:d}=n;let g={};if(i){const p=this.getDataSelectionState(void 0),f=this.getDataCandidacyState(void 0),m=this.makeStylerParams(e,p,f),y=this.cachedCallWithContext(i,m)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],y,{pick:!1})??{}}return g.marker??(g.marker={}),{lineDash:g.lineDash??s,lineDashOffset:g.lineDashOffset??r,stroke:g.stroke??o,strokeOpacity:g.strokeOpacity??a,strokeWidth:g.strokeWidth??l,marker:{fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??d,shape:g.marker.shape??h,size:g.marker.size??c,lineDash:g.marker.lineDash??n.lineDash??s,lineDashOffset:g.marker.lineDashOffset??n.lineDashOffset??r,stroke:g.marker.stroke??n.stroke??o,strokeOpacity:g.marker.strokeOpacity??n.strokeOpacity??a,strokeWidth:g.marker.strokeWidth??n.strokeWidth??l}}}getFormattedMarkerStyle(e){const i=this.getStyle(void 0),n=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,i.marker);return this.getMarkerStyle(this.properties.marker,e,n,{isHighlight:!0},void 0,i)}computeFocusBounds(e){return Gg(this,e)}hasItemStylers(){return this.properties.selection.enabled||this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Wl.className="LineSeries",Wl.type="line",Wl.computeNoStylerMarkerStyle=(t,e,i,n,s)=>{const r=t.getStyle(i);return t.getMarkerStyle(e.marker,s,void 0,{isHighlight:e.isHighlight,highlightState:i,selectionState:n,hideWithSize0:e.hideWithSize0},r.marker,{stroke:r.stroke,strokeWidth:r.strokeWidth,strokeOpacity:r.strokeOpacity})},Wl.computeStylerStyle=(t,e,i)=>t.getStyle(i),Wl.applyStylerDatum=(t,e,i,n,s,r)=>{const{stroke:o,strokeWidth:a,strokeOpacity:l}=r,c=r.marker,h=e.xColumn[i.datumIndex],u=e.yColumn[i.datumIndex],d=t.filterItemStylerFillParams(c.fill)??c.fill,g={...yg(h,u,e.xKey,e.yKey,e.xDomain,e.yDomain),xValue:h,yValue:u,...c,fill:d};i.style=t.getMarkerStyle(e.marker,i,g,{isHighlight:e.isHighlight,highlightState:n,selectionState:s,hideWithSize0:e.hideWithSize0},c,{stroke:o,strokeWidth:a,strokeOpacity:l})};var $B=Wl,WB={series:{stroke:rf,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Oc],["image",_s],["pattern",Qi]]},stroke:{$palette:"stroke"}},label:{...us,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:cf,selection:xr,segmentation:Wu}},VA={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:Qe,dependencies:[gn],options:ah,predictAxis:Bh,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:WB,create:t=>new $B(t)},Xb=class extends AA{constructor(){super(...arguments),this.properties=new CA}getSizeFloorOverride(t){return t.size}};Xb.className="ScatterSeries",Xb.type="scatter";var BA={title:O,showInMiniChart:L,label:{placement:V("top","right","bottom","left"),...ze},tooltip:ke,errorBar:Tc,styler:Ae(Bn),maxRenderedItems:G,...Ie,...q(Bn,["enabled"]),highlight:ht(We,We),colorScale:ho(Bs)},_A={...BA,...Vn,type:Z(_e("scatter")),xKey:Z(O),yKey:Z(O),labelKey:O,colorKey:ho(O),xName:O,yName:O,labelName:O,colorName:ho(O),legendItemName:O,xKeyAxis:O,yKeyAxis:O,errorBar:Ou,highlight:ht(We,We)};_A.selectedKey=Q(O);var UB={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Oc],["image",_s],["pattern",Qi]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...us,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Ec,selection:xr,colorScale:TA},gradientLegend:LA},zA={type:"series",name:"scatter",chartType:"cartesian",version:Qe,dependencies:[gn],options:_A,predictAxis:Eb,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:UB,create:t=>new Xb(t)},GA=[mA,SA,NA,PA,VA,zA],jA=[PC,GA,pI,sy,ry].flat(),HA={angle:["angleKey"],radius:["radiusKey"]},$A={angle:["angleName"],radius:["radiusName"]},qb=class extends Wy{constructor({categoryKey:t,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:n,...s}){super({...s,categoryKey:t,pickModes:e,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new se({name:"items"})),this.nodeData=[],this.itemSelection=At.selectNoInference(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=At.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=At.selectNoInference(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=At.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=n,this.animationState=new Xc("empty",{empty:{update:{target:"ready",action:r=>this.animateEmptyUpdateReady(r)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:r=>this.animateReadyHighlight(r),highlightMarkers:r=>this.animateReadyHighlightMarkers(r),resize:r=>this.animateReadyResize(r),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:r=>this.animateWaitingUpdateReady(r)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:r=>this.animateClearingUpdateEmpty(r)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",r=>this.onLegendItemClick(r)),this.ctx.eventsHub.on("legend:item-double-click",r=>this.onLegendItemDoubleClick(r)))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(t){if(t==="angle")return this.properties.angleKeyAxis;if(t==="radius")return this.properties.radiusKeyAxis}setZIndex(t){super.setZIndex(t),this.contentGroup.zIndex=[t,1],this.highlightGroup.zIndex=[t,2],this.labelGroup.zIndex=[t,3]}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new Wi;return t.pointerEvents=1,t}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new $(-t,-t,t*2,t*2),axis:new $(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&Qt([this.itemSelection,this.highlightSelection],t),e&&Qt([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&&Qt([this.highlightSelection],e),i&&Qt([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 Rt&&i.datum===e)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(t,e){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:n,datumIndex:s}=t??{},r=typeof s=="number"?e?.[s]:void 0;return i===this||r!=null&&r===n}},Jb=class extends Ng{constructor(t,e){super(t,e),this.series=[],this.axes=this.createChartAxes(),this.ctx.axisManager.axisGroup.zIndex=8}createChartAxes(){return new bF}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(t=>t.type==="pie"||t.type==="donut")}async performLayout(t){const e=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=e,this.animationRect=e,this.seriesRoot.translationX=e.x,this.seriesRoot.translationY=e.y,await this.computeCircle(e);for(const n of this.axes)n.update();let i=0;for(const n of this.series)i=Math.max(i,n.properties.marker?.size??0);for(const n of WA(this.series))n.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:e,paddedRect:t.layoutBox},layoutBox:t.layoutBox})}updateAxes(t,e,i,n){if(this.axes.length===0)return;const s=this.axes.angle,r=this.axes.radius,o=s.scale,a=r.innerRadiusRatio;s.innerRadiusRatio=a,s.computeRange(),s.gridLength=n,r.gridAngles=o.ticks({nice:[s.nice,s.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>o.convert(l)),r.gridRange=s.range,r.range=[n,n*a];for(const l of[s,r])l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()}async computeCircle(t){const e=WA(this.series),i=(l,c,h)=>{this.updateAxes(t,l,c,h);for(const d of e)d.centerX=l,d.centerY=c,d.radius=h;const u=e.filter(d=>d.type==="donut"||d.type==="pie");if(u.length>1){const d=u.map(g=>{const p=g.getInnerRadius();return{series:g,innerRadius:p}}).sort((g,p)=>g.innerRadius-p.innerRadius);d.at(-1).series.surroundingRadius=void 0;for(let g=0;g<d.length-1;g++)d[g].series.surroundingRadius=d[g+1].innerRadius}},n=t.width/2,s=t.height/2,r=Math.max(0,Math.min(t.width,t.height)/2);let o=r;i(n,s,o);const a=async({hideWhenNecessary:l=!1}={})=>{const c=[];for(const d of fo(this.axes,e)){const g=await d.computeLabelsBBox({hideWhenNecessary:l},t);g&&c.push(g)}if(c.length===0){i(n,s,r);return}const h=$.merge(c),u=this.refineCircle(h,o,t);i(u.centerX,u.centerY,u.radius),o=u.radius};await a(),await a(),await a(),await a({hideWhenNecessary:!0}),await a({hideWhenNecessary:!0});for(const l of fo(this.axes,e))await l.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:o,centerX:n,centerY:s}}refineCircle(t,e,i){const s=-e,r=-e,o=e,a=e;let l=Math.max(0,s-t.x),c=Math.max(0,r-t.y),h=Math.max(0,t.x+t.width-o),u=Math.max(0,t.y+t.height-a);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,g=i.height-c-u;let p=Math.min(d,g)/2;const f=.5*i.width/2,m=.5*i.height/2,y=Math.min(f,m);if(p<y){p=y;const S=l+h,M=c+u;if(2*p+M>i.height){const D=i.height-2*p;Math.min(c,u)*2>D?(c=D/2,u=D/2):c>u?c=D-u:u=D-c}if(2*p+S>i.width){const D=i.width-2*p;Math.min(l,h)*2>D?(l=D/2,h=D/2):l>h?l=D-h:h=D-l}}const b=l+2*p+h,v=c+2*p+u;return{centerX:(i.width-b)/2+l+p,centerY:(i.height-v)/2+c+p,radius:p}}};Jb.className="PolarChart",Jb.type="polar";function WA(t){return t.filter(e=>e instanceof qb)}var Jg={type:"chart",name:"polar",version:Qe,options:pV,themeTemplate:yb,create(t,e){return new Jb(t,e)},validate(t,e,i,n){const s=[],r=t?.series?.[0]?.type;(r==="pie"||r==="donut")&&t?.axes&&(s.push(new bu([],t.axes,i,"axes")),t=q(t,["axes"]));const o=$t(t,e,i,n);return o.invalid.push(...s),o}},UA=class Kv{constructor(e,i,n,s){this.startAngle=e,this.endAngle=i,this.innerRadius=n,this.outerRadius=s}clone(){const{startAngle:e,endAngle:i,innerRadius:n,outerRadius:s}=this;return new Kv(e,i,n,s)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[Ud](e,i){return new Kv(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 KA({startAngle:t,endAngle:e,innerRadius:i,outerRadius:n}){let s=1/0,r=1/0,o=-1/0,a=-1/0;const l=(c,h)=>{s=Math.min(c,s),r=Math.min(h,r),o=Math.max(c,o),a=Math.max(h,a)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(n*Math.cos(t),n*Math.sin(t)),l(n*Math.cos(e),n*Math.sin(e)),Lr(0,t,e)&&l(n,0),Lr(Math.PI*.5,t,e)&&l(0,n),Lr(Math.PI,t,e)&&l(-n,0),Lr(Math.PI*1.5,t,e)&&l(0,-n),new $(s,r,o-s,a-r)}function la(t,e,i){const n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:s,outerRadius:r}=i;if(i.startAngle===i.endAngle||n<Math.min(s,r)||n>Math.max(s,r))return!1;const o=pd(i.startAngle),a=pd(i.endAngle),l=Math.atan2(e,t);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function er(t,e,i,n,s,r,o,a,l,c){if(Number.isNaN(t)||Number.isNaN(e))return 0;r&&([s,n]=[n,s]);const h=[];if(o===l){const d=Math.pow(i,2)-Math.pow(o-t,2);if(d<0)return 0;const g=Math.sqrt(d);h.push({x:o,y:e+g},{x:o,y:e-g})}else{const d=(c-a)/(l-o),g=a-d*o,p=Math.pow(d,2)+1,f=2*(d*(g-e)-t),m=Math.pow(t,2)+Math.pow(g-e,2)-Math.pow(i,2),y=Math.pow(f,2)-4*p*m;if(y<0)return 0;const b=(-f+Math.sqrt(y))/2/p,v=(-f-Math.sqrt(y))/2/p;h.push({x:b,y:d*b+g},{x:v,y:d*v+g})}let u=0;for(const{x:d,y:g}of h){if(!(d>=Math.min(o,l)&&d<=Math.max(o,l)&&g>=Math.min(a,c)&&g<=Math.max(a,c)))continue;const f=Math.atan2(g-e,d-t);Lr(f,n,s)&&u++}return u}function YA(t,e){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=e,o={x:r*Math.cos(i),y:r*Math.sin(i)},a={x:r*Math.cos(n),y:r*Math.sin(n)},l=s===0?{x:0,y:0}:{x:s*Math.cos(i),y:s*Math.sin(i)},c=s===0?{x:0,y:0}:{x:s*Math.cos(n),y:s*Math.sin(n)};return rn(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||rn(t.start.x,t.start.y,t.end.x,t.end.y,a.x,a.y,c.x,c.y)||er(0,0,r,i,n,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function KB(t,e){const i={x:t.x,y:t.y},n={x:t.x+t.width,y:t.y},s={x:t.x,y:t.y+t.height},r={x:t.x+t.width,y:t.y+t.height};return YA({start:i,end:n},e)||YA({start:s,end:r},e)}function YB(t,e){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=e,o=t.y,a=t.y+t.height,l=t.x,c=t.x+t.width,h=Math.sin(i),u=Math.cos(i),d=Math.sin(n),g=Math.cos(n),p=s*u,f=s*h,m=r*u,y=r*h,b=s*g,v=s*d,S=r*g,M=r*d,D=(I,A)=>I>=l&&I<=c&&A>=o&&A<=a;return!!(D(p,f)||D(m,y)||D(b,v)||D(S,M)||la(l,o,e)||la(c,o,e)||la(l,a,e)||la(c,a,e)||rn(l,o,c,o,p,f,m,y)||rn(l,o,c,o,b,v,S,M)||rn(l,a,c,a,p,f,m,y)||rn(l,a,c,a,b,v,S,M)||rn(l,o,l,a,p,f,m,y)||rn(l,o,l,a,b,v,S,M)||rn(c,o,c,a,p,f,m,y)||rn(c,o,c,a,b,v,S,M)||er(0,0,r,i,n,!1,l,o,c,o)||er(0,0,r,i,n,!1,l,a,c,a)||er(0,0,r,i,n,!1,l,o,l,a)||er(0,0,r,i,n,!1,c,o,c,a)||s>0&&(er(0,0,s,i,n,!1,l,o,c,o)||er(0,0,s,i,n,!1,l,a,c,a)||er(0,0,s,i,n,!1,l,o,l,a)||er(0,0,s,i,n,!1,c,o,c,a)))}function ZA(t,e,i,n){if(i===0&&n===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*n)/(t+1*n))-e<0)return 1;let r=0,o=1;for(let a=0;a<8;a+=1){const l=(r+o)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*n)/(t+l*n))-e<0?r=l:o=l}return r}var XA=1e-6;function Xr(t,e){return fd(t,e)<XA?e:Ci(t-e)+e}function Qg(t,e,i=0){const s=Math.abs(e-t)>=2*Math.PI-XA?2*Math.PI:Ci(e-t);return t=Xr(t,i),e=t+s,{startAngle:t,endAngle:e}}function ep(t,e,i,n,s,r){const o=Math.sin(r),a=Math.cos(r),l=t**2+e**2-i**2;let c,h,u,d;if(a>.5){const v=o/a,S=1+v**2,M=-2*(t+e*v),D=M**2-4*S*l;if(D<0)return;const I=(-M+Math.sqrt(D))/(2*S),A=(-M-Math.sqrt(D))/(2*S);c=I,h=I*v,u=A,d=A*v}else{const v=a/o,S=1+v**2,M=-2*(e+t*v),D=M**2-4*S*l;if(D<0)return;const I=(-M+Math.sqrt(D))/(2*S),A=(-M-Math.sqrt(D))/(2*S);c=I*v,h=I,u=A*v,d=A}const g=a,p=o,f=c*g+h*p,m=u*g+d*p,y=f>0?Xr(Math.atan2(h-e,c-t),n):Number.NaN,b=m>0?Xr(Math.atan2(d-e,u-t),n):Number.NaN;if(y>=n&&y<=s)return y;if(b>=n&&b<=s)return b}function tp(t,e,i,n,s,r){const o=Math.hypot(t,e),a=(o**2-i**2+r**2)/(2*o),l=o-a,c=Math.atan2(e,t),h=Math.acos(-l/i),u=Xr(c+h,n),d=Xr(c-h,n);if(u>=n&&u<=s)return u;if(d>=n&&d<=s)return d}var Qb=class{constructor(t,e,i,n,s){this.cx=t,this.cy=e,this.r=i,this.a0=n,this.a1=s,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.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=Number.NaN,this.a1=Number.NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},zt=class extends Rt{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 KA(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}=Qg(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),r=Qg(t.startAngle,t.endAngle,e);return new UA(Math.max(e,r.startAngle),Math.min(i,r.endAngle),Math.max(n,t.innerRadius),Math.min(s,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,n,s,r,o,a){if(t<=0)return;const{startAngle:l,endAngle:c}=Qg(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const g=a?this.getAngleOffset(h+t):this.getAngleOffset(u-t),p=o?l+g+e:c-g-e,f=a?h+t:u-t,m=f*Math.cos(p),y=f*Math.sin(p);if(d!=null&&(!o&&!(p>=l-1e-6&&p<=d.endAngle-1e-6)||o&&!(p>=d.startAngle+1e-6&&p<=c-1e-6)||a&&f<d.innerRadius-1e-6||!a&&f>d.outerRadius+1e-6))return;const b=new Qb(m,y,t,i,n);if(d!=null){a?(b.clipStart(ep(m,y,t,i,n,d.endAngle)),b.clipEnd(ep(m,y,t,i,n,d.startAngle))):(b.clipStart(ep(m,y,t,i,n,d.startAngle)),b.clipEnd(ep(m,y,t,i,n,d.endAngle)));let I,A;if(o?(I=tp(m,y,t,i,n,d.innerRadius),A=tp(m,y,t,i,n,d.outerRadius)):(I=tp(m,y,t,i,n,d.outerRadius),A=tp(m,y,t,i,n,d.innerRadius)),b.clipStart(I),b.clipEnd(A),I!=null){const{x:k,y:T}=b.pointAt(I),R=Xr(Math.atan2(T,k),l);o?r?.clipStart(R):s.clipEnd(R)}if(A!=null){const{x:k,y:T}=b.pointAt(A),R=Xr(Math.atan2(T,k),l);o?s.clipStart(R):r?.clipEnd(R)}}if(d!=null){const{x:I,y:A}=b.pointAt((b.a0+b.a1)/2);if(!la(I,A,d))return}const{x:v,y:S}=b.pointAt(o===a?b.a0:b.a1),M=Xr(Math.atan2(S,v),l),D=a?r:s;return o?D?.clipStart(M):D?.clipEnd(M),b}updatePath(){const{path:e,centerX:i,centerY:n,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:a,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=Qg(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:g}=this.normalizedRadii(),p=this.normalizedClipSector(),f=u-h,m=f>=2*Math.PI-1e-6;e.clear();const y=this.getAngleOffset(d),b=f-2*y,v=g-d,S=d>0&&b>0?2*d*Math.sin(b/2):0,M=g>0&&b>0?2*g*Math.sin(b/2):0;if(o=Math.floor(Math.max(0,Math.min(o,M/2,v/2))),a=Math.floor(Math.max(0,Math.min(a,M/2,v/2))),l=Math.floor(Math.max(0,Math.min(l,S/2,v/2))),c=Math.floor(Math.max(0,Math.min(c,S/2,v/2))),d===0&&g===0||d>g||S<0||M<=0)return;if((p?.startAngle??h)===(p?.endAngle??u))return;if(m&&this.clipSector==null&&o===0&&a===0&&l===0&&c===0){e.moveTo(i+g*Math.cos(h),n+g*Math.sin(h)),e.arc(i,n,g,h,u),d>s&&(e.moveTo(i+d*Math.cos(u),n+d*Math.sin(u)),e.arc(i,n,d,u,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(d-g)<1e-6){e.arc(i,n,g,h,u,!1),e.arc(i,n,g,u,h,!0),e.closePath();return}const I=this.getAngleOffset(g);if(f<2*I)return;const k=(p?.innerRadius??d)>s,T=d<s||f<2*y,R=Math.max(o,l,a,c),E=R>0?Math.min(v/R,1):1;o*=E,a*=E,l*=E,c*=E;const F=ZA(g,f-2*I,-o,-a);if(o*=F,a*=F,!T&&k){const me=ZA(d,f-2*y,l,c);l*=me,c*=me}else l=0,c=0;const N=Math.max(o+l,a+c),P=N>0?Math.min(v/N,1):1;o*=P,a*=P,l*=P,c*=P;let z=0,Y=0;const j=o/(g-o),ie=a/(g-a);if(j>=0&&j<1-1e-6)z=Math.asin(j);else{z=f/2;const me=g/(1/Math.sin(z)+1);o=Math.min(me,o)}if(ie>=0&&ie<1-1e-6)Y=Math.asin(ie);else{Y=f/2;const me=g/(1/Math.sin(Y)+1);a=Math.min(me,a)}const ge=Math.asin(l/(d+l)),ae=Math.asin(c/(d+c)),le=p?.outerRadius??g,xt=this.getAngleOffset(le),pe=new Qb(0,0,le,h+xt,u-xt),jt=p?.innerRadius??d,di=this.getAngleOffset(jt),fe=k?new Qb(0,0,jt,h+di,u-di):void 0;p!=null&&(pe.clipStart(p.startAngle),pe.clipEnd(p.endAngle),fe?.clipStart(p.startAngle),fe?.clipEnd(p.endAngle));const Ns=this.arc(o,z,h-Math.PI*.5,h+z,pe,fe,!0,!1),wn=this.arc(a,Y,u-Y,u+Math.PI*.5,pe,fe,!1,!1),Jn=this.arc(c,ae,u+Math.PI*.5,u+Math.PI-ae,pe,fe,!1,!0),tt=this.arc(l,ge,h+Math.PI+ge,h+Math.PI*1.5,pe,fe,!0,!0);if(!(T&&k)){if(T){const me=f<Math.PI*.5?r*(1+Math.cos(f))/Math.sin(f):Number.NaN;let He;me>0&&me<g?He=Math.max(Math.hypot(r,me),d):He=r,He=Math.max(He,d);const Me=h+f*.5;e.moveTo(i+He*Math.cos(Me),n+He*Math.sin(Me))}else if(!(tt?.isValid()===!0||fe?.isValid()===!0)){const me=h+f/2,He=d*Math.cos(me),Me=d*Math.sin(me);e.moveTo(i+He,n+Me)}}if(Ns?.isValid()===!0){const{cx:me,cy:He,r:Me,a0:Ei,a1:kn}=Ns;e.arc(i+me,n+He,Me,Ei,kn)}if(pe.isValid()){const{r:me,a0:He,a1:Me}=pe;e.arc(i,n,me,He,Me)}if(wn?.isValid()===!0){const{cx:me,cy:He,r:Me,a0:Ei,a1:kn}=wn;e.arc(i+me,n+He,Me,Ei,kn)}if(!T){if(Jn?.isValid()===!0){const{cx:me,cy:He,r:Me,a0:Ei,a1:kn}=Jn;e.arc(i+me,n+He,Me,Ei,kn)}if(fe?.isValid()===!0){const{r:me,a0:He,a1:Me}=fe;e.arc(i,n,me,Me,He,!0)}if(tt?.isValid()===!0){const{cx:me,cy:He,r:Me,a0:Ei,a1:kn}=tt;e.arc(i+me,n+He,Me,Ei,kn)}}e.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=this.clipSector??this;return la(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:n,innerRadius:Math.min(s,r),outerRadius:Math.max(s,r)})}};zt.className="Sector",x([H()],zt.prototype,"centerX",2),x([H()],zt.prototype,"centerY",2),x([H()],zt.prototype,"innerRadius",2),x([H()],zt.prototype,"outerRadius",2),x([H()],zt.prototype,"startAngle",2),x([H()],zt.prototype,"endAngle",2),x([Ro({equals:(t,e)=>t.equals(e)})],zt.prototype,"clipSector",2),x([H()],zt.prototype,"concentricEdgeInset",2),x([H()],zt.prototype,"radialEdgeInset",2),x([H()],zt.prototype,"startOuterCornerRadius",2),x([H()],zt.prototype,"endOuterCornerRadius",2),x([H()],zt.prototype,"startInnerCornerRadius",2),x([H()],zt.prototype,"endInnerCornerRadius",2);var Tt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},tr={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},qA=class extends It{constructor(){super(...arguments),this.showInLegend=!1}};x([C],qA.prototype,"showInLegend",2);var ev=class extends ln{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};x([C],ev.prototype,"text",2),x([C],ev.prototype,"spacing",2);var tv=class extends Fe{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};x([C],tv.prototype,"fill",2),x([C],tv.prototype,"fillOpacity",2);var Ul=class extends ln{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};x([C],Ul.prototype,"offset",2),x([C],Ul.prototype,"minAngle",2),x([C],Ul.prototype,"minSpacing",2),x([C],Ul.prototype,"maxCollisionOffset",2),x([C],Ul.prototype,"avoidCollisions",2);var iv=class extends ln{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};x([C],iv.prototype,"positionOffset",2),x([C],iv.prototype,"positionRatio",2);var Hh=class extends Fe{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};x([C],Hh.prototype,"colors",2),x([C],Hh.prototype,"length",2),x([C],Hh.prototype,"strokeWidth",2),x([C],Hh.prototype,"itemStyler",2);var xe=class extends Dn{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Tt),this.strokes=Object.values(tr),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 Ga(ev),this.title=new qA,this.innerCircle=new tv,this.shadow=new Cs,this.calloutLabel=new Ul,this.sectorLabel=new iv,this.calloutLine=new Hh,this.tooltip=oa()}};x([C],xe.prototype,"angleKey",2),x([C],xe.prototype,"angleName",2),x([C],xe.prototype,"angleFilterKey",2),x([C],xe.prototype,"radiusKey",2),x([C],xe.prototype,"radiusName",2),x([C],xe.prototype,"radiusMin",2),x([C],xe.prototype,"radiusMax",2),x([C],xe.prototype,"calloutLabelKey",2),x([C],xe.prototype,"calloutLabelName",2),x([C],xe.prototype,"sectorLabelKey",2),x([C],xe.prototype,"sectorLabelName",2),x([C],xe.prototype,"legendItemKey",2),x([C],xe.prototype,"defaultColorRange",2),x([C],xe.prototype,"defaultPatternFills",2),x([C],xe.prototype,"fills",2),x([C],xe.prototype,"strokes",2),x([C],xe.prototype,"fillOpacity",2),x([C],xe.prototype,"strokeOpacity",2),x([C],xe.prototype,"lineDash",2),x([C],xe.prototype,"lineDashOffset",2),x([C],xe.prototype,"cornerRadius",2),x([C],xe.prototype,"itemStyler",2),x([C],xe.prototype,"rotation",2),x([C],xe.prototype,"outerRadiusOffset",2),x([C],xe.prototype,"outerRadiusRatio",2),x([C],xe.prototype,"innerRadiusOffset",2),x([C],xe.prototype,"innerRadiusRatio",2),x([C],xe.prototype,"strokeWidth",2),x([C],xe.prototype,"sectorSpacing",2),x([C],xe.prototype,"hideZeroValueSectorsInLegend",2),x([C],xe.prototype,"innerLabels",2),x([C],xe.prototype,"title",2),x([C],xe.prototype,"innerCircle",2),x([C],xe.prototype,"shadow",2),x([C],xe.prototype,"calloutLabel",2),x([C],xe.prototype,"sectorLabel",2),x([C],xe.prototype,"calloutLine",2),x([C],xe.prototype,"tooltip",2);function nv(t,e,i,n){const s=[i.convert(0),i.convert(1)],r=[n.convert(0),n.convert(1)],o=Math.PI/-2+ni(e),a=t?"initial":"update",l=({radius:p})=>({innerRadius:s[0],outerRadius:s[0]+(s[1]-s[0])*p}),c=({radius:p})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*p});return{nodes:{toFn:(p,f,m,{prevLive:y})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:M}=f;const{stroke:D,fill:I}=f.sectorFormat;if(m==="removed"&&y?(b=y.unsafeDatum?.endAngle,v=y.unsafeDatum?.endAngle):m==="removed"&&!y&&(b=o,v=o),m==="removed"){const k=l(f);S=k.innerRadius,M=k.outerRadius}return{startAngle:b,endAngle:v,outerRadius:M,innerRadius:S,stroke:D,...typeof I=="string"?{fill:I}:{}}},fromFn:(p,f,m,{prevFromProps:y})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:M}=p,{fill:D,stroke:I}=f.sectorFormat;if(m==="updated"&&p.previousDatum==null&&(m="added"),m==="unknown"||m==="added"&&!y?(b=o,v=o,S=f.innerRadius,M=f.outerRadius):m==="added"&&y&&(b=y.endAngle??o,v=y.endAngle??o,S=y.innerRadius??f.innerRadius,M=y.outerRadius??f.outerRadius),m==="added"&&!t){const k=c(f);S=k.innerRadius,M=k.outerRadius}return m==="updated"&&(D=p.fill??D,I=(typeof p.stroke=="string"?p.stroke:void 0)??I),{startAngle:b,endAngle:v,innerRadius:S,outerRadius:M,stroke:I,phase:a,...typeof D=="string"?{fill:D}:{}}}},innerCircle:{fromFn:(p,f)=>({size:p.unsafePreviousDatum?.radius??p.size??0,phase:a}),toFn:(p,f)=>({size:f.radius??0})}}}function ZB(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function XB(t,e){const i=e.y-t.centerY,n=e.x-t.centerX,s=Math.atan2(i,n),r=t.getItemNodes();for(const o of r)if(o.datum.missing!==!0&&Lr(s,o.startAngle,o.endAngle)){const a=Math.hypot(n,i);let l=0;return a<o.innerRadius?l=o.innerRadius-a:a>o.outerRadius&&(l=a-o.outerRadius),{datum:o.datum,distance:l}}}function JA(t){const e=n=>n,i=t.properties.selection.containment;switch(i){case"any":return(n,s)=>{if(s instanceof zt){const r=Oe.fromCanvas(t.contentGroup,new $(n.x,n.y,n.width,n.height));return r.x-=s.centerX,r.y-=s.centerY,YB(r,s)}return!1};case"all":return(n,s)=>{if(s instanceof zt){const{x:r,y:o,width:a,height:l}=Oe.toCanvas(t.contentGroup,s.getBBox());return tl(n,r,o,a,l)}return!1};default:return e(i)}}var qB=class extends bg{constructor(t,e,i,n,s){super(t,e,i,n,s),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},ip=class extends qb{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{...HA,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...$A,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:ZB,label:ra}}),this.properties=new xe,this.phantomNodeData=void 0,this.backgroundGroup=new qt({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Zo,this.radiusScale=new Zo,this.phantomGroup=this.contentGroup.appendChild(new se({name:"phantom",zIndex:-1})),this.phantomSelection=At.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new se({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=At.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new se({name:"pieCalloutLabels"})),this.calloutLabelSelection=At.select(this.calloutLabelGroup,se),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new se({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Mt({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Mt({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new se({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new se({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=At.select(this.innerLabelsGroup,Wi),this.innerCircleSelection=At.select(this.innerCircleGroup,()=>new Mt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=qB,this.angleScale=new Zo,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}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),this.backgroundGroup.remove()}setZIndex(t){super.setZIndex(t),this.backgroundGroup.zIndex=[0,t]}nodeFactory(){const t=new zt;return t.miterLimit=1e9,t}getSeriesDomain(t){return t==="angle"?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(t){if(this.data==null)return;const{visible:e,id:i,ctx:{legendManager:n}}=this,{angleKey:s,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(y,b)=>e&&(n?.getItemEnabled({seriesId:i,itemId:b})??!0)?y:0,u=!this.ctx.animationManager.isSkipped(),d=this.properties.allowNullKeys??!1,g=[],p=[];c?g.push(jr(c,"category",{id:"legendItemKey",allowNullKey:d})):a?g.push(jr(a,"category",{id:"calloutLabelKey",allowNullKey:d})):l&&g.push(jr(l,"category",{id:"sectorLabelKey",allowNullKey:d}));const f=this.radiusScale.type,m=this.angleScale.type;o&&p.push(FP(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),et(o,f,{id:"radiusRaw",processor:h}),Ry("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(et(a,"category",{id:"calloutLabelValue",allowNullKey:d})),l&&p.push(et(l,"category",{id:"sectorLabelValue",allowNullKey:d})),c&&p.push(et(c,"category",{id:"legendItemValue",allowNullKey:d})),r&&p.push(Ey(r,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),et(r,m,{id:"angleFilterRaw"}),Ry("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&g.length>0&&p.push(fg(this.id,this.processedData)),p.push(wh()),await this.requestDataModel(t,this.data,{props:[...g,Ey(s,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),et(s,m,{id:"angleRaw"}),Ry("angleValue",[0,1],0,0),...p]});for(const y of this.processedData?.defs?.values??[]){const{id:b,missing:v,property:S}=y,M=uD(this,v);b!=="angleRaw"&&M>0&&B.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,t.length>0&&or.record(`${this.type}:nodeData`,t.length),this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e,"number"),n=t.resolveColumnById(this,"angleRaw",e,"mixed-numeric"),s=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterValue",e,"number"),r=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterRaw",e,"number"),o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e,"number"):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e,"mixed-numeric"):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e,"object"):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e,"object"):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e,"object"):void 0;return{angleValues:i,angleRawValues:n,angleFilterValues:s,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:n,ctx:{legendManager:s},visible:r}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!i||e?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,e),{angleValues:c,angleRawValues:h,angleFilterValues:u,angleFilterRawValues:d,radiusValues:g,radiusRawValues:p,legendItemValues:f}=l,m=d?.some((I,A)=>I>h[A])??!1;let y=0,b=0;const v=[],S=d==null?void 0:[],M=e.dataSources.get(this.id)?.data??[],D=e.invalidData?.get(this.id);for(const[I,A]of M.entries()){if(D?.[I]===!0)continue;const k=m?u[I]:c[I],T=d!=null&&!m?Math.sqrt(Ze(d[I])/Ze(h[I])):1,R=n.convert(y)+ni(o);y=k,b+=k;const E=n.convert(y)+ni(o),F=Math.abs(E-R),N=R+F/2,P=h[I],Y=(g?.[I]??1)*T,j=p?.[I],ie=f?.[I],ge=this.getLabels(I,A,N,F,l),ae=this.getItemStyle({datum:A,datumIndex:I},!1,!1),le={series:this,datum:A,datumIndex:I,angleValue:P,midAngle:N,midCos:Math.cos(N),midSin:Math.sin(N),startAngle:R,endAngle:E,radius:Y,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(Y),0),sectorFormat:ae,radiusValue:j,legendItemValue:ie,enabled:r&&(s?.getItemEnabled({seriesId:t,itemId:I})??!0),focusable:!0,...ge};v.push(le),S?.push({...le,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=b===0,this.zerosumInnerRing.visible=b===0&&a!=null&&a!==1&&a>0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(t,e,i){const{id:n,ctx:s,properties:r}=this,{formatManager:o}=s,{calloutLabel:a,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:u}=r,d=r.allowNullKeys??!1,g=i.calloutLabelValues?.[t],p=i.sectorLabelValues?.[t],f=i.legendItemValues?.[t],m={datum:e,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},y={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(y.callout=this.getLabelText(g,e,c,"calloutLabel",[],a,{...m,value:g},d)),h&&(y.sector=this.getLabelText(p,e,h,"sectorLabel",[],l,{...m,value:p},d)),u!=null&&(f!=null||d)){const b=f??"";y.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:d?f:b,datum:e,seriesId:n,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??b}return y}getLabels(t,e,i,n,s){const{properties:r}=this,{calloutLabel:o,sectorLabel:a,legendItemKey:l}=r,c=this.getLabelContent(t,e,s),h={};return o.enabled&&c.callout&&n>=ni(o.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),a.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=pd(t),n=-.75*Math.PI,s=i-n,r=Math.floor(s/(Math.PI/2)),o=Dx(r,e.length);return e[o]}getFillParams(t,e,i){if(!(!sn(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getItemStyle({datum:t,datumIndex:e},i,n,s,r){const{fills:o,strokes:a,itemStyler:l}=this.properties,c=this.getHighlightStyle(i,e,s,r),h=n?this.getSelectionStyle(e):void 0,u={fill:o[e],stroke:a[e]},{fill:d,fillOpacity:g,stroke:p,strokeWidth:f,strokeOpacity:m,lineDash:y,lineDashOffset:b,cornerRadius:v,opacity:S}=de(h,c,u,this.properties);let M;return l&&(M=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>{const D=this.makeItemStylerParams(t,e,i,{fill:d,fillOpacity:g,stroke:p,strokeWidth:f,strokeOpacity:m,lineDash:y,lineDashOffset:b,cornerRadius:v});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(l,D),{proxyPaths:{fill:["fills",`${e}`],stroke:["strokes",`${e}`]}})})),{fill:M?.fill??d,fillOpacity:M?.fillOpacity??g,stroke:M?.stroke??p,strokeWidth:M?.strokeWidth??f,strokeOpacity:M?.strokeOpacity??m,lineDash:M?.lineDash??y,lineDashOffset:M?.lineDashOffset??b,cornerRadius:M?.cornerRadius??v,opacity:S}}makeItemStylerParams(t,e,i,n){const{angleKey:s,radiusKey:r,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(n.fill)??n.fill;return{datum:t,angleKey:s,radiusKey:r,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:l,...n,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,e),selectionState:this.getSelectionStateString(e),candidateState:this.getCandidateStateString(e),seriesId:this.id}}getCalloutLineStyle(t,e){const{properties:i}=this;let n={};if(i.calloutLine.itemStyler){const s=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),e,t.datumIndex),r=this.getSelectionStateString(t.datumIndex),o=this.getCandidateStateString(t.datumIndex),a={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:t.datum,highlightState:s,selectionState:r,candidateState:o,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};n=this.cachedCallWithContext(i.calloutLine.itemStyler,a)??{}}return{length:n.length??i.calloutLine.length,strokeWidth:n.strokeWidth??i.calloutLine.strokeWidth,color:n.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,n=t*e+i;return n===t||n<0?0:n}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=n=>({...n,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(n.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 Number.NaN;const i=2+(this.properties.title?.spacing??0),n=Math.max(0,-t);return-t-i-n}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},n=ps(this.nodeDataDependencies,i)!=null;if(n&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),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 s=this.getTitleTranslationY();e.node.y=Number.isFinite(s)?s:0;const r=e.node.getBBox();e.node.visible=e.enabled&&Number.isFinite(s)&&!this.bboxIntersectsSurroundingSeries(r)}for(const s of[this.zerosumInnerRing,this.zerosumOuterRing])s.fillOpacity=0,s.stroke=this.properties.calloutLabel.color,s.strokeWidth=1,s.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&t.node.remove(),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)}};for(const e of this.nodeData)t(e);if(this.phantomNodeData)for(const e of this.phantomNodeData)t(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,calloutLabelSelection:s,labelSelection:r,highlightLabelSelection:o,innerLabelsSelection:a}=this,l=this.nodeData.map(u=>({...u,sectorFormat:{...u.sectorFormat}})),c=this.phantomNodeData?.map(u=>({...u,sectorFormat:{...u.sectorFormat}})),h=(u,d)=>{u.update(d,void 0,g=>this.getDatumId(g.datumIndex)),this.ctx.animationManager.isSkipped()&&u.cleanup()};h(t,this.nodeData),h(e,l),h(i,this.phantomNodeData??[]),h(n,c??[]),s.update(this.calloutNodeData,u=>{const d=new cn;d.tag=0,d.pointerEvents=1,u.appendChild(d);const g=new Wi;g.tag=1,g.pointerEvents=1,u.appendChild(g)}),r.update(this.nodeData),o.update(l),a.update(this.properties.innerLabels,u=>{u.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const s=Math.min(i,this.getOuterRadius()),r=1;e=Math.ceil(s*2+r)}const n=t?[{radius:e}]:[];this.innerCircleSelection.update(n)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:n,processedData:s}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!n||!s)return;const{legendItemValues:r}=this.getProcessedDataValues(n,s),o=this.isSeriesHighlighted(e,r),a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&o,this.labelGroup.visible=i,this.innerCircleSelection.each((g,{radius:p})=>{g.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:p})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),u=this.ctx.animationManager.isSkipped(),d=(g,p,f,m,y)=>{const b=this.getItemStyle(p,m,!0,void 0,r);p.sectorFormat.fill=b.fill,p.sectorFormat.stroke=b.stroke,u&&(g.startAngle=p.startAngle,g.endAngle=p.endAngle,g.innerRadius=p.innerRadius,g.outerRadius=p.outerRadius),(m||u)&&(g.fill=b.fill,g.stroke=b.stroke);const v=this.getFillParams(b.fill,l,c);g.setStyleProperties(b,h,v),g.drawingMode=y,g.cornerRadius=b.cornerRadius,g.fillShadow=this.properties.shadow;const S=Math.max((this.properties.sectorSpacing+(b.stroke==null?0:b.strokeWidth))/2,0);g.inset=S,g.lineJoin=this.properties.sectorSpacing>=0||S>0?"miter":"round";const M=this.ctx.dataSelectionService?.getDataSelectionState(this,p.datumIndex),D=!Vy(M),I=this.properties.selection.selectedOffset;if(D&&I>0){const A=(g.endAngle+g.startAngle)/2;g.centerX=I*Math.cos(A),g.centerY=I*Math.sin(A)}else g.centerX=0,g.centerY=0};this.itemSelection.each((g,p,f)=>d(g,p,f,!1,"overlay")),this.phantomSelection.each((g,p,f)=>d(g,p,f,!1,"overlay")),this.highlightSelection.each((g,p,f)=>{d(g,p,f,!0,a),g.visible=p.datumIndex===e?.datumIndex}),this.phantomHighlightSelection.each((g,p,f)=>{d(g,p,f,!0,a),g.visible=p.datumIndex===e?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:t}=this.properties,{offset:e}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i);for(const s of this.calloutLabelSelection.selectByTag(0)){const r=s.unsafeClosestDatum(),o=n&&this.isItemHighlighted(i,r.datumIndex)===!0,{length:a,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(r,!1),u=l,d=sM(h)?h:t,{calloutLabel:g,outerRadius:p,datumIndex:f}=r;if(g?.text&&!g.hidden&&p!==0){s.visible=!0,s.strokeWidth=u,s.stroke=c??d[f%d.length],s.strokeOpacity=this.getHighlightStyle(o,r.datumIndex).opacity??1,s.fill=void 0;const m=r.midCos*p,y=r.midSin*p;let b=r.midCos*(p+a),v=r.midSin*(p+a);if((g.collisionTextAlign??g.collisionOffsetY!==0)&&g.box!=null){const M=g.box;let D=b,I=v;b<M.x?D=M.x:b>M.x+M.width&&(D=M.x+M.width),v<M.y?I=M.y:v>M.y+M.height&&(I=M.y+M.height);const A=D-b,k=I-v,T=Math.sqrt(Math.pow(A,2)+Math.pow(k,2)),R=T-e;R>0&&(b=b+A*R/T,v=v+k*R/T)}s.x1=m,s.y1=y,s.x2=b,s.y2=v}else s.visible=!1}}getLabelOverflow(t,e){const i=-this.centerX,n=i+e.width,s=-this.centerY,r=s+e.height,o=1;let a=t.width;t.x+o<i?a=(t.x+t.width-i)/t.width:t.x+t.width-o>n&&(a=(n-t.x)/t.width);const l=t.y+o<s||t.y+t.height-o>r,c=this.bboxIntersectsSurroundingSeries(t);return{maxWidth:a,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}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}],n=e**2;return i.some(s=>s.x**2+s.y**2>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e}=this.properties,{offset:i,minSpacing:n}=e,s=t.convert(0),r=m=>!m.calloutLabel||m.outerRadius===0,o=this.calloutNodeData,a=o.filter(m=>!r(m));for(const m of a){const y=m.calloutLabel;y!=null&&(y.hidden=!1,y.collisionTextAlign=void 0,y.collisionOffsetY=0)}if(a.length<=1)return;const l=a.filter(m=>m.midCos<0).sort((m,y)=>m.midSin-y.midSin),c=a.filter(m=>m.midCos>=0).sort((m,y)=>m.midSin-y.midSin),h=a.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,y)=>m.midCos-y.midCos),u=a.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,y)=>m.midCos-y.midCos),d=m=>{const y=m.calloutLabel;if(y==null)return $.zero.clone();const b=this.getLabelStyle(m,e,"calloutLabel"),v=Ml(b),S=this.getCalloutLineStyle(m,!1).length,M=m.outerRadius+S+i,D=m.midCos*M,I=m.midSin*M+y.collisionOffsetY,A=y.collisionTextAlign??y.textAlign,k=y.textBaseline;return Wi.measureBBox(y.text,D,I,{font:this.properties.calloutLabel,textAlign:A,textBaseline:k}).grow(v)},g=(m,y,b)=>{const v=d(m).grow(n/2),S=d(y).grow(n/2);v.x<S.x+S.width&&v.x+v.width>S.x&&(b==="to-top"?v.y<S.y+S.height:v.y+v.height>S.y)&&(y.calloutLabel.collisionOffsetY=b==="to-top"?v.y-S.y-S.height:v.y+v.height-S.y)},p=m=>{const y=m.slice().sort((v,S)=>Math.abs(v.midSin)-Math.abs(S.midSin))[0],b=m.indexOf(y);for(let v=b-1;v>=0;v--){const S=m[v+1],M=m[v];g(S,M,"to-top")}for(let v=b+1;v<m.length;v++){const S=m[v-1],M=m[v];g(S,M,"to-bottom")}},f=m=>{const y=a.some(I=>I.calloutLabel.collisionOffsetY!==0),b=m.map(I=>d(I)),v=b.map(I=>I.clone().grow(n/2));let S=!1;for(let I=0;I<v.length&&!S;I++){const A=v[I];for(let k=I+1;k<m.length;k++){const T=v[k];if(A.collidesBBox(T)){S=!0;break}}}const M=o.map(I=>{const{startAngle:A,endAngle:k,outerRadius:T}=I;return{startAngle:A,endAngle:k,innerRadius:s,outerRadius:T}}),D=b.some(I=>M.some(A=>KB(I,A)));if(!(!S&&!y&&!D))for(const I of m){if(I.calloutLabel.textAlign!=="center")continue;const A=I.calloutLabel;I.midCos<0?A.collisionTextAlign="right":I.midCos>0?A.collisionTextAlign="left":A.collisionTextAlign="center"}};p(l),p(c),f(h),f(u)}getLabelStyle(t,e,i,n=!1){const s=this.ctx.highlightManager?.getActiveHighlight();return sa(this,t,this.properties,e,n,s,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i}=this.properties,n=new Wi,s=this.ctx.highlightManager?.getActiveHighlight(),r=this.isSeriesHighlighted(s);for(const o of this.calloutLabelSelection.selectByTag(1)){const a=o.unsafeClosestDatum(),l=a.calloutLabel,c=e.convert(a.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){o.visible=!1;continue}const u=r&&this.isItemHighlighted(s,a.datumIndex)===!0,d=this.getLabelStyle(a,i,"calloutLabel",u),g=this.getCalloutLineStyle(a,!1).length,p=h+g+i.offset,f=a.midCos*p,m=a.midSin*p+l.collisionOffsetY,y={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};n.text=l.text,n.x=f,n.y=m,n.setFont(d),n.setAlign(y),n.setBoxing(d);const b=n.getBBox();let v=l.text,S=!0;if(i.avoidCollisions){const{maxWidth:M,hasVerticalOverflow:D}=this.getLabelOverflow(b,t);if(b.width>M){const I={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:M};v=kd(l.text,I)}S=!D}o.text=v,o.x=f,o.y=m,o.setFont(d),o.setAlign(y),o.setBoxing(d),o.fill=d.color,o.fillOpacity=this.getHighlightStyle(u,a.datumIndex).opacity??1,o.visible=S}}computeLabelsBBox(t,e){const{calloutLabel:i}=this.properties,{offset:n,maxCollisionOffset:s,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const o=[],a=new Wi;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(a.text=c.text,a.x=0,a.y=h,a.setFont(c),a.setAlign({textBaseline:"bottom",textAlign:"center"}),l=a.getBBox(),o.push(l))}for(const h of this.calloutNodeData){const u=h.calloutLabel;if(!u||h.outerRadius===0)continue;const d=this.getLabelStyle(h,i,"calloutLabel"),g=this.getCalloutLineStyle(h,!1).length,p=h.outerRadius+g+n,f=h.midCos*p,m=h.midSin*p+u.collisionOffsetY;a.text=u.text,a.x=f,a.y=m,a.setFont(d),a.setAlign({textAlign:u.collisionTextAlign??u.textAlign,textBaseline:u.textBaseline}),a.setBoxing(d);const y=a.getBBox();if(u.box=y,Math.abs(u.collisionOffsetY)>s){u.hidden=!0;continue}if(l){const b=-this.centerY,v=new $(l.x-r,b,l.width+2*r,l.y+l.height+r-b);if(y.collidesBBox(v)){u.hidden=!0;continue}}if(t.hideWhenNecessary){const{maxWidth:b,hasVerticalOverflow:v,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(y,e),M=y.width>b;if(v||M||S){u.hidden=!0;continue}}u.hidden=!1,o.push(y)}return o.length===0?null:$.merge(o)}updateSectorLabelNodes(){const{properties:t}=this,{positionOffset:e,positionRatio:i}=this.properties.sectorLabel,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(n),r=this.radiusScale.convert(0),o=r<=0&&this.ctx.legendManager?.getData(this.id)?.filter(c=>c.enabled).length===1,a={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,u)=>{const{outerRadius:d,startAngle:g,endAngle:p}=u,f=s&&this.isItemHighlighted(n,u.datumIndex)===!0;let m=!1;if(u.sectorLabel&&d!==0){const y=this.getLabelStyle(u,t.sectorLabel,"sectorLabel",f),b=r*(1-i)+d*i+e;h.fill=y.color,h.fillOpacity=this.getHighlightStyle(f,u.datumIndex).opacity??1,h.text=u.sectorLabel.text,o?(h.x=0,h.y=0):(h.x=u.midCos*b,h.y=u.midSin*b),h.setFont(y),h.setAlign(a),h.setBoxing(y);const v=h.getBBox(),S=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],M={startAngle:g,endAngle:p,innerRadius:r,outerRadius:d};S.every(([D,I])=>la(D,I,M))&&(m=!0)}h.visible=m});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:g,fontSize:p,fontFamily:f,color:m}=u;h.fontStyle=d,h.fontWeight=g,h.fontSize=p,h.fontFamily=f,h.text=u.text,h.x=0,h.y=0,h.fill=m,h.textAlign="center",t.push(h.getBBox()),e.push(u.spacing)});const i=h=>h===0?0:e[h],n=h=>h===e.length-1?0:e[h],s=t.reduce((h,u)=>Math.max(h,u.width),0),r=t.reduce((h,u,d)=>h+u.height+i(d)+n(d),0),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(s/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,u=-r/2;h<t.length;h++){const g=t[h].height+u+i(h);c.push(g),u=g+n(h)}this.innerLabelsSelection.each((h,u,d)=>{h.visible=l,Array.isArray(h.text)?h.y=c[d]-t[d].height:h.y=c[d]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return XB(this,t)}pickNodesInBBoxPredicate(){return JA(this)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s,ctx:{formatManager:r}}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:g,radiusName:p,tooltip:f}=s,m=this.properties.title.node.getPlainText();if(!i||!n)return;const y=n.dataSources.get(this.id)?.data?.[t],b=this.getProcessedDataValues(i,n),{angleRawValues:v}=b,S=v[t],M=this.getLabelContent(t,y,b),D=M.legendItem??M.callout??M.sector??d,I=lc(i.getDomain(this,"angleRaw","value",n)),A=r.format(this.callWithContext.bind(this),{type:"number",value:S,datum:y,seriesId:e,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:I,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??Co(S,3);return this.formatTooltipWithContext(f,{title:m,symbol:this.legendItemSymbol(t),data:[{label:je(D),fallbackLabel:u,value:A}]},{seriesId:e,datum:y,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:g,radiusName:p,...this.getItemStyle({datum:y,datumIndex:t},!1,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.data?.[t],i=this.getItemStyle({datum:e,datumIndex:t},!1,!1),{fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return sn(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(t){const{visible:e,processedData:i,dataModel:n,id:s,ctx:{legendManager:r}}=this;if(!n||!i||t!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const u=this.getProcessedDataValues(n,i),{angleRawValues:d}=u,g=this.properties.title?.showInLegend&&this.properties.title.text,p=[],f=this.properties.hideZeroValueSectorsInLegend,m=i.dataSources.get(this.id)?.data,y=i.invalidData?.get(this.id);for(let b=0;b<i.input.count;b++){const v=m?.[b],S=d[b];if(y?.[b]===!0||f&&S===0)continue;const M=[];g&&M.push(g);const D=this.getLabelContent(b,v,u);c&&D.legendItem!==void 0?M.push(D.legendItem):a&&a!==o&&D.callout!==void 0?M.push(D.callout):l&&l!==o&&D.sector!==void 0&&M.push(D.sector),M.length!==0&&p.push({legendType:"category",id:s,datum:v,itemId:b,seriesId:s,hideToggleOtherSeries:!0,enabled:e&&(r?.getItemEnabled({seriesId:s,itemId:b})??!0),label:{text:M.map(I=>je(I)).join(" - ")},symbol:this.legendItemSymbol(b),legendItemName:c==null?void 0:v[c],hideInLegend:!h})}return p}setLegendState(t){const{id:e,ctx:{legendManager:i,eventsHub:n}}=this;for(const[s,r]of t.entries())i?.toggleItem(r,e,s);n.emit("chart:request-update",{type:7})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=nv(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);wt(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,n=>this.getDatumId(n.unsafeDatum.datumIndex)),wt(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),mt(this,"callout",e,this.calloutLabelSelection),mt(this,"sector",e,this.labelSelection,this.highlightLabelSelection),mt(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,processedData:s,radiusScale:r,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,l=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,h=(s?.defs.keys.length??0)>0,u=s?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!h||!u)&&this.ctx.animationManager.skipCurrentBatch();const d=!this.nodeData.some(p=>p.enabled),g=nv(!1,this.properties.rotation,r,o);wt(this.id,"nodes",a,[t,e,i,n],g.nodes,p=>this.getDatumId(p.unsafeDatum.datumIndex),l),wt(this.id,"innerCircle",a,[this.innerCircleSelection],g.innerCircle),mt(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),mt(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,mt(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,radiusScale:s,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=nv(!1,this.properties.rotation,s,r);wt(this.id,"nodes",o,[t,e,i,n],a.nodes,l=>this.getDatumId(l.unsafeDatum.datumIndex)),wt(this.id,"innerCircle",o,[this.innerCircleSelection],a.innerCircle),Pg(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Pg(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),Pg(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return`${t}`;const{calloutLabelKey:n,sectorLabelKey:s,legendItemKey:r}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${t}`;if(r){const o=e.resolveKeysById(this,"legendItemKey",i);return ei(o[t])}else if(n){const o=e.resolveKeysById(this,"calloutLabelKey",i);return ei(o[t])}else if(s){const o=e.resolveKeysById(this,"sectorLabelKey",i);return ei(o[t])}return`${t}`}hasItemStylers(){return!(!this.properties.selection.enabled&&this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(t=>t.itemStyler==null))}};ip.className="DonutSeries",ip.type="donut";var QA=ht(We,We),sv={...Cu(We)};sv.selectedOffset=Q(G);var rv={...Ie,radiusMin:w,radiusMax:w,rotation:G,outerRadiusOffset:G,outerRadiusRatio:X,hideZeroValueSectorsInLegend:L,sectorSpacing:w,cornerRadius:w,itemStyler:Ae({...W,..._,...U,cornerRadius:w}),title:{enabled:L,text:O,showInLegend:L,spacing:w,...we},calloutLabel:{enabled:L,offset:G,minAngle:w,avoidCollisions:L,formatter:ti(yn),format:O,itemStyler:Ae({enabled:L,...mn,...we}),...mn,...we},sectorLabel:{enabled:L,positionOffset:G,positionRatio:X,formatter:ti(yn),format:O,itemStyler:Ae({enabled:L,...mn,...we}),...mn,...we},calloutLine:{colors:ne(K),length:w,strokeWidth:w,itemStyler:Ae({color:K,length:w,strokeWidth:w})},fills:ne(Xi),strokes:ne(K),tooltip:ke,shadow:cs,highlight:QA,selection:sv,...U,...q(W,["fill"]),...q(_,["stroke"])},As={...rv,...Vn,type:Z(_e("pie")),angleKey:Z(O),radiusKey:O,calloutLabelKey:O,sectorLabelKey:O,legendItemKey:O,angleName:O,radiusName:O,calloutLabelName:O,sectorLabelName:O,highlight:QA,selection:sv};As.angleFilterKey=Q(O),As.defaultColorRange=Q(ne(ne(Wt))),As.defaultPatternFills=Q(ne(Wt)),As.title._enabledFromTheme=Q(L),As.calloutLabel._enabledFromTheme=Q(L),As.sectorLabel._enabledFromTheme=Q(L),As.angleKeyAxis=Q(O),As.radiusKeyAxis=Q(O);var ew={...rv,innerRadiusOffset:G,innerRadiusRatio:X,innerCircle:{fill:O,fillOpacity:X},innerLabels:{spacing:w,...we,...mn}},tw={...ew,...As,type:Z(_e("donut")),innerLabels:ct({text:Z(O),spacing:w,...we,...mn},"inner label options array")};tw.angleFilterKey=Q(O);var ov={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:br.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...us,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...us,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",_0],["pattern",Qi],["image",_s]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Mo,xOffset:3,yOffset:3,blur:5},highlight:hf,selection:xr},legend:{enabled:!0}},JB={...ov,series:{...ov.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...us,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:hf,selection:xr}},iw={type:"series",name:"donut",chartType:"polar",version:Qe,dependencies:[Jg],options:tw,themeTemplate:JB,create:t=>new ip(t)},av=class extends ip{};av.className="PieSeries",av.type="pie";var nw={type:"series",name:"pie",chartType:"polar",version:Qe,dependencies:[Jg],options:As,themeTemplate:ov,create:t=>new av(t)},sw=[Jg,iw,nw,sy,ry],lv=[jA,sw,RM].flat();function rw(t,e,i,n){return{unit:t,step:e,epoch:i,utc:n,every(s){return rw(this.unit,(this.step??1)*s,this.epoch,this.utc)}}}var ow={};function Lt(t,e=1,i,n=!1){B.warnOnce("time import is deprecated, use object notation instead");const s=`${t}:${e}:${i?.getTime()??0}:${n}`;let r=ow[s];return r==null&&(r=rw(t,e,i,n),ow[s]=r),r}var QB={get millisecond(){return Lt("millisecond")},get second(){return Lt("second")},get minute(){return Lt("minute")},get hour(){return Lt("hour")},get day(){return Lt("day")},get monday(){return Lt("day",7,new Date(1970,0,5))},get tuesday(){return Lt("day",7,new Date(1970,0,6))},get wednesday(){return Lt("day",7,new Date(1970,0,7))},get thursday(){return Lt("day",7,new Date(1970,0,1))},get friday(){return Lt("day",7,new Date(1970,0,2))},get saturday(){return Lt("day",7,new Date(1970,0,3))},get sunday(){return Lt("day",7,new Date(1970,0,4))},get month(){return Lt("month")},get year(){return Lt("year")},get utcMillisecond(){return Lt("millisecond",1,void 0,!0)},get utcSecond(){return Lt("second",1,void 0,!0)},get utcMinute(){return Lt("minute",1,void 0,!0)},get utcHour(){return Lt("hour",1,void 0,!0)},get utcDay(){return Lt("day",1,void 0,!0)},get utcMonth(){return Lt("month",1,void 0,!0)},get utcYear(){return Lt("year",1,void 0,!0)}},qr=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesModule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"series",name:"organization",chartType:"standalone",enterprise:!0,moduleId:"OrganizationSeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"plugin",name:"selection",enterprise:!0,moduleId:"SelectionModule"},{type:"axis:plugin",name:"crossLines",chartType:"cartesian",moduleId:"CrossLinesModule"},{type:"axis:plugin",name:"polarCrossLines",chartType:"polar",optionsKey:"crossLines",enterprise:!0,moduleId:"PolarCrossLinesModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map(t=>[t.name,t]));function e_(t){const e=qr.get(t);return e?.type==="series"?e.chartType:void 0}function aw(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var cv="#ffffff",t_={"radial-gauge":!0,"linear-gauge":!0};function Kl(t){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${t}`,{$lessThan:[{$path:`/series/$index/${t}`},1]},!1]}]},{$path:"/series"}]}}function i_(t){return t_[t]===!0}var Yn=class iu{static getDefaultColors(){return{fills:Tt,fillsFallback:Object.values(Tt),strokes:tr,sequentialColors:en(Tt),divergingColors:[Tt.ORANGE,Tt.YELLOW,Tt.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:De.interpolate([De.fromHexString(Tt.BLUE),De.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[Tt.GREEN,Tt.YELLOW,Tt.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Tt.GREEN,stroke:tr.GREEN},down:{fill:Tt.RED,stroke:tr.RED},neutral:{fill:Tt.GRAY,stroke:tr.GRAY},altUp:{fill:Tt.BLUE,stroke:tr.BLUE},altDown:{fill:Tt.ORANGE,stroke:tr.ORANGE},altNeutral:{fill:Tt.GRAY,stroke:tr.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisLineColor:{$ref:"borderColor"},backgroundColor:cv,borderColor:{$foregroundBackgroundMix:.15},borderRadius:4,borderWidth:1,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px color-mix(in srgb, var(--ag-charts-accent-color) 50%, transparent)",foregroundColor:"#181d1f",fontFamily:'"IBM Plex Sans", -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',fontSize:yr,fontWeight:400,gridLineColor:{$mix:[{$ref:"axisLineColor"},{$ref:"backgroundColor"},.35]},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},buttonBorderRadius:{$ref:"borderRadius"},buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},inputBorderRadius:{$ref:"borderRadius"},inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},menuBorderRadius:{$ref:"borderRadius"},menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:{color:{$ref:"borderColor"},width:{$ref:"borderWidth"}},tooltipBorderRadius:{$ref:"borderRadius"},tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"},groupedCategoryLineColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{$applyPadding:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$applyPadding:{$if:[{$path:"./border/enabled"},5,0]}}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:br.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:kr,textAlign:Tr},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:br.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:kr,textAlign:Tr},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:br.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:kr,textAlign:Tr},highlight:{enabled:!0,drawingMode:{$if:[{$or:[Kl("highlight/highlightedItem/opacity"),Kl("highlight/unhighlightedItem/opacity"),Kl("highlight/highlightedSeries/opacity"),Kl("highlight/unhighlightedSeries/opacity"),Kl("fillOpacity"),Kl("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:Qa,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:Qa},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$path:["/tooltip/range","exact"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]},offset:{$path:["/tooltip/position/offset",{$if:[{$eq:[{$path:"./anchorTo"},"chart"]},0,12]}]}}}}}}constructor(e={}){const{overrides:i,palette:n,params:s}=Ue(e),r=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.processOverrides(o,i);const{fills:a,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=Ji(de(n,{fills:Object.values(a),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=aw(n),this.params=de(s,this.getThemeParameters()),this.config=Ji(Ue(r)),this.overrides=Ji(i),this.presets=Ji(o)}processOverrides(e,i){for(const n of ee.listModulesByType("series")){const s=n.name,r=i[s];i_(s)&&(e[s]=r,delete i[s])}}createChartConfigPerChartType(e){var i;for(const n of ee.listModulesByType("chart"))for(const s of ee.listModulesByType("series"))s.chartType===n.name&&(e[i=s.name]??(e[i]=n.themeTemplate));return e}getDefaults(){const e=(s,r)=>{const o={},a=de({axes:{}},...Array.from(ee.listModulesByType("plugin"),l=>({[l.name]:l.themeTemplate})),ee.getChartModule(s)?.themeTemplate,this.getChartDefaults());for(const l of r){o[l]=de(s_(l),o[l]??a);const{axes:c}=o[l];for(const h of ee.listModulesByType("axis"))c[h.name]=de(c[h.name],!h.chartType||h.chartType===s?n_(h.name):null);(l==="map-shape-background"||l==="map-line-background")&&delete o[l].series.tooltip}return o},i=[...ee.listModulesByType("series")],n=uc(i,s=>s.chartType||"unknown");return de(...Object.keys(n).map(s=>e(s,n[s]?.map(r=>r.name)??[])))}static applyTemplateTheme(e,i,n){if(ue(e))for(let s=0;s<e.length;s++){const r=e[s];typeof r=="symbol"&&n?.has(r)&&(e[s]=n.get(r))}else for(const s of Object.keys(e)){const r=e[s];typeof r=="symbol"&&n?.has(r)&&(e[s]=n.get(r))}}templateTheme(e,i=!0){const n=i?Ue(e):e,s=this.getTemplateParameters();return fs(n,iu.applyTemplateTheme,void 0,void 0,s),n}getDefaultColors(){return iu.getDefaultColors()}getThemeParameters(){return{...iu.getDefaultPublicParameters(),...iu.getPrivateParameters()}}getTemplateParameters(){const e=new Map;e.set(Qa,!1),e.set(Mo,"#00000080"),e.set(sd,"#aaa"),e.set(kr,"block"),e.set(Tr,"center"),e.set(_f,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),e.set(nd,cv),e.set(Gi,Tt.BLUE),e.set(ji,Tt.BLUE),e.set(rd,Tt.BLUE),e.set(od,cv),e.set(ad,"#fafafa"),e.set(ld,"#ddd"),e.set(cd,"#000"),e.set(hd,"#181d1f"),e.set(zf,"#e35c5c"),e.set(Gf,"#e35c5c"),e.set(ud,"#fafafa"),e.set(dd,"#ddd"),e.set(gd,"#000"),e.set(Hc,"top");const i=this.getDefaultColors();return e.set(wf,this.palette.up?.stroke??i.up.stroke),e.set(Tf,this.palette.up?.fill??i.up.fill),e.set(kf,this.palette.down?.stroke??i.down.stroke),e.set(Lf,this.palette.down?.fill??i.down.fill),e.set(Nf,this.palette.neutral?.stroke??i.neutral.stroke),e.set(Of,this.palette.neutral?.fill??i.neutral.fill),e.set(Ef,this.palette.altUp?.stroke??i.up.stroke),e.set(Pf,this.palette.altUp?.fill??i.up.fill),e.set(Rf,this.palette.altDown?.stroke??i.down.stroke),e.set(Ff,this.palette.altDown?.fill??i.down.fill),e.set(Vf,this.palette.altNeutral?.fill??i.altNeutral.fill),e.set(Bf,this.palette.altNeutral?.stroke??i.altNeutral.stroke),e}};function n_(t){let e=ee.getAxisModule(t)?.themeTemplate??{};for(const i of ee.listModulesByType("axis:plugin"))if(i.axisTypes?.includes(t)??!0){const n=i.optionsKey??i.name;e=de({[n]:i.themeTemplate},e)}return e}function s_(t){let e=ee.getSeriesModule(t)?.themeTemplate??{};for(const i of ee.listModulesByType("series:plugin"))(i.seriesTypes?.includes(t)??!0)&&(e=de({series:{[i.name]:i.themeTemplate}},e));return e}var r_=new Set(["foreground"]),hv=new WeakMap,lw=-1,cw=re.create(!0,"perf","theme");function uv(t){lw=ee.ifRegistryChanged(lw,()=>{hv=new WeakMap});const e=hv.get(t);if(e!==void 0)return cw("[CACHE] SanitizedTheme","hit"),e;cw("[CACHE] SanitizedTheme","miss");const i=o_(t);return hv.set(t,i),i}function o_(t){const e=new Map,i=new Set([...ee.listModulesByType("axis:plugin")].map(u=>u.optionsKey??u.name));for(const[u,{type:d,optionsKey:g}]of qr){if(ee.hasModule(u))continue;const p=d==="axis:plugin"?g??u:u;d==="axis:plugin"&&i.has(p)||(e.has(d)?e.get(d).add(p):e.set(d,new Set([p])))}if(e.size===0)return t;function n(u){const d=e.get("plugin");if(!(!ce(u)||!d))for(const g of d)g in u&&u[g].enabled!==!0&&delete u[g]}function s(u){const d=e.get("series:plugin");if(!(!ce(u)||!d))for(const g of d)g in u&&delete u[g]}function r(u){const d=e.get("axis:plugin");if(!(!ce(u)||!d))for(const g of d)g in u&&u[g].enabled!==!0&&delete u[g]}function o(u){if(ce(u))for(const d of Object.keys(u)){if(e.get("axis")?.has(d)){delete u[d];continue}r(u[d])}}function a(u){ce(u)&&(o(u.axes),n(u),s(u.series))}const l=Ue(t.config),c=Ue(t.overrides),h=Ue(t.presets);for(const u of Object.keys(l)){if(e.get("series")?.has(u)){delete l[u];continue}a(l[u])}if(ce(c)){const u=c;ce(u.common)&&(o(u.common.axes),n(u.common));for(const d of Object.keys(u))if(d!=="common"){if(e.get("series")?.has(d)){delete u[d];continue}a(u[d])}}if(ce(h)){const u=h;for(const d of Object.keys(u)){if(e.get("preset")?.has(d)||e.get("series")?.has(d)){delete u[d];continue}n(u[d]),o(u[d]?.axes)}}return Object.create(t,{config:{value:Ji(l),enumerable:!0},overrides:{value:ce(c)?Ji(c):c,enumerable:!0},presets:{value:ce(h)?Ji(h):h,enumerable:!0}})}function a_(t,e,i){const n=Mp(u_(t,e).concat(i));if(!n.length)return;const s=ee.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/r/module-registry/",r=uc(n,o=>o.enterprise?"enterprise":"community");if(n.length){const o=ee.isEnterprise()||r.enterprise?.length?"enterprise":"community";B.errorOnce(["required modules are not registered. Check if you have registered the modules:","",ee.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":h_(n.map(l_),o),"",`See ${s} for more details.`].join(`
`))}}function l_(t){return t.moduleId??t.name}function hw(t){return` ${t},`}function c_(t,e){return t.length?`import {
${t.map(hw).join(`
`)}
} from 'ag-charts-${e}';`:null}function h_(t,e){const i=c_(["ModuleRegistry"].concat(t),e),n=t.map(hw).join(`
`);return`${i}
ModuleRegistry.registerModules([
${n}
]);`}function u_(t,e){const i=new Map,n="axes"in e&&ce(e.axes)?e.axes:{},s=new Set(Object.values(n).map(a=>a?.type).filter(rs)),r=new Set(e.series?.map(a=>a.type).filter(rs));function o(a){i.set(a.name,a)}for(const a of qr.values())if(!ee.hasModule(a.name)&&!r_.has(a.name)&&!(t&&a.chartType&&t!==a.chartType))switch(a.type){case"chart":break;case"axis":if(s.has(a.name)){for(const h of Object.keys(n))n?.[h].type===a.name&&delete n[h];o(a)}break;case"series":r.has(a.name)&&(e.series=e.series.filter(h=>h.type!==a.name),o(a));break;case"plugin":const l=a.name,c=e[l];ce(c)&&(c.enabled!==!1&&o(a),delete e[l]);break;case"axis:plugin":for(const h of Object.values(n)){const u=a.optionsKey??a.name;h?.[u]&&(h[u].enabled!==!1&&o(a),delete h[u])}break;case"series:plugin":for(const h of e.series??[])h[a.name]&&(delete h[a.name],o(a));break}for(const a of r){const l=qr.get(a);l?.type==="series"&&!ee.hasModule(l.name)&&!i.has(l.name)&&(e.series=e.series.filter(c=>c.type!==l.name),o(l))}return Array.from(i.values())}function uw(t,e){const i="axes"in e&&ce(e.axes),n="series"in e&&ue(e.series),s=a=>t==null||!a.chartType||a.chartType===t,r=[],o=new Set;for(const a of ee.listModulesByType("axis:plugin"))s(a)&&o.add(a.optionsKey??a.name);for(const a of ee.listModules())if(ee.isModuleType("plugin",a))s(a)||(delete e[a.name],r.push(a.name));else if(ee.isModuleType("axis:plugin",a)){if(i&&!s(a)){const l=a.optionsKey??a.name;if(o.has(l))continue;for(const c of Object.values(e.axes))delete c[l];r.push(a.name)}}else if(ee.isModuleType("series:plugin",a)&&n&&!s(a)){for(const l of e.series)delete l[a.name];r.push(a.name)}return r}var dv="#192232",oi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ca={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Yl=class extends Yn{getDefaultColors(){return{fills:oi,fillsFallback:Object.values(oi),strokes:ca,sequentialColors:en(oi),divergingColors:[oi.ORANGE,oi.YELLOW,oi.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[oi.GREEN,oi.YELLOW,oi.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:oi.GREEN,stroke:ca.GREEN},down:{fill:oi.RED,stroke:ca.RED},neutral:{fill:oi.GRAY,stroke:ca.GRAY},altUp:{fill:oi.BLUE,stroke:ca.BLUE},altDown:{fill:oi.ORANGE,stroke:ca.ORANGE},altNeutral:{fill:oi.GRAY,stroke:ca.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisLineColor:{$foregroundBackgroundMix:.737},backgroundColor:dv,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},groupedCategoryLineColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qa,!0),t.set(nd,dv),t.set(Gi,oi.BLUE),t.set(rd,"#fff"),t.set(ji,oi.BLUE),t.set(od,dv),t.set(ad,"#28313e"),t.set(ld,"#4b525d"),t.set(cd,"#fff"),t.set(hd,"#fff"),t.set(ud,"#28313e"),t.set(dd,"#4b525d"),t.set(gd,"#fff"),t}constructor(t){super(t)}},Ui={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ha={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},d_=class extends Yl{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ui},fillsFallback:Object.values({...Ui}),strokes:{...ha},sequentialColors:en(Ui),divergingColors:[Ui.GREEN,Ui.BLUE,Ui.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Ui.GREEN,stroke:ha.GREEN},down:{fill:Ui.RED,stroke:ha.RED},neutral:{fill:Ui.BLUE,stroke:ha.BLUE},altUp:{fill:Ui.GREEN,stroke:ha.GREEN},altDown:{fill:Ui.RED,stroke:ha.RED},altNeutral:{fill:Ui.GRAY,stroke:ha.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,Ui.BLUE),t.set(ji,Ui.BLUE),t.set(kr,"overlay"),t.set(Tr,"left"),t.set(Hc,"bottom"),t}},Ki={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ua={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},g_=class extends Yn{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ki},fillsFallback:Object.values({...Ki}),strokes:{...ua},sequentialColors:en(Ki),divergingColors:[Ki.GREEN,Ki.BLUE,Ki.RED],up:{fill:Ki.GREEN,stroke:ua.GREEN},down:{fill:Ki.RED,stroke:ua.RED},neutral:{fill:Ki.BLUE,stroke:ua.BLUE},altUp:{fill:Ki.GREEN,stroke:ua.GREEN},altDown:{fill:Ki.RED,stroke:ua.RED},altNeutral:{fill:Ki.GRAY,stroke:ua.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,Ki.BLUE),t.set(ji,Ki.BLUE),t.set(kr,"overlay"),t.set(Tr,"left"),t.set(Hc,"bottom"),t}},ai={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},da={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},p_=class extends Yl{getDefaultColors(){return{...super.getDefaultColors(),fills:ai,fillsFallback:Object.values(ai),strokes:da,sequentialColors:en(ai),divergingColors:[ai.ORANGE,ai.YELLOW,ai.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[ai.GREEN,ai.YELLOW,ai.RED],up:{fill:ai.GREEN,stroke:da.GREEN},down:{fill:ai.RED,stroke:da.RED},neutral:{fill:ai.GRAY,stroke:da.GRAY},altUp:{fill:ai.BLUE,stroke:da.BLUE},altDown:{fill:ai.RED,stroke:da.RED},altNeutral:{fill:ai.GRAY,stroke:da.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,ai.BLUE),t.set(ji,ai.BLUE),t}},li={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},ga={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},f_=class extends Yn{getDefaultColors(){return{...super.getDefaultColors(),fills:li,fillsFallback:Object.values(li),strokes:ga,sequentialColors:en(li),divergingColors:[li.ORANGE,li.YELLOW,li.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[li.GREEN,li.YELLOW,li.RED],up:{fill:li.GREEN,stroke:ga.GREEN},down:{fill:li.RED,stroke:ga.RED},neutral:{fill:li.GRAY,stroke:ga.GRAY},altUp:{fill:li.BLUE,stroke:ga.BLUE},altDown:{fill:li.RED,stroke:ga.RED},altNeutral:{fill:li.GRAY,stroke:ga.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,li.BLUE),t.set(ji,li.BLUE),t}},bt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},pa={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},m_=class extends Yl{getDefaultColors(){return{fills:bt,fillsFallback:Object.values(bt),strokes:pa,sequentialColors:en(bt),divergingColors:[bt.BLUE,bt.RED],hierarchyColors:[],secondSequentialColors:[bt.BLUE,bt.PURPLE,bt.MAGENTA,bt.PINK,bt.RED,bt.ORANGE,bt.YELLOW,bt.GREEN],secondDivergingColors:[bt.BLUE,bt.RED],secondHierarchyColors:[],up:{fill:bt.GREEN,stroke:pa.GREEN},down:{fill:bt.RED,stroke:pa.RED},neutral:{fill:bt.GRAY,stroke:pa.GRAY},altUp:{fill:bt.BLUE,stroke:pa.BLUE},altDown:{fill:bt.RED,stroke:pa.RED},altNeutral:{fill:bt.GRAY,stroke:pa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,bt.BLUE),t.set(ji,bt.BLUE),t}},vt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},fa={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},y_=class extends Yn{getDefaultColors(){return{...super.getDefaultColors(),fills:vt,fillsFallback:Object.values(vt),strokes:fa,sequentialColors:en(vt),divergingColors:[vt.BLUE,vt.RED],hierarchyColors:[],secondSequentialColors:[vt.BLUE,vt.PURPLE,vt.MAGENTA,vt.PINK,vt.RED,vt.ORANGE,vt.YELLOW,vt.GREEN],secondDivergingColors:[vt.BLUE,vt.RED],secondHierarchyColors:[],up:{fill:vt.GREEN,stroke:fa.GREEN},down:{fill:vt.RED,stroke:fa.RED},neutral:{fill:vt.GRAY,stroke:fa.GRAY},altUp:{fill:vt.BLUE,stroke:fa.BLUE},altDown:{fill:vt.RED,stroke:fa.RED},altNeutral:{fill:vt.GRAY,stroke:fa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,vt.BLUE),t.set(ji,vt.BLUE),t}},Bt={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"},Jr={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"},b_=class extends Yl{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Bt,RED:Bt.ORANGE},fillsFallback:Object.values({...Bt,RED:Bt.ORANGE}),strokes:{...Jr,RED:Jr.ORANGE},sequentialColors:en({...Bt,RED:Bt.ORANGE}),divergingColors:[Bt.ORANGE,Bt.YELLOW,Bt.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Bt.GREEN,Bt.YELLOW,Bt.ORANGE],up:{fill:Bt.GREEN,stroke:Jr.GREEN},down:{fill:Bt.ORANGE,stroke:Jr.ORANGE},neutral:{fill:Bt.GRAY,stroke:Jr.GRAY},altUp:{fill:Bt.BLUE,stroke:Jr.BLUE},altDown:{fill:Bt.ORANGE,stroke:Jr.ORANGE},altNeutral:{fill:Bt.GRAY,stroke:Jr.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,Bt.BLUE),t.set(ji,Bt.BLUE),t}},Gt={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"},ir={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"},v_=class extends Yn{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Gt,RED:Gt.ORANGE},fillsFallback:Object.values({...Gt,RED:Gt.ORANGE}),strokes:{...ir,RED:ir.ORANGE},sequentialColors:en({...Gt,RED:Gt.ORANGE}),divergingColors:[Gt.ORANGE,Gt.YELLOW,Gt.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Gt.GREEN,Gt.YELLOW,Gt.ORANGE],secondHierarchyColors:[],up:{fill:Gt.GREEN,stroke:ir.GREEN},down:{fill:Gt.ORANGE,stroke:ir.ORANGE},neutral:{fill:ir.GRAY,stroke:ir.GRAY},altUp:{fill:Gt.BLUE,stroke:ir.BLUE},altDown:{fill:Gt.ORANGE,stroke:ir.ORANGE},altNeutral:{fill:Gt.GRAY,stroke:ir.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,Gt.BLUE),t.set(ji,Gt.BLUE),t}},Zl={...Br,type:_e("ordinal-time"),paddingInner:X,paddingOuter:X,groupPaddingInner:X,label:ng,parentLevel:oy,interval:PI,crosshair:Ko(!0,!0),crossLines:ct(Ss(te(Ne,Ct),Uo),"a cross-line options array"),bandHighlight:sg,bandAlignment:V("justify","start","center","end"),skipNullBars:L},gv={...Cl,...vh(Ne),type:_e("angle-number"),crossLines:ct(Ss(Ne,Dl),"a cross-line options array"),startAngle:G,endAngle:G,label:{...Vr,orientation:V("fixed","parallel","perpendicular"),format:Fn}};gv.shape=V("polygon","circle");var pv={...Cl,type:_e("angle-category"),shape:V("polygon","circle"),crossLines:ct(Ss(he,Dl),"a cross-line options array"),startAngle:G,endAngle:G,paddingInner:X,groupPaddingInner:X,label:{...Vr,orientation:V("fixed","parallel","perpendicular")}};pv.innerRadiusRatio=X;var dw={...Cl,...vh(Ne),type:_e("radius-number"),shape:V("polygon","circle"),positionAngle:G,innerRadiusRatio:X,title:ay,crossLines:ct(Ss(Ne,tg),"a cross-line options array"),label:{...Vr,format:Fn}},fv={...Cl,type:_e("radius-category"),positionAngle:G,innerRadiusRatio:X,paddingInner:X,paddingOuter:X,groupPaddingInner:X,label:Vr,title:ay,crossLines:ct(Ss(he,tg),"a cross-line options array")};fv.shape=V("polygon","circle");var Xl={lineStyle:V("solid","dashed","dotted"),...U},ma={...W,..._,...U},$h={visible:L,locked:L,readOnly:L,handle:ma,...we},np={position:V("top","center","bottom"),alignment:V("left","center","right"),...we},gw={position:V("top","inside","bottom"),alignment:V("left","center","right"),...we},x_={enabled:L,cornerRadius:w,...we,...W,..._,...U},S_={visible:L,...Xl,..._},pw={divider:_,...W,..._,...we},fw={handle:ma,statistics:pw,...Xl,...W,..._},sp={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:ma,text:np,...Xl,..._},mv={visible:L,locked:L,readOnly:L,axisLabel:x_,handle:ma,text:np,...Xl,..._},mw={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:ma,text:gw,background:W,...Xl,..._},yw={...mw},bw={...mw,middle:S_},yv={label:we,showFill:L,isMultiColor:L,strokes:ne(K),rangeStroke:K,bands:V(4,6,10),...sp},vw={...W,..._,...$h},xw={...W,..._,...$h},Sw={...W,..._,...$h,background:{...W,..._}},bv={visible:L,locked:L,readOnly:L,handle:ma,...W},rp={visible:L,locked:L,readOnly:L,extendStart:L,extendEnd:L,handle:ma,text:np,background:W,statistics:pw,...Xl,..._},Mw={visible:L,up:fw,down:fw},ql={enabled:L,axesButtons:{enabled:L,axes:V("x","y","xy")},toolbar:{enabled:L,padding:w,buttons:ct({..._a,value:V("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:L,buttons:ne(te(Re({..._a,type:V("button"),value:Z(V("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),Re({..._a,type:Z(V("switch")),value:Z(V("lock")),checkedOverrides:_a})))}};ql.data=Q(ls),ql.xKey=Q(O),ql.volumeKey=Q(O),ql.snap=Q(L);var ws={...W,..._,opacity:X},M_={...W,..._,...U,opacity:X},Iw={...W,..._,...U,cornerRadius:w,whisker:{..._,...U},cap:{lengthRatio:X}},Dw={...Iw,opacity:X},Cw=Ae({...W,..._,...U,cornerRadius:w,whisker:{..._,...U},cap:{lengthRatio:X}}),Aw={direction:V("horizontal","vertical"),showInMiniChart:L,styler:Cw,itemStyler:Cw,tooltip:ke,...Ie,...Iw,highlight:ht(Dw,Dw),segmentation:Ba,width:Fs,widthRatio:X},vv={cornerRadius:w,wick:{..._,...U},...W,..._,...U},ww={...vv,opacity:X},kw={item:{up:vv,down:vv},itemStyler:Ae({...W,..._,...U,cornerRadius:w,wick:{..._,...U}}),showInMiniChart:L,tooltip:ke,...Ie,highlight:ht(ww,ww)},Tw={fills:ne(Xi),strokes:ne(K),label:{spacing:w,maxWidth:w,...ze},link:{tension:X,itemStyler:Ae({...W,..._,...U,tension:X}),...W,..._,...U},node:{width:w,spacing:w,itemStyler:Ae({...W,..._,...U}),...W,..._,...U},tooltip:ke,...Ie},Lw={direction:V("horizontal","vertical"),fills:ne(Xi),strokes:ne(K),label:{spacing:w,placement:V("before","middle","after"),...ze},stageLabel:{placement:V("before","after"),format:Fn,...Vr},tooltip:ke,...q(Ie,["showInLegend"]),...q(W,["fill"]),...q(_,["stroke"]),...U,highlight:Wp(ur)},Nw={direction:V("horizontal","vertical"),fills:ne(Xi),strokes:ne(K),itemStyler:Ae({...W,..._,...U}),spacingRatio:X,crisp:L,dropOff:{enabled:L,...W,..._,...U},stageLabel:{placement:V("before","after"),format:Fn,...Vr},label:ze,tooltip:ke,shadow:cs,...q(Ie,["showInLegend"]),...q(W,["fill"]),...q(_,["stroke"]),...U},Ow={title:O,textAlign:V("left","center","right"),verticalAlign:V("top","middle","bottom"),itemPadding:w,itemStyler:Ae({...W,..._}),showInMiniChart:L,label:pr,tooltip:ke,colorScale:Bs,...Ie,..._},Ew={showInMiniChart:L,itemStyler:Ae({..._,...U}),item:{up:{..._,...U},down:{..._,...U}},tooltip:ke,...Ie,highlight:ht(ur,ur)},Rw={colorScale:Bs,minStrokeWidth:w,maxStrokeWidth:w,itemStyler:Ae({..._,...U}),sizeDomain:Se(ne(jp),En(2,2)),label:ze,tooltip:ke,...Ie,..._,...U,highlight:ht(ur,ur)},Pw={..._,...U},Fw={colorScale:Bs,minSize:w,maxSize:w,sizeDomain:Se(ne(jp),En(2,2)),label:{placement:V("top","bottom","left","right"),...ze},tooltip:ke,...Ie,...q(Bn,["enabled"]),highlight:ht(We,We)},Vw={colorScale:Bs,padding:w,itemStyler:Ae({...W,..._,...U}),label:pr,tooltip:ke,...Ie,...W,..._,...U,highlight:ht(We,We)},Bw={...Ie,...W,..._,...U},Jl=Ae({...W,..._,...U,cornerRadius:w}),_w={cornerRadius:w,styler:Jl,itemStyler:Jl,label:ze,tooltip:ke,...Ie,...W,..._,...U,highlight:ht(Rn,Rn)},zw={...Ie,innerSpacing:he,outerSpacing:he,verticalSpacing:he,expander:he,link:he,node:he,tooltip:ke},Gw={direction:V("horizontal","vertical"),aspectRatio:w,spacing:w,reverse:L,itemStyler:Ae({...W,..._,...U}),fills:ne(Xi),strokes:ne(K),label:ze,stageLabel:{spacing:w,placement:V("before","after"),...ze},tooltip:ke,shadow:cs,...Ie,...q(W,["fill"]),...q(_,["stroke"]),...U},jw={connectMissingData:L,marker:Bn,styler:Ae({marker:gr,...W,..._,...U}),label:ze,tooltip:ke,...Ie,...W,..._,...U,highlight:ht(We,We)},Hw={connectMissingData:L,marker:Bn,styler:Ae({marker:gr,..._,...U}),label:ze,tooltip:ke,...Ie,..._,...U,highlight:ht(We,ur)},$w={cornerRadius:w,styler:Jl,itemStyler:Jl,label:ze,tooltip:ke,...Ie,...W,..._,...U,highlight:ht(Rn,Rn)},Ww={cornerRadius:w,columnWidthRatio:X,maxColumnWidthRatio:X,styler:Jl,itemStyler:Jl,label:ze,tooltip:ke,...Ie,...W,..._,...U,highlight:ht(Rn,Rn)},I_={marker:Bn,..._,...U},Uw={marker:{enabled:L,...gr},..._,...U},Kw={marker:gr,..._,...U},Yw={showInMiniChart:L,connectMissingData:L,interpolation:Eu,label:{...ze,placement:V("inside","outside"),spacing:w},tooltip:ke,shadow:cs,...Ie,...W,...I_,item:{low:{...Uw},high:{...Uw}},styler:Ae({...W,item:{low:{...Kw},high:{...Kw}}}),highlight:ht(We,We),segmentation:Ba,invertedStyle:{enabled:L,...W}},Zw=Ae({...W,..._,...U,cornerRadius:w}),Xw={direction:V("horizontal","vertical"),grouped:L,showInMiniChart:L,cornerRadius:w,styler:Zw,itemStyler:Zw,label:{...ze,placement:V("inside","outside"),spacing:w},tooltip:ke,shadow:cs,...Ie,...W,..._,...U,highlight:ht(Rn,Rn),segmentation:Ba,width:Fs,widthRatio:X},qw={fills:ne(Xi),strokes:ne(K),label:{...ze,spacing:w,placement:V("left","right","center"),edgePlacement:V("inside","outside")},link:{itemStyler:Ae({...W,..._,...U}),...W,..._,...U},node:{width:w,spacing:w,minSpacing:Se(w,Jx("spacing")),alignment:V("left","center","right","justify"),verticalAlignment:V("top","bottom","center"),sort:V("data","ascending","descending","auto"),itemStyler:Ae({...W,..._,...U}),...W,..._,...U},tooltip:ke,...Ie},Jw={fills:ne(Xi),strokes:ne(K),colorScale:Bs,sectorSpacing:w,cornerRadius:w,padding:w,itemStyler:Ae({...W,..._}),label:{spacing:w,...pr},secondaryLabel:pr,tooltip:ke,...q(Ie,["highlight","showInLegend"]),...q(W,["fill"]),...q(_,["stroke"]),highlight:{enabled:L,highlightedItem:ws,highlightedBranch:ws,unhighlightedItem:ws,unhighlightedBranch:ws}},Qw={fills:ne(Xi),strokes:ne(K),colorScale:Bs,itemStyler:Ae({...W,..._}),group:{gap:w,padding:w,cornerRadius:w,textAlign:V("left","center","right"),interactive:L,highlight:{enabled:L,highlightedItem:ws,unhighlightedItem:ws},label:{...ze,spacing:w},...W,..._},tile:{gap:w,padding:w,cornerRadius:w,textAlign:V("left","center","right"),verticalAlign:V("top","middle","bottom"),label:{...ze,spacing:w,lineHeight:w,minimumFontSize:w,wrapping:go,overflowStrategy:wu},secondaryLabel:{...ze,lineHeight:w,minimumFontSize:w,wrapping:go,overflowStrategy:wu},highlight:{enabled:L,highlightedItem:ws,highlightedBranch:ws,unhighlightedItem:ws,unhighlightedBranch:ws},selection:Cu(M_),...W,..._},tooltip:ke,...q(Ie,["highlight","selection","showInLegend"])},xv={name:O,cornerRadius:w,itemStyler:Ae({...W,..._,...U,cornerRadius:w}),label:{...ze,placement:V("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:w},tooltip:ke,shadow:cs,...W,..._,...U},ek={direction:V("horizontal","vertical"),showInMiniChart:L,item:{positive:xv,negative:xv,total:xv},line:{enabled:L,..._,...U},tooltip:ke,width:Fs,widthRatio:X,...Ie},op=Re({__type:Z(_e("date")),value:te(O,G)},"a serializable date object"),tk={width:w,height:w,grip:L,fill:K,stroke:K,strokeWidth:w,cornerRadius:w},Te={enabled:L,height:w,spacing:w,cornerRadius:G,mask:{fill:K,fillOpacity:X,stroke:K,strokeWidth:w},minHandle:tk,maxHandle:tk,miniChart:{enabled:L,padding:Ut,label:{enabled:L,avoidCollisions:L,spacing:w,format:Fn,formatter:ti(yn),interval:{minSpacing:w,maxSpacing:w,values:ls,step:G},...we},series:he}},Sv={...W,..._,...U,cornerRadius:w,opacity:X},ik={...Sv,minSize:w,hoverStyle:{fill:W.fill,stroke:_.stroke}},nk={enabled:L,thickness:w,spacing:w,tickSpacing:w,visible:V("auto","always","never"),placement:V("outer","inner"),track:Sv,thumb:ik},D_={...nk,position:V("top","bottom")},C_={...nk,position:V("left","right")},bi={enabled:L,enableAxisScrolling:L,enableSeriesAreaScrolling:L,thickness:w,spacing:w,tickSpacing:w,visible:V("auto","always","never"),placement:V("outer","inner"),track:Sv,thumb:ik,horizontal:D_,vertical:C_},ya={...bh,label:Uo},vi={number:{...q(kl,["type","crossLines"]),top:q(kl,["type","crossLines","position"]),right:q(kl,["type","crossLines","position"]),bottom:q(kl,["type","crossLines","position"]),left:q(kl,["type","crossLines","position"]),crossLines:ya},log:{...q(Tl,["type","crossLines"]),top:q(Tl,["type","crossLines","position"]),right:q(Tl,["type","crossLines","position"]),bottom:q(Tl,["type","crossLines","position"]),left:q(Tl,["type","crossLines","position"]),crossLines:ya},category:{...q(Al,["type","crossLines"]),top:q(Al,["type","crossLines","position"]),right:q(Al,["type","crossLines","position"]),bottom:q(Al,["type","crossLines","position"]),left:q(Al,["type","crossLines","position"]),crossLines:ya},time:{...q(Ll,["type","crossLines"]),top:q(Ll,["type","crossLines","position"]),right:q(Ll,["type","crossLines","position"]),bottom:q(Ll,["type","crossLines","position"]),left:q(Ll,["type","crossLines","position"]),crossLines:ya},"unit-time":{...q(Nl,["type","crossLines"]),top:q(Nl,["type","crossLines","position"]),right:q(Nl,["type","crossLines","position"]),bottom:q(Nl,["type","crossLines","position"]),left:q(Nl,["type","crossLines","position"]),crossLines:ya},"grouped-category":{...q(wl,["type"]),top:q(wl,["type","position"]),right:q(wl,["type","position"]),bottom:q(wl,["type","position"]),left:q(wl,["type","position"]),crossLines:ya},"ordinal-time":{...q(Zl,["type","crossLines"]),top:q(Zl,["type","crossLines","position"]),right:q(Zl,["type","crossLines","position"]),bottom:q(Zl,["type","crossLines","position"]),left:q(Zl,["type","crossLines","position"]),crossLines:ya}},Ql={"angle-category":{...q(pv,["type","crossLines"]),crossLines:{...bh,label:Dl}},"angle-number":{...q(gv,["type","crossLines"]),crossLines:{...bh,label:Dl}},"radius-category":{...q(fv,["type","crossLines"]),crossLines:{...bh,label:tg}},"radius-number":{...q(dw,["type","crossLines"]),crossLines:{...bh,label:tg}}},Ee={visible:Q(L)},A_={common:{...oe,navigator:Te,scrollbar:bi,axes:{...vi,...Ql},annotations:{...ql,line:sp,"horizontal-line":mv,"vertical-line":mv,"disjoint-channel":yw,"parallel-channel":bw,"fibonacci-retracement":yv,"fibonacci-retracement-trend-based":yv,callout:vw,comment:xw,note:Sw,text:$h,arrow:sp,"arrow-up":bv,"arrow-down":bv,"date-range":rp,"price-range":rp,"date-price-range":rp,"quick-date-price-range":Mw},chartToolbar:{enabled:L},initialState:{legend:ct({visible:L,seriesId:O,itemId:O,legendItemName:O},"legend state array"),zoom:{rangeX:{start:te(G,op),end:te(G,op)},rangeY:{start:te(G,op),end:te(G,op)},ratioX:{start:X,end:X},ratioY:{start:X,end:X},autoScaledAxes:ne(_e("y"))}}},line:{...oe,axes:vi,series:Fm,navigator:Te,scrollbar:bi,...Ee},scatter:{...oe,axes:vi,series:BA,navigator:Te,scrollbar:bi,...Ee,paired:Q(L)},bubble:{...oe,axes:vi,series:wA,navigator:Te,scrollbar:bi,...Ee},area:{...oe,axes:vi,series:wM,navigator:Te,scrollbar:bi,...Ee},bar:{...oe,axes:vi,series:Pm,navigator:Te,scrollbar:bi,...Ee},"box-plot":{...oe,axes:vi,series:Aw,navigator:Te,scrollbar:bi,...Ee},candlestick:{...oe,axes:vi,series:kw,navigator:Te,scrollbar:bi,...Ee},"cone-funnel":{...oe,axes:vi,series:Lw,navigator:Te,scrollbar:bi,...Ee},funnel:{...oe,axes:vi,series:Nw,navigator:Te,scrollbar:bi,...Ee},ohlc:{...oe,axes:vi,series:Ew,navigator:Te,scrollbar:bi,...Ee},histogram:{...oe,axes:q(vi,["category","grouped-category","unit-time","ordinal-time"]),series:RA,navigator:Te,scrollbar:bi,...Ee},heatmap:{...oe,axes:vi,series:Ow,navigator:Te,scrollbar:bi,...Ee},waterfall:{...oe,axes:vi,series:ek,navigator:Te,scrollbar:bi,...Ee},"range-bar":{...oe,axes:vi,series:Xw,navigator:Te,scrollbar:bi,...Ee},"range-area":{...oe,axes:vi,series:Yw,navigator:Te,scrollbar:bi,...Ee},donut:{...oe,series:ew,navigator:Te,...Ee},pie:{...oe,series:rv,navigator:Te,...Ee},"radar-line":{...oe,axes:Ql,series:Hw,navigator:Te,...Ee},"radar-area":{...oe,axes:Ql,series:jw,navigator:Te,...Ee},"radial-bar":{...oe,axes:Ql,series:$w,navigator:Te,...Ee},"radial-column":{...oe,axes:Ql,series:Ww,navigator:Te,...Ee},nightingale:{...oe,axes:Ql,series:_w,navigator:Te,...Ee},sunburst:{...oe,series:Jw,navigator:Te,...Ee},treemap:{...oe,series:Qw,navigator:Te,...Ee},"map-shape":{...oe,series:Vw,navigator:Te,...Ee},"map-line":{...oe,series:Rw,navigator:Te,...Ee},"map-marker":{...oe,series:Fw,navigator:Te,...Ee},"map-shape-background":{...oe,series:Bw,navigator:Te,...Ee},"map-line-background":{...oe,series:Pw,navigator:Te,...Ee},sankey:{...oe,series:qw,navigator:Te,...Ee},chord:{...oe,series:Tw,navigator:Te,...Ee},organization:{...oe,series:zw,navigator:Te,...Ee},pyramid:{...oe,series:Gw,navigator:Te,...Ee},"radial-gauge":{...oe,...ju,targets:q(zu,["value"]),tooltip:{...ju.tooltip,...oe.tooltip}},"linear-gauge":{...oe,...Gu,targets:q(_u,["value"]),tooltip:{...Gu.tooltip,...oe.tooltip}}};function ap(t,e){const i={};for(const n of Reflect.ownKeys(t))i[n]=e(t[n],n,t);return i}var w_=ap(A_,function t(e,i){if(Ra(i))return e;if(os(e))return te(e,Vs,Ra);if(ce(e))return te(Re(Dc in e?ap(e,n=>ce(n)?ap(n,t):n):ap(e,t)),Vs,Ra);throw new Error(`Invalid theme override value: ${String(e)}`)}),ci={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},ba={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},k_=class extends Yl{getDefaultColors(){return{fills:ci,fillsFallback:Object.values(ci),strokes:ba,sequentialColors:en(ci),divergingColors:[ci.ORANGE,ci.YELLOW,ci.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ci.GREEN,ci.YELLOW,ci.RED],secondHierarchyColors:[],up:{fill:ci.GREEN,stroke:ba.GREEN},down:{fill:ci.RED,stroke:ba.RED},neutral:{fill:ci.GRAY,stroke:ba.GRAY},altUp:{fill:ci.BLUE,stroke:ba.BLUE},altDown:{fill:ci.ORANGE,stroke:ba.ORANGE},altNeutral:{fill:ci.GRAY,stroke:ba.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,ci.BLUE),t.set(ji,ci.BLUE),t}},hi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},va={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},T_=class extends Yn{getDefaultColors(){return{...super.getDefaultColors(),fills:hi,fillsFallback:Object.values(hi),strokes:va,sequentialColors:en(hi),divergingColors:[hi.ORANGE,hi.YELLOW,hi.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[hi.GREEN,hi.YELLOW,hi.RED],secondHierarchyColors:[],up:{fill:hi.GREEN,stroke:va.GREEN},down:{fill:hi.RED,stroke:va.RED},neutral:{fill:hi.GRAY,stroke:va.GRAY},altUp:{fill:hi.BLUE,stroke:va.BLUE},altDown:{fill:hi.ORANGE,stroke:va.ORANGE},altNeutral:{fill:hi.GRAY,stroke:va.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Gi,hi.BLUE),t.set(ji,hi.BLUE),t}};function Cn(t){let e,i=-1;return()=>(i=ee.ifRegistryChanged(i,()=>{e=t()}),e)}var Mv=Cn(()=>new Yn),Iv={"ag-default-dark":Cn(()=>new Yl),"ag-sheets-dark":Cn(()=>new b_),"ag-polychroma-dark":Cn(()=>new m_),"ag-vivid-dark":Cn(()=>new k_),"ag-material-dark":Cn(()=>new p_),"ag-financial-dark":Cn(()=>new d_),"ag-default":Mv,"ag-sheets":Cn(()=>new v_),"ag-polychroma":Cn(()=>new y_),"ag-vivid":Cn(()=>new T_),"ag-material":Cn(()=>new f_),"ag-financial":Cn(()=>new g_)},Dv=new Map,sk=-1,rk=re.create(!0,"perf","theme"),Wh=t=>{sk=ee.ifRegistryChanged(sk,()=>{Dv.clear()});let e=Dv.get(t);return e==null?(rk("[CACHE] ChartTheme","miss",Cv.name,[t]),e=Cv(t),Dv.set(t,e)):rk("[CACHE] ChartTheme","hit",Cv.name,[t]),e};function Cv(t){if(t instanceof Yn)return t;if(!E_(t))return Mv();if(t==null||typeof t=="string"){const s=Iv[t??"ag-default"];if(s)return s();throw new Error(`Cannot find theme \`${t}\`.`)}const{cleared:e,invalid:i}=$t(L_(t),N_,"theme");for(const s of i)B.warnOnce(String(s));const n=e?.baseTheme?Wh(e.baseTheme):Mv();return e?new n.constructor(e):n}function L_(t){if(!ce(t)||!ce(t.baseTheme))return t;let e=t,i,n;const s=[];for(;typeof e=="object";)i??(i=e.palette),n??(n=e.params),e.overrides&&s.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:de(...s),params:n,palette:i}}var lp=Re({color:K,width:w}),N_={baseTheme:te(O,hr),overrides:w_,params:{accentColor:K,axisLineColor:K,backgroundColor:K,borderColor:K,borderRadius:G,borderWidth:G,chartBackgroundColor:K,chartPadding:G,focusShadow:O,foregroundColor:K,fontFamily:Au,fontSize:G,fontWeight:Ac,gridLineColor:K,popupShadow:O,subtleTextColor:K,textColor:K,groupedCategoryLineColor:K,chromeBackgroundColor:K,chromeFontFamily:Au,chromeFontSize:G,chromeFontWeight:Ac,chromeSubtleTextColor:K,chromeTextColor:K,buttonBackgroundColor:K,buttonBorder:te(L,lp),buttonBorderRadius:G,buttonFontWeight:Ac,buttonTextColor:K,inputBackgroundColor:K,inputBorder:te(L,lp),inputBorderRadius:G,inputTextColor:K,menuBackgroundColor:K,menuBorder:te(L,lp),menuBorderRadius:G,menuTextColor:K,panelBackgroundColor:K,panelSubtleTextColor:K,tooltipBackgroundColor:K,tooltipBorder:te(L,lp),tooltipBorderRadius:G,tooltipTextColor:K,tooltipSubtleTextColor:K,crosshairLabelBackgroundColor:K,crosshairLabelTextColor:K},palette:{fills:ne(d0),strokes:ne(Wt),up:{fill:te(Wt,Du),stroke:Wt},down:{fill:te(Wt,Du),stroke:Wt},neutral:{fill:te(Wt,Du),stroke:Wt}}},O_=V("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function E_(t){const{invalid:e}=$t({theme:t},{theme:te(O_,hr)});for(const i of e)B.warnOnce(String(i));return e.length===0}function cp(t){const e=t.series?.[0]?.type??"line";return ee.getSeriesModule(e)?.chartType??e_(e)??"unknown"}var Je="path",An="pathArray",Ve="default",xi="override",ui="user",Qr="userPartial",Zn="operation",Xn="operationValue",ec="dependency",Av="autoEnable",ok="autoEnableValue",ak="prune",lk="childrenSource";function hp(t){return Nn(t)&&t>=0&&t<=1}function Uh(t,e){let i=t;for(const n of e){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return!1;i=i[n]}return!0}function at(t,e){let i=t;for(const n of e){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return;i=i[n]}return i}function tc(t,e,i){const n=e.length;if(n===0)return;let s=t;const r=n-1,o=e[r];for(let a=0;a<r;a++){const l=e[a],c=e[a+1];let h=s[l];(h==null||!Oa(h))&&(h=Number.isNaN(Number(c))?{}:[],s[l]=h),s=h}s[o]=i}var R_=/^\d+$/;function P_(t,e=0){let i=0;for(let n=t.length-1;n>=0;n--){const s=t[n];if(R_.test(s)&&(i++,i>e))return n}return-1}function ic(t,e=0){const i=P_(t,e);return Number(t[i])}function xa(t,e,i){const n=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],n.shift());let r=!1;for(const o of n){if(o==="..")s.pop(),r||s.pop();else if(o===".")s.pop();else if(o==="$index"){const a=ic(t);if(Number.isNaN(a))return ks;s.push(`${a}`)}else if(o==="$prevIndex"){const a=ic(t);if(Number.isNaN(a)||Number(a)<=0)return ks;s.push(`${Number(a)-1}`)}else if(o.startsWith("$")){const a=i?.[o.slice(1)];if(a==null)return ks;s.push(a)}else o.length!==0&&s.push(o);r=o===".."}return s}var ks=Symbol("unresolvable-path"),Oi=Symbol("resolved-to-branch");function eo(t,e){if(t==null||typeof t!="object"||Array.isArray(t)||(e??(e=Object.keys(t)),e.length===0))return;const i=F_(t,e);if(i)return i;const n=e[0];if(Tv.has(n))return{operation:n,values:Array.isArray(t[n])?t[n]:[t[n]]}}function F_(t,e){if("ref"in t&&typeof t.ref=="string"){let i=0;const n=e.at(-1);if(n&&Tv.has(n)&&(i=1),e.length===1+i)return{operation:"$ref",values:[t.ref]};if("mix"in t&&typeof t.mix=="number"){if(e.length===2+i)return{operation:"$opacity",values:[{$ref:t.ref},J(0,t.mix,1)]};if("onto"in t&&typeof t.onto=="string"&&e.length===3+i)return{operation:"$mix",values:[{$ref:t.ref},{$ref:t.onto},1-J(0,t.mix,1)]}}}}function V_(t,e,i){const n=eo(t.getVertexValue(i));switch(n?.operation){case"$path":{const[s]=n.values,r=t.getPathArray(e),o=xa(r,s);return o===ks?void 0:t.findVertexAtPath(o)}case"$value":return e}}var B_={$cacheMax:__};function __(t,e,i){const[n]=i,s=t.getPathArray(e),r=t.getCachedValue(s,"$cacheMax"),o=t.resolveVertexValue(e,n);if(typeof o!="number")return r;if(typeof r!="number")return t.setCachedValue(s,"$cacheMax",o),o;const a=Math.max(r,o);return t.setCachedValue(s,"$cacheMax",a),a}var z_={$hasSeriesType:{dependencies:wv,resolve:j_},$isChartType:{dependencies:wv,resolve:$_},$isPackageType:G_,$isSeriesType:{dependencies:wv,resolve:H_}};function G_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=ee.isEnterprise();return s==="enterprise"?r:s==="community"?!r:!1}function wv(t,e,i){const n=t.findVertexAtPath(["series","0","type"]);n&&t.addEdge(e,n,ec)}function j_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getResolvedPath(["series"]);if(!Array.isArray(r))return!1;for(const o of r)if(o.type===s)return!0;return!1}function H_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return t.getResolvedPath(["series","0","type"])===s}function $_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getResolvedPath(["series","0","type"]);if(typeof r!="string")return!1;const o=ee.getSeriesModule(r);if(o==null)return!1;switch(s){case"cartesian":return o.chartType==="cartesian";case"polar":return o.chartType==="polar";case"standalone":return o.chartType==="standalone"}return!1}var W_={$foregroundBackgroundMix:U_,$foregroundOpacity:K_,$interpolate:Y_,$isGradient:Z_,$isImage:X_,$isPattern:q_,$mix:J_,$opacity:Q_};function U_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getParamValue("foregroundColor"),o=t.getParamValue("backgroundColor");if(typeof r=="string"&&typeof o=="string"&&hp(s))return De.mix(De.fromString(r),De.fromString(o),1-s).toString();re.inDevelopmentMode(()=>B.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(s)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function K_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getParamValue("foregroundColor");if(typeof r=="string"&&hp(s)){const o=De.fromString(r);return new De(o.r,o.g,o.b,s).toString()}re.inDevelopmentMode(()=>B.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(s)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function Y_(t,e,i){const[n,s]=i,r=t.resolveVertexValue(e,n),o=t.resolveVertexValue(e,s);if(!(!ue(r)||!Nn(o)))return De.interpolate(r.map(a=>De.fromString(a)),o).map(a=>a.toString())}function Z_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return sn(s)}function X_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Oo(s)}function q_(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Us(s)}function J_(t,e,i){const[n,s,r]=i,o=t.resolveVertexValue(e,n),a=t.resolveVertexValue(e,s),l=t.resolveVertexValue(e,r),c=t.getPathArray(e),h=`\`$mix\` json operation failed on [${String(o)}, ${String(a)}, ${String(l)}] at [${c.join(".")}], expecting`,u=`${h} two colors and a number between 0 and 1.`;if(typeof a!="string"||!hp(l)){re.inDevelopmentMode(()=>B.warnOnce(u));return}if(typeof o=="string")try{return De.mix(De.fromString(o),De.fromString(a),l).toString()}catch{re.inDevelopmentMode(()=>B.warnOnce(u));return}if(!sn(o)){re.inDevelopmentMode(()=>B.warnOnce(u));return}let d=o.colorStops;try{d=d?.map(g=>{let p;return typeof g.color=="string"&&(p=De.mix(De.fromString(g.color),De.fromString(a),l).toString()),{...g,color:p}})}catch{re.inDevelopmentMode(()=>B.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...o,colorStops:d}}function Q_(t,e,i){const[n,s]=i,r=t.resolveVertexValue(e,n),o=t.resolveVertexValue(e,s);if(typeof r=="string"&&hp(o)){const a=De.fromString(r);return new De(a.r,a.g,a.b,o).toString()}re.inDevelopmentMode(()=>B.warnOnce(`\`$opacity\` operation failed on [${String(r)}, ${String(o)}}}] at [${t.getPathArray(e).join(".")}], expecting a color and a number between 0 and 1.`))}var ez={$rem:tz};function tz(t,e,i){const[n,s]=i,r=t.getVertexValue(n),o=s?t.getVertexValue(s):"fontSize",a=t.getParamValue(o);if(typeof a=="number"&&typeof r=="number")return Math.round(r*a);re.inDevelopmentMode(()=>B.warnOnce(`\`$rem\` json operation failed on [${String(r)}] at [${t.getPathArray(e).join(".")}], expecting a number.`))}var iz={$and:nz,$eq:sz,$every:rz,$greaterThan:oz,$if:az,$lessThan:lz,$not:cz,$or:hz,$some:uz,$switch:dz};function nz(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);if(i.length===1&&Array.isArray(s))return s.every(r=>!!r);if(!s)return!1}return!0}function sz(t,e,i){let n,s=!0;for(const r of i){const o=t.resolveVertexValue(e,r);if(s)n=o,s=!1;else if(o!==n)return!1}return!0}function rz(t,e,i){const[n,s]=i,r=t.getVertexValue(n),o=t.resolveVertexValue(e,s);if(!Array.isArray(o))return;let a=0;for(const l of o){if(!t.graftAndResolveOrphanValue(e,`${a}`,r,l))return!1;a++}return!0}function oz(t,e,i){const[n,s]=i;return t.resolveVertexValue(e,n)>t.resolveVertexValue(e,s)}function az(t,e,i){const[n,s,r]=i,a=t.resolveVertexValue(e,n)?s:r,l=t.neighboursWithEdgeValue(a,Je);if(l)for(const c of l)t.addEdge(e,c,Je);return t.resolveVertexValue(e,a)}function lz(t,e,i){const[n,s]=i;return t.resolveVertexValue(e,n)<t.resolveVertexValue(e,s)}function cz(t,e,i){const[n]=i;if(n)return!t.resolveVertexValue(e,n)}function hz(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);if(i.length===1&&Array.isArray(s))return s.some(r=>!!r);if(s)return!0}return!1}function uz(t,e,i){const[n,s]=i,r=t.getVertexValue(n),o=t.resolveVertexValue(e,s);if(!Array.isArray(o))return;let a=0;for(const l of o){if(t.graftAndResolveOrphanValue(e,`${a}`,r,l))return!0;a++}return!1}function dz(t,e,i){const[n,s,...r]=i,o=t.resolveVertexValue(e,n);for(const a of r){const l=t.getVertexValue(a);if(!Array.isArray(l))continue;const[c,h]=l;if(o===c||Array.isArray(c)&&c.includes(o))return h}return t.resolveVertexValue(e,s)}var gz={$circular:pz,$isUserOption:fz,$palette:mz,$mapPalette:yz,$path:{dependencies:uk,resolve:bz},$pathString:{dependencies:uk,resolve:vz},$ref:xz};function pz(t,e,i){const[n]=i;t.setResolveFresh(!0);const s=t.resolveVertexValue(e,n);return t.setResolveFresh(!1),s}function fz(t,e,i){const[n,s,r]=i,o=t.neighboursWithEdgeValue(n,Je);if(o)for(const a of o){const l=t.findNeighbour(a,Ve);if(l&&ck(t,e,l))return t.resolveVertexValue(e,s)}else if(ck(t,e,n))return t.resolveVertexValue(e,s);return t.resolveVertexValue(e,r)}function ck(t,e,i){const n=t.resolveVertexValue(e,i);if(!nt(n))throw new Error(`\`$isUserOption\` json operation failed on [${String(n)}], expecting a string.`);const s=t.getPathArray(e),r=xa(s,n);return r===ks?!1:t.hasUserOption(r)}var hk=new Set(["fill","fillFallback","stroke","gradient","range2"]);function mz(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(!nt(s))return;if(hk.has(s)){const o=t.getPathArray(e),a=ic(o);if(Number.isNaN(a))return;switch(s){case"fill":return Ln(t.palette.fills,1,a)[0];case"fillFallback":return Ln(t.palette.fillsFallback,1,a)[0];case"stroke":return Ln(t.palette.strokes,1,a)[0];case"gradient":return Ln(t.palette.sequentialColors,1,a)[0];case"range2":return Ln(t.palette.fills,2,a)}return}if(s==="gradients")return t.palette.sequentialColors;if(s==="type")return t.paletteType;const r=at(t.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function yz(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(!nt(s))return;if(hk.has(s)){const o=t.getPathArray(e);let a=ic(o),l=0;const c=["series","0","type"];for(let h=0;h<a;h++){c[1]=`${h}`;const u=t.getResolvedPath(c);(u==="map-shape-background"||u==="map-line-background")&&l++}if(a-=l,Number.isNaN(a))return;switch(s){case"fill":return Ln(t.palette.fills,1,a)[0];case"fillFallback":return Ln(t.palette.fillsFallback,1,a)[0];case"stroke":return Ln(t.palette.strokes,1,a)[0];case"gradient":return Ln(t.palette.sequentialColors,1,a)[0];case"range2":return Ln(t.palette.fills,2,a)}return}if(s==="gradients")return t.palette.sequentialColors;if(s==="type")return t.paletteType;const r=at(t.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function uk(t,e,i){const[n]=i,s=t.getVertexValue(n);if(nt(s)){const r=t.getPathArray(e),o=xa(r,s);if(o===ks)return;const a=t.findVertexAtPath(o);a&&t.addEdge(e,a,ec)}}function bz(t,e,i){const n=i.length>1,s=i.length>2,[r,o,a]=i,l=t.resolveVertexValue(e,r),c=s?t.resolveVertexValue(e,a):null;if(!nt(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=t.getPathArray(e),u=xa(h,l);if(u===ks)return;const d=c?at(c,u):t.getResolvedPath(u);if(d!=null)return d;if(n)return t.resolveVertexValue(e,o)}function vz(t,e,i){const[n,s]=i,r=t.resolveVertexValue(e,n);if(!nt(r))throw new Error(`\`$path\` json operation failed on [${String(r)}], expecting a string.`);let o;s&&(o=t.graftAndResolveOrphan(e,s));const a=t.getPathArray(e),l=xa(a,r,o);if(l===ks)throw new Error(`Unresolvable path [${r}] at [${a.join(".")}]`);return l}function xz(t,e,i){const[n]=i,s=t.getVertexValue(n);return t.getParamValue(s)}var Sz={$apply:Mz,$applyCycle:Iz,$applyPadding:Dz,$applySwitch:Cz,$applyTheme:Az,$clone:wz,$findFirstSiblingNotOperation:kz,$map:Tz,$merge:Lz,$omit:Nz,$size:Oz,$shallow:Rz,$shallowSimple:Ez,$value:Pz};function Mz(t,e,i){const[n,s,r,o]=i,a=t.getVertexValue(n);if(!Le(a))return;const l=s?t.getVertexValue(s):void 0,c=t.neighboursWithEdgeValue(e,Je),h=c&&c.length>0;if(!h&&l==null)return Oi;const u=r?t.resolveVertexValue(e,r):void 0,d=o?t.resolveVertexValue(e,o):void 0;if(!h&&l!=null)if(eo(l)){const g=t.resolveVertexValue(e,s);Le(g)&&t.graftObject(e,g,[u,d])}else t.graftObject(e,l,[u,d]);if(!h)return Oi;for(const g of c){const p=t.neighboursWithEdgeValue(g,Je);if(!p||p.length===0){const f=t.addVertex({});t.addEdge(g,f,Ve)}else t.graftObject(g,a,[u,d])}return Oi}function Iz(t,e,i){const[n,s,r]=i,o=t.resolveVertexValue(e,n);if(typeof o!="number")return;const a=t.getPathArray(e),l=t.dangerouslyGetUserOption(a),c=t.hasThemeOverride(a),h=l==null?void 0:ui,u=l??t.resolveVertexValue(e,s);if(!Array.isArray(u))return;const d=r?t.getVertexValue(r):void 0;for(let g=0;g<o;g++){const p=u[g%u.length];p!=null&&((l||!c)&&t.graftValue(e,`${g}`,p,void 0,h),d&&t.graftValue(e,`${g}`,d,p,h))}return Oi}function kv(t){return typeof t=="number"?{top:t,right:t,bottom:t,left:t}:typeof t=="object"?t:void 0}function Dz(t,e,i){const[n]=i,s=t.getPathArray(e),r=t.dangerouslyGetUserOption(s),o=t.dangerouslyGetThemeOverride(s),a=t.resolveVertexValue(e,n),l=kv(a);if(typeof l!="object")return;const c=kv(o),h=kv(r);return c==null&&h==null?l:(t.graftObject(e,{...l,...c,...h}),Oi)}function Cz(t,e,i){const[n,s,...r]=i,o=t.resolveVertexValue(e,n);for(const a of r){const l=t.getVertexValue(a);if(!Array.isArray(l))continue;const[c,h]=l;if(o===c||Array.isArray(c)&&c.includes(o))return t.graftObject(e,h,[],Ve),Oi}return t.resolveVertexValue(e,s)}function Az(t,e,i){const[n,s,r]=i;let o=t.getVertexValue(n);if(typeof o=="string"&&(o=[o]),!Array.isArray(o))return;const a=t.neighboursWithEdgeValue(e,Je),l=r?t.getVertexValue(r):[],c=Array.isArray(l)?new Set(l):new Set;if(!a)return Oi;for(const h of a){const u=t.graftAndResolveOrphan(h,s);for(const d of o){const g=xa([],d,u);g!==ks&&t.graftConfig(h,g,c)}}return Oi}function wz(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(Le(s))return t.graftObject(e,s,void 0,ui),Oi}function kz(t,e,i){const[n]=i,s=t.getPathArray(e),r=xa(s,"..");if(r===ks)return;const o=t.findVertexAtPath(r);if(!o)return t.resolveVertexValue(e,n);const a=t.neighboursWithEdgeValue(o,Je);if(a)for(const l of a){const c=t.getPathArray(l);if(c[r.length]===s[r.length])continue;const h=c.concat(s.slice(r.length+1)),u=t.findVertexAtPath(h);if(!u)continue;const d=t.findNeighbourValue(u,ui);if(d!=null)return d;const g=t.findNeighbourValue(u,xi);if(g!=null)return g}return t.resolveVertexValue(e,n)}function Tz(t,e,i){const[n,s]=i,r=t.getVertexValue(n),o=t.resolveVertexValue(e,s);if(!Array.isArray(o))return;const a=t.neighboursWithEdgeValue(e,Je);if(a&&a.length>0)return;let l=0;for(const c of o)t.graftValue(e,`${l}`,r,c),l++;return Oi}function Lz(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);Le(s)&&t.graftObject(e,s)}return Oi}function Nz(t,e,i){const[n,s]=i;let r=t.getVertexValue(n);if(!Array.isArray(r)){const a=V_(t,e,s);if(!a)return;r=t.resolveVertexValue(a,n)}const o=t.resolveVertexValue(e,s);if(!(!Array.isArray(r)||!Le(o)))return q(o,r)}function Oz(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Oa(s)?"length"in s?s.length:Object.keys(s).length:0}function Ez(t,e,i){const n=[];for(const s of i)n.push(t.getVertexValue(s));return n}function Rz(t,e,i){const n=t.getPathArray(e),s=t.hasUserOption(n);if(!s&&i.length===1)return t.resolveVertexValue(e,i[0]);const r=[];for(const o of i)r.push(t.getVertexValue(o));return s?(t.prune(e,[xi,Ve]),Oi):(t.graftObject(e,r),Oi)}function Pz(t,e,i){const[n]=i,s=t.getVertexValue(n),r=t.getPathArray(e);if(s==="$index")return ic(r);if(s==="$parentIndex")return ic(r,1);if(s==="$1")return t.resolveValue$1(r)}var Fz={$isEven:Vz};function Vz(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Number.isNaN(Number(s))?!1:Number(s)%2===0}var Kh={...B_,...z_,...W_,...ez,...gz,...iz,...Fz,...Sz},Tv=new Set(Object.keys(Kh));function nc(t){return Tv.has(t)}var Ye=re.create("opts","options-graph"),Bz=Cd(dk);function dk(t,e,i){return Ye.group("OptionsGraph.constructor()",()=>{const n=new pk(t.config,e,t.params,t.getThemeParameters(),t.palette,t.overrides,t.getTemplateParameters(),i);return{resolve(){return n.resolve()},resolveParams(){return n.resolveParams()},resolveAnnotationThemes(){return n.resolveAnnotationThemes()},resolvePartial(s,r,o,a){return n.resolvePartial(s,r,o,a)},clearSafe(){return n.clearSafe()}}})}var gk=new Set(["context","data","topology"]),to=class Ht extends CS{constructor(e={},i={},n=void 0,s={},r={},o=void 0,a=new Map,l={}){super({cachedNeighboursEdge:Je,processedEdge:Zn,singleValueEdges:new Set([Qr,ui])}),this.config=e,this.userOptions=i,this.palette=r,this.overrides=o,this.internalParams=a,this.cssVariables=l,this.edgePriority=[...Ht.EDGE_PRIORITY],this.graftEdge=Ht.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.resolveFresh=!1,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=ce(i?.theme)?aw(i.theme?.palette):"inbuilt";const c=i.series?.[0]?.type??"line";this.seriesType=c,Ye("build user"),this.buildGraphFromObject(this.root,ui,q(i,["theme"])),Ye("build defaults"),this.buildGraphFromObject(this.root,Ve,q(e[c],Ht.COMPLEX_KEYS));const h=o?q(o[c],Ht.COMPLEX_KEYS):{};Object.keys(h).length>0&&(Ye("build series overrides"),this.buildGraphFromObject(this.root,xi,h));const u=o?q(o.common,Ht.COMPLEX_KEYS):{};Object.keys(u).length>0&&(Ye("build common overrides"),this.buildGraphFromObject(this.root,xi,ee.getSeriesModule(c)?.chartType==="cartesian"?u:q(u,["zoom","navigator"]))),n&&(Ye("build params"),this.buildGraphFromObject(this.params,Ve,n),this.findAndWarnParamsCycle(this.neighboursWithEdgeValue(this.params,Je))&&(this.params=this.addVertex("params"),this.buildGraphFromObject(this.params,Ve,s)));const d=this.findNeighbourWithValue(this.root,"axes",Je),g=this.findNeighbourWithValue(this.root,"series",Je);d&&(Ye("build axes"),this.buildGraphFromObject(d,Ve,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]})),g&&(Ye("build series"),this.buildGraphFromObject(g,Ve,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const p=q(e[c]?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&(Ye("build annotations type config"),this.buildGraphFromObject(this.annotations,Ve,p));const f=q(o?.common?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(Ye("build annotations type overrides"),this.buildGraphFromObject(this.annotations,xi,f));const m=Vu(e[c]?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(m).length>0&&(Ye("build annotations config"),this.buildGraphFromObject(this.root,Ve,{annotations:m}));const y=Vu(o?.common?.annotations??{},Ht.ANNOTATIONS_OPTIONS_KEYS);Object.keys(y).length>0&&(Ye("build annotations overrides"),this.buildGraphFromObject(this.root,xi,{annotations:y})),this.buildDependencyGraph()}static clearValueCache(){Ht.valueCache.clear()}clear(){Ye.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,Ye("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return Ye.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},Ye("resolve params"),this.resolveVertex(this.params,this.resolvedParams),Ye("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),Ye("resolve root"),this.resolveVertex(this.root),Ye("resolved root",this.resolved),Ye("vertex count",this.getVertexCount()),Ye("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(e){const i=super.addVertex(e);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(e,i,n){const s=(this.neighboursWithEdgeValue(e,n)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!s&&(this.rollbackEdgesFrom.push(e),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(n)),super.addEdge(e,i,n)}resolvePartial(e,i,n,s){if(!i||!this.root)return;const{permissivePath:r,proxyPaths:o}=n??{},a=Object.keys(i);if(Ye.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${e.join(".")} [${a}]`),a.length===0)return{};s&&(this.cssVariables={...this.cssVariables,...s});const l=this.findVertexAtPath(e);if(!l){if(r)return;throw new Error(`Could not find vertex in OptionsGraph at path [${e.join(".")}].`)}const c=this.findNeighbour(l,An);if(this.userPartialOptions={},tc(this.userPartialOptions,e,i),o)for(const p of Object.keys(o)){const f=o[p],m=at(i,[p]);m!=null&&(tc(i,f,m),tc(this.userPartialOptions,[...e,...f],m),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=Qr,this.edgePriority=[Qr,...Ht.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(l,Qr,i,c);for(const p of a){const f=o?.[p]?this.findVertexAtPath([...e,...o[p]]):this.findNeighbourWithValue(l,p,Je);f&&this.refreshPendingProcessingEdges(f)}this.buildDependencyGraph();const h={};if(this.resolveVertex(l,h),this.rollback(),this.graftEdge=Ht.GRAFT_EDGE,this.edgePriority=Ht.EDGE_PRIORITY,this.userPartialOptions=void 0,o)for(const p of Object.keys(o)){const f=o[p],m=at(h,[...e,...f]);tc(h,[...e,p],m)}const u=at(h,e),g=n?.pick??!0?Vu(at(h,e),a):u;return Ye("vertex count",this.getVertexCount()),Ye("edge count",this.getEdgeCount()),Ye("resolved partial",g),Ye.check()&&console.groupEnd(),g}findVertexAtPath(e){const i=e.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const n=this.findVertexAlongEdge(this.root,e,Je);if(n)return this.cachedPathVertices.set(i,n),n}hasUserOption(e){if(Uh(this.userOptions,e))return!0;const n=this.findVertexAtPath(e);if(n){if(this.findNeighbour(n,ui)!=null||this.findNeighbour(n,Qr)!=null)return!0;const s=this.findNeighbourValue(n,lk);return s===ui||s===Qr}return!1}dangerouslyGetUserOption(e){if(this.userPartialOptions){const i=at(this.userPartialOptions,e);if(i!=null)return i}return at(this.userOptions,e)}dangerouslyGetThemeOverride(e){if(this.overrides!=null){if(e[0]==="axes"&&e.length>1){const i=this.getResolvedPath(["axes",e[1],"type"]);return at(this.overrides,[this.seriesType,"axes",i,...e.slice(2)])??at(this.overrides,["common","axes",i,...e.slice(2)])}if(e[0]==="series"&&e.length>1){const i=this.getResolvedPath(["series",e[1],"type"]);return at(this.overrides,[i,"series",...e.slice(2)])}return at(this.overrides,[this.seriesType,...e])??at(this.overrides,["common",...e])??at(this.overrides,e)}}hasThemeOverride(e){if(this.overrides==null)return!1;if(e[0]==="axes"&&e.length>1){const i=this.getResolvedPath(["axes",e[1],"type"]);if(Uh(this.overrides,["common","axes",i,...e.slice(2)]))return!0;const n=this.getResolvedPath(["series","0","type"]);return Uh(this.overrides,[n,"axes",i,...e.slice(2)])}if(e[0]==="series"&&e.length>1){const i=this.getResolvedPath(["series",e[1],"type"]);return Uh(this.overrides,[i,"series",...e.slice(2)])}return Uh(this.overrides,e)}getParamValue(e){if(this.resolvedParams[e]!=null)return this.resolvedParams[e];const i=this.findVertexAlongEdge(this.params,[e],Je);if(!i)return;const n=this.findNeighbour(i,Ve);if(!n)return;const s=this.resolveVertexValue(i,n);return this.resolvedParams[e]=s,s}getPathArray(e){return this.findNeighbourValue(e,An)??[]}getResolvedPath(e){return at(this.resolved,e)}getCachedValue(e,i){const n=[...e,i].join(".");return Ht.valueCache.get(n)}setCachedValue(e,i,n){const s=[...e,i].join(".");Ht.valueCache.set(s,n)}setResolveFresh(e){this.resolveFresh=e}prune(e,i){this.addEdge(e,this.addVertex(i),ak)}resolveVertexValue(e,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,Zn);if(n&&nc(n)){const r=this.neighboursWithEdgeValue(i,Xn),o=Kh[n],l=(typeof o=="function"?o:o.resolve)?.(this,e,r??[]);return l===Oi?void 0:this.resolveValueOrSymbol(l)}let s=this.getVertexValue(i);if(Array.isArray(s)){const r={};this.resolveVertexChildren(i,r),s=at(r,this.getPathArray(e))}return this.resolveValueOrSymbol(s)}resolveValue$1(e){for(let i=e.length;i>=0;i--){const n=e.slice(0,i).join("."),s=this.value$1.get(n);if(s!=null)return s}}graftConfig(e,i,n){const s=at(this.config,i),r=this.findNeighbour(e,An);if(ce(s)&&this.buildGraphFromObject(e,Ve,s,r,void 0,n),this.overrides){const o=at(this.overrides,i);ce(o)&&this.buildGraphFromObject(e,xi,o,r,void 0,n);const a=at(this.overrides,["common",...i.slice(1)]);ce(a)&&this.buildGraphFromObject(e,xi,a,r,void 0,n)}this.buildDependencyGraph()}graftObject(e,i,n,s=this.graftEdge){const r=this.findNeighbour(e,An);if(this.buildGraphFromObject(e,s,i,r),this.overrides&&n)for(const o of n){if(o==null)continue;const a=at(this.overrides,o);a&&this.buildGraphFromObject(e,xi,a,r)}this.buildDependencyGraph()}graftValue(e,i,n,s,r=this.graftEdge){const o=[...this.getPathArray(e),i],a=this.findVertexAtPath(o)??this.addVertex(i);eo(s)||(this.value$1.set(o.join("."),s),this.buildGraphFromValue(e,a,r,o,n),this.buildDependencyGraph())}graftAndResolveOrphan(e,i){const n={},s=this.addVertex(n),r=this.getPathArray(e);return this.graftAndResolveChildren(i,s,r,[]),this.resolveVertex(s,n),at(n,r)}graftAndResolveOrphanValue(e,i,n,s,r=this.graftEdge){const o={},a=this.addVertex(o),c=[...this.getPathArray(e),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),s),this.buildGraphFromValue(a,h,r,c,n),this.resolveVertex(a,o),at(o,c)}buildGraphFromObject(e,i,n,s,r=gk,o){const a=Object.keys(n),l=eo(n,a);if(l){const p=this.addVertex(n);this.addEdge(e,p,i),this.buildGraphFromOperation(p,i,l,s);return}if(a.length===0){this.addEdge(e,this.addVertex(Array.isArray(n)?[]:{}),i),this.buildGraphAutoEnable(e,i,n,void 0);return}const c=this.getVertexChildrenByKey(e),h=s?this.getVertexValue(s):[];let u;Array.isArray(n)&&this.addEdge(e,this.addVertex(i),lk);const d=[...h],g=h.length;for(const p of a){if(o?.has(p))continue;const f=c?.get(p)??this.addVertex(p);d[g]=p,r?.has(p)?this.buildShallowGraphFromValue(e,f,i,d,n[p]):this.buildGraphFromValue(e,f,i,d,n[p],r),p==="enabled"&&(u=f)}this.buildGraphAutoEnable(e,i,n,u)}buildGraphAutoEnable(e,i,n,s){if(i===Ve&&!s||i===ui&&s||i!==Ve&&i!==ui&&i!==Qr&&i!==xi)return;let r=this.findNeighbour(e,Av);r||(r=this.addVertex(Av),this.addEdge(e,r,Av)),s&&this.addEdge(s,r,ok);const{enabled:o,_enabledFromTheme:a}=n;this.addEdge(r,this.addVertex({enabled:o,_enabledFromTheme:a,keys:Object.keys(n).length}),i)}getVertexChildrenByKey(e){const i=this.neighboursWithEdgeValue(e,Je);if(!i)return;const n=new Map;for(const s of i)n.set(this.getVertexValue(s),s);return n}buildGraphFromValue(e,i,n,s,r,o){this.addEdge(e,i,Je);let a=this.findNeighbour(i,An);a||(a=this.addVertex([...s]),this.addEdge(i,a,An));const l=eo(r);if(l){const c=this.addVertex(r);this.addEdge(i,c,n),this.addEdge(c,a,An),this.buildGraphFromOperation(c,n,l,a)}else if(Oa(r))this.buildGraphFromObject(i,n,r,a,o);else{const c=this.findNeighbour(i,n);if(c&&this.getVertexValue(c)===r)return;const h=this.addVertex(r);this.addEdge(i,h,n)}}buildShallowGraphFromValue(e,i,n,s,r){this.addEdge(e,i,Je);let o=this.findNeighbour(i,An);o||(o=this.addVertex([...s]),this.addEdge(i,o,An));const a=this.addVertex(r);this.addEdge(i,a,n)}buildGraphFromOperation(e,i,n,s){const r=this.addVertex(n.operation);this.addEdge(e,r,Zn);for(const o of n.values)this.buildGraphFromOperationValue(e,o,i,s)}buildGraphFromOperationValue(e,i,n,s=this.EMPTY_PATH_ARRAY_VERTEX){const r=this.addVertex(i);this.addEdge(e,s,An),this.addEdge(e,r,Xn);const o=eo(i);o?this.buildGraphFromOperation(r,n,o,s):Oa(i)&&this.buildGraphFromObject(r,n,i,s)}findAndWarnParamsCycle(e,i){let n=!1;if(!this.params||!e)return n;for(const s of e){if(!s)continue;if(typeof s.value=="string"&&i?.includes(s.value))return B.warnOnce(`Infinite loop cycle found in theme params [${i.join(" -> ")}], ignoring.`),!0;const r=[...i??[]];typeof s.value=="string"&&r?.push(s.value);const o=this.findNeighbour(s,Ve);o&&(n||(n=this.findAndWarnParamsCycleVertex(o,r)))}return n}findAndWarnParamsCycleVertex(e,i){let n=!1;const s=this.findNeighbourValue(e,Zn);if(!s||!nc(s))return n;const r=this.neighboursWithEdgeValue(e,Xn);if(!r)return n;if(s==="$ref"){const o=this.findNeighbourWithValue(this.params,r[0].value,Je);n||(n=this.findAndWarnParamsCycle([o],i))}else for(const o of r)n||(n=this.findAndWarnParamsCycleVertex(o,[...i]));return n}buildDependencyGraph(){for(let e=0;e<this.pendingProcessingEdgesFrom.length;e++){const i=this.pendingProcessingEdgesFrom[e],n=this.pendingProcessingEdgesTo[e],s=this.getVertexValue(n);if(!nc(s))continue;const r=this.neighboursWithEdgeValue(i,Xn),o=Kh[s];(typeof o=="function"?void 0:o.dependencies)?.(this,i,r??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}refreshPendingProcessingEdges(e){const n=this.findNeighbour(e,Ve)??e,s=this.findNeighbour(n,Zn);if(s){this.pendingProcessingEdgesFrom.push(n),this.pendingProcessingEdgesTo.push(s);const o=this.neighboursWithEdgeValue(n,Xn);if(o)for(const a of o)this.refreshPendingProcessingEdges(a)}const r=this.neighboursWithEdgeValue(e,Je);if(r)for(const o of r)this.refreshPendingProcessingEdges(o)}resolveVertex(e,i=this.resolved,n){const s=this.getPathArray(e),r=s[0];if(s.length===1&&this.resolvedRootAncestorsPaths.add(r),!this.resolveFresh&&s.length>1&&!this.resolvedRootAncestorsPaths.has(r)){const o=this.findVertexAtPath([r]);if(o){this.resolveVertex(o,i,n);return}}if(!this.resolveFresh&&this.userPartialOptions==null&&i===this.resolved&&s.length>0){const o=at(i,s);if(o!=null&&!Le(o))return}this.resolveVertexInEdgePriority(e,i,s,n),this.resolveVertexAutoEnable(e,i,s),this.resolveVertexChildren(e,i,n)}resolveVertexInEdgePriority(e,i,n,s){const r=n.at(-1),o=this.neighboursWithEdgeValue(e,Je);let a=this.edgePriority;if(r in Ht.TRANSFORM_USER_KEY_OPERATION_PAIRS){const c=Ht.TRANSFORM_USER_KEY_OPERATION_PAIRS[r],h=eo(this.findNeighbourValue(e,xi))?.operation.valueOf()===c,u=eo(this.findNeighbourValue(e,Ve))?.operation.valueOf()===c;h?a=[xi,Ve]:u&&(a=[Ve])}const[l]=a;for(const c of a){const h=this.findNeighbour(e,c);if(h==null)continue;const u=this.resolveVertexValueInternal(e,h);if(!(u==null&&c!==l)&&!(o&&o.length>0&&c!==l)&&!(Array.isArray(s)&&s.includes(c))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=u!=null&&Ht.UNSAFE_CLEAR_KEYS.has(r)),n.length===0){if(u==null)continue;this.resolved=u}else tc(i,n,u);break}}}resolveVertexValueInternal(e,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,Zn);if(n&&nc(n)){const s=this.neighboursWithEdgeValue(i,Xn),r=Kh[n],a=(typeof r=="function"?r:r.resolve)?.(this,e,s??[]);return a===Oi?void 0:this.resolveValueOrSymbol(a)}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(e,i,n){const s=this.neighboursWithEdgeValue(e,ok)?.[0];if(!s)return;const r=this.findVertexAtPath(n),o=this.findNeighbourValue(s,Ve),a=this.findNeighbourValue(s,xi),l=this.findNeighbourValue(s,ui),h=r&&this.findNeighbour(r,ui)!=null?void 0:this.findNeighbourValue(s,Qr);if(h?.enabled===!1)return;(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!o?._enabledFromTheme&&!a?._enabledFromTheme&&tc(i,n,!0)}resolveVertexChildren(e,i,n){const s=this.neighboursWithEdgeValue(e,Je);if(s){n??(n=this.findNeighbourValue(e,ak));for(const r of s){const o=this.getVertexValue(r);s.length>1&&nc(o)||o!=="_enabledFromTheme"&&this.resolveVertex(r,i,n)}}}resolveVertexDependencies(e){const i=this.neighboursWithEdgeValue(e,ec);if(i)for(const n of i)this.resolveVertex(n)}graftAndResolveChildren(e,i,n,s){const r=this.neighboursWithEdgeValue(e,Je);if(r)for(const o of r){const a=this.getVertexValue(o),l=[...n,a],c=[...s,a],h=this.addVertex(a),u=this.findNeighbourValue(o,Ve);this.addEdge(i,h,Je);const d=this.addVertex(l);if(this.addEdge(h,d,An),ce(u)){this.buildGraphFromObject(h,Ve,u,d);const g=this.findNeighbour(h,Ve);this.addEdge(g,this.addVertex(l),An);const p=this.findNeighbourValue(g,Zn);if(nc(p)){const f=this.neighboursWithEdgeValue(g,Xn),m=Kh[p];(typeof m=="function"?void 0:m.dependencies)?.(this,g,f??[])}}this.graftAndResolveChildren(o,h,l,c)}}resolveValueOrSymbol(e){return typeof e=="symbol"&&this.internalParams?.has(e)?this.internalParams.get(e):typeof e=="string"&&e in this.cssVariables?this.cssVariables[e]:e}snapshot(){Ye("snapshot"),this.isRollingBack=!0}rollback(){Ye(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let e=0;e<this.rollbackEdgesFrom.length;e++){const i=this.rollbackEdgesFrom[e],n=this.rollbackEdgesTo[e],s=this.rollbackEdgesValue[e];this.removeEdge(i,n,s)}for(const e of this.rollbackVertices)this.removeVertex(e);this.cachedPathVertices.clear(),this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1}diagram(e,i=2){this.diagramKeys=new Map,this.diagramEdges=new Map;const n=this.findVertexAtPath(e),s=["---","config:"," layout: elk"," look: neo"," theme: redux","---","flowchart TB"];n&&this.diagramVertex(s,n,1,i),s.push("classDef UO fill: #e8f5e8, stroke: #4caf50"),s.push("classDef DE fill: #e3f2fd, stroke: #2196f3"),s.push("classDef DEP fill: #ffe0fd, stroke: #ff00f2"),s.push("classDef OP fill: #fff3e0, stroke: #ff9800"),s.push("classDef OPV fill: #fff3e0, stroke: #ff9800, stroke-width: 1px"),s.push("classDef OV fill: #e8f5ee, stroke: #4caf87"),console.log(s.join(`
`))}diagramKey(e){let i=this.diagramKeys.get(e);return i||(i=`${this.diagramKeys.size}`,this.diagramKeys.set(e,i)),i}diagramLabel(e,i,n){let s=this.diagramKeys.get(e);if(s)return s;s=this.diagramKey(e);const r={[ui]:"UO",[Ve]:"DE",[ec]:"DEP",[Zn]:"OP",[Xn]:"OPV",[xi]:"OV"};let o=n?r[n]??void 0:void 0;return o=o?`:::${o}`:"",typeof i.value=="symbol"?`${s}[/"[symbol]"\\]${o}`:Array.isArray(i.value)?`${s}[/"[array]"\\]${o}`:typeof i.value=="object"?`${s}[/"[object]"\\]${o}`:n===Ve||n===ui||n===xi?`${s}("${i.value}")${o}`:`${s}["${i.value}"]${o}`}diagramVertex(e,i,n,s){const r=this.getPathArray(i),o=r.length>0?r.join("."):"root";this.diagramNeighbours(e,o,i,n+1,s);let a=this.diagramKeys.get(o);a||(a=this.diagramKey(o),e.push(` ${a}["${i.value}"]`))}diagramNeighbours(e,i,n,s,r){for(const g of this.neighboursWithEdgeValue(n,Je)??[]){const p=this.getPathArray(g),f=p.length>0?p.join("."):"root";s<r&&this.diagramVertex(e,g,s+1,r),this.diagramChild(e,Je,i,n,f,g)}const o=this.neighboursWithEdgeValue(n,ui)??[];let a=0;for(const g of o)this.diagramChild(e,ui,i,n,`${i}.${ui}.${a}`,g),a++;const l=this.neighboursWithEdgeValue(n,Ve)??[];a=0;for(const g of l)this.diagramChildWithNeighbours(e,Ve,i,n,`${i}.${Ve}.${a}`,g,s+1,r),a++;const c=this.neighboursWithEdgeValue(n,Zn)??[];a=0;const[h]=c;h&&(this.diagramChildWithNeighbours(e,Zn,i,n,`${i}.${Zn}.${a}`,h,s+1,r),a++);const u=this.neighboursWithEdgeValue(n,Xn)??[];a=0;for(const g of u)this.diagramChildWithNeighbours(e,Xn,i,n,`${i}.${Xn}.${a}`,g,s+1,r),a++;const d=this.neighboursWithEdgeValue(n,ec)??[];a=0;for(const g of d)this.diagramChildWithNeighbours(e,ec,i,n,this.getPathArray(g).join("."),g,s+1,r),a++}diagramChild(e,i,n,s,r,o){let a=this.diagramEdges.get(n);if(a?.has(r))return;a||(a=new Set,this.diagramEdges.set(n,a)),a.add(r);const l=i===Je?"":`|${i}|`;e.push(` ${this.diagramLabel(n,s)} -->${l} ${this.diagramLabel(r,o,i)}`)}diagramChildWithNeighbours(e,i,n,s,r,o,a,l){this.diagramChild(e,i,n,s,r,o),this.diagramNeighbours(e,r,o,a+1,l)}};to.EDGE_PRIORITY=[ui,xi,Ve],to.GRAFT_EDGE=Ve,to.COMPLEX_KEYS=["annotations","axes","series"],to.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],to.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),to.TRANSFORM_USER_KEY_OPERATION_PAIRS={padding:"$applyPadding"},to.valueCache=new Map;var pk=to,_z=8,Lv=new cc(_z),fk=-1,zz=re.create(!0,"perf","opts"),Gz=new Set(["data","container","document","window","styleContainer","context"]),mk=["container","context"];function jz(t){let e=!1;const i=(n,s)=>{if(!Gz.has(n)){if(typeof s=="function"||s instanceof Date||s instanceof Map||s instanceof Set){e=!0;return}return s}};try{const n=JSON.stringify(t,i);return e||!n?void 0:`${n}|${Hz(t.data)}`}catch{return}}function Hz(t){if(!Array.isArray(t))return t==null?"no-data":"object";if(t.length===0)return"empty";const e=t.find(i=>i!=null);return e==null?"null":typeof e=="number"?"number":Array.isArray(e)?"tuple":typeof e=="object"?`object:${Object.keys(e).sort((i,n)=>i.localeCompare(n)).join(",")}`:typeof e}function yk(){fk=ee.ifRegistryChanged(fk,()=>{Lv.clear()})}function $z(t){yk();const e=Lv.get(t);return zz("[CACHE] StructuralOptions",e?"hit":"miss"),e}function Wz(t,e){yk(),Lv.set(t,Ji(e))}function bk(){return{googleFonts:new Set,fonts:new Set}}function up(t,e){const{fontFamily:i,fontWeight:n,fontStyle:s}=e;if(typeof i=="string")for(const r of i.split(",")){const o=r.trim().replace(/(^['"])|(['"]$)/g,"");o!==""&&!Op.has(o.toLowerCase())&&t.add(fu({fontSize:16,fontFamily:o,fontWeight:n,fontStyle:s}))}}var vk=t=>`'${t}'`,Nv="__AXIS_ID_",Sa={top:"x",bottom:"x",left:"y",right:"y"},Uz={bubble:["minSize","maxSize"],"map-marker":["minSize","maxSize"],"map-line":["minStrokeWidth","maxStrokeWidth"]},io=class lt{constructor(e,i,n,s,r,o,a=!1,l=!1,c){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=n??{};let h=null;e instanceof lt?(h=e,this.specialOverrides=h.specialOverrides,o&&(this.userDeltaKeys=new Set(Object.keys(o))),o==null&&(o=ps(h.userOptions,i,lt.JSON_DIFF_OPTS,lt.REMOVED),a||(a=lt.containsRemovalSentinel(o))),this.userOptions=Ue(Nc(o,h.userOptions),{...lt.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Ue(e??i,{...lt.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...s})),this.findSeriesWithUserVisiblity(i,o),a&&this.removeLeftoverSymbols(this.userOptions);const u=e instanceof lt&&o?.data!==void 0&&o?.data?.length!==e.userOptions.data?.length;let d,g,p,f,m,y,b,v;if(!a&&!l&&this.seriesWithUserVisibility==null&&o!==void 0&<.isFastPathDelta(o)&&h!=null&&!u?({activeTheme:d,processedOptions:g,fastDelta:p}=this.fastSetup(o,h),f=h.themeParameters,m=h.annotationThemes,b=h.fonts):(lt.perfDebug("ChartOptions.slowSetup()"),{activeTheme:d,processedOptions:g,themeParameters:f,annotationThemes:m,googleFonts:y,fonts:b,optionsGraph:v}=this.slowSetup(n,o,a)),this.activeTheme=d,this.processedOptions=g,this.fastDelta=p??void 0,this.themeParameters=f,this.annotationThemes=m,this.googleFonts=y,this.fonts=b,this.optionsGraph=v,c!==void 0&&typeof c=="number"&&!Number.isNaN(c)){const S=performance.now();this.optionsProcessingTime=S-c}re.inDevelopmentMode(()=>Ji(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return lt.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return lt.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}static containsRemovalSentinel(e){if(!Le(e))return!1;for(const i of Object.keys(e)){const n=e[i];if(Ra(n)||!gk.has(i)&<.containsRemovalSentinel(n))return!0}return!1}findSeriesWithUserVisiblity(e,i){for(const n of[e,i]){const s=n?.series;if(Array.isArray(s))for(let r=0;r<s.length;r++){const o=s[r];"visible"in o&&(this.seriesWithUserVisibility??(this.seriesWithUserVisibility={identifiers:new Set,indices:new Set}),o.id?this.seriesWithUserVisibility.identifiers.add(o.id):this.seriesWithUserVisibility.indices.add(r))}}}fastSetup(e,i){const{activeTheme:n,processedOptions:s}=i,{presetType:r}=this.optionMetadata;if(r!=null&&e?.data!=null){const a=ee.getPresetModule(r);if(a?.processData){const{series:l,data:c}=a.processData(e.data);e=de({series:l,data:c},e)}}this.fastSeriesSetup(e,s);const o=de(e,s);return lt.debug("ChartOptions.fastSetup() - processed options",o),{activeTheme:n,processedOptions:o,fastDelta:e}}fastSeriesSetup(e,i){e?.series&&(e.series?.every((n,s)=>wS(n,i.series?.[s]??{}))?delete e.series:e.series=e.series.map((n,s)=>Nc(n,i.series?.[s]??{})))}slowSetup(e,i,n=!1){const s=this.computeStructuralCacheKeyForSlowSetup(i,n);if(s!==void 0){const M=$z(s);if(M)return this.slowSetupCached(M)}let r=Ue(this.userOptions,lt.OPTIONS_CLONE_OPTS_FAST);i&&(r=de(i,r),n&&this.removeLeftoverSymbols(r));let o=uv(Wh(r.theme));const{presetType:a}=this.optionMetadata;if(a!=null){const M=ee.getPresetModule(a);if(M){const{validate:D=$t}=M,I=r,A=r.type,k=A==null?void 0:o.presets[A],{cleared:T,invalid:R}=D(I,M.options,"");for(const E of R)B.warn(E);uo(R,"")?r={}:(lt.debug(">>> AgCharts.createOrUpdate() - applying preset",T),r=M.create(T,k,()=>this.activeTheme,o.overrides),o=uv(Wh(r.theme)))}}this.soloSeriesIntegrity(r),a!=null&&o.templateTheme(r,!1),uw(void 0,r);const l=this.validateSeriesOptions(r),c=cp(r);if(this.chartDef=ee.getChartModule(c),!this.chartDef.placeholder){const{validate:M=$t}=this.chartDef,{cleared:D,invalid:I}=M(r,this.chartDef.options,"");for(const A of I)B.warn(A);r=D}const h=this.validateAxesOptions(r);this.removeDisabledOptions(r);let u=this.processFonts(o.params);u=this.processFonts(r,u);const{googleFonts:d}=u;this.processSeriesOptions(r);const g=this.processAxesOptions(r,c);this.optionMetadata.presetType!=="sparkline"&&(this.processedCSSVariables=this.processCSSVariables(r));const p=Bz(o,r,this.processedCSSVariables),f=p.resolve(),m=p.resolveParams(),y=p.resolveAnnotationThemes();p.clearSafe();const b=de(e,f);uw(this.chartDef.name,b),a_(this.chartDef.name,b,l.concat(h));const v={skipDisabledNodeValidation:!0};this.validateSeriesOptions(b,v),this.validateAxesOptions(b,g,v),this.validatePluginOptions(b,v),this.processMiniChartSeriesOptions(b),b.loadGoogleFonts||d.clear();const{fonts:S}=u;if(lt.debug(()=>["ChartOptions.slowSetup() - processed options",Ue(b)]),s!==void 0){const{data:M,...D}=b;for(const I of mk)delete D[I];Wz(s,{processedOptions:D,themeParameters:m,googleFonts:d.size>0?new Set(d):void 0,fonts:S.size>0?new Set(S):void 0,annotationThemes:y,chartDef:this.chartDef})}return{activeTheme:o,processedOptions:b,themeParameters:m,annotationThemes:y,googleFonts:d,fonts:S,optionsGraph:p}}computeStructuralCacheKeyForSlowSetup(e,i){if(this.optionMetadata.domMode==="minimal"&&!i&&!e)return jz(this.userOptions)}slowSetupCached(e){const i=uv(Wh(this.userOptions.theme));this.chartDef=e.chartDef;const n=this.optionMetadata.presetType==null?void 0:ee.getPresetModule(this.optionMetadata.presetType),s=this.userOptions.data,r=n?.processData?n.processData(s).data:s,o=this.userOptions,a={...e.processedOptions,data:r};for(const c of mk)c in o&&(a[c]=o[c]);this.optionMetadata.presetType!=="sparkline"&&(this.processedCSSVariables=this.processCSSVariables(a));const l=dk(i,a);return{activeTheme:i,processedOptions:a,themeParameters:e.themeParameters,annotationThemes:e.annotationThemes,googleFonts:e.googleFonts?new Set(e.googleFonts):void 0,fonts:e.fonts?new Set(e.fonts):void 0,optionsGraph:l}}validatePluginOptions(e,i={}){for(const n of ee.listModulesByType("plugin")){const s=n.name;if(s in e&&n.options!=null&&(!n.chartType||n.chartType===this.chartDef?.name)){const{cleared:r,invalid:o}=$t(e[s],n.options,n.name,i);for(const a of o)B.warn(a);e[s]=r}}}validateSeriesOptions(e,i={}){const n=this.chartDef?.name,s=[],r=e.series?.length??0,o=[];let a;for(let l=0;l<r;l++){const c=`series[${l}]`,h=e.series[l],u=ee.getSeriesModule(h.type);if(u==null){const f=ee.isEnterprise();a??(a=cr(Array.from(qr.values()).filter(y=>y.type==="series"&&(f||!y.enterprise)&&(!n||y.chartType===n)).map(y=>y.name),"or",vk));const m=qr.get(h.type);if(h.type!=null&&m?.type==="series"){o.push(m);continue}B.warn(h.type==null?`Option \`${c}.type\` is required and has not been provided; expecting ${a}, ignoring.`:`Unknown type \`${h.type}\` at \`${c}.type\`; expecting ${a}, ignoring.`);continue}else if(n&&u.chartType!==n){B.warn(`Series type \`${u.name}\` at \`${c}.type\` is not supported by chart type \`${n}\`, ignoring.`);continue}if(u.options==null){s.push(h);continue}const{validate:d=$t}=u,{cleared:g,invalid:p}=d(h,u.options,c,i);for(const f of p)B.warn(f);uo(p,c)||s.push(g)}return e.series=s,o}validateAxesOptions(e,i,n={}){const s=[];if(!("axes"in e)||!e.axes)return s;const r=this.chartDef?.name,o={};let a;for(const[l,c]of ut(e.axes)){if(!c)continue;if(c.type==null){o[l]=c;continue}const h=`axes.${i?.get(l)??l}`,u=ee.getAxisModule(c.type);if(u==null){const f=qr.get(c.type);if(f?.type==="axis"){s.push(f);continue}const m=ee.isEnterprise();a??(a=cr(Array.from(qr.values()).filter(y=>y.type==="axis"&&(m||!y.enterprise)&&y.chartType===r).map(y=>y.name),"or",vk)),B.warn(`Unknown type \`${c.type}\` at \`${h}.type\`; expecting one of ${a}, ignoring.`);continue}else if(u.chartType!==r){B.warn(`Axis type \`${u.name}\` at \`${h}.type\` is not supported by chart type \`${r}\`, ignoring.`);break}const{validate:d=$t}=u,{cleared:g,invalid:p}=d(c,u.options,h,n);for(const f of p)B.warn(f);uo(p,h)||(o[l]=g)}return e.axes=o,s}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??ps(e.processedOptions,this.processedOptions,lt.JSON_DIFF_OPTS)}optionsType(e){return e.series?.[0]?.type??"line"}processSeriesOptions(e){const i=e.displayNullData,n=e.series?.map((s,r)=>{this.validateSizeBounds(s,r);const a=!!ee.getSeriesModule(s.type)?.options?.visible,l={};return a&&(l.visible=!0),i!==void 0&&s.allowNullKeys===void 0&&(l.allowNullKeys=i),de(this.getSeriesGroupingOptions(s),s,l)});e.series=this.setSeriesGroupingOptions(n??[])}validateSizeBounds(e,i){const n=Uz[e.type];if(n==null)return;const[s,r]=n,o=e,a=o[s],l=o[r];Zi(a)&&Zi(l)&&a>l&&(B.warnOnce(`series[${i}].${s} (${a}) cannot be greater than ${r} (${l}), ignoring both.`),delete o[s],delete o[r])}processAxesOptions(e,i){const n=i==="polar"?["angle","radius"]:["x","y"],s="axes"in e&&Object.keys(e.axes??{}).length>0,r=this.countNonDefaultSeriesAxisKeys(e,n),o=r>0,a=o&&r<(e?.series?.length??0),l=e.series?.[0],c=this.optionsType(e),h=this.predictAxes(c,n,l,e.data)??this.cloneDefaultAxes(c),u=ce(l)&&"direction"in l&&l.direction==="horizontal"&&ee.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!s&&!o&&!u){e.axes=h;return}const d="axes"in e?new Set(Object.keys(e.axes??{})):new Set,g=this.getPrimaryAxisKeys(e,n,d,o),p=this.getRemappedAxisKeys(d,g,n,a),f={},m=new Map;for(const[y,b]of p)f[b]="axes"in e?Ao(e.axes?.[y]):void 0,m.set(b,y);return this.remapSeriesAxisKeys(e,n,f,p,h,a),this.predictAxesMissingTypesAndPositions(e,n,f,h),this.alternateSecondaryAxisPositions(e,f,m),e.axes=f,m}getSeriesDirectionAxisKey(e,i){const n=ee.getSeriesModule(e.type);return n?"direction"in e&&e.direction==="horizontal"&&n.axisKeysFlipped?n.axisKeysFlipped[i]:n.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(e,i){let n=0;for(const s of e.series??[])for(const r of i){const o=this.getSeriesDirectionAxisKey(s,r);!o||!Sc(o,s)||s[o]!==r&&n++}return n}getPrimaryAxisKeys(e,i,n,s){const r=new Map;for(const o of i){let a=!1;if("axes"in e&&e.axes&&!(o in e.axes&&ce(e.axes[o])&&!("position"in e.axes[o]))){for(const[l,c]of ut(e.axes))if("position"in c&&c.position&&o===Sa[c.position]){r.set(o,l),a=!0;break}}if(!a&&s)for(const l of e.series??[]){const c=this.getSeriesDirectionAxisKey(l,o);if(!c)continue;const h=l[c];if(!n.has(h)){if(!h){r.set(o,o);break}r.set(o,h);break}}}if(n.size===0||!("axes"in e)||!e.axes)return r;if(r.size===0)for(const o of i)o in e.axes&&r.set(o,o);if(r.size===0){for(const o of i)for(const[a,l]of ut(e.axes))if(l.type?.startsWith(o)){r.set(o,a);break}}if(r.size===0&&(e.series?.length??0)>0)for(const o of i)for(const a of e.series){const l=this.getSeriesDirectionAxisKey(a,o);if(!l)continue;const c=a[l];if(n.has(c)){r.set(o,c);break}}if(r.size<2){const o=new Set(r.values());for(const[a,l]of ut(e.axes))if(!(o.has(a)||"position"in l)){for(const c of i)if(!r.has(c)){r.set(c,a),o.add(a);break}if(r.size===2)break}}return r}getRemappedAxisKeys(e,i,n,s){const r=new Map;for(const[o,a]of i)r.set(a,o);for(const o of e)r.has(o)||r.set(o,`${Nv}${r.size}`);if(s)for(const o of n)r.has(o)||r.set(o,`${Nv}${r.size}`);return r}remapSeriesAxisKeys(e,i,n,s,r,o){for(const a of e.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(a,l);if(!c)continue;n[l]??(n[l]=Ao(r[l]));let h=l;if(c in a){const u=a[c];s.has(u)?h=s.get(u):(h=`${Nv}${s.size}`,s.set(u,h),n[h]=Ao(r[l]))}else s.has(l)&&o&&(h=s.get(l),n[h]??(n[h]=Ao(r[l])));a[c]=h}}predictAxes(e,i,n,s){if(!n)return;const r=n?.data??s;if(!r?.length)return;const o=ee.getSeriesModule(e)?.predictAxis;if(!o)return;const a=new Map,l=ix(0,r.length-1,5);for(const c of l){const h=r[c];for(const u of i){const d=o(u,h,n);if(!a.has(u)){a.set(u,d);continue}const g=a.get(u);if(!(!d&&!g)){if(!d||!g)return;for(const p of Object.keys(g))if(g[p]!==d[p])return}}}for(const[c,h]of a)h||a.delete(c);if(a.size!==0){if(a.size===1){const[c]=a.values(),h=this.cloneDefaultAxes(e);return"position"in c?Jp(h,u=>"position"in u&&u.position===c.position?c:u):void 0}return Object.fromEntries(a)}}cloneDefaultAxes(e){const i=ee.getSeriesModule(e);return i?.defaultAxes?Ue(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(e,i,n,s){for(const[r,o]of ut(n)){if(!Le(o)||"type"in o&&"position"in o)continue;if(r in s){o.type??(o.type=s[r].type),o.position??(o.position=s[r].position);continue}this.predictAxisMissingTypeFromPosition(o,s)||(this.predictAxisMissingTypeAndPositionFromSeries(e,i,r,o,s),"type"in o||delete n[r])}}predictAxisMissingTypeFromPosition(e,i){if(!("position"in e)||!Sc(e.position,Sa))return!1;for(const n of Object.values(i))if(Sc(n.position,Sa)&&Sa[e.position]===Sa[n.position])return e.type=n.type,!0;for(const[n,s]of ut(Sa))if(e.position!==n&&s===Sa[e.position])return e.type=i[s].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(e,i,n,s,r){for(const o of e.series??[])for(const a of i){const l=this.getSeriesDirectionAxisKey(o,a);if(!(!l||!Sc(l,o))&&o[l]===n)return s.type??(s.type=r[a].type),s.position??(s.position=r[a].position),a==="y"}return!1}alternateSecondaryAxisPositions(e,i,n){let s=0,r=0;for(const[o,a]of ut(i)){if(!Le(a)||!("position"in a))continue;const l=n.get(o),c="axes"in e&&e.axes&&l&&l in e.axes?e.axes[l]:void 0,h=c&&"position"in c?c.position:void 0;if(a.position==="top"||a.position==="bottom"?(s+=1,s===2&&h==null&&(a.position="top")):(a.position==="left"||a.position==="right")&&(r+=1,r===2&&h==null&&(a.position="right")),s>1&&r>1)break}}processMiniChartSeriesOptions(e){const i=e.navigator?.miniChart?.series;i!=null&&(e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(e){const{groupable:i,stackable:n,stackedByDefault:s=!1}=ee.getSeriesModule(e.type);e.grouped&&!i&&B.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!n&&B.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:o}=e;return o??(o=(s||e.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:n&&o,grouped:i&&r&&!(n&&o)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);lt.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const n={},s=i.reduce((r,o)=>{var a;return o.groupType==="default"||(r[a=o.seriesType]??(r[a]=0),r[o.seriesType]+=o.groupType==="stack"?1:o.series.length),r},{});return i.flatMap(r=>{var o;switch(n[o=r.seriesType]??(n[o]=0),r.groupType){case"stack":{const a=n[r.seriesType]++;return r.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:r.groupId,groupIndex:a,groupCount:s[r.seriesType],stackIndex:c,stackCount:r.series.length}}))}case"group":return r.series.map(a=>Object.assign(a,{seriesGrouping:{groupId:r.groupId,groupIndex:n[r.seriesType]++,groupCount:s[r.seriesType],stackIndex:0,stackCount:0}}))}return r.series}).map(({stacked:r,grouped:o,...a})=>a)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((n,s)=>{const r=s.type;if(!s.stacked&&!s.grouped)n.push({groupType:"default",seriesType:r,series:[s],groupId:"__default__"});else{const o=this.getSeriesGroupId(s);if(!i.has(o)){const l={groupType:s.stacked?"stack":"group",seriesType:r,series:[],groupId:o};i.set(o,l),n.push(l)}i.get(o).series.push(s)}return n},[])}soloSeriesIntegrity(e){if(!ue(e.series))return;const i=s=>ee.getSeriesModule(s)?.solo??!1,n=e.series;if(n&&n.length>1&&n.some(s=>i(s.type))){const s=this.optionsType(e);if(i(s))B.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=n.slice(0,1);else{const{solo:r,nonSolo:o}=uc(n,l=>i(l.type)?"solo":"nonSolo"),a=Mp(r.map(l=>l.type)).join(", ");B.warn(`Unable to mix these series types with the lead series type: ${a}`),e.series=o}}}static processFontOptions(e,i=bk()){if(typeof e=="object"&&"fontFamily"in e){const{fontWeight:n,fontStyle:s}=e;if(Array.isArray(e.fontFamily)){const r=[];for(const o of e.fontFamily)typeof o=="object"&&"googleFont"in o?(r.push(o.googleFont),i.googleFonts.add(o.googleFont),up(i.fonts,{fontFamily:o.googleFont,fontWeight:n,fontStyle:s})):(r.push(o),up(i.fonts,{fontFamily:o,fontWeight:n,fontStyle:s}));e.fontFamily=r.join(", ")}else typeof e.fontFamily=="object"&&"googleFont"in e.fontFamily?(e.fontFamily=e.fontFamily.googleFont,i.googleFonts.add(e.fontFamily),up(i.fonts,{fontFamily:e.fontFamily,fontWeight:n,fontStyle:s})):typeof e.fontFamily=="string"&&up(i.fonts,{fontFamily:e.fontFamily,fontWeight:n,fontStyle:s})}return i}processFonts(e,i=bk()){return fs(e,n=>lt.processFontOptions(n,i),new Set(["data","theme"])),i}static removeDisabledOptionJson(e){if("enabled"in e&&e.enabled===!1)for(const i of Object.keys(e))i!=="enabled"&&delete e[i]}removeDisabledOptions(e){fs(e,lt.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!ce(e)))for(const i of Object.keys(e)){const n=e[i];Ra(n)&&delete e[i]}}removeLeftoverSymbols(e){fs(e,lt.removeLeftoverSymbolsJson,new Set(["data"]))}static processCSSVariablesJSON(e,i,n,s){if(s??(s={}),!e||!Oa(e)||!n)return s;for(const r of Object.keys(e)){const o=e[r];if(typeof o!="string"||!o.startsWith("var(--"))continue;const a=o.slice(4,-1),[l,...c]=a.split(",");if(a.startsWith("--ag-charts"))continue;const h=getComputedStyle(n);let u=h.getPropertyValue(l),d=De.validColorString(u);if(!d&&c.length>0){const g=c.join(",").trim();u=h.getPropertyValue(g)||g,d=De.validColorString(u)}if(!d){B.warnOnce(`CSS property [${o}] is not a valid color, ignoring.`),delete e[r];continue}s[o]??(s[o]=u)}return s}processCSSVariables(e){if(e.container!=null)return fs(e,lt.processCSSVariablesJSON,new Set(["data"]),void 0,e.container)}processCSSVariablesPartial(e,i){if(!(e==null||i==null))return fs(e,lt.processCSSVariablesJSON,new Set(["data"]),void 0,i)}specialOverridesDefaults(e){if(e.window==null?e.window=ts():sx(e.window),e.document==null?e.document=rr():nx(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}};io.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},io.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},io.JSON_DIFF_OPTS=new Set(["data","localeText"]),io.REMOVED=Symbol("UNSET"),io.perfDebug=re.create(!0,"perf"),io.FAST_PATH_OPTIONS=new Set(["data","width","height","container","context"]),io.debug=re.create(!0,"opts");var sc=io,dp=re.create(!0,"opts"),no="AG Charts - Chart was destroyed, cannot perform request.",Yh=class{constructor(e,i,n){this.factoryApi=i,this.licenseManager=n,this.chart=e}async update(e){if(!this.chart)throw new Error(no);return dp.group("AgChartInstance.update()",async()=>{const i=re.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(e,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(no);return dp.group("AgChartInstance.updateDelta()",async()=>{const i=re.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,e,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(no);const e=Ue(this.chart.getOptions(),sc.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(no);return this.chart.waitForUpdate()}applyTransaction(e){const{chart:i}=this;if(!i)throw new Error(no);if(e==null||typeof e!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:n,addIndex:s,remove:r,update:o}=e;if(n!=null&&!Array.isArray(n))throw new Error('AG Charts - transaction "add" must be an array.');if(s!=null){if(typeof s!="number"||!Number.isSafeInteger(s)||s<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(n==null||n.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(r!=null&&!Array.isArray(r))throw new Error('AG Charts - transaction "remove" must be an array.');if(o!=null&&!Array.isArray(o))throw new Error('AG Charts - transaction "update" must be an array.');return dp.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const a=i.ctx.dataSelectionService,l=mC(a,i.data);return l.addTransaction(e),l.commitPendingTransactions(a),this.updateDelta({data:l.data})}return dp("transaction",e),this.chart?.applyTransaction(e)})}async download(e){if(!this.chart)throw new Error(no);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(no);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(no);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){if(!this.chart)return;const{interactionManager:i,legendManager:n,zoomManager:s}=this.chart.ctx,r=this.getEnabledOriginators(),o=new Set(r);i.isState(2)||(n&&s&&o.has(n)&&o.has(s)?(o.delete(s),await this.setStateOriginators(e,Array.from(o)),await this.setStateOriginators(e,[s])):await this.setStateOriginators(e,r))}getSelection(){return this.chart?.getSelection()??[]}setSelection(e){return this.chart?.setSelection(e)}clearSelection(){return this.chart?.clearSelection()}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,n={}){const s=n.width??i.width??i.ctx.scene.canvas.width,r=n.height??i.height??i.ctx.scene.canvas.height,o=e.getState(),a=i.chartOptions.specialOverrides.document??rr(),l={...i.chartOptions.processedOverrides,container:a.createElement("div"),width:s,height:r};n.width!=null&&n.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();if(ee.isEnterprise()){l.animation={enabled:!1};const m=this.licenseManager?.getWatermarkForegroundConfigForBrowser();m&&(l.foreground=m)}const h={...i.chartOptions.specialOverrides},u={...i.chartOptions.optionMetadata},d=await this.chart?.ctx.dataService.getData(),g=this.factoryApi.create(c,l,h,u,d);o.legend&&this.syncLegend(i,g,o),g.chart?.update(0,{forceNodeDataRefresh:!0}),await g.waitForUpdate(),await g.setState(o);const p={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};g.chart?.ctx.zoomManager?.updateZoom(p,i.ctx.chartState.getValue("zoom")),g.chart?.update(0,{forceNodeDataRefresh:!0}),await g.waitForUpdate();const f=[];for(const m of i.modulesManager.legends())f.push(m.legend.pagination?.currentPage??0);for(const m of g.chart.modulesManager.legends()){const y=f.shift()??0;m.legend.pagination&&m.legend.pagination.setPage(y)}return g.chart?.update(0,{forceNodeDataRefresh:!0}),await g.waitForUpdate(),g}syncLegend(e,i,n){const s=new Map;for(const[r,o]of e.series.entries()){const a=i.chart?.series[r];a&&s.set(o.id,a.id)}n.legend=n.legend?.map(r=>({...r,seriesId:s.get(r.seriesId??"")??r.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:n,chartTypeOriginator:s,zoomManager:r,legendManager:o},modulesManager:a}=this.chart,l=[];return"annotations"in e&&e.annotations?.enabled&&n&&l.push(n),i.presetType==="price-volume"&&l.push(s),(e.navigator?.enabled||e.zoom?.enabled)&&r&&l.push(r),a.isEnabled("legend")&&e.legend?.enabled!==!1&&o&&l.push(o),l.push(this.chart.ctx.activeManager),l.push(this.chart.ctx.collapsedManager),l}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),await this.chart?.waitForUpdate()}};Yh.chartInstances=new WeakMap,x([gi({oldValue(t){t.destroyed||(t.publicApi=void 0),Yh.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,Yh.chartInstances.set(t,this))}})],Yh.prototype,"chart",2);var xk=Yh,Kz=1e3,Ov=class lo{constructor(e,i,n,s,r,o=Kz){this.name=e,this.buildItem=i,this.releaseItem=n,this.destroyItem=s,this.maxPoolSize=r,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(e,i,n,s,r){return this.pools.has(e)||this.pools.set(e,new lo(e,i,n,s,r)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),lo.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):lo.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 lo.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.");lo.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),lo.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),n=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<n&&(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);lo.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()}};Ov.pools=new Map,Ov.debug=re.create(!0,"pool");var Yz=Ov,nr=re.create(!0,"opts"),so=class{static licenseCheck(t){if(t.withinStudio)return;let e=this.licenseManager;return this.licenseChecked||(e=ar.licenseManager?.(t),this.licenseManager=e,e?.validateLicense(),this.licenseChecked=!0),e}static getLicenseDetails(t){return ar.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return Sk.getInstance(t)}static create(t,e){const i=re.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return nr.group("AgCharts.create()",()=>{t=re.inDevelopmentMode(()=>Ji(Ue(t)))??t,this.licenseCheck(t);const n=this.licenseCheck(t),s=Sk.createOrUpdate({userOptions:t,licenseManager:n,optionsMetadata:e,apiStartTime:i});return n?.isDisplayWatermark()&&ar.injectWatermark?.(s.chart.ctx.domManager,n.getWatermarkMessage()),s})}static createFinancialChart(t){return nr.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return nr.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge-preset"}))}static __createSparkline(t){return nr.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal",withDragInterpretation:!1})})}};so.licenseChecked=!1;var Ts=class Ia{static getInstance(e){const i=Ng.getInstance(e);return i?xk.chartInstances.get(i):void 0}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:n,licenseManager:s,processedOverrides:r=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:a=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:u}=e,d=ar.styles==null?[]:[["ag-charts-enterprise",ar.styles]];if(ee.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create().","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join(`
`));nr(()=>[">>> AgCharts.createOrUpdate() user options",Ue(n)]);const{presetType:g}=a;let p=n;so.optionsMutationFn&&p&&(p=so.optionsMutationFn(Ue(p,sc.OPTIONS_CLONE_OPTS_FAST),g),nr(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ue(p)]));const f=this.getPool(a);let m=!1,y,b=i?.chart;b==null&&f?.hasFree()&&(y=f.obtainFree(),b=y.item);const{document:v,window:S,styleContainer:M,skipCss:D,...I}=p??{},A=b?.getChartOptions(),k={...o,document:v,window:S,styleContainer:M,skipCss:D},T=new sc(A,I,r,k,a,l,h,!1,u);(b==null||cp(T.processedOptions)!==cp(b.chartOptions.processedOptions))&&(y?.release(),y=this.getPool(T.optionMetadata)?.obtain(T),y?b=y.item:(m=!0,b=Ia.createChartInstance(T,b))),T.optionsGraph&&b.ctx.optionsGraphService.updateCallback((E,F,N)=>{const P=T.processCSSVariablesPartial(F,T.processedOptions.container);return b.ctx.domManager.updateCSSVariableWatchers(P),T.optionsGraph?.resolvePartial(E,F,N,P)});for(const[E,F]of d)b.ctx.domManager.addStyles(E,F);b.ctx.fontManager.updateFonts(T.googleFonts),b.ctx.fontManager.waitForFonts(T.fonts),c!=null&&b.ctx.dataService.restoreData(c);const R="loading"in T.processedOptions?T.processedOptions.loading:void 0;return b.ctx.dataService.setForcedLoading(R),i==null?(i=new xk(b,Ia.callbackApi,s),i.releaseChart=y?.release):(y||m)&&(i.releaseChart?.(),i.chart=b,i.releaseChart=y?.release),nr.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[b.id]=b),b.ctx.domManager.updateCSSVariableWatchers(T.processedCSSVariables),b.setRequestRefreshListener(()=>{const E=new sc(A,I,r,k,a,l,h,!0,re.check("scene:stats","scene:stats:verbose")?performance.now():void 0);Ia.requestFactoryUpdate(b,E)}),Ia.requestFactoryUpdate(b,T),i}static updateUserDelta(e,i,n){i=Ue(i,sc.OPTIONS_CLONE_OPTS_FAST);const s=fs(i,Ia.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);nr(()=>[">>> AgCharts.updateUserDelta() user delta",Ue(i)]),Ia.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s,apiStartTime:n})}static createChartInstance(e,i){const n=i?.destroy({keepTransferableResources:!0}),s=cp(e.processedOptions);return ee.getChartModule(s).create(e,n)}static getPool(e){if(e.pool===!0)return Yz.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}static requestFactoryUpdate(e,i){e.queuedUserOptions.push(i.userOptions),e.queuedChartOptions.push(i),e.requestFactoryUpdate(n=>{nr.group(">>>> Chart.applyOptions()",()=>{n.applyOptions(i);const s=n.queuedUserOptions.indexOf(i.userOptions)+1;n.queuedUserOptions.splice(0,s),n.queuedChartOptions.splice(0,s)})})}};Ts.caretaker=new uf(Qe),Ts.callbackApi={caretaker:Ts.caretaker,create(t,e,i,n,s){return Ts.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:n,data:s})},update(t,e,i,n){return Ts.createOrUpdate({userOptions:t,proxy:e,specialOverrides:i,apiStartTime:n})},updateUserDelta(t,e,i){return Ts.updateUserDelta(t,e,i)}},Ts.markRemovedProperties=(t,e,i,n)=>{let s=n??!1;if(typeof t!="object"||t==null)return s;for(const r of hs(t))t[r]===void 0&&(Object.assign(t,{[r]:Symbol("UNSET")}),s||(s=!0));return s},Ts.detachAndClear=t=>t.detachAndClear(),Ts.destroy=t=>t.destroy();var Sk=Ts,Mk={};Ri(Mk,{APPROXIMATE_THRESHOLD:()=>cE,AbstractBarSeries:()=>yA,AbstractBarSeriesProperties:()=>_h,AggregationManager:()=>Rg,AnchoredPopover:()=>Gk,AnnotationManager:()=>Zz,ApproximateOrdinalTimeScale:()=>bG,Arc:()=>Ls,Axis:()=>gy,AxisGroupZIndexMap:()=>jI,BBox:()=>$,Background:()=>WD,BandScale:()=>Hn,BaseToolbar:()=>Bv,BucketLookupManager:()=>Sb,Caption:()=>It,CartesianAxis:()=>Mh,CartesianCrossLine:()=>mi,CartesianSeries:()=>Kr,CartesianSeriesNodeEvent:()=>vg,CartesianSeriesProperties:()=>Un,CategoryAxis:()=>El,CategoryScale:()=>Yo,Chart:()=>Ng,ChartAxes:()=>xg,ChartOptions:()=>sc,CollapseMode:()=>JC,ColorScale:()=>Rr,ColorScaleProperties:()=>Vo,ContextMenuRegistry:()=>Qz,ContinuousScale:()=>Ge,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Vl,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Bl,DEFAULT_POLAR_DIRECTION_KEYS:()=>HA,DEFAULT_POLAR_DIRECTION_NAMES:()=>$A,DOMElementProxy:()=>Ig,DOMManager:()=>XD,DataChangeDescription:()=>vD,DataController:()=>fC,DataModel:()=>Oy,DataModelSeries:()=>Wy,DataSet:()=>Fl,DiscreteTimeAxis:()=>EC,DraggablePopover:()=>jk,DropShadow:()=>Cs,ExtendedPath2D:()=>Bo,FillGradientDefaults:()=>Wr,FillImageDefaults:()=>Js,FillPatternDefaults:()=>Ft,FloatingToolbar:()=>AG,FormatManager:()=>Fr,Group:()=>se,GroupWidget:()=>eC,HierarchyHighlightState:()=>Ok,HierarchyNode:()=>hG,HierarchySeries:()=>uG,HierarchySeriesProperties:()=>oo,HighlightManager:()=>hC,HighlightProperties:()=>qs,HighlightState:()=>RD,Image:()=>rc,IndexSetBucketLookupManager:()=>GC,InteractionManager:()=>mI,InteractionState:()=>fI,LARGEST_KEY_INTERVAL:()=>OD,Label:()=>ln,LabelStyle:()=>an,LayoutElement:()=>ty,Line:()=>cn,LinearScale:()=>Zo,LogScale:()=>yy,Marker:()=>Mt,Menu:()=>vG,MercatorScale:()=>dG,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Wn,NativeWidget:()=>zl,NiceMode:()=>zI,Node:()=>bs,OrdinalTimeScale:()=>_r,PHASE_METADATA:()=>Sh,PanToBBoxScalingModeEnum:()=>Ik,Path:()=>Rt,PointerEvents:()=>HM,PolarAxis:()=>gG,PolarSeries:()=>qb,QuadtreeNearest:()=>nD,RadialColumnShape:()=>qn,Range:()=>vs,Rect:()=>Pt,Rotatable:()=>Go,RotatableSvgPath:()=>yG,RotatableText:()=>qm,SMALLEST_KEY_INTERVAL:()=>ND,Scalable:()=>Yd,ScalableGroup:()=>zO,Scene:()=>kg,Sector:()=>zt,SectorBox:()=>UA,SegmentedPath:()=>by,Selection:()=>At,SelectionState:()=>PD,Series:()=>Ur,SeriesLabelProperties:()=>Nt,SeriesMarker:()=>Ni,SeriesNodeEvent:()=>bg,SeriesNodePickMode:()=>GD,SeriesProperties:()=>Dn,SeriesSelectionProperties:()=>$r,SeriesTooltip:()=>Qs,Shape:()=>_o,SliderWidget:()=>lb,SplitBucketLookupManager:()=>zC,StopProperties:()=>uh,SvgPath:()=>Rk,Text:()=>Wi,TimeScale:()=>Ol,Toolbar:()=>DG,ToolbarButtonWidget:()=>$k,ToolbarWidget:()=>wg,TooltipManager:()=>Tg,Transformable:()=>Oe,TransformableGroup:()=>bl,TransformableText:()=>xl,Translatable:()=>yl,TranslatableGroup:()=>qt,TranslatableSvgPath:()=>Pk,UnitTimeScale:()=>zr,ZoomManager:()=>cG,accumulativeValueProperty:()=>Ey,addHitTestersToQuadtree:()=>Wg,adjustLabelPlacement:()=>VC,angleCategoryAxisOptionsDefs:()=>pv,angleNumberAxisOptionsDefs:()=>gv,animationValidation:()=>wh,annotationCalloutStylesDefs:()=>vw,annotationChannelTextDefs:()=>gw,annotationCommentStylesDefs:()=>xw,annotationCrossLineStyleDefs:()=>mv,annotationDisjointChannelStyleDefs:()=>yw,annotationFibonacciStylesDefs:()=>yv,annotationLineStyleDefs:()=>sp,annotationLineTextDefs:()=>np,annotationMeasurerStylesDefs:()=>rp,annotationNoteStylesDefs:()=>Sw,annotationOptionsDef:()=>ql,annotationParallelChannelStyleDefs:()=>bw,annotationQuickMeasurerStylesDefs:()=>Mw,annotationShapeStylesDefs:()=>bv,annotationTextStylesDef:()=>$h,boxPlotSeriesThemeableOptionsDef:()=>Aw,buildColorCategoryLegendData:()=>Hb,buildGradientLegendDatum:()=>Gb,buildResetPathFn:()=>Ob,calculateDataDiff:()=>vA,calculateLabelTranslation:()=>mG,calculateSegments:()=>$g,candlestickSeriesThemeableOptionsDef:()=>kw,cartesianMarkerDrawMode:()=>Tb,checkCrisp:()=>bA,chordSeriesThemeableOptionsDef:()=>Tw,clippedRoundRect:()=>Jd,collapsedStartingBarPosition:()=>zh,colorScaleLegendFormatterContext:()=>jb,commonAxisThemeTemplate:()=>ia,commonChartThemeTemplate:()=>yb,computeBarFocusBounds:()=>Bb,computeMarkerFocusBounds:()=>Gg,coneFunnelSeriesThemeableOptionsDef:()=>Lw,configureColorScale:()=>zb,createAxisLabelFormatterCache:()=>gI,createDatumId:()=>ei,createDynamicContext:()=>kp,deepCloneDataSet:()=>mC,diff:()=>fg,drawCorner:()=>dh,drawMarkerUnitPolygon:()=>ph,findNodeDatumInArray:()=>_D,findQuadtreeMatch:()=>Ug,fixNumericExtent:()=>Li,formatAxisLabelValue:()=>Qm,fromToMotion:()=>wt,funnelSeriesThemeableOptionsDef:()=>Nw,generateTicks:()=>QI,getAxisLabelSideFlag:()=>gh,getColorStops:()=>UM,getCrossLineValue:()=>uI,getCrossLinesPlugin:()=>mb,getItemId:()=>Th,getItemStyles:()=>_y,getItemStylesPerItemId:()=>tF,getLabelStyles:()=>sa,getMarkerStyles:()=>jg,getMissCount:()=>uD,getRadialColumnWidth:()=>Fk,getShapeFill:()=>xI,getShapeStyle:()=>ny,groupAccumulativeValueProperty:()=>Qo,hasDimmedOpacity:()=>zy,heatmapSeriesThemeableOptionsDef:()=>Ow,initialStatePickedOptionsDef:()=>oC,interpolatePoints:()=>Ph,isTooltipValueMissing:()=>$o,isUnselected:()=>Vy,keyProperty:()=>jr,makeSeriesTooltip:()=>oa,mapLineBackgroundSeriesThemeableOptionsDef:()=>Pw,mapLineSeriesThemeableOptionsDef:()=>Rw,mapMarkerSeriesThemeableOptionsDef:()=>Fw,mapShapeBackgroundSeriesThemeableOptionsDef:()=>Bw,mapShapeSeriesThemeableOptionsDef:()=>Vw,markerFadeInAnimation:()=>Fh,markerSwipeScaleInAnimation:()=>kb,midpointStartingBarPosition:()=>pB,minimumTimeAxisDatumGranularity:()=>sD,motion:()=>kG,nightingaleSeriesThemeableOptionsDef:()=>_w,normaliseGroupTo:()=>gg,ohlcSeriesThemeableOptionsDef:()=>Ew,ordinalTimeAxisOptionsDefs:()=>Zl,organizationSeriesThemeableOptionsDef:()=>zw,pairUpSpans:()=>Rh,parentLevelAxisThemeTemplate:()=>bb,pathFadeInAnimation:()=>Nb,pathMotion:()=>Eg,pathSwipeInAnimation:()=>Lb,pickSectorsInBBoxPredicate:()=>JA,plotAreaPathFill:()=>hA,plotInterpolatedLinePathStroke:()=>Bg,plotLinePathStroke:()=>Cb,predictCartesianFinancialAxis:()=>iB,predictCartesianNonPrimitiveAxis:()=>Bh,prepareAreaFillAnimationFns:()=>uA,prepareBarAnimationFunctions:()=>Gh,prepareLinePathPropertyAnimation:()=>Ab,processedDataIsAnimatable:()=>In,pyramidSeriesThemeableOptionsDef:()=>Gw,radarAreaSeriesThemeableOptionsDef:()=>jw,radarLineSeriesThemeableOptionsDef:()=>Hw,radialBarSeriesThemeableOptionsDef:()=>$w,radialColumnSeriesThemeableOptionsDef:()=>Ww,radiusCategoryAxisOptionsDefs:()=>fv,radiusNumberAxisOptionsDefs:()=>dw,rangeAreaSeriesThemeableOptionsDef:()=>Yw,rangeBarSeriesThemeableOptionsDef:()=>Xw,replaceDataSet:()=>yC,resetAxisLabelSelectionFn:()=>og,resetBarSelectionsDirect:()=>Kg,resetBarSelectionsFn:()=>jh,resetLabelFn:()=>ra,resetMarkerFn:()=>_g,resetMarkerPositionFn:()=>Vh,resetMarkerSelectionsDirect:()=>zg,resetMotion:()=>Qt,sankeySeriesThemeableOptionsDef:()=>qw,sectorBox:()=>KA,seriesLabelFadeInAnimation:()=>mt,seriesLabelFadeOutAnimation:()=>Pg,stackCartesianSeries:()=>HD,standaloneChartOptionsDefs:()=>mV,sunburstSeriesThemeableOptionsDef:()=>Jw,titleAxisThemeTemplate:()=>ta,toHierarchyHighlightString:()=>Zh,toHighlightString:()=>Hr,toSelectionString:()=>un,topologyChartOptionsDefs:()=>fV,trailingAccumulatedValueProperty:()=>VP,treemapSeriesThemeableOptionsDef:()=>Qw,updateClipPath:()=>Hg,updateLabelNode:()=>FC,upsertNodeDatum:()=>Ub,userInteraction:()=>lG,validateCrossLineValue:()=>dI,valueProperty:()=>et,visibleRangeIndices:()=>kh,waterfallSeriesThemeableOptionsDef:()=>ek});var Zz=class{constructor(t){this.ctx=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||ue(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(n=>{const s=this.getAnnotationTypeStyles(n.type);return de(n,s)}),this.ctx.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.ctx.fireEvent({type:"annotations",annotations:Ue([...this.annotations])})}attachNode(t){return this.ctx.annotationRoot.append(t),()=>(t.remove(),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}},Xz=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},qz=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},Jz=class{constructor(){this.items=new Xz,this.lists=new qz}},Qz=class{constructor(t){this.ctx=t,this.builtins=new Jz,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(t,e){return e.showOn==t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,n){const{widgetEvent:s}=e;if(s.sourceEvent.defaultPrevented)return;const r=n?.x??e.canvasX,o=n?.y??e.canvasY,a={showOn:t,x:r,y:o,context:i,widgetEvent:s};this.ctx.eventsHub.emit("context-menu:setup",a),this.ctx.eventsHub.emit("context-menu:complete",a)}isVisible(t){return!this.hiddenActions.has(t)}toggle(t,e){switch(e??(e=this.isVisible(t)?"hide":"show"),e){case"show":this.hiddenActions.delete(t);break;case"hide":this.hiddenActions.add(t);break}}},Ik=(t=>(t[t.None=0]="None",t[t.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",t[t.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",t))(Ik||{});function ro(t,e,i,n,s){return e+(n-e)*((s-t)/(i-t))}function Dk(t,e,i,n,s){return t+(s-e)*((i-t)/(n-e))}function Ck(t,e,i){return[Dk(t,i.min,e,i.max,0),Dk(t,i.min,e,i.max,1)]}function eG(t,e,i){const[n,s]=Ck(t.x1,t.x2,e),[r,o]=Ck(t.y1,t.y2,i);return{x1:n,x2:s,y1:r,y2:o}}function Ak(t,e){const i=e.width>t.width,n=e.height>t.height;return{x:i,y:n}}function wk(t,e,i,n,s,r){if(i<=s&&r<=n)return i;const o=s-i,a=r-n,l=Math.abs(o)<Math.abs(a)?o:a;return J(t,i+l,e)}function tG(t,e,i,n){const s=eG(t,i,n);return{x:wk(s.x1,s.x2,t.x1,t.x2,e.x1,e.x2),y:wk(s.y1,s.y2,t.y1,t.y2,e.y1,e.y2)}}function iG(t,e,i,n){switch(t){case 0:return nG(e,i,n);case 1:return rG(e,i,n);case 2:return sG(e,i,n);default:return t}}function gp(t,e,i,n){const{x:s={min:0,max:1},y:r={min:0,max:1}}=i,o=No.from(n),a=No.from(e),l=tG(a,o,s,r),c={x:t.x?{min:ro(a.x1,s.min,a.x2,s.max,a.x1),max:ro(a.x1,s.min,a.x2,s.max,a.x2)}:{min:ro(a.x1,s.min,a.x2,s.max,l.x),max:ro(a.x1,s.min,a.x2,s.max,l.x+e.width)},y:t.y?{min:ro(a.y1,r.min,a.y2,r.max,a.y1),max:ro(a.y1,r.min,a.y2,r.max,a.y2)}:{min:ro(a.y1,r.min,a.y2,r.max,l.y),max:ro(a.y1,r.min,a.y2,r.max,l.y+e.height)}},h=c.x.max-c.x.min,u=c.y.max-c.y.min;return c.x.min=J(0,c.x.min,1-h),c.x.max=c.x.min+h,c.y.min=J(0,c.y.min,1-u),c.y.max=c.y.min+u,c}function nG(t,e,i){return gp({x:!1,y:!1},t,e,i)}function sG(t,e,i){const n=Ak(t,i);return gp(n,t,e,i)}function rG(t,e,i){const n=Ak(t,i);if(!n.x&&!n.y)return gp(n,t,e,i);const s=i.width/t.width,r=i.height/t.height,o=Math.max(s,r),a=No.from(i),l=(a.x1+a.x2)/2,c=(a.y1+a.y2)/2,h=t.width*o,u=t.height*o,d={x:l-h/2,y:c-u/2,width:h,height:u};return gp({x:!1,y:!1},d,e,i)}var kk=t=>be((e,{options:i})=>!Ge.is(t?.scale)&&!Ks.is(t?.scale)||e==null||i.end==null?!0:e<i.end,"to be less than end");function oG(t){for(const e of hs(t)){const i=t[e];if(!i)continue;const{min:n,max:s}=i;(n<0||s>1)&&(B.warnOnce(`Attempted to update axis (${e}) zoom to an invalid ratio of [{ min: ${n}, max: ${s} }], expecting a ratio of 0 to 1. Ignoring.`),delete t[e])}}function aG(t,e){const i={};for(const{id:n,direction:s}of t){const{min:r,max:o}=e[n]??{min:0,max:1};i[n]={min:r,max:o,direction:s}}return i}function Tk(t,e){const i=hs(t),n=hs(e);if(i.length!==n.length)return!1;for(const s of i)if(!n.includes(s))return!1;for(const s of i){const r=t[s],o=e[s];if(r!==o&&(r==null||r.direction!==o?.direction||r.min!==o.min||r.max!==o.max))return!1}return!0}function lG(t){return{source:"user-interaction",sourceDetail:t}}function Lk(t){return Zi(t)||nt(t)||pn(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}function Nk(t){return ce(t)&&"groupPercentage"in t}var cG=class extends Zy{constructor(t){super(),this.ctx=t,this.mementoOriginatorKey="zoom",this.axes=[],this.allAxes=[],this.didLayoutAxes=!1,this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=re.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(t.eventsHub.on("zoom:change-request",e=>{this.constrainZoomToRequiredWidth(e)}),t.eventsHub.on("update:pre-series",({requiredRangeRatio:e,requiredRangeDirection:i,requiredRange:n})=>{this.didLayoutAxes=!0;const{pendingMemento:s}=this;s?this.restoreMemento(s.version,s.mementoVersion,s.memento):this.restoreRequiredRange(e,i,n),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),t.eventsHub.on("update:complete",({wasShortcut:e})=>{if(!e&&this.pendingZoomEventSource){const i=this.pendingZoomEventSource;this.ctx.fireEvent({type:"zoom",source:i,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}get state(){const t=this.ctx.chartState.getValue("zoom"),e={};for(const i of this.allAxes){const n=this.axes.find(o=>o.id===i.id);let s,r;if(n)({min:s,max:r}=n.getZoom());else{const o=sh(t,i.direction);s=o?.min??0,r=o?.max??1}e[i.id]={min:s,max:r,direction:i.direction}}return e}set state(t){const e=new Set;for(const r of this.axes){const o=t[r.id];e.add(r.id),o&&r.setZoom({min:o.min,max:o.max})}const i=this.allAxes.filter(r=>!e.has(r.id));if(i.length===0)return;const n={};for(const r of i){const o=t[r.id];o&&(n[r.id]=o)}const s=ys(n);s!=null&&this.ctx.chartState.setValue("zoom",s)}toCoreZoomState(t){const e={};let i;const{state:n}=this;if(this.independentAxes){const s=this.getPrimaryAxisId("x"),r=this.getPrimaryAxisId("y");i=[],s&&i.push(s),r&&i.push(r)}else i=hs(n);for(const s of i){const{direction:r}=n[s]??{};if(r!=null){const o=t[r];if(o){const{min:a,max:l}=o;e[s]={min:a,max:l,direction:r}}}}return e}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!ce(t))return!1;const i=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y"),s={rangeX:{start:kk(i),end:he},rangeY:{start:kk(n),end:he},ratioX:{start:he,end:he},ratioY:{start:he,end:he},autoScaledAxes:he},{invalid:r}=$t(t,s);return r.length>0?(e.push(...r.map(String)),!1):!0}restoreMemento(t,e,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const n=nh(ys(this.state));i?.rangeX?n.x=this.rangeToRatioDirection("x",i.rangeX)??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1};const{navigatorModule:s,zoomModule:r}=this;this.ctx.eventsHub.emit("zoom:load-memento",{zoom:n,memento:i,navigatorModule:s,zoomModule:r});const o=this.toCoreZoomState(n);this.writeInitialZoom(ys(o)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:o,isReset:!1})}writeInitialZoom(t){const e=this.ctx.chartState.getValue("initialZoom");st(e,t)||this.ctx.chartState.setValue("initialZoom",t)}findAxis(t){for(const e of this.axes)if(e.id===t)return e}getAxes(){return this.axes}setAxes(t){const e=this.state,i=new Map;for(const a of this.axes)i.set(a.id,a.type);const{axes:n,allAxes:s}=this;n.length=0,s.length=0;for(const a of t)s.push({id:a.id,direction:a.direction}),"range"in a&&n.push(a);const r={...e};for(const a of n){const l=i.get(a.id);l!==void 0&&l!==a.type&&delete r[a.id]}const o=aG(t,r);this.state=o,this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:o,isReset:!1})}setIndependentAxes(t=!0){this.independentAxes=t}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:t,sourceDetail:e},i){const n=this.toCoreZoomState(i??{});return this.updateChanges({source:t,sourceDetail:e,changes:n,isReset:!1})}computeChangedAxesIds(t){const e=[],i=this.state;for(const n of hs(t)){const s=t[n]??{min:0,max:1},r=i[n];(r?.min!==s.min||r.max!==s.max)&&e.push(n)}return e}updateChanges(t){const{source:e,sourceDetail:i,isReset:n,changes:s}=t;oG(s);const r=this.computeChangedAxesIds(s),o=Ue(this.state),a=Ue(this.state);for(const l of r){const c=a[l];c!=null&&(c.min=s[l]?.min??0,c.max=s[l]?.max??1)}return this.state=a,this.dispatch(e,i,r,n,o)}resetZoom({source:t,sourceDetail:e}){const i=this.ctx.chartState.getValue("initialZoom"),n={};for(const s of this.allAxes){const r=sh(i,s.direction);n[s.id]=r?{min:r.min,max:r.max}:{min:0,max:1}}this.updateChanges({source:t,sourceDetail:e,changes:n,isReset:!0})}resetAxisZoom({source:t,sourceDetail:e},i){const n=this.allAxes.find(a=>a.id===i);if(!n)return;const s=this.ctx.chartState.getValue("initialZoom"),r=sh(s,n.direction),o=r?{min:r.min,max:r.max}:{min:0,max:1};this.updateChanges({source:t,sourceDetail:e,changes:{[i]:o},isReset:!0})}panToBBox(t,e){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=ys(this.state);if(i===void 0||!i.x&&!i.y)return!1;const{panToBBoxScalingMode:n}=this;if(!(t.width>0&&t.height>0&&(n!==0||Math.abs(e.width)<=Math.abs(t.width)&&Math.abs(e.height)<=Math.abs(t.height))))return B.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=iG(n,t,i,e),o=this.toCoreZoomState(r);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:o,isReset:!1})}fireZoomPanStartEvent(t){this.ctx.eventsHub.emit("zoom:pan-start",{callerId:t})}updateWith({source:t,sourceDetail:e},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const r=s.scale.getDomainMinMax();if(!r)return;const[o,a]=s.visibleRange,l=this.getRange(s.id,{min:o,max:a});if(!l)return;const[c,h]=r,{start:u,end:d}=l,g=n({start:c,end:h,windowStart:u,windowEnd:d,source:t});if(!this.isValidUpdateWithResult(g)){this.resetZoom({source:t,sourceDetail:e});return}const[p,f]=g,m=this.rangeToRatioAxis(s,{start:p,end:f});m&&this.updateChanges({source:t,sourceDetail:e,changes:{[i]:m},isReset:!1})}isValidUpdateWith(t,e,i){const n=this.getPrimaryAxis(t);if(!n)return!0;const s=n.scale.getDomainMinMax();if(!s)return!0;const[r,o]=n.visibleRange,a=this.getRange(n.id,{min:r,max:o});if(!a)return!0;const[l,c]=s,{start:h,end:u}=a,d=e({start:l,end:c,windowStart:h,windowEnd:u,source:i});if(!this.isValidUpdateWithResult(d))return!0;const[g,p]=d;let f=!0;return g!=null&&f&&(f=g>=l),p!=null&&f&&(f=p<=c),g!=null&&p!=null&&f&&(f=g<=p),f}getAxisZooms(){return this.state}getAxisZoom(t){return this.state[t]??{min:0,max:1}}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}getBoundSeries(){const t=this.getPrimaryAxis("x"),e=this.getPrimaryAxis("y");let i;if(this.independentAxes){const n=new Set(t?.boundSeries??[]),s=new Set(e?.boundSeries??[]);i=new Set;for(const r of n)s.has(r)&&i.add(r)}else i=new Set([...t?.boundSeries??[],...e?.boundSeries??[]]);return i}constrainZoomToItemCount(t,e,i){let n=[t.x.min,t.x.max],s=i?void 0:[t.y.min,t.y.max];for(const a of this.getBoundSeries()){const l=a.getZoomRangeFittingItems(n,s,e);l!=null&&(n=l.x,s=l.y)}const r={min:J(0,n[0],1),max:J(0,n[1],1)},o=s?{min:J(0,s[0],1),max:J(0,s[1],1)}:void 0;return nh({x:r,y:o})}isVisibleItemsCountAtLeast(t,e,i){const n=this.getBoundSeries(),s=[t.x.min,t.x.max],r=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[t.y.min,t.y.max];let o=0;for(const a of n){const l=e-(o??0),c=a.getVisibleItems(s,r,l);if(o+=c,o>=e)return!0}return n.size===0}getMementoRanges(){const t=nh(ys(this.state)),e={rangeX:this.getRangeDirection("x",t.x),rangeY:this.getRangeDirection("y",t.y),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:void 0};return this.ctx.eventsHub.emit("zoom:save-memento",{memento:e}),e}restoreRequiredRange(t,e,i){const{lastRestoredRequiredRange:n,lastRestoredRequiredRangeDirection:s}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0),this.restoreRequiredRangeIterations+=1;const r=e!=="x"&&e!=="y",o=s===e&&n===t,a=t===0&&(n==null||n===0);if(r||o||a||this.restoreRequiredRangeIterations>1){this.restoreRequiredRangeIterations=0;return}const l=this.getPrimaryAxisId(e);if(!l)return;const c=this.state[l]??{min:0,max:1},h=Math.min(1,1/t);let u=0,d=1;e==="x"?(u=J(0,1-h,c.min),d=J(0,u+h,1)):(d=Math.min(1,c.max),u=d-h,u<0&&(d-=u,u=0),u=J(0,u,1),d=J(0,d,1)),this.lastRestoredRequiredRange=t,this.lastRestoredRequiredRangeDirection=e;const g={[e]:{min:u,max:d}},p=this.toCoreZoomState(g);this.writeInitialZoom(ys(p)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:p,isReset:!1})}constrainZoomToRequiredWidth(t){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const e=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!e)return;const i=t.state[e],n=t.oldState[e];if(!i||!n)return;const s=i.max-i.min,r=1/this.lastRestoredRequiredRange;Math.abs(s-r)<1e-12||s<=r||t.constrainChanges({[e]:{direction:this.lastRestoredRequiredRangeDirection,min:n.min,max:n.min+r}})}dispatch(t,e,i,n,s){const{x:r,y:o}=ys(this.state)??{},a=this.state;let l;const c=this.debug,h=this,u={source:t,sourceDetail:e,isReset:n,changedAxes:i,state:a,oldState:s,x:r,y:o,stateAsDefinedZoom(){return nh(ys(u.state))},constrainZoom(p){this.constrainChanges(h.toCoreZoomState(p))},constrainChanges(p){c.check()&&c("ZoomManager.constrainChanges()",a,"->",p,new Error().stack),l??(l=Ue(a));for(const f of hs(p)){const m=p[f],y=l[f];m&&y&&(y.min=m.min,y.max=m.max)}u.state=l}};this.ctx.eventsHub.emit("zoom:change-request",u),l&&!Tk(a,l)&&(this.state=l);const d=ys(this.state);st(this.ctx.chartState.getValue("zoom"),d)||this.ctx.chartState.setValue("zoom",d);const g=!Tk(s,this.state);return g&&(this.ctx.eventsHub.emit("zoom:change-complete",{source:t,sourceDetail:e,x:d?.x}),this.pendingZoomEventSource=t),g}getRange(t,e){return this.getRangeAxis(this.findAxis(t),e)}getRangeDirection(t,e){return this.getRangeAxis(this.getPrimaryAxis(t),e)}getRangeAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i;let r,o;return n<=s?(r=t.scale.invertWithPercentage(0),o=t.scale.invertWithPercentage(n+(s-n)*e.max)):(r=t.scale.invertWithPercentage(n-(n-s)*e.min),o=t.scale.invertWithPercentage(0)),{start:r,end:o}}rangeToRatioDirection(t,e){return this.rangeToRatioAxis(this.getPrimaryAxis(t),e)}rangeToRatioAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i,{scale:r}=t,{start:o,end:a}=e,l=Lk(o),c=Lk(a),h=r.bandwidth===0?r.step??0:r.bandwidth??0,[u=0,d=1]=rI(l.value,c.value);let g=n,p=s;if(l.value!=null&&(Nk(o)?g=r.convert(l.value)+h*l.groupPercentage:g=r.convert(o,{alignment:u,alignmentExclusive:!0})),c.value!=null&&(Nk(a)?p=r.convert(c.value)+h*c.groupPercentage:p=r.convert(a,{alignment:d,alignmentExclusive:!0})+(r.bandwidth??0)),!Be(g)||!Be(p))return;const[f,m]=[Math.min(n,s),Math.max(n,s)];g=J(f,g,m),p=J(f,p,m);const y=s-n;if(y===0)return;const b=Math.abs((g-n)/y),v=Math.abs((p-n)/y);if(!(b>=v))return{min:b,max:v}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!Be(e)||!Be(i)))return[e,i]}isValidUpdateWithResult(t){return t==null||!Array.isArray(t)||t.length<1?!1:t.every(e=>e==null||typeof e=="number"||vc(e))}},Ok=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.Branch=3]="Branch",t[t.OtherBranch=4]="OtherBranch",t))(Ok||{});function Zh(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return e(t)}}var oo=class extends Dn{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Tt),this.strokes=Object.values(tr),this.colorScale=new Vo}};x([C],oo.prototype,"childrenKey",2),x([C],oo.prototype,"sizeKey",2),x([C],oo.prototype,"colorKey",2),x([C],oo.prototype,"colorName",2),x([C],oo.prototype,"fills",2),x([C],oo.prototype,"strokes",2),x([C],oo.prototype,"colorScale",2);var Ek=class Sp{constructor(e,i,n,s,r,o,a,l,c,h,u,d){this.series=e,this.itemId=i,this.path=n,this.datumIndex=s,this.datum=r,this.sizeValue=o,this.colorValue=a,this.sumSize=l,this.depth=c,this.parent=h,this.children=u,this.style=d,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=Sp.Walk.PreOrder){i===Sp.Walk.PreOrder&&e(this);for(const n of this.children)n.walk(e,i);i===Sp.Walk.PostOrder&&e(this)}find(e){if(e(this))return this;for(const i of this.children){const n=i.find(e);if(n!=null)return n}}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};Ek.Walk={PreOrder:0,PostOrder:1};var hG=Ek,uG=class extends Ur{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Rr,this.animationState=new Xc("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(){this.data?.commitPendingTransactions(this.ctx.dataSelectionService);const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:n}=this.properties;let s=0,r=1/0,o=-1/0,a=-1;const l=(g,p,f)=>{const m=f.depth==null?0:f.depth+1,y=e==null?void 0:g[e],b=y==null||y.length===0;let v=i==null?void 0:g[i];On(v)?v=Math.max(Ze(v),0):v=b?1:0;const S=v;s=Math.max(s,m);let M=n==null?void 0:g[n];Zi(M)&&(M=Ze(M),r=Math.min(r,M),o=Math.max(o,M)),++a;const D=this.getItemStyle({datumIndex:a,datum:g,depth:m,colorValue:M},b,!1);return c(new t(this,ei(p.join(";")),p,a,g,v,M,S,m,f,[],D),y)},c=(g,p)=>{const{path:f}=g;if(p)for(const[m,y]of p.entries()){const b=l(y,f.concat(m),g);g.children.push(b),g.sumSize+=b.sumSize}return g},h=c(new t(this,"root",[],a,void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),u=[r,o],d=r<o?[r,o]:[0,1];zb(this.colorScale,this.properties.colorScale,d),this.rootNode=h,this.maxDepth=s,this.colorDomain=u}update({seriesRect:t}){this.updateSelections(),this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return this.rootNode?.find(e=>e.itemId===t)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(t){const{colorKey:e,colorScale:i}=this.properties,n=i.fills.length>0,{id:s,ctx:{legendManager:r},visible:o}=this;if(e==null||!n)return[];const a=o&&(r?.getItemEnabled({seriesId:s})??!0);return t==="category"&&i.mode==="discrete"&&n?Hb(this.colorScale,i.fills,s,a,jb(this)):t==="gradient"?[Gb(this.colorScale,i.fills,s,a,this.getFormatterContext("color"))]:[]}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum?.path??[]}removeMeIndexForIndexPath(t){const e=this.datumSelection.nodes();for(let i=0;i<e.length;i++){const{datum:n}=e[i];if(n!==void 0&&es(n.path,t))return i-1}return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=J(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:n}=t;let s=this.removeMeIndexPathForIndex(e);const r=s.reduce((c,h)=>c.children[h],this.rootNode);if(n>0&&r.hasChildren)s=[...s,0];else if(n<0&&s.length>1)s=s.slice(0,-1);else if(n===0&&i!==0){const c=r.parent.children.length-1;s=s.slice(),s[s.length-1]=J(0,s.at(-1)+i,c)}const o=s.reduce((c,h)=>c.children[h],this.rootNode),a=this.datumSelection.at(e+1);if(a==null)return;const l=this.computeFocusBounds(a);if(l!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(s),otherIndex:o.depth,bounds:l,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){B.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){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const t=this.ctx.highlightManager?.getActiveHighlight();if(t?.series===this)return t}getHierarchyHighlightState(t,e,i){if(t)return 1;if(e==null)return 0;const n=i.path?.[0],s=e.path?.[0];return n==null||s==null?0:n===s?3:4}getHierarchyHighlightStyles(t,e){switch(t){case 1:return de(e.highlightedItem,e.highlightedBranch);case 3:return de(e.unhighlightedItem,e.highlightedBranch);case 4:return e.unhighlightedBranch;default:return}}getHighlightStateString(t,e,i,n){if(!this.properties.highlight.enabled||i==null)return Zh(0);const s=this.dfsFind(i),r=this.getActiveHighlightNode();if(s==null)return Zh(0);const o=this.getHierarchyHighlightState(e??!1,r,s);return Zh(o)}dfsFind(t){const e=[];let i=this.rootNode;for(;i&&i.datumIndex!==t;)e.push(...i.children),i=e.pop();return i}},pp=Math.PI/180,Ev=t=>t*pp,Rv=t=>-Math.log(Math.tan(Math.PI*.25+t*pp*.5)),Pv=t=>t/pp,Fv=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(pp*.5),dG=class Yv extends $d{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=Yv.bounds(e)}static bounds(e){const[[i,n],[s,r]]=e,o=Ev(i),a=Rv(n),l=Ev(s),c=Rv(r);return new $(Math.min(o,l),Math.min(a,c),Math.abs(l-o),Math.abs(c-a))}static fixedScale(){return new Yv([[Pv(0),Fv(0)],[Pv(1),Fv(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,n=1/0,s=-1/0,r=1/0;for(const o of e){const a=o.domain;for(const[l,c]of a)i=Math.min(l,i),n=Math.max(l,n),s=Math.min(c,s),r=Math.max(c,r)}return{domain:[[i,s],[n,r]],animatable:!0}}convert([e,i]){const[[n,s],[r,o]]=this.range,a=(r-n)/this.bounds.width,l=(o-s)/this.bounds.height;return[(Ev(e)-this.bounds.x)*a+n,(Rv(i)-this.bounds.y)*l+s]}invert([e,i]){const[[n,s],[r,o]]=this.range,a=(r-n)/this.bounds.width,l=(o-s)/this.bounds.height;return[Pv((e-n)/a+this.bounds.x),Fv((i-s)/l+this.bounds.y)]}getDomainMinMax(){return Wd(this.domain)}},Nt=class extends Fe{constructor(){super(...arguments),this.enabled=!0,this.border=new Sl,this.wrapping="never",this.truncate=!1,this.spacing=5,this.avoidCollisions=!0,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}formatValue(t,e,i,n){const{formatter:s,format:r}=this,{type:o,value:a,domain:l,boundSeries:c}=e,h=e.type==="number"?e.fractionDigits:void 0,u=e.type==="date"?e.unit:void 0;let d;if(s!=null){const g=e.type==="date"?e.step:void 0,p=e.type==="number"?e.visibleDomain:void 0;d=t(s,{type:o,value:a,index:i,domain:l,fractionDigits:h,unit:u,step:g,boundSeries:c,visibleDomain:p})}if(r!=null&&d==null){const{specifier:g,dateStyle:p="long",truncateDate:f}=n??{},m=`${p}:${f??"none"}`;let y=this._formatters[m];const b=Fr.mergeSpecifiers(g,r);(y?.type!==o||y?.unit!==u||!st(y?.mergedFormat,b))&&(y={type:o,mergedFormat:b,unit:u,formatter:Fr.getFormatter(o,b,u,p,{truncateDate:f})},this._formatters[m]=y),d=y.formatter?.(a,h)}return d==null||ue(d)?d:String(d)}};x([C],Nt.prototype,"enabled",2),x([C],Nt.prototype,"border",2),x([C],Nt.prototype,"cornerRadius",2),x([C],Nt.prototype,"fill",2),x([C],Nt.prototype,"fillOpacity",2),x([C],Nt.prototype,"fontStyle",2),x([C],Nt.prototype,"fontWeight",2),x([C],Nt.prototype,"fontSize",2),x([C],Nt.prototype,"fontFamily",2),x([C],Nt.prototype,"wrapping",2),x([C],Nt.prototype,"truncate",2),x([C],Nt.prototype,"spacing",2),x([C],Nt.prototype,"minSpacing",2),x([C],Nt.prototype,"color",2),x([C],Nt.prototype,"rotation",2),x([C],Nt.prototype,"avoidCollisions",2),x([C],Nt.prototype,"padding",2),x([C],Nt.prototype,"itemStyler",2),x([C],Nt.prototype,"formatter",2),x([C],Nt.prototype,"format",2);var gG=class extends gy{constructor(){super(...arguments),this.defaultTickMinSpacing=20}get shape(){return this.options.shape}get innerRadiusRatio(){return this._innerRadiusRatio??this.options.innerRadiusRatio??0}set innerRadiusRatio(t){this._innerRadiusRatio=t}update(){super.update(),this.tickLineGroup.visible=this.options.tick.enabled,this.tickLabelGroup.visible=this.options.label.enabled}createAxisContext(){const t=super.createAxisContext();return t.getPolarLayout=()=>this.computePolarLayout(),t}updatePosition(){super.updatePosition();const t=Math.floor(this.translation.x),e=Math.floor(this.translation.y);this.tickLineGroup.translationX=t,this.tickLineGroup.translationY=e,this.tickLabelGroup.translationX=t,this.tickLabelGroup.translationY=e,this.tickLabelGroupSelection.each(og())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}},pG={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}},fG={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 mG({yDirection:t,padding:e=0,position:i="top",bbox:n}){const s=t?pG:fG,{xTranslationDirection:r,yTranslationDirection:o}=s[i],a=r*(e+n.width/2),l=o*(e+n.height/2);return{xTranslation:a,yTranslation:l}}var Rk=class extends Rt{constructor(t=""){super(),this._d="",this.d=t}get d(){return this._d}set d(t){t!==this._d&&(this._d=t,this.path.clear(),this.path.appendSvg(t),this.checkPathDirty())}},Pk=class extends yl(Rk){isPointInPath(t,e){return super.isPointInPath(t-this.translationX,e-this.translationY)}},yG=class extends Go(Pk){},bG=class gT extends _r{static is(e){return e instanceof gT}setSourceScale(e){this._sourceScale=e;const i=s=>{Object.defineProperty(this,s,{get:()=>e[s],set:r=>{e[s]=r},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const n=s=>{Object.defineProperty(this,s,{get:()=>e[s],configurable:!0})};n("bandwidth"),n("step"),n("inset"),n("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(e){return this._sourceScale?this._sourceScale.ordinalRange(e):super.ordinalRange(e)}convert(e,i){this.refresh();const n=this.findIndex(e,i?.alignment);return n==null||n<0||n>=this.bands.length?Number.NaN:this.ordinalRange(n)}findIndex(e,i=0){if(e==null)return;const{bands:n,reversed:s}=this,r=n.length;if(r===0)return;if(r===1)return 0;const o=n[0],a=n[r-1];if(o==null||a==null)return this._sourceScale?.findIndex(e,i);const l=e.valueOf(),c=o.valueOf(),h=a.valueOf(),u=(l-c)/(h-c),d=s?(1-u)*(r-1):u*(r-1);return i===0?Math.max(0,Math.min(r-1,Math.floor(d))):Math.max(0,Math.min(r-1,Math.ceil(d)))}},rc=class extends bs{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)}};x([H()],rc.prototype,"x",2),x([H()],rc.prototype,"y",2),x([H()],rc.prototype,"width",2),x([H()],rc.prototype,"height",2),x([H()],rc.prototype,"opacity",2);var Ls=class extends Rt{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return Vi(Ci(this.startAngle),Ci(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 $(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)}};Ls.className="Arc",x([H()],Ls.prototype,"centerX",2),x([H()],Ls.prototype,"centerY",2),x([H()],Ls.prototype,"radius",2),x([H()],Ls.prototype,"startAngle",2),x([H()],Ls.prototype,"endAngle",2),x([H()],Ls.prototype,"counterClockwise",2),x([H()],Ls.prototype,"type",2);function fp(t,e,i){const n=Math.hypot(t,e),r=Math.atan2(e,t)+i;return{x:Math.cos(r)*n,y:Math.sin(r)*n}}var qn=class extends Rt{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}set cornerRadius(t){}computeBBox(){const{columnWidth:t}=this,[e,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=this.getRotation(),s=-t/2,r=t/2,o=-i,a=-e;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:g,y:p}=fp(d%2===0?s:r,d<2?o:a,n);l=Math.min(g,l),c=Math.min(p,c),h=Math.max(g,h),u=Math.max(p,u)}return new $(l,c,h-l,u-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=fd(t,e);return Ci(t+i/2+Math.PI/2)}normalizeRadii(t,e){return t>e?[e,t]:[t,e]}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,path:e}=this,[i,n]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=-t/2,r=t/2,o=-n,a=-i,l=this.getRotation(),c=[[s,a],[s,o],[r,o],[r,a]].map(([h,u])=>fp(h,u,l));e.clear(!0),e.moveTo(c[0].x,c[0].y),e.lineTo(c[1].x,c[1].y),e.lineTo(c[2].x,c[2].y),e.lineTo(c[3].x,c[3].y),e.closePath()}calculateCircleIntersection(t,e){const i=t*t;if(e<i)return null;const n=-Math.sqrt(e-i),s=Math.atan2(n,t);return{y:n,angle:s}}calculateBothIntersections(t,e,i){const n=i*i,s=this.calculateCircleIntersection(t,n),r=this.calculateCircleIntersection(e,n);return!s||!r?null:{left:s,right:r}}calculateAxisOuterIntersections(t,e,i){const n=i*i,s=this.calculateCircleIntersection(t,n),r=this.calculateCircleIntersection(e,n);return!s||!r?null:{left:s,right:r,radiusSquared:n}}moveToRotated(t,e,i){const n=fp(t,e,i);this.path.moveTo(n.x,n.y)}lineToRotated(t,e,i){const n=fp(t,e,i);this.path.lineTo(n.x,n.y)}renderTopWithCornerClipping(t,e,i){const{path:n}=this,{right:s,top:r,rotation:o}=i,a=r*r,l=e.radiusSquared-a;if(l<=0)this.lineToRotated(s,e.right.y,o),n.arc(0,0,t,o+e.right.angle,o+e.left.angle,!0);else{const c=Math.sqrt(l),h=Math.atan2(r,c),u=Math.atan2(r,-c);this.lineToRotated(s,e.right.y,o),n.arc(0,0,t,o+e.right.angle,o+h,!0),this.lineToRotated(-c,r,o),n.arc(0,0,t,o+u,o+e.left.angle,!0)}}updateBeveledPath(){const{columnWidth:t,path:e,axisInnerRadius:i,axisOuterRadius:n}=this,[s,r]=this.normalizeRadii(this.innerRadius,this.outerRadius),o=-t/2,a=t/2,l=-r,c=-s,h=this.getRotation(),u=Vi(s,i),d=Vi(r,n),g=Math.hypot(o,l)>n||Math.hypot(a,l)>n;if(!u&&!d&&!g){this.updateRectangularPath();return}const p=u?this.calculateBothIntersections(o,a,s):null,f=d?this.calculateBothIntersections(o,a,r):null,m=g?this.calculateAxisOuterIntersections(o,a,n):null;if(u&&!p||d&&!f||g&&!m){this.updateRectangularPath();return}e.clear(!0);const y={left:o,right:a,top:l,bottom:c,rotation:h};p?this.moveToRotated(o,p.left.y,h):this.moveToRotated(o,c,h),p?e.arc(0,0,s,h+p.left.angle,h+p.right.angle,!1):this.lineToRotated(a,c,h),f?(this.lineToRotated(a,f.right.y,h),e.arc(0,0,r,h+f.right.angle,h+f.left.angle,!0)):m?this.renderTopWithCornerClipping(n,m,y):(this.lineToRotated(a,l,h),this.lineToRotated(o,l,h)),e.closePath()}};qn.className="RadialColumnShape",x([H()],qn.prototype,"isBeveled",2),x([H()],qn.prototype,"columnWidth",2),x([H()],qn.prototype,"startAngle",2),x([H()],qn.prototype,"endAngle",2),x([H()],qn.prototype,"outerRadius",2),x([H()],qn.prototype,"innerRadius",2),x([H()],qn.prototype,"axisInnerRadius",2),x([H()],qn.prototype,"axisOuterRadius",2);function Fk(t,e,i,n,s){const r=fd(t,e),o=r*(1-n)/2;if(t+=o,e-=o,r<.001)return 2*i*s;if(r>=2*Math.PI){const g=t+r/2;t=g-Math.PI,e=g+Math.PI}const a=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),u=Math.floor(Math.hypot(a-c,l-h)),d=2*i*s;return Math.max(1,Math.min(d,u))}var Vv=class extends rb{constructor(){super(ye("div"),"menuitem")}},Vk=class extends rb{constructor(){super(ye("div"),"menuitemradio")}setChecked(t){Ce(this.elem,"aria-checked",t)}},Bk=class pT extends ob{constructor(e="vertical"){super(e,"menu"),this.handleMouseEnter=(i,n)=>{n.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,n)=>{n.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const e=this.elem.ownerDocument.createElement("div");return Ce(e,"role","separator"),this.elem.appendChild(e),e}toggleChildEnabledByIndex(e,i){this.children.at(e)?.setEnabled(i)}onChildAdded(e){super.onChildAdded(e),e.addListener("mouseenter",this.handleMouseEnter),e.addListener("mousemove",this.handleMouseMove)}onChildRemoved(e){super.onChildRemoved(e),e.removeListener("mouseenter",this.handleMouseEnter),e.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const e=new Vv,i=new pT(this.orientation);i.id=Kc();const n=()=>{this.collapseExpandedSubMenu(i),e.expandControlled()},s=r=>{const o=Na(this.elem)?"ArrowLeft":"ArrowRight";wo(r.sourceEvent)&&r.sourceEvent.code===o&&(this.collapseExpandedSubMenu(i),e.expandControlled())};return e.setControlled(i),e.setAriaHasPopup("menu"),e.addListener("click",n),e.addListener("mouseenter",n),e.addListener("keydown",s),this.addChild(e),{subMenuButton:e,subMenu:i}}expandSubMenu(e,i){const{expansionScope:n}=this;n&&(this.collapseExpandedSubMenu(i),i?.expand(e))}collapseExpandedSubMenu(e){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=e)}getCloseKeys(){return Na(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(e){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:Qf(e.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new it};const i=this.expansionScope,n=this.children.map(s=>s.getElement());Ce(i.lastFocus,"aria-expanded",!0),i.removers.register(kS(this.elem,i.abort),TS(this.elem,i.abort),...this.children.map(s=>qf(s.getElement(),i.close,()=>this.getCloseKeys())),e?.overrideFocusVisible&&NS(this.elem,n,e.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(e){const{mode:i="0"}=e??{};if(this.expansionScope===void 0)return;const{lastFocus:n,removers:s,expandedSubMenu:r}=this.expansionScope;this.expansionScope=void 0,r?.collapse({mode:"3"}),Ce(n,"aria-expanded",!1),i==="0"&&n?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},_k="canvas-overlay",zk=class extends pc{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.setOwnedWidget=(()=>{let n;return s=>{n?.destroy(),n=s}})(),this.moduleId=`popover-${e}`,i?.detached?this.element=ye("div"):this.element=t.domManager.addChild(_k,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>t.domManager.removeChild(_k,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();e?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return t??(t=ye("div","ag-charts-popover")),t.classList.toggle("ag-charts-popover",!0),e.ariaLabel!=null&&t.setAttribute("aria-label",e.ariaLabel),e.class!=null&&t.classList.add(e.class),e.minWidth!=null&&(t.style.minWidth=`${e.minWidth}px`),this.element.replaceChildren(t),t}showWidget(t,e,i){this.setOwnedWidget(e),this.initPopoverElement(e.getElement(),i),e.addListener("collapse-widget",()=>{this.hide(),t.setControlled(void 0),this.setOwnedWidget(void 0)}),t.setControlled(e),t.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}showWithChildren(t,e){const i=this.initPopoverElement(void 0,e);if(i.replaceChildren(...t),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const n=Qf(e.sourceEvent);n!==void 0&&(this.lastFocus=n,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",`${t.x}px`),t.y!=null&&e.style.setProperty("top",`${t.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},Gk=class extends zk{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}updateAnchor(t){const e=t.anchor??this.anchor,i=t.fallbackAnchor??this.fallbackAnchor;e&&this.setAnchor(e,i)}showWidget(t,e,i){super.showWidget(t,e,i),this.updateAfterShow(i)}showWithChildren(t,e){const i=super.showWithChildren(t,e);return this.updateAfterShow(e),i}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,n=this.getPopoverElement();if(!t||!n)return;const s=e.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:o}=n,{isRtl:a}=e.domManager,l=a?t.x-r:t.x;let c=J(0,l,s.width-r),h=J(0,t.y,s.height-o);if(c!==l&&i?.x!=null){const u=a?i.x:i.x-r;c=J(0,u,s.width-r)}h!==t.y&&i?.y!=null&&(h=J(0,i.y-o,s.height-o)),this.updatePosition({x:c,y:h})}updateAfterShow(t){this.updateAnchor(t),this.ctx.agDocument.requestAnimationFrame(()=>{this.repositionWithinBounds()})}},vG=class extends Gk{show(t,e){const i=new Bk("vertical");for(const n of e.items)i.addChild(this.createRow(e,n,i));i.addClass("ag-charts-menu"),this.showWidget(t,i,e)}allocRow(t,e){if(t.menuItemRole==null||t.menuItemRole==="menuitem")return new Vv;{t.menuItemRole;const i=new Vk;return i.setChecked(t.value===e.value),i}}createRow(t,e,i){const n=e.value===t.value,s=this.allocRow(t,e);if(e.enabled!=null&&s.setEnabled(e.enabled),s.addClass("ag-charts-menu__row"),s.toggleClass("ag-charts-menu__row--active",n),typeof e.value=="string"&&(s.getElement().dataset.popoverId=e.value),e.icon!=null){const o=ye("span",`ag-charts-menu__icon ${bc(e.icon)}`);s.getElement().appendChild(o)}const r=e.strokeWidth!=null;if(r&&(s.toggleClass("ag-charts-menu__row--stroke-width-visible",r),s.setCSSVariable("--strokeWidth",r?`${e.strokeWidth}px`:null)),e.label!=null){const o=ye("span","ag-charts-menu__label");o.textContent=this.ctx.localeManager.t(e.label),s.getElement().appendChild(o)}return"altText"in e&&s.setAriaLabel(this.ctx.localeManager.t(e.altText)),s.addListener("click",({sourceEvent:o})=>{t.onPress?.(e),o.preventDefault(),i.collapse()}),s}},jk=class extends zk{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Lo.from(t.clientX,t.clientY),position:Lo.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const n=Lo.sub(Lo.from(t.clientX,t.clientY),e.client),s=Lo.add(e.position,n),r=this.ctx.domManager.getBoundingClientRect(),o={};s.x>=0&&s.x+i.offsetWidth<=r.width&&(o.x=s.x),s.y>=0&&s.y+i.offsetHeight<=r.height&&(o.y=s.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},xG={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function SG(t){return typeof t!="string"?"false":xG[t]}function MG(t){return wo(t.sourceEvent)&&t.sourceEvent.code==="ArrowLeft"}function IG(t){return wo(t.sourceEvent)&&t.sourceEvent.code==="ArrowRight"}function Hk(t){return!1}var $k=class extends Ag{constructor(t,e){super(),this.localeManager=t,this.arrowKeyPredicate=Hk,e&&this.addKeyboardClickBinding(i=>this.arrowKeyPredicate(i))}update(t,e){const{localeManager:i}=this;if(t.tooltip){const r=i.t(t.tooltip);r!==this.lastTooltip&&(this.elem.title=r,this.lastTooltip=r)}let n="";if(t.icon!=null&&t.iconPosition!=="after"&&(n=`<span class="${bc(t.icon)} ag-charts-toolbar__icon"></span>`),t.label!=null){const r=i.t(t.label);n=`${n}<span class="ag-charts-toolbar__label">${r}</span>`}t.icon!=null&&t.iconPosition==="after"&&(n=`${n}<span class="${bc(t.icon)} ag-charts-toolbar__icon"></span>`);const s=SG(t.value);s=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0),this.arrowKeyPredicate=Hk):(this.setAriaHasPopup(s),this.setAriaExpanded(!1),this.arrowKeyPredicate=e.isRtl?MG:IG),n!==this.lastInnerHTML&&(this.elem.innerHTML=n,this.lastInnerHTML=n)}setChecked(t){Ce(this.elem,"aria-checked",t)}},Wk="ag-charts-toolbar__button--active",Bv=class extends wg{constructor({eventsHub:t,localeManager:e,domManager:i},n,s){super(s),this.ariaLabelId=n,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new sI,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=t,this.localeManager=e,this.domManager=i,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(t){this.ariaLabelId=t,this.updateAriaLabel()}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}getInteractionOptions(){const{isRtl:t}=this.domManager;return{isRtl:t}}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,n]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,n)).update(n,this.getInteractionOptions());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,this.getInteractionOptions())}clearActiveButton(){for(const t of this.buttonWidgets)t.toggleClass(Wk,!1)}toggleActiveButtonByIndex(t){if(t!==-1)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(Wk,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))}getButtonWidget(t){return this.buttonWidgets.at(t)}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds(),n=t.getBoundingClientRect(),s=n.x-Math.floor(n.x),r=n.y-Math.floor(n.y);return new $(i.x+e.x+s,i.y+e.y+r,n.width,n.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,n,s;for(const[r,o]of t.entries())i=!e&&r===0||s!=o.section,n=r===t.length-1||o.section!=t.at(r+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",n),o.toggleClass("ag-charts-toolbar__button--group-first",r>0&&i),s=o.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",n=>{const s={index:t,...e instanceof Fe?e.toJson():e},r=this.getButtonWidgetBounds(i),o={event:n,button:s,buttonBounds:r,buttonWidget:i};this.events.dispatch("button-pressed",o)}),i.addListener("focus",()=>{const n={button:{index:t}};this.events.dispatch("button-focused",n)}),i.addListener("expand-controlled-widget",n=>{this.expanded?.collapse({mode:"4"}),this.expanded=n.controlled;const s=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,s()})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},DG=class extends Bv{createButtonWidget(){return new $k(this.localeManager,!0)}},CG=class extends jk{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 $(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const n=this.getPopoverElement();if(!n)return;const s=t.position??"above",{offsetWidth:r,offsetHeight:o}=n;let a=t.y-o-i,l=t.x-r/2;s==="below"?a=t.y+i:s==="right"?(a=t.y-o/2,l=t.x+e):s==="above-left"&&(l=t.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(J(0,t.x,i.width-e.width)),t.y=Math.floor(J(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},AG=class extends Bv{constructor(t,e,i){super(t,e,"horizontal"),this.hasPrefix=!0,this.popover=new CG(t,i,this.onPopoverMoved.bind(this)),this.dragHandle=new wG(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}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),n=this.dragHandle.getBounds();return new $(i.x+e.x-n.width,i.y+e.y,i.width,i.height)}},wG=class extends zl{constructor(t){super(ye("div","ag-charts-floating-toolbar__drag-handle"));const e=new zl(ye("span",`${bc("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},kG={...VI,..._I},Uk={};Ri(Uk,{ButtonWidget:()=>Ag,MenuItemRadioWidget:()=>Vk,MenuItemWidget:()=>Vv,MenuWidget:()=>Bk,NativeWidget:()=>zl,SliderWidget:()=>lb,ToolbarWidget:()=>wg,Widget:()=>Zr,WidgetEventUtil:()=>Yr});var _v={};Ri(_v,{Arc:()=>Ls,BBox:()=>$,Caption:()=>It,CategoryScale:()=>Yo,Group:()=>se,Line:()=>cn,LinearScale:()=>Zo,Marker:()=>Mt,Path:()=>Rt,RadialColumnShape:()=>qn,Rect:()=>Pt,Scene:()=>kg,Sector:()=>zt,Shape:()=>_o,TranslatableGroup:()=>qt,getRadialColumnWidth:()=>Fk,toRadians:()=>ni});var zv={};Ri(zv,{AGGREGATION_INDEX_SELECTED:()=>Kt,AGGREGATION_INDEX_UNSET:()=>zc,AGGREGATION_INDEX_X_MAX:()=>St,AGGREGATION_INDEX_X_MIN:()=>dt,AGGREGATION_INDEX_Y_MAX:()=>gt,AGGREGATION_INDEX_Y_MIN:()=>Et,AGGREGATION_MAX_POINTS:()=>oL,AGGREGATION_MIN_RANGE:()=>Dr,AGGREGATION_SPAN:()=>Di,AGGREGATION_THRESHOLD:()=>Gs,AbstractModuleInstance:()=>pc,ActionOnSet:()=>gi,AgDocument:()=>uS,AsyncAwaitQueue:()=>Wf,BASE_FONT_SIZE:()=>yr,BLOCK_IMAGE_SPACING:()=>al,BREAK_TRANSFORM_CHAIN:()=>Ru,BaseProperties:()=>Fe,Bitfield:()=>vT,Border:()=>el,CANVAS_HEIGHT:()=>CL,CANVAS_TO_BUFFER_DEFAULTS:()=>AL,CANVAS_WIDTH:()=>DL,CARTESIAN_AXIS_TYPE:()=>R0,CARTESIAN_POSITION:()=>E0,CSS_GENERIC_FAMILIES:()=>Op,CallbackCache:()=>hS,ChangeDetectableProperties:()=>Lm,ChartAxisDirection:()=>df,ChartTheme:()=>Yn,ChartUpdateType:()=>_n,CleanupRegistry:()=>it,Color:()=>De,ConfiguredCanvasMixin:()=>wL,DEFAULT_ANNOTATION_HANDLE_FILL:()=>od,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>cd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>hd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>zf,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Gf,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>ad,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>ld,DEFAULT_CAPTION_ALIGNMENT:()=>Tr,DEFAULT_CAPTION_LAYOUT_STYLE:()=>kr,DEFAULT_FIBONACCI_STROKES:()=>_f,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>ji,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Gi,DEFAULT_POLAR_SERIES_STROKE:()=>nd,DEFAULT_SHADOW_COLOUR:()=>Mo,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>sd,DEFAULT_TEXTBOX_COLOR:()=>gd,DEFAULT_TEXTBOX_FILL:()=>ud,DEFAULT_TEXTBOX_STROKE:()=>dd,DEFAULT_TEXT_ANNOTATION_COLOR:()=>rd,DEFAULT_TOOLBAR_POSITION:()=>Hc,DIRECTION_SWAP_AXES:()=>B0,Debug:()=>re,DebugMetrics:()=>or,DeclaredSceneChangeDetection:()=>Xe,DeclaredSceneObjectChangeDetection:()=>oh,Deprecated:()=>NL,DeprecatedAndRenamedTo:()=>OL,EllipsisChar:()=>La,ErrorType:()=>Zx,EventEmitter:()=>Os,FILL_GRADIENT_BLANK_DEFAULTS:()=>of,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>U1,FILL_GRADIENT_LINEAR_DEFAULTS:()=>vr,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>j1,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>$1,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>H1,FILL_GRADIENT_RADIAL_DEFAULTS:()=>$u,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Oc,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>_0,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>W1,FILL_IMAGE_BLANK_DEFAULTS:()=>lf,FILL_IMAGE_DEFAULTS:()=>_s,FILL_PATTERN_BLANK_DEFAULTS:()=>af,FILL_PATTERN_DEFAULTS:()=>Qi,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>Y1,FILL_PATTERN_KEYED_DEFAULTS:()=>Z1,FILL_PATTERN_SINGLE_DEFAULTS:()=>K1,FONT_SIZE:()=>O0,FONT_SIZE_RATIO:()=>br,Graph:()=>CS,IS_DARK_THEME:()=>Qa,InterpolationProperties:()=>ja,LABEL_BOXING_DEFAULTS:()=>us,LEGEND_CONTAINER_THEME:()=>z0,LRUCache:()=>cc,LineSplitter:()=>lr,Logger:()=>B,MARKER_SERIES_HIGHLIGHT_STYLE:()=>cf,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Ec,MementoCaretaker:()=>uf,ModuleRegistry:()=>ee,ModuleType:()=>qv,ObserveChanges:()=>md,PALETTE_ALT_DOWN_FILL:()=>Ff,PALETTE_ALT_DOWN_STROKE:()=>Rf,PALETTE_ALT_NEUTRAL_FILL:()=>Vf,PALETTE_ALT_NEUTRAL_STROKE:()=>Bf,PALETTE_ALT_UP_FILL:()=>Pf,PALETTE_ALT_UP_STROKE:()=>Ef,PALETTE_DOWN_FILL:()=>Lf,PALETTE_DOWN_STROKE:()=>kf,PALETTE_NEUTRAL_FILL:()=>Of,PALETTE_NEUTRAL_STROKE:()=>Nf,PALETTE_UP_FILL:()=>Tf,PALETTE_UP_STROKE:()=>wf,PART_WHOLE_HIGHLIGHT_STYLE:()=>hf,POLAR_AXIS_SHAPE:()=>F0,POLAR_AXIS_TYPE:()=>P0,Padding:()=>rl,ParallelStateMachine:()=>XL,PolarZIndexMap:()=>W0,PropertiesArray:()=>Ga,Property:()=>C,ProxyOnWrite:()=>xL,ProxyProperty:()=>Hi,ProxyPropertyOnWrite:()=>Yt,ReactiveState:()=>G0,SAFE_FILLS_OPERATION:()=>z1,SAFE_FILL_OPERATION:()=>_1,SAFE_RANGE2_OPERATION:()=>G1,SAFE_STROKE_FILL_OPERATION:()=>rf,SEGMENTATION_DEFAULTS:()=>Wu,SERIES_SELECTION_THEME:()=>xr,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>X1,SKIP_JS_BUILTINS:()=>L0,ScaleAlignment:()=>Jv,SceneArrayChangeDetection:()=>Om,SceneChangeDetection:()=>H,SceneObjectChangeDetection:()=>Ro,SceneRefChangeDetection:()=>jd,SeriesContentZIndexMap:()=>$0,SeriesZIndexMap:()=>H0,SimpleCache:()=>TL,SpanJoin:()=>pM,StateMachine:()=>Xc,StateMachineProperty:()=>ZL,TRIPLE_EQ:()=>fl,TextMeasurer:()=>am,TickIntervals:()=>Ed,TrimCharsRegex:()=>Nx,TrimEdgeGuard:()=>mc,UNIT_MAX:()=>Tm,UNIT_MIN:()=>km,UnknownError:()=>bu,ValidationError:()=>Ps,Vec2:()=>Lo,Vec4:()=>No,Vertex:()=>AS,WeakCache:()=>mS,ZIndexMap:()=>j0,absValue:()=>hu,addEscapeEventListener:()=>qf,addFakeTransformToInstanceProperty:()=>C,addMouseCloseListener:()=>kS,addObserverToInstanceProperty:()=>Xp,addOverrideFocusVisibleEventListener:()=>NS,addTouchCloseListener:()=>TS,addTransformToInstanceProperty:()=>fr,addValues:()=>cu,aggregationBucketForDatum:()=>jc,aggregationDatumMatchesIndex:()=>Af,aggregationDomain:()=>td,aggregationIndexForXRatio:()=>id,aggregationRangeFittingPoints:()=>js,aggregationXRatioForDatumIndex:()=>Ja,aggregationXRatioForXValue:()=>bn,and:()=>Se,angleBetween:()=>fd,angularPadding:()=>$f,appendEllipsis:()=>Rp,applySkiaPatches:()=>kL,arcDistanceSquared:()=>EL,areScalingEqual:()=>Eo,array:()=>ls,arrayLength:()=>En,arrayOf:()=>ne,arrayOfDefs:()=>ct,arraysEqual:()=>es,assignIfNotStrictlyEqual:()=>V1,attachDescription:()=>be,attachListener:()=>rt,autoSizedLabelOptionsDefs:()=>pr,barHighlightOptionsDef:()=>Rn,bezier2DDistance:()=>aM,bezier2DExtrema:()=>oM,bigIntAggregationExtent:()=>sS,blockStripHeight:()=>hm,blockStripWidth:()=>Jc,boolean:()=>L,borderOptionsDef:()=>po,boxCollides:()=>yd,boxContains:()=>tl,boxEmpty:()=>SL,boxesEqual:()=>bd,buildDateFormatter:()=>pl,cachedTextMeasurer:()=>Zt,calcLineHeight:()=>Ep,calculatePlacement:()=>VS,callWithContext:()=>tn,callback:()=>Pe,callbackDefs:()=>Ae,callbackOf:()=>ti,ceilTo:()=>$T,checkDatum:()=>tM,circularSliceArray:()=>Ln,clamp:()=>J,clampArray:()=>Ha,clipLines:()=>jS,clipSpanX:()=>wm,coerceIso8601Date:()=>PS,coerceTextValue:()=>_x,collapseSpanToPoint:()=>_d,collectAggregationLevels:()=>uL,collectSparseSelection:()=>rS,color:()=>Wt,colorOrRef:()=>K,colorScaleOptionsDef:()=>Bs,colorStopsOrderValidator:()=>Mu,colorUnion:()=>Xi,commonChartOptionsDefs:()=>oe,commonSeriesOptionsDefs:()=>Vn,commonSeriesThemeableOptionsDefs:()=>Ie,compactAggregationIndices:()=>So,compareDates:()=>Kf,computeColorBins:()=>Ax,computeExtremesAggregation:()=>lS,computeExtremesAggregationPartial:()=>dL,constant:()=>_e,contextMenuItemsArray:()=>M0,countFractionDigits:()=>du,countLines:()=>$x,createAggregationIndices:()=>Hs,createBigIntBins:()=>qS,createBigIntTickBins:()=>JS,createBigIntTicks:()=>XS,createButton:()=>YN,createCanvasContext:()=>pS,createCheckbox:()=>ZN,createDeprecationWarning:()=>Xf,createDynamicContext:()=>kp,createElement:()=>ye,createElementId:()=>Kc,createIcon:()=>MM,createId:()=>xn,createIdsGenerator:()=>Sm,createNumberFormatter:()=>Hp,createSelect:()=>XN,createSvgElement:()=>pt,createTextArea:()=>qN,createTicks:()=>hl,date:()=>Ct,dateToNumber:()=>ii,dateTruncationForDomain:()=>Sf,datesSortOrder:()=>Zf,debounce:()=>c1,decodeIntervalValue:()=>X0,deepClone:()=>Ue,deepFreeze:()=>Ji,defaultEpoch:()=>mm,defined:()=>he,definedZoomState:()=>nh,deriveNormalizedStops:()=>wx,diffArrays:()=>yS,discreteColorStops:()=>Np,distribute:()=>ix,downloadUrl:()=>zS,dropFirstWhile:()=>ex,dropLastWhile:()=>tx,durationDay:()=>xo,durationHour:()=>vo,durationMinute:()=>Sr,durationMonth:()=>pf,durationSecond:()=>Wa,durationWeek:()=>U0,durationYear:()=>Rc,easeIn:()=>JN,easeInOut:()=>QN,easeInOutQuad:()=>iO,easeInQuad:()=>eO,easeOut:()=>rh,easeOutQuad:()=>tO,encodedToTimestamp:()=>Mr,ensureEpochColumn:()=>Ju,enterprise:()=>ho,enterpriseRegistry:()=>ar,entries:()=>ut,epochColumnForTimeScale:()=>Cr,errorBarOptionsDefs:()=>Ou,errorBarThemeableOptionsDefs:()=>Tc,estimateTickCount:()=>eM,evaluateBezier:()=>dl,every:()=>k0,expandLegendPosition:()=>Ku,extent:()=>Or,extractDecoratedProperties:()=>A0,extractDomain:()=>lc,fillCssOptionsDef:()=>qi,fillGradientDefaults:()=>l0,fillImageDefaults:()=>h0,fillOptionsDef:()=>W,fillPatternDefaults:()=>c0,findDiscreteColorBinLabel:()=>kx,findMaxIndex:()=>il,findMaxValue:()=>ML,findMinIndex:()=>nl,findMinMax:()=>Ot,findMinValue:()=>IL,findRangeExtent:()=>bo,first:()=>Ii,flush:()=>mx,focusCursorAtEnd:()=>t1,fontFamilyFull:()=>Au,fontOptionsDef:()=>we,fontWeight:()=>Ac,formatColorBinLabel:()=>Lp,formatColorScaleBinLabel:()=>Cx,formatNumber:()=>xS,formatObjectValidator:()=>I0,formatPercent:()=>bS,formatValue:()=>Co,fromPairs:()=>T0,generateUUID:()=>Dd,geoJson:()=>DS,getAngleRatioRadians:()=>dS,getAttribute:()=>Do,getChartTheme:()=>Wh,getDOMMatrix:()=>Ip,getDocument:()=>rr,getElementBBox:()=>Ex,getEpochColumn:()=>If,getIconClassNames:()=>bc,getImage:()=>rx,getLastFocus:()=>Qf,getMaxInnerRectSize:()=>jf,getMidpointsForIndices:()=>gs,getMinOuterRectSize:()=>pL,getOffscreenCanvas:()=>su,getPath:()=>Qp,getPath2D:()=>dc,getPrevNextKeys:()=>Uc,getResizeObserver:()=>ox,getSequentialColors:()=>en,getTickTimeInterval:()=>eh,getWindow:()=>ts,googleFont:()=>Up,gradientColorStops:()=>Iu,gradientStrict:()=>Du,graphemeSegments:()=>Rs,greaterThan:()=>Mi,groupBy:()=>uc,guardTextEdges:()=>zx,hasNoModifiers:()=>wo,hasRequiredInPath:()=>uo,highlightOptionsDef:()=>Wp,htmlElement:()=>_p,imageBoxAroundBaseline:()=>cm,imageSegmentBox:()=>qc,inRange:()=>Mx,initRovingTabIndex:()=>jL,insertListItemsSorted:()=>FS,instanceOf:()=>g1,interpolationOptionsDefs:()=>Eu,intervalAgo:()=>tL,intervalCeil:()=>K0,intervalEpoch:()=>Vc,intervalExtent:()=>mf,intervalFloor:()=>_i,intervalHierarchy:()=>Bc,intervalMilliseconds:()=>zi,intervalNext:()=>ff,intervalPrevious:()=>Y0,intervalRange:()=>zn,intervalRangeCount:()=>yf,intervalRangeNumeric:()=>Z0,intervalRangeStartIndex:()=>q0,intervalStep:()=>Ir,intervalUnit:()=>zs,invalidateEpochColumn:()=>eS,inverseEaseOut:()=>DM,isArray:()=>ue,isBetweenAngles:()=>Lr,isBigInt:()=>Ea,isBlockBoundary:()=>um,isBoolean:()=>Px,isButtonClickEvent:()=>Jf,isColor:()=>Bx,isContinuous:()=>jn,isDate:()=>pn,isDecoratedObject:()=>Fu,isDefined:()=>rs,isDenseInterval:()=>ul,isDirectionRtl:()=>Na,isDocumentFragment:()=>lx,isElement:()=>Dp,isEmptyObject:()=>xc,isEnumKey:()=>n1,isEnumValue:()=>s1,isFiniteNumber:()=>Be,isFiniteNumericValue:()=>On,isFunction:()=>os,isGradientFill:()=>sn,isGradientFillArray:()=>BN,isGradientOrPatternFill:()=>_N,isHTMLElement:()=>Da,isHtmlElement:()=>Vx,isISO8601:()=>ms,isImageFill:()=>Oo,isInputPending:()=>Rx,isInteger:()=>Ix,isKeyOf:()=>Sc,isNegative:()=>Ta,isNode:()=>ru,isNumber:()=>Nn,isNumberEqual:()=>Vi,isNumberObject:()=>Im,isNumericValue:()=>Zi,isObject:()=>ce,isObjectLike:()=>Oa,isObjectWithProperty:()=>N0,isObjectWithStringProperty:()=>B1,isPatternFill:()=>Us,isPlainObject:()=>Le,isPointLabelDatum:()=>cM,isProperties:()=>Yu,isRegExp:()=>Fx,isScaleValid:()=>ih,isSegmentTruncated:()=>Mc,isString:()=>nt,isStringFillArray:()=>sM,isStringObject:()=>Mm,isSymbol:()=>Ra,isTextTruncated:()=>as,isTimeInterval:()=>iL,isTimeIntervalUnit:()=>nL,isTruncated:()=>jx,isUnitTimeCategoryScaling:()=>Er,isValidDate:()=>vc,isValidNumberFormat:()=>i0,iterate:()=>fo,joinFormatted:()=>cr,jsonDiff:()=>ps,jsonPropertyCompare:()=>wS,jsonWalk:()=>fs,kebabCase:()=>Ux,labelBoxOptionsDef:()=>mn,legendPositionValidator:()=>ku,lessThan:()=>Si,lessThanOrEqual:()=>Jx,levenshteinDistance:()=>Wx,lineDashOptionsDef:()=>U,lineDistanceSquared:()=>vd,lineHighlightOptionsDef:()=>ur,lineSegmentOptions:()=>m0,lineSegmentation:()=>y0,linear:()=>IM,linearGaugeSeriesOptionsDef:()=>mo,linearGaugeSeriesThemeableOptionsDef:()=>Gu,linearGaugeTargetOptionsDef:()=>_u,linearPoints:()=>fM,listDecoratedProperties:()=>mr,lowestGranularityForInterval:()=>_c,lowestGranularityUnitForTicks:()=>xf,lowestGranularityUnitForValue:()=>qu,makeAccessibleClickListener:()=>HL,mapValues:()=>Jp,markerOptionsDefs:()=>Bn,markerStyleOptionsDefs:()=>gr,maxValue:()=>ss,measureTextSegments:()=>Ws,memo:()=>sl,merge:()=>Nc,mergeArrayDefaults:()=>F1,mergeDefaults:()=>de,minValue:()=>Es,modulus:()=>Dx,multiSeriesHighlightOptionsDef:()=>ht,narrowAggregationX:()=>wr,narrowBigIntColumn:()=>Ar,narrowBigIntColumnByOffset:()=>nS,narrowBigIntColumnRelative:()=>Gc,narrowToNumber:()=>ka,nearestSquared:()=>Ad,nearestSquaredInContainer:()=>YL,nextPowerOf2:()=>$a,niceBigIntDomain:()=>QS,niceTicksDomain:()=>xm,normalisedExtentWithMetadata:()=>xd,normalisedTimeExtentWithMetadata:()=>Sd,normalizeAngle180:()=>pd,normalizeAngle360:()=>Ci,normalizeAngle360FromDegrees:()=>$s,normalizeAngle360Inclusive:()=>fL,number:()=>G,numberFormatValidator:()=>Fn,numberMin:()=>Gp,numberRange:()=>Xx,numericValue:()=>Ne,object:()=>hr,objectsEqual:()=>st,objectsEqualWith:()=>qp,optionsDefs:()=>Re,or:()=>te,overflowStrategy:()=>wu,padding:()=>Ut,paddingOptions:()=>b0,parseColor:()=>Ox,parseNumberFormat:()=>xu,partialAssign:()=>tf,pause:()=>Uf,pick:()=>Vu,pickDirectionZoom:()=>sh,placeLabels:()=>hM,populateBucketSelectedFromSparse:()=>oS,populateBucketSelectedFromSparseSplit:()=>aS,positiveNumber:()=>w,positiveNumberNonZero:()=>Fs,positiveNumericValue:()=>jp,positiveNumericValueNonZero:()=>qx,preserveArabicJoining:()=>Pp,previousPowerOf2:()=>gf,radialGaugeSeriesOptionsDef:()=>Hu,radialGaugeSeriesThemeableOptionsDef:()=>ju,radialGaugeTargetOptionsDef:()=>zu,range:()=>Rd,rangeValidator:()=>Lu,ratio:()=>X,readIntegratedWrappedValue:()=>Dm,record:()=>fx,required:()=>Z,rescaleSpan:()=>gl,rescaleVisibleRange:()=>Od,resetIds:()=>$L,resolveOperation:()=>NG,resolvePadding:()=>wd,resolveStopPositions:()=>Tp,reversePush:()=>xT,rotatePoint:()=>Hf,roundTo:()=>uu,safeCall:()=>Vp,seedEpochColumnIdentity:()=>Mf,seedNumericColumnIdentity:()=>tS,selectionContainmentValidator:()=>p0,selectionOptionsDef:()=>Cu,seriesLabelOptionsDefs:()=>ze,seriesTooltipRangeValidator:()=>v0,setAttribute:()=>Ce,setAttributes:()=>Io,setDocument:()=>nx,setElementBBox:()=>gu,setElementStyle:()=>Gn,setElementStyles:()=>gS,setPath:()=>ef,setWindow:()=>sx,shadowOptionsDefs:()=>cs,shallowClone:()=>Ao,shapeHighlightOptionsDef:()=>We,shapeSegmentOptions:()=>f0,shapeSegmentation:()=>Ba,shapeSelectionOptionsDef:()=>g0,shapeValidator:()=>dr,simpleColorUnion:()=>d0,simpleMemorize:()=>Cd,simpleMemorize2:()=>Zc,smoothPoints:()=>yM,solveBezier:()=>Bd,sortAndUniqueDates:()=>Yf,sortBasedOnArray:()=>Qv,spanRange:()=>Ai,splitBezier2D:()=>th,stepPoints:()=>mM,stopPageScrolling:()=>ES,strictObjectKeys:()=>hs,strictUnion:()=>vu,string:()=>O,stringLength:()=>zp,stringifyValue:()=>Ic,strokeOptionsDef:()=>_,subtractValues:()=>fc,textAlign:()=>T1,textOrSegments:()=>yn,textWrap:()=>go,themeNames:()=>LG,themeOperator:()=>Vs,themeSymbols:()=>TG,themes:()=>Iv,throttle:()=>Fp,tickFormat:()=>cN,tickStep:()=>To,timeInterval:()=>kc,timeIntervalUnit:()=>za,timeValueToNumber:()=>ds,toArray:()=>hc,toCanvasTextBaseline:()=>ol,toDegrees:()=>mL,toFontString:()=>fu,toIterable:()=>w0,toNumber:()=>Ze,toNumberOrUndefined:()=>lu,toPlainText:()=>je,toRadians:()=>ni,toTextString:()=>$e,toTimeInterval:()=>vf,toZoomState:()=>ys,toolbarButtonOptionsDefs:()=>_a,tooltipOptionsDefs:()=>ke,tooltipOptionsDefsWithArea:()=>C0,transformIntegratedCategoryValue:()=>Pd,truncateLine:()=>ko,typeUnion:()=>Pa,undocumented:()=>Q,unguardTextEdges:()=>Gx,union:()=>V,unionSymbol:()=>Dc,unique:()=>Mp,validate:()=>$t,withTimeout:()=>yL,without:()=>q,wrapLines:()=>gm,wrapText:()=>dm,wrapTextOrSegments:()=>kd,wrapTextSegments:()=>Ld,zeroLike:()=>co});var TG={DEFAULT_ANNOTATION_HANDLE_FILL:od,DEFAULT_ANNOTATION_STATISTICS_COLOR:cd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:hd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:zf,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:Gf,DEFAULT_ANNOTATION_STATISTICS_FILL:ad,DEFAULT_ANNOTATION_STATISTICS_STROKE:ld,DEFAULT_CAPTION_ALIGNMENT:Tr,DEFAULT_CAPTION_LAYOUT_STYLE:kr,DEFAULT_FIBONACCI_STROKES:_f,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:ji,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Gi,DEFAULT_POLAR_SERIES_STROKE:nd,DEFAULT_SHADOW_COLOUR:Mo,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:sd,DEFAULT_TEXTBOX_COLOR:gd,DEFAULT_TEXTBOX_FILL:ud,DEFAULT_TEXTBOX_STROKE:dd,DEFAULT_TEXT_ANNOTATION_COLOR:rd,DEFAULT_TOOLBAR_POSITION:Hc,IS_DARK_THEME:Qa,PALETTE_ALT_DOWN_FILL:Ff,PALETTE_ALT_DOWN_STROKE:Rf,PALETTE_ALT_NEUTRAL_FILL:Vf,PALETTE_ALT_NEUTRAL_STROKE:Bf,PALETTE_ALT_UP_FILL:Pf,PALETTE_ALT_UP_STROKE:Ef,PALETTE_DOWN_FILL:Lf,PALETTE_DOWN_STROKE:kf,PALETTE_NEUTRAL_FILL:Of,PALETTE_NEUTRAL_STROKE:Nf,PALETTE_UP_FILL:Tf,PALETTE_UP_STROKE:wf},LG=Object.keys(Iv);function NG(t){const e=Yn.getDefaultPublicParameters(),i=Yn.getDefaultColors();return new pk({line:{operation:t}},{series:[{type:"line"}]},e,e,i).resolve().operation}var Gv={};Ri(Gv,{Color:()=>De,interpolateColor:()=>BI});var OG={VERSION:Qe,_Scene:_v,_Theme:zv,_Util:Gv,create:so.create.bind(so),createSparkline:so.__createSparkline.bind(so),setup:()=>{ee.setRegistryMode(ee.RegistryMode.Integrated),ee.registerModules(lv)},isEnterprise:!1};if(ee.registerModules(lv),typeof Qn.exports=="object"&&typeof ac=="object"){var EG=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Object.getOwnPropertyNames(e))!Object.prototype.hasOwnProperty.call(t,s)&&s!==i&&Object.defineProperty(t,s,{get:()=>e[s],enumerable:!(n=Object.getOwnPropertyDescriptor(e,s))||n.enumerable});return t};Qn.exports=EG(Qn.exports,ac)}return Qn.exports});