{"version":3,"file":"HeatmapWeeks.mjs","names":[],"sources":["../../src/Heatmap/HeatmapWeeks.tsx"],"sourcesContent":["import { getHeatColor } from './get-heat-color/get-heat-color';\nimport { HeatmapWeeksSharedProps } from './HeatmapWeeks.types';\n\nexport function HeatmapWeeks({\n  data,\n  datesRange,\n  rectSize,\n  gap,\n  rectRadius,\n  min,\n  max,\n  colors,\n  withTooltip,\n  setHoveredRect,\n  getRectProps,\n  getStyles,\n}: HeatmapWeeksSharedProps) {\n  const rectSizeWithGap = rectSize + gap;\n\n  return (\n    <>\n      {datesRange.map((week, weekIndex) => {\n        // Original simple logic without month splitting\n        const days = week.map((date, dayIndex) => {\n          if (!date) {\n            return null;\n          }\n\n          const hasValue = date in data && data[date] !== null;\n          const rectValue = hasValue ? data[date] : null;\n\n          return (\n            <rect\n              key={date}\n              width={rectSize}\n              height={rectSize}\n              x={gap}\n              y={dayIndex * rectSizeWithGap + gap}\n              rx={rectRadius}\n              data-empty={!hasValue || undefined}\n              fill={hasValue ? getHeatColor({ value: data[date], min, max, colors }) : undefined}\n              onPointerEnter={\n                withTooltip ? () => setHoveredRect({ date, value: rectValue }) : undefined\n              }\n              {...getRectProps?.({ date, value: rectValue })}\n              {...getStyles('rect')}\n            />\n          );\n        });\n\n        return (\n          <g\n            key={weekIndex}\n            transform={`translate(${weekIndex * rectSizeWithGap}, 0)`}\n            data-id=\"week\"\n          >\n            {days}\n          </g>\n        );\n      })}\n    </>\n  );\n}\n"],"mappings":";;;;AAGA,SAAgB,aAAa,EAC3B,MACA,YACA,UACA,KACA,YACA,KACA,KACA,QACA,aACA,gBACA,cACA,aAC0B;CAC1B,MAAM,kBAAkB,WAAW;AAEnC,QACE,oBAAA,UAAA,EAAA,UACG,WAAW,KAAK,MAAM,cAAc;EAEnC,MAAM,OAAO,KAAK,KAAK,MAAM,aAAa;AACxC,OAAI,CAAC,KACH,QAAO;GAGT,MAAM,WAAW,QAAQ,QAAQ,KAAK,UAAU;GAChD,MAAM,YAAY,WAAW,KAAK,QAAQ;AAE1C,UACE,oBAAC,QAAD;IAEE,OAAO;IACP,QAAQ;IACR,GAAG;IACH,GAAG,WAAW,kBAAkB;IAChC,IAAI;IACJ,cAAY,CAAC,YAAY,KAAA;IACzB,MAAM,WAAW,aAAa;KAAE,OAAO,KAAK;KAAO;KAAK;KAAK;KAAQ,CAAC,GAAG,KAAA;IACzE,gBACE,oBAAoB,eAAe;KAAE;KAAM,OAAO;KAAW,CAAC,GAAG,KAAA;IAEnE,GAAI,eAAe;KAAE;KAAM,OAAO;KAAW,CAAC;IAC9C,GAAI,UAAU,OAAO;IACrB,EAbK,KAaL;IAEJ;AAEF,SACE,oBAAC,KAAD;GAEE,WAAW,aAAa,YAAY,gBAAgB;GACpD,WAAQ;aAEP;GACC,EALG,UAKH;GAEN,EACD,CAAA"}