{"version":3,"file":"get-series-labels.cjs","names":[],"sources":["../../../src/utils/get-series-labels/get-series-labels.ts"],"sourcesContent":["import { ChartSeries } from '../../types';\n\ntype ChartSeriesLabels = Record<string, string | undefined>;\n\nexport function getSeriesLabels(series: ChartSeries[] | undefined): ChartSeriesLabels {\n  if (!series) {\n    return {};\n  }\n\n  return series.reduce<ChartSeriesLabels>((acc, item) => {\n    const matchFound = item.name.search(/\\./);\n    if (matchFound >= 0) {\n      const key = item.name.substring(matchFound + 1);\n      acc[key] = item.label;\n      return acc;\n    }\n    acc[item.name] = item.label;\n    return acc;\n  }, {});\n}\n"],"mappings":";;AAIA,SAAgB,gBAAgB,QAAsD;AACpF,KAAI,CAAC,OACH,QAAO,EAAE;AAGX,QAAO,OAAO,QAA2B,KAAK,SAAS;EACrD,MAAM,aAAa,KAAK,KAAK,OAAO,KAAK;AACzC,MAAI,cAAc,GAAG;GACnB,MAAM,MAAM,KAAK,KAAK,UAAU,aAAa,EAAE;AAC/C,OAAI,OAAO,KAAK;AAChB,UAAO;;AAET,MAAI,KAAK,QAAQ,KAAK;AACtB,SAAO;IACN,EAAE,CAAC"}