UNPKG

ag-charts-core

Version:

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

2 lines (1 loc) 25 kB
var ft=Object.defineProperty,$e=(e,t)=>{for(var n in t)ft(e,n,{get:t[n],enumerable:!0})},ke={};$e(ke,{error:()=>Me,errorOnce:()=>pt,log:()=>dt,logGroup:()=>yt,reset:()=>gt,table:()=>ht,warn:()=>Se,warnOnce:()=>W});var ae=new Set;function dt(...e){console.log(...e)}function Se(e,...t){console.warn(`AG Charts - ${e}`,...t)}function Me(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function ht(...e){console.table(...e)}function xe(e,t,n){let r;e instanceof Error?r=e.message:typeof e=="string"?r=e:typeof e=="object"?r=JSON.stringify(e):r=String(e);const i=`${t}: ${r}`;ae.has(i)||(n(e),ae.add(i))}function W(e,...t){xe(e,"Logger.warn",n=>Se(n,...t))}function pt(e,...t){xe(e,"Logger.error",n=>Me(n,...t))}function gt(){ae.clear()}function yt(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var je={};$e(je,{detectChartDefinition:()=>$t,getAxisModule:()=>kt,getPresetModule:()=>St,getSeriesModule:()=>Mt,hasModule:()=>vt,listModulesByType:()=>wt,register:()=>Ce,registerMany:()=>bt,reset:()=>mt});var Ae=(e=>(e.Axis="axis",e.Chart="chart",e.Preset="preset",e.Plugin="plugin",e.Series="series",e))(Ae||{}),A=new Map;function Ce(e){const t=A.get(e.name);if(t&&(t.enterprise||!e.enterprise))throw new Error(`AG Charts - Module '${e.name}' already registered`);A.set(e.name,e)}function bt(e){for(const t of e)Ce(t)}function mt(){A.clear()}function vt(e){return A.has(e)}function*wt(e){for(const t of A.values())G(e,t)&&(yield t)}function $t(e){for(const t of A.values())if(G("chart",t)&&t.detect(e))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function kt(e){const t=A.get(e);if(G("axis",t))return t}function St(e){const t=A.get(e);if(G("preset",t))return t}function Mt(e){const t=A.get(e);if(G("series",t))return t}function G(e,t){return t?.type===e}var xt=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const n=this.events.get(e);n&&(n.delete(t),n.size===0&&this.events.delete(e))}emit(e,t){this.events.get(e)?.forEach(n=>n(t))}clear(e){e?this.events.delete(e):this.events.clear()}},x={};typeof window<"u"?x.window=window:typeof global<"u"&&(x.window=global.window),typeof document<"u"?x.document=document:typeof global<"u"&&(x.document=global.document);function K(e){return e?x.document?.[e]:x.document}function Oe(e){return e?x.window?.[e]:x.window}function jt(e){x.document=e}function At(e){x.window=e}function Pe(e,t,n){const r=K().createElement(e);if(typeof t=="object"&&(n=t,t=void 0),t)for(const i of t.split(" "))r.classList.add(i);return n&&Object.assign(r.style,n),r}function Ct(e){return K().createElementNS("http://www.w3.org/2000/svg",e)}function Ot(e,t){const n=K("body"),r=Pe("a",{display:"none"});r.href=e,r.download=t,n.appendChild(r),r.click(),setTimeout(()=>n.removeChild(r))}function Ie(e){const t=Oe("Option"),{style:n}=new t;return n.color=e,n.color||null}function Ee(e){return e!=null}function F(e){return Array.isArray(e)}function Fe(e){return typeof e=="boolean"}function le(e){return e instanceof Date}function ce(e){return le(e)&&!isNaN(Number(e))}function Pt(e){return e instanceof RegExp}function O(e){return typeof e=="function"}function P(e){return typeof e=="object"&&e!==null&&!F(e)}function It(e){return F(e)||De(e)}function De(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function D(e){return typeof e=="string"}function Et(e){return typeof e=="number"}function I(e){return Number.isFinite(e)}function Ft(e){return typeof window<"u"&&e instanceof HTMLElement}function Dt(e,t){return D(t)&&Object.keys(e).includes(t)}function Vt(e,t){return Object.values(e).includes(t)}function Tt(e){return typeof e=="symbol"}function Ve(e){return D(e)&&(e==="none"||Ie(e)!=null)}function qt(e,t){return e in t}function Nt(e,t=0,n){const{leading:r=!1,trailing:i=!0,maxWait:o=1/0}=n??{};let a,s;if(o<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function c(...l){if(r&&!s){s=Date.now(),a=setTimeout(()=>s=null,t),e(...l);return}let d=t;if(o!==1/0&&s){const h=Date.now()-s;t>o-h&&(d=o-h)}clearTimeout(a),s??(s=Date.now()),a=setTimeout(()=>{s=null,i&&e(...l)},d)}return Object.assign(c,{cancel(){clearTimeout(a),s=null}})}function Rt(e,t,n){const{leading:r=!0,trailing:i=!0}=n??{};let o,a,s=!1;function c(){i&&a?(o=setTimeout(c,t),e(...a)):s=!1,a=null}function l(...d){s?a=d:(s=!0,o=setTimeout(c,t),r?e(...d):a=d)}return Object.assign(l,{cancel(){clearTimeout(o),s=!1,a=null}})}function ue(e,t,n=""){try{return e(...t)}catch(r){const i=n?` \`${n}\``:"";W(`Uncaught exception in user callback${i}`,r)}}function J(e,t="and",n=String,r=1/0){if(e.length===0)return"";if(e.length===1)return n(e[0]);e=e.map(n);const i=e.pop();if(e.length>=r){const o=e.length-(r-1);return`${e.slice(0,r-1).join(", ")}, and ${o} more ${t} ${i}`}return`${e.join(", ")} ${t} ${i}`}function Z(e,t=1/0){if(typeof e=="number"){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const n=JSON.stringify(e)??typeof e;return n.length>t?`${n.slice(0,t)}... (+${n.length-t} characters)`:n}function Ut(e){let t=1;for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Te(e,t){if(e===t)return 0;const[n,r]=e.length<t.length?[e,t]:[t,e],i=n.length,o=r.length;let a=new Array(i+1).fill(0).map((c,l)=>l),s=new Array(i+1);for(let c=1;c<=o;c++){s[0]=c;for(let l=1;l<=i;l++){const d=r[c-1]===n[l-1]?0:1;s[l]=Math.min(a[l]+1,s[l-1]+1,a[l-1]+d)}[a,s]=[s,a]}return a[i]}var w=Symbol("description"),qe=Symbol("required"),Q=Symbol("marked"),Ne=Symbol("undocumented"),X=Symbol("union"),Wt=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((e,t)=>{for(const n of t)e.set(n.toLowerCase(),new Set(t.filter(r=>r!==n)));return e},new Map),Re=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(Re||{});function B(e,t){return I(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var z=class{constructor(e,t,n,r,i){this.type=e,this.description=t,this.value=n,this.path=r,this.key=i}setUnionType(e,t){if(this.path.startsWith(t)){const n=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${n}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?B(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:n}=this;return t==="required"&&n==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${Z(n,50)}\`; expecting ${e}, ignoring.`}},fe=class extends z{constructor(e,t,n,r){super("unknown",void 0,t,n,r),this.suggestions=e,this.key=r}getPrefix(){return`Unknown option \`${B(this.path,this.key)}\``}getPostfix(){const e=J(Gt(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function V(e,t,n=""){if(!P(e))return{cleared:null,invalid:[new z("required","an object",e,n)]};const r={},i=[],o=new Set(Object.keys(e)),a=[];if(X in t){const s=Object.keys(t),c=t[X];if(e.type!=null&&s.includes(e.type)||e.type==null&&c!=null){const{type:l=c,...d}=e,h=V(d,t[l],n);Object.assign(r,{type:l},h.cleared);for(const v of h.invalid)v.setUnionType(l,n);i.push(...h.invalid)}else{const l=J(s,"or",d=>`'${d}'`);i.push(new z("required",`a keyword such as ${l}`,e.type,n,"type"))}return{cleared:r,invalid:i}}for(const s of Object.keys(t)){const c=t[s],l=c[qe],d=e[s];if(o.delete(s),typeof d>"u"&&(c[Ne]||a.push(s),!l))continue;const h=B(n,s);if(O(c)){const k=c(d,{options:e,path:h});if(typeof k=="object"){if(i.push(...k.invalid),k.valid){r[s]=k.cleared;continue}else if(ee(k.invalid,h))continue}else if(k){r[s]=d;continue}i.push(new z(l?"required":"invalid",c[w],d,n,s))}else{const v=V(d,c,h);v.cleared!=null&&(r[s]=v.cleared),i.push(...v.invalid)}}for(const s of o){const c=e[s];typeof c>"u"||i.push(new fe(a,c,n,s))}return{cleared:r,invalid:i}}function Gt(e,t,n=2){const r=[],i=e.toLowerCase(),o=Wt.get(i);for(const a of t){const s=a.toLowerCase();(o?.has(a)||s.includes(i)||Te(i,s)<=n)&&r.push(a)}return r}function u(e,t){return Object.assign(O(e)?(n,r)=>e(n,r):{...e},{[w]:t})}function f(e){return Object.assign(O(e)?(t,n)=>e(t,n):j(e),{[qe]:!0,[w]:e[w]})}function S(e){return Object.assign(O(e)?(t,n)=>e(t,n):j(e),{[Ne]:!0,[w]:e[w]})}var j=(e,t="an object")=>u((n,r)=>{const i=V(n,e,r.path);return{valid:!ee(i.invalid,r.path),cleared:i.cleared,invalid:i.invalid}},t),Ue=(e,t,n)=>({...e,[w]:t,[X]:n}),de=(...e)=>u((t,n)=>{const r=[];for(const i of e){const o=i(t,n);if(typeof o=="object"){if(r.push(...o.invalid),!o.valid)return{valid:!1,cleared:t,invalid:r};t=o.cleared}else if(!o)return!1}return{valid:!0,cleared:t,invalid:r}},e.map(t=>t[w]).filter(Boolean).join(" and ")),T=(...e)=>u((t,n)=>{for(const r of e){const i=r(t,n);if(typeof i=="object"?i.valid:i)return i}return!1},e.map(t=>t[w]).filter(Boolean).join(" or ")),Y=e=>I(e)||ce(e),Bt=e=>le(e)||(I(e)||D(e))&&ce(new Date(e)),zt=u(F,"an array"),L=u(Fe,"a boolean"),_t=u(O,"a function"),y=u(Ve,"a color string"),Ht=u(Bt,"a date"),Kt=u(Ee,"a defined value"),C=u(I,"a number"),Jt=u(P,"an object"),q=u(D,"a string"),Zt=u(e=>typeof HTMLElement>"u"||e instanceof HTMLElement,"an html element"),he=(e,t=1/0)=>{let n;return t===1/0?n=`an array of at least ${e} items`:e===t?n=`an array of exactly ${e} items`:e===0?n=`an array of no more than ${t} items`:n=`an array of at least ${e} and no more than ${t} items`,u(r=>F(r)&&r.length>=e&&r.length<=t,n)},pe=(e,t=1/0)=>{let n;return t===1/0?n=`a string of at least ${e} characters`:e===t?n=`an string of exactly ${e} characters`:e===0?n=`an string of no more than ${t} characters`:n=`an string of at least ${e} and no more than ${t} characters`,u(r=>D(r)&&r.length>=e&&r.length<=t,n)},ge=(e,t=!0)=>u(n=>I(n)&&(n>e||t&&n===e),`a number greater than ${t?"or equal to ":""}${e}`),We=(e,t)=>u(n=>I(n)&&n>=e&&n<=t,`a number between ${e} and ${t} inclusive`),g=ge(0),Qt=ge(0,!1),M=We(0,1),Xt=e=>u((t,{options:n})=>!Y(t)||!Y(n[e])||t<n[e],`the value to be less than \`${e}\``),Yt=e=>u((t,{options:n})=>!Y(t)||!Y(n[e])||t>n[e],`the value to be greater than \`${e}\``);function b(...e){P(e[0])&&(e=Object.values(e[0]));const t=J(e,"or",n=>`'${n}'`);return u(n=>e.includes(n),`a keyword such as ${t}`)}var _=e=>u(t=>e===t,`the value ${JSON.stringify(e)}`),Lt=(e,t)=>u(n=>n instanceof e,t??`an instance of ${e.name}`),H=(e,t,n=!0)=>u((r,i)=>{if(!F(r))return!1;let o=n;const a=[],s=[],c=l=>o=n?o&&l:o||l;if(r.length===0)return{valid:!0,cleared:a,invalid:s};for(let l=0;l<r.length;l++){const d=r[l],h=e(d,{options:d,path:`${i.path}[${l}]`});typeof h=="object"?(o=c(h.valid),s.push(...h.invalid),h.cleared!=null&&a.push(h.cleared)):(o=c(h),h&&a.push(d))}return{valid:o,cleared:o||!n?a:null,invalid:s}},t??`${e[w]} array`),en=(e,t="an object array")=>u((n,r)=>{if(!F(n))return!1;const i=[],o=[];for(let a=0;a<n.length;a++){const s=`${r.path}[${a}]`,c=V(n[a],e,s);ee(c.invalid,s)||i.push(c.cleared),o.push(...c.invalid)}return{valid:!0,cleared:i,invalid:o}},t),tn=(e,t)=>u((n,r)=>O(n)?Q in n?!0:{valid:!0,cleared:Object.assign((...o)=>{const a=ue(n,o);if(a==null)return;const s=e(a,{options:a,path:""});if(typeof s=="object"){if(s.invalid.forEach(Ge(r,t??e[w])),s.valid)return s.cleared}else{if(s)return a;W(`Callback \`${r.path}\` returned an invalid value \`${Z(a,50)}\`; expecting ${t??e[w]}, ignoring.`)}},{[Q]:!0}),invalid:[]}:!1,"a function"),nn=(e,t="an object")=>u((n,r)=>O(n)?Q in n?!0:{valid:!0,cleared:Object.assign((...o)=>{const a=ue(n,o,r.path);if(a==null)return;const s=V(a,e);return s.invalid.forEach(Ge(r,t)),s.cleared},{[Q]:!0}),invalid:[]}:!1,"a function");function ee(e,t){return e.some(n=>n.type==="required"&&n.path===t)}function Ge(e,t){return n=>{if(n instanceof fe)return W(`Callback \`${e.path}\` returned an unknown property \`${B(n.path,n.key)}\`${n.getPostfix()}`);const r=Z(n.value,50);W(n.key?`Callback \`${e.path}\` returned an invalid property \`${B(n.path,n.key)}\`: \`${r}\`; expecting ${n.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${r}\`; expecting ${t??n.description}, ignoring.`)}}var Be=e=>{if(!P(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},rn=j({color:y,stop:M},""),ze=u(e=>{let t=-1/0;for(const n of e)if(n?.stop!=null){if(n.stop<t)return!1;t=n.stop}return!0},"color stops to be defined in ascending order"),te=de(he(2),H(rn),ze),ye=b("axis","item","series"),on=j({type:f(_("gradient")),colorStops:f(te),rotation:C,gradient:S(b("linear","radial","conic")),bounds:S(ye),reverse:S(L)},"a gradient object with color stops"),_e={stroke:y,strokeWidth:g,strokeOpacity:M},He=j({type:f(_("gradient")),gradient:f(b("linear","radial","conic")),bounds:f(ye),colorStops:f(T(te,de(he(2),H(y)))),rotation:f(C),reverse:f(L)}),Ke=j({type:f(_("pattern")),pattern:f(b("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:pe(2),width:f(g),height:f(g),fill:f(y),fillOpacity:f(M),backgroundFill:f(y),backgroundFillOpacity:f(M),padding:f(g),rotation:f(C),scale:f(g),stroke:f(y),strokeWidth:f(g),strokeOpacity:f(M)}),Je=j({type:f(_("image")),url:q,width:g,height:g,rotation:f(C),backgroundFill:f(y),backgroundFillOpacity:M,fit:f(b("stretch","contain","cover")),repeat:f(b("repeat","repeat-x","repeat-y","no-repeat"))}),sn=Ue({gradient:{colorStops:te,rotation:C,gradient:S(b("linear","radial","conic")),bounds:S(ye),reverse:S(L)},pattern:{pattern:b("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:pe(2),width:g,height:g,rotation:C,scale:g,fill:y,fillOpacity:M,backgroundFill:y,backgroundFillOpacity:M,..._e,padding:S(g)},image:{url:f(q),backgroundFill:y,backgroundFillOpacity:M,width:g,height:g,fit:b("stretch","contain","cover","none"),repeat:b("repeat","repeat-x","repeat-y","no-repeat"),rotation:C}},"a color object"),Ze=T(y,j(sn,"a color object")),ne={fill:Ze,fillOpacity:M};ne.fillGradientDefaults=S(He),ne.fillPatternDefaults=S(Ke),ne.fillImageDefaults=S(Je);var an={lineDash:H(g),lineDashOffset:C},be=j({googleFont:q},"google font"),Qe=T(q,Be,be,H(T(q,be))),ln={color:y,fontFamily:Qe,fontSize:g,fontStyle:b("normal","italic","oblique"),fontWeight:T(g,b("normal","bold","bolder","lighter"))};function cn(e){return typeof e>"u"?[]:Array.isArray(e)?e:[e]}function un(e){return Array.from(new Set(e))}function fn(e,t){return e.reduce((n,r)=>{const i=t(r);return n[i]??(n[i]=[]),n[i].push(r),n},{})}function Xe(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(Array.isArray(e[n])&&Array.isArray(t[n])){if(!Xe(e[n],t[n]))return!1}else if(e[n]!==t[n])return!1;return!0}function dn(e,t,n=0){if(e.length===0)return[];const r=[];for(let i=0;i<t;i++)r.push(e.at((i+n)%e.length));return r}function hn(e,t){const n=new Map;return t.forEach((r,i)=>{n.set(r,i)}),e.sort((r,i)=>{const o=n.get(r)??1/0,a=n.get(i)??1/0;return o-a})}function pn(e,t){let n=0;for(;n<e.length&&t(e[n]);)n+=1;const r=n;r!==0&&e.splice(0,r)}function gn(e,t){let n=e.length-1;for(;n>=0&&t(e[n]);)n-=1;const r=e.length-1-n;r!==0&&e.splice(e.length-r,r)}var yn=class{constructor(){this.queue=[]}await(e=50){return new Promise(t=>{const n=()=>{clearTimeout(i),t(!0)},i=setTimeout(()=>{const o=this.queue.indexOf(n);o<0||(this.queue.splice(o,1),t(!1))},e);this.queue.push(n)})}notify(){this.queue.splice(0).forEach(e=>e())}};function bn(e=0){return new Promise(t=>{setTimeout(t,e)})}function*mn(...e){for(const t of e)yield*t}function vn(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function wn(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*me(e){const t=[void 0,void 0];for(const n of Object.keys(e))t[0]=n,t[1]=e[n],yield t}function E(e){return e==="true"}function $n(e){return Number(e)}function m(e){return e}var kn={role:m,"aria-checked":E,"aria-controls":m,"aria-describedby":m,"aria-disabled":E,"aria-expanded":E,"aria-haspopup":m,"aria-hidden":E,"aria-label":m,"aria-labelledby":m,"aria-live":m,"aria-orientation":m,"aria-selected":E,"data-focus-override":E,"data-focus-visible-override":E,"data-preventdefault":E,class:m,for:m,id:m,tabindex:$n,title:m,placeholder:m};function Ye(e,t,n){n==null||n===""||n===""?e?.removeAttribute(t):e?.setAttribute(t,n.toString())}function Sn(e,t){if(t!=null)for(const[n,r]of me(t))n!=="class"&&Ye(e,n,r)}function Mn(e,t,n){if(!(e instanceof HTMLElement))return;const r=e.getAttribute(t);return r===null?n:kn[t]?.(r)??void 0}function Le(e,t,n){e!=null&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n.toString()))}function xn(e,t){for(const[n,r]of me(t))Le(e,n,r)}function jn(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2);n(i)?(r=i,e=i+1):t=i-1}return r}function An(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2);n(i)?(r=i,t=i-1):e=i+1}return r}function Cn(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2),o=n(i);o==null?t=i-1:(r=o,e=i+1)}return r}function On(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2),o=n(i);o==null?e=i+1:(r=o,t=i-1)}return r}function Pn(e,t){const n=Math.max(e.length,t.length),r=new Set,i=new Set;for(let o=0;o<n;o++){const a=e[o],s=t[o];a!==s&&(i.has(s)?i.delete(s):s&&r.add(s),r.has(a)?r.delete(a):a&&i.add(a))}return{changed:r.size>0||i.size>0,added:r,removed:i}}function et(e,t,n){return Math.min(n,Math.max(e,t))}function In(e,t,n=1e-10){return e>=t[0]-n&&e<=t[1]+n}function ve(e,t,n=1e-10){return e===t||Math.abs(e-t)<n}function En(e){return Math.sign(e)===-1||Object.is(e,-0)}function Fn(e){return e%1===0}function Dn(e,t=2){const n=10**t;return Math.round(e*n)/n}function Vn(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function Tn(e){if(Math.floor(e)===e)return 0;let t=String(e),n=0;if(e<1e-6||e>=1e21){let i;[t,i]=t.split("e"),i!=null&&(n=Number(i))}const r=t.split(".")[1]?.length??0;return Math.max(r-n,0)}function tt(e){return Array.isArray(e)&&e.length>=2&&e.every(I)}function re(e){return Array.isArray(e)&&e.length>=2&&e.every(tt)}function qn(e){const t=e[0],n=e[e.length-1];return ve(t[0],n[0],.001)&&ve(t[1],n[1],.001)}function nt(e){return Array.isArray(e)&&e.every(re)&&e.every(qn)}function rt(e){if(e===null)return!0;if(!P(e)||e.type==null)return!1;const{type:t,coordinates:n}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(rt);case"MultiPolygon":return Array.isArray(n)&&n.every(nt);case"Polygon":return nt(n);case"MultiLineString":return Array.isArray(n)&&n.every(re);case"LineString":return re(n);case"MultiPoint":return re(n);case"Point":return tt(n);default:return!1}}function Nn(e){return P(e)&&e.type==="Feature"&&rt(e.geometry)}function Rn(e){return P(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(Nn)}var Un=u(Rn,"a GeoJSON object"),we=new Map,tr=Symbol("ElementID"),it=1;function Wn(){we.clear(),it=1}function Gn(e){const t=e.constructor,n=Object.hasOwn(t,"className")?t.className:t.name;if(!n)throw new Error(`The ${t} is missing the 'className' property.`);const r=(we.get(n)??0)+1;return we.set(n,r),`${n}-${r}`}function Bn(){return`ag-charts-${it++}`}function zn(){return crypto.randomUUID?.()??_n()}function _n(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<e.length;n++)(n===4||n===6||n===8||n===10)&&(t+="-"),t+=e[n].toString(16).padStart(2,"0");return t}var ot=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,st=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function Hn(e){if(!D(e))return!1;const t=st.exec(e);return ot.test(t?t[2]:e)}function at(e){let t,n;const r=st.exec(e);r&&([,t,e,n]=r);const i=ot.exec(e);if(!i)throw new Error(`The number formatter is invalid: ${e}`);const[,o,a,s,c,l,d,h,v,k,R]=i;return{fill:o,align:a,sign:s,symbol:c,zero:l,width:parseInt(d),comma:h,precision:parseInt(v),trim:!!k,type:R,prefix:t,suffix:n}}function Kn(e){const t=typeof e=="string"?at(e):e,{fill:n,align:r,sign:i="-",symbol:o,zero:a,width:s,comma:c,type:l,prefix:d="",suffix:h="",precision:v}=t;let{trim:k}=t;const R=v==null||isNaN(v);let U;if(!l)U=$.g,k=!0;else if(l in $&&l in N)U=R?N[l]:$[l];else if(l in $)U=$[l];else if(l in N)U=N[l];else throw new Error(`The number formatter type is invalid: ${l}`);let oe;return R?oe=l?6:12:oe=v,se=>{let p=U(se,oe);return k&&(p=Qn(p)),c&&(p=Xn(p,c)),p=Ln(se,p,i),o&&o!=="#"&&(p=`${o}${p}`),o==="#"&&l==="x"&&(p=`0x${p}`),l==="s"&&(p=`${p}${Yn(se)}`),(l==="%"||l==="p")&&(p=`${p}%`),s!=null&&!isNaN(s)&&(p=er(p,s,n??a,r)),p=`${d}${p}${h}`,p}}var N={b:e=>ie(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>ie(e).toString(8),x:e=>ie(e).toString(16),X:e=>N.x(e).toUpperCase(),n:e=>N.d(e),"%":e=>`${ie(e*100).toFixed(0)}`},$={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>$.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>$.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),r=Math.floor(Math.log10(n));return r>=-4&&r<t?n.toFixed(t-1-r):n.toExponential(t-1)},G:(e,t)=>$.g(e,t).toUpperCase(),n:(e,t)=>$.g(e,t),p:(e,t)=>$.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),i=Math.floor(Math.log10(n))-(t-1);if(i<=0)return n.toFixed(-i);const o=10**i;return(Math.round(n/o)*o).toFixed()},s:(e,t)=>{const n=ut(e);return $.r(e/10**n,t)},"%":(e,t)=>$.f(e*100,t)},lt=-24,ct=24,Jn={[lt]:"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",[ct]:"Y"},Zn="\u2212";function ie(e){return Math.floor(Math.abs(e))}function Qn(e){return e.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function Xn(e,t){let n=e.indexOf(".");n<0&&(n=e.length);const r=e.substring(0,n).split(""),i=e.substring(n);for(let o=r.length-3;o>0;o-=3)r.splice(o,0,t);return`${r.join("")}${i}`}function Yn(e){return Jn[ut(e)]}function ut(e){return et(lt,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,ct)}function Ln(e,t,n=""){if(n==="(")return e>=0?t:`(${t})`;const r=n==="+"?"+":"";return`${e>=0?r:Zn}${t}`}function er(e,t,n=" ",r=">"){let i=e;if(r===">"||!r)i=i.padStart(t,n);else if(r==="<")i=i.padEnd(t,n);else if(r==="^"){const o=Math.max(0,t-i.length),a=Math.ceil(o/2),s=Math.floor(o/2);i=i.padStart(a+i.length,n),i=i.padEnd(s+i.length,n)}return i}export{yn as AsyncAwaitQueue,Re as ErrorType,xt as EventEmitter,ke as Logger,je as ModuleRegistry,Ae as ModuleType,fe as UnknownError,z as ValidationError,de as and,zt as array,he as arrayLength,H as arrayOf,en as arrayOfDefs,Xe as arraysEqual,u as attachDescription,L as boolean,_t as callback,nn as callbackDefs,tn as callbackOf,dn as circularSliceArray,et as clamp,y as color,ze as colorStopsOrderValidator,Ze as colorUnion,_ as constant,Tn as countFractionDigits,Ut as countLines,Pe as createElement,Bn as createElementId,Gn as createId,Kn as createNumberFormatter,Ct as createSvgElement,Ht as date,Nt as debounce,Kt as defined,Pn as diffArrays,Ot as downloadUrl,pn as dropFirstWhile,gn as dropLastWhile,me as entries,He as fillGradientDefaults,Je as fillImageDefaults,ne as fillOptionsDef,Ke as fillPatternDefaults,jn as findMaxIndex,Cn as findMaxValue,An as findMinIndex,On as findMinValue,wn as first,Qe as fontFamilyFull,ln as fontOptionsDef,zn as generateUUID,Un as geoJson,Mn as getAttribute,K as getDocument,Oe as getWindow,be as googleFont,te as gradientColorStops,on as gradientStrict,Yt as greaterThan,fn as groupBy,ee as hasRequiredInPath,Zt as htmlElement,In as inRange,Lt as instanceOf,F as isArray,Fe as isBoolean,Ve as isColor,le as isDate,Ee as isDefined,Dt as isEnumKey,Vt as isEnumValue,I as isFiniteNumber,O as isFunction,Ft as isHtmlElement,Fn as isInteger,qt as isKeyOf,En as isNegative,Et as isNumber,ve as isNumberEqual,P as isObject,It as isObjectLike,De as isPlainObject,Pt as isRegExp,D as isString,Tt as isSymbol,ce as isValidDate,Hn as isValidNumberFormat,mn as iterate,J as joinFormatted,Xt as lessThan,Te as levenshteinDistance,an as lineDashOptionsDef,Vn as modulus,C as number,ge as numberMin,We as numberRange,Jt as object,j as optionsDefs,T as or,Ie as parseColor,at as parseNumberFormat,bn as pause,g as positiveNumber,Qt as positiveNumberNonZero,M as ratio,f as required,Wn as resetIds,Dn as roundTo,ue as safeCall,Ye as setAttribute,Sn as setAttributes,jt as setDocument,Le as setElementStyle,xn as setElementStyles,At as setWindow,hn as sortBasedOnArray,q as string,pe as stringLength,Z as stringifyValue,_e as strokeOptionsDef,Be as themeOperator,Rt as throttle,cn as toArray,vn as toIterable,Ue as typeUnion,S as undocumented,b as union,X as unionSymbol,un as unique,V as validate};