"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("./Colors.js"),l="#9F9F9F";class f extends M.default{constructor(e,s,i,h,c,y,n,p,a,r){super(i,h,c,y,n),this.colorMap={},this._colorBy=s=="line"?"id":i,this._indexBy&&p&&[...p].forEach(o=>{o&&o.items&&o.items.forEach(t=>{r&&t.labels&&t.labels[r.toUpperCase()]?this.colorMap[t.labels[r.toUpperCase()]]=t.categoryStyle:this.colorMap[t.value]=t.categoryStyle})}),a&&[...a].forEach(o=>{o&&o.styles&&(r&&o.labels&&o.labels[r.toUpperCase()]?this.colorMap[o.labels[r.toUpperCase()]]=o.styles:this.colorMap[o.label]=o.styles)})}getColor(e,s){return this._colorBy==="index"?this.colorMap[s[this._indexBy]]?this.colorMap[s[this._indexBy]].color:l:this.colorMap[e]?this.colorMap[e].color:l}getColorByIndex(e){return this.colorMap[e]?this.colorMap[e].color:l}getColorByKey(e){return this.colorMap[e]?this.colorMap[e].color:l}}exports.default=f;
