{"version":3,"file":"utils.mjs","sources":["../../../../src/components/VizLegend/utils.ts"],"sourcesContent":["import { LegendDisplayMode, type VizLegendOptions } from '@grafana/schema';\n\nimport { SeriesVisibilityChangeMode } from '../PanelChrome/types';\n\nexport function mapMouseEventToMode(event: React.MouseEvent): SeriesVisibilityChangeMode {\n  if (event.ctrlKey || event.metaKey || event.shiftKey) {\n    return SeriesVisibilityChangeMode.AppendToSelection;\n  }\n  return SeriesVisibilityChangeMode.ToggleSelection;\n}\n\n/**\n * `displayMode: hidden` is deprecated in favour of `showLegend: false`. The v37 migration normalizes stored\n * v1 dashboards, but the value can still arrive via v2 dashboards, dashboards written at schemaVersion >= 37,\n * or options built in code. VizLegend renders nothing for it, so a legend passed to VizLayout would reserve\n * an empty slot that measures 0px, and the viz is never sized.\n *\n * @internal\n */\nexport function shouldShowLegend(legend: Pick<VizLegendOptions, 'showLegend' | 'displayMode'>): boolean {\n  return legend.showLegend !== false && legend.displayMode !== LegendDisplayMode.Hidden;\n}\n"],"names":[],"mappings":";;;;AAIO,SAAS,oBAAoB,KAAA,EAAqD;AACvF,EAAA,IAAI,KAAA,CAAM,OAAA,IAAW,KAAA,CAAM,OAAA,IAAW,MAAM,QAAA,EAAU;AACpD,IAAA,OAAO,0BAAA,CAA2B,iBAAA;AAAA,EACpC;AACA,EAAA,OAAO,0BAAA,CAA2B,eAAA;AACpC;AAUO,SAAS,iBAAiB,MAAA,EAAuE;AACtG,EAAA,OAAO,MAAA,CAAO,UAAA,KAAe,KAAA,IAAS,MAAA,CAAO,gBAAgB,iBAAA,CAAkB,MAAA;AACjF;;;;"}