"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("./Colors.js");class x extends j.default{constructor(i,u,r,C,d,f,_,g,a,e,h,m,b){if(super(r,C,d,g,a),this._manualColor={},this._manualColor[m]=e?e.Overall:null,i!="csv"){const y=t=>{const o=[...f][t];o&&(c=o.items),e!=null&&e!=null&&Object.keys(e).forEach(s=>{const l=c.filter(n=>n.code===s);if(l.length>0&&l[0].labels){let n;h&&(n=l[0].labels[h.toUpperCase()]),n?this._manualColor[n]=e[s]:this._manualColor[l[0].value]=e[s]}})},p=()=>{c=_,Object.keys(e).forEach(t=>{const o=[...c].filter(s=>s.value===t);if(o.length>0&&o[0].labels){const s=b[t];b&&s&&(this._manualColor[s]=e[t]);let l;h&&(l=o[0].labels[h.toUpperCase()]),l?this._manualColor[l]=e[t]:this._manualColor[o[0].label]=e[t]}})},O=()=>{Object.keys(e).forEach(t=>{this._manualColor[t]=e[t]})};let c=[];const v=u=="line"?1:r==="index"?0:1;!f&&!_?O():f?f.size==1&&v==1?a=="measure"?y(0):p():y(v):p()}else this._manualColor=e&&e[r]?e[r]:{}}getColor(i,u){if(this.colorBy==="index"){const r=this._manualColor[i]||this._manualColor[u[this.indexBy]];return r||"#5555"}return this.colorBy==="id"&&this._manualColor[i]?this._manualColor[i]:"#5555"}getColorByIndex(i){}getColorByKey(i){return this._manualColor[i]?this._manualColor[i]:"#5555"}}exports.default=x;
