{"version":3,"file":"styles.mjs","sources":["../../../../../src/components/Table/TableNG/styles.ts"],"sourcesContent":["import { css } from '@emotion/css';\nimport { type Property } from 'csstype';\nimport memoize, { type Key, type RawKey } from 'micro-memoize';\n\nimport { colorManipulator, type GrafanaTheme2 } from '@grafana/data';\n\nimport {\n  COLUMN,\n  COLUMN_SETTLE_MS,\n  FIRST_COLUMN_CLASS,\n  FIRST_COLUMN_EXTRA_PADDING,\n  LAST_COLUMN_CLASS,\n  NESTED_LAST_ROW_CLASS,\n  OVERFLOW_CELL_CLASS,\n  NESTED_ROW_CLASS,\n  getPaginationChromeHeight,\n  PAGINATION_MARGIN,\n  STRIPED_ROW_CLASS,\n  TABLE,\n} from './constants';\nimport { type TableCellStyles } from './types';\n\n// TextAlign, getJustifyContent, and IS_SAFARI_26 live here rather than in utils.tsx to avoid a\n// circular dependency: styles.ts → utils.tsx → renderers.tsx → AutoCell/PillCell → styles.ts\nexport type TextAlign = 'left' | 'right' | 'center';\n\nexport function getJustifyContent(textAlign: TextAlign): Property.JustifyContent {\n  return textAlign === 'center' ? 'center' : textAlign === 'right' ? 'flex-end' : 'flex-start';\n}\n\n// Safari 26.0 introduced rendering bugs which require us to disable several features of the table.\n// The bugs were later fixed in Safari 26.2.\nexport const IS_SAFARI_26 = (() => {\n  if (navigator == null) {\n    return false;\n  }\n  const userAgent = navigator.userAgent;\n  const safariVersionMatch = userAgent.match(/Version\\/(\\d+)\\.(\\d+)/);\n  if (!safariVersionMatch) {\n    return false;\n  }\n  const majorVersion = +safariVersionMatch[1];\n  const minorVersion = +safariVersionMatch[2];\n  return majorVersion === 26 && minorVersion <= 1;\n})();\n\n/**\n * @internal\n * a method that can be used with micro-memoize as a cache key equality comparator.\n */\nexport const isTableCellStylesKeyEqual = (cacheKey: Key, key: RawKey): boolean =>\n  cacheKey[0] === key[0] &&\n  cacheKey[1].shouldOverflow === key[1].shouldOverflow &&\n  cacheKey[1].hoverOverflow === key[1].hoverOverflow &&\n  cacheKey[1].maxHeight === key[1].maxHeight &&\n  cacheKey[1].textAlign === key[1].textAlign &&\n  cacheKey[1].tableRefreshEnabled === key[1].tableRefreshEnabled &&\n  cacheKey[1].textWrap === key[1].textWrap;\n\n// Geometry shared by the two header corner masks (see their use in `getGridStyles`). react-data-grid\n// gives every cell `position: relative`, so the pseudo-element anchors to the header cell itself, and\n// `::after` is free — rdg only takes `::before`, on the grid root, for its Firefox scrollbar fix.\nconst headerCornerMask = (radius: string) =>\n  ({\n    content: '\"\"',\n    position: 'absolute',\n    insetBlockStart: 0,\n    inlineSize: radius,\n    blockSize: radius,\n    pointerEvents: 'none',\n  }) as const;\n\n// Drag states derive from the header surface.\nconst HEADER_DRAGGING_EMPHASIS = 0.1;\nconst HEADER_DRAG_TARGET_EMPHASIS = 0.05;\n\nexport const getGridBackgroundColor = (theme: GrafanaTheme2, transparent?: boolean): string => {\n  return transparent\n    ? theme.flags.visualDesignRefresh\n      ? theme.colors.background.page\n      : theme.colors.background.canvas\n    : theme.components.panel.background;\n};\n\nconst getHeaderBackgroundColor = (\n  theme: GrafanaTheme2,\n  transparent?: boolean,\n  tableRefreshEnabled?: boolean\n): string => {\n  const bgColor = getGridBackgroundColor(theme, transparent);\n  return tableRefreshEnabled ? theme.components.table.headerBackground : bgColor;\n};\n\nexport const getGridStyles = memoize(\n  (\n    theme: GrafanaTheme2,\n    enablePagination?: boolean,\n    transparent?: boolean,\n    tableRefreshEnabled?: boolean,\n    noPanelPadding?: boolean,\n    zebraStriping?: boolean,\n    showColumnSidebarBorder?: boolean\n  ) => {\n    const table = theme.components.table;\n    const bgColor = getGridBackgroundColor(theme, transparent);\n    const headerBackgroundColor = tableRefreshEnabled ? table.headerBackground : bgColor;\n    const nestedBorderColor = theme.isDark && !transparent ? theme.colors.border.medium : table.border;\n    const cornerRadius = theme.shape.radius.default;\n    const headerBorderColor = colorManipulator\n      .onBackground(theme.colors.secondary.shade, headerBackgroundColor)\n      .toHexString();\n\n    const headerCellDraggingBackgroundColor = theme.colors.emphasize(headerBackgroundColor, HEADER_DRAGGING_EMPHASIS);\n    const headerCellDragTargetBackgroundColor = theme.colors.emphasize(\n      headerBackgroundColor,\n      HEADER_DRAG_TARGET_EMPHASIS\n    );\n\n    return {\n      gridFrame: css({\n        // This wrapper can be a flex item alongside controls such as the multi-frame picker. Its\n        // automatic minimum is the grid's content height, which prevents it from yielding the space\n        // reserved for those controls.\n        minBlockSize: 0,\n        // Give pagination controls their room back, so the frame and pager together still fit the\n        // panel (see getPaginationChromeHeight).\n        blockSize: enablePagination ? `calc(100% - ${getPaginationChromeHeight(noPanelPadding)}px)` : '100%',\n        boxSizing: 'border-box',\n        ...(tableRefreshEnabled &&\n          !noPanelPadding && {\n            // Reserve the same space as the visible frame without putting that frame underneath the\n            // grid. Native scrollbars paint over an ancestor's ordinary border at their bottom corner.\n            border: `${TABLE.FRAME_BORDER_WIDTH}px solid transparent`,\n            borderEndStartRadius: cornerRadius,\n            borderEndEndRadius: cornerRadius,\n            borderStartStartRadius: cornerRadius,\n            borderStartEndRadius: cornerRadius,\n            overflow: 'hidden',\n            // Paint the frame after the scrolling grid so the native scrollbar corner cannot cover it.\n            '&::after': {\n              content: '\"\"',\n              position: 'absolute',\n              inset: 0,\n              pointerEvents: 'none',\n              zIndex: 1,\n              border: `${TABLE.FRAME_BORDER_WIDTH}px solid ${table.border}`,\n              borderEndStartRadius: cornerRadius,\n              borderEndEndRadius: cornerRadius,\n              borderStartStartRadius: cornerRadius,\n              borderStartEndRadius: cornerRadius,\n            },\n          }),\n        position: 'relative',\n      }),\n      grid: css({\n        '--rdg-background-color': bgColor,\n        // `table.refresh` gives the header its own surface distinct from the body rows.\n        '--rdg-header-background-color': headerBackgroundColor,\n        '--rdg-border-color': table.border,\n        '--rdg-color': theme.colors.text.primary,\n        '--rdg-summary-border-color': table.border,\n        '--rdg-summary-border-width': '1px',\n\n        '--rdg-selection-color': theme.colors.action.selectedBorder,\n        '--rdg-selection-width': '0.5px',\n        // note: this cannot have any transparency since default cells that\n        // overlay/overflow on hover inherit this background and need to occlude cells below\n        '--rdg-row-background-color': bgColor,\n        '--rdg-row-hover-background-color': table.rowHoverBackground,\n        '--rdg-row-selected-background-color': table.rowSelectedBackground,\n        '--rdg-row-selected-hover-background-color': theme.colors.emphasize(table.rowSelectedBackground, 0.05),\n\n        blockSize: '100%',\n        scrollbarWidth: 'thin',\n        scrollbarColor: theme.isDark ? '#fff5 #fff1' : '#0005 #0001',\n\n        border: 'none',\n        ...(showColumnSidebarBorder && { borderInlineStart: `1px solid ${table.border}` }),\n\n        // The grid defaults to tabular digits; override them while dataviz.tabularNums is disabled.\n        ...(theme.flags.tabularNums ? {} : { fontVariantNumeric: 'normal' }),\n\n        '.rdg-cell': {\n          padding: TABLE.CELL_PADDING,\n\n          '&:last-child': {\n            borderInlineEnd: 'none',\n          },\n          [`${SELECTED_CELL_SELECTOR}[role=\"columnheader\"]`]: {\n            outline: 'none',\n          },\n        },\n\n        ...(tableRefreshEnabled &&\n          !noPanelPadding && {\n            // The frame is painted above the grid so native scrollbars cannot erase its\n            // corners. Repaint the selected edge just inside that frame so it cannot cover the cell's\n            // outermost selection outline.\n            [`.rdg-cell.${FIRST_COLUMN_CLASS}[role=\"gridcell\"][aria-selected=\"true\"]:focus-within::before`]: {\n              content: '\"\"',\n              position: 'absolute',\n              insetBlock: 0,\n              insetInlineStart: '1px',\n              inlineSize: 'var(--rdg-selection-width)',\n              backgroundColor: 'var(--rdg-selection-color)',\n              pointerEvents: 'none',\n              zIndex: 1,\n            },\n            [`.rdg-cell.${LAST_COLUMN_CLASS}[role=\"gridcell\"][aria-selected=\"true\"]:focus-within::after`]: {\n              content: '\"\"',\n              position: 'absolute',\n              insetBlock: 0,\n              insetInlineEnd: '1px',\n              inlineSize: 'var(--rdg-selection-width)',\n              backgroundColor: 'var(--rdg-selection-color)',\n              pointerEvents: 'none',\n              zIndex: 1,\n            },\n          }),\n\n        '& > :not(.rdg-summary-row, .rdg-header-row) > .rdg-cell': {\n          [`&.${OVERFLOW_CELL_CLASS}`]: {\n            [getActiveCellSelector()]: { boxShadow: tableRefreshEnabled ? 'none' : theme.shadows.z2 },\n            ...(!IS_SAFARI_26 && { '&:hover': { zIndex: theme.zIndex.tooltip - 6 } }),\n          },\n          // A selected cell sits below a hovered one, so that hovering a neighbor of the selected\n          // cell lifts its overflow clear rather than tucking it behind. The two selectors carry the\n          // same specificity, so the hover rule has to come last for a cell that is both to land on\n          // the hover value.\n          [SELECTED_CELL_SELECTOR]: { zIndex: theme.zIndex.tooltip - 7 },\n          // react-data-grid rings the selected cell in the selection color. Once focus is gone that\n          // ring marks a cell the user can no longer see they are on, so leave the cell bare.\n          [`${SELECTED_CELL_SELECTOR}:not(:focus-within)`]: { outline: 'none' },\n        },\n\n        '.rdg-cell.rdg-cell-frozen-start': {\n          backgroundColor: 'var(--rdg-row-background-color)',\n          zIndex: theme.zIndex.tooltip - 4,\n          [SELECTED_CELL_SELECTOR]: { zIndex: theme.zIndex.tooltip - 3 },\n          ...(!IS_SAFARI_26 && {\n            [`&.${OVERFLOW_CELL_CLASS}:hover`]: { zIndex: theme.zIndex.tooltip - 2 },\n          }),\n        },\n\n        // Row hover is painted on `.rdg-row`, but frozen cells carry a solid background to occlude\n        // scrolled content, so they'd otherwise miss the highlight. Exclude expansion containers\n        // because hovering a nested table also hovers its container. Selected rows are handled below.\n        [`.rdg-row:not(.rdg-header-row, .rdg-summary-row, .${NESTED_ROW_CLASS}, [aria-selected='true']):hover > .rdg-cell.rdg-cell-frozen-start`]:\n          {\n            backgroundColor: 'var(--rdg-row-hover-background-color)',\n          },\n\n        // have to override styles for row selection to workaround safari styles workaround\n        '[role=\"row\"][aria-selected=\"true\"]': {\n          '&:hover': {\n            '.rdg-cell.rdg-cell-frozen-start': {\n              backgroundColor: 'var(--rdg-row-selected-hover-background-color)',\n            },\n          },\n          '.rdg-cell.rdg-cell-frozen-start': {\n            backgroundColor: 'var(--rdg-row-selected-background-color)',\n          },\n        },\n\n        // Which rows carry a stripe is decided in `makeStripedRowClass`, not by react-data-grid's\n        // own `rdg-row-odd` — see that function for why. Selection still wins over the stripe, and\n        // has to be excluded by hand rather than left to win on specificity: react-data-grid paints\n        // it inside its own `@layer rdg.Row`, and an unlayered rule — which everything in here is —\n        // beats a layered one whatever its specificity.\n        ...(zebraStriping && {\n          [`.${STRIPED_ROW_CLASS}:not([aria-selected='true'])`]: {\n            backgroundColor: table.rowStripedBackground,\n            // A `.rdg-cell` inherits its background from the row, which is how the row rule reaches\n            // the cells at all (rows use subgrid to align with the parent grid's tracks).\n            // Frozen cells are the exception: they set an opaque background so they can occlude the\n            // cells scrolling behind them, so the stripe has to be repeated here or a striped row's\n            // frozen column falls back to the plain row background.\n            '.rdg-cell.rdg-cell-frozen-start': {\n              backgroundColor: table.rowStripedBackground,\n            },\n          },\n        }),\n\n        // Repeat the hover surface on striped cells, including frozen cells. Nested containers must\n        // be excluded because hovering their children also hovers the expansion container.\n        ...(zebraStriping && {\n          [`.rdg-row:not(.rdg-summary-row, .${NESTED_ROW_CLASS}, [aria-selected='true']):hover > .rdg-cell`]: {\n            backgroundColor: table.rowHoverBackground,\n          },\n        }),\n\n        // Summary rows are sticky stacking contexts; raising their cells alone cannot place them\n        // above active or hovered frozen body cells outside that context.\n        '.rdg-summary-row': {\n          zIndex: theme.zIndex.tooltip - 1,\n        },\n\n        '.rdg-header-row, .rdg-summary-row': {\n          '.rdg-cell': {\n            zIndex: theme.zIndex.tooltip - 5,\n            '&.rdg-cell-frozen-start': {\n              zIndex: theme.zIndex.tooltip - 1,\n            },\n          },\n        },\n        '.rdg-summary-row >': {\n          '.rdg-cell': {\n            // 0.75 padding causes \"jumping\" on hover.\n            paddingBlock: theme.spacing(0.625),\n          },\n          [getActiveCellSelector()]: {\n            whiteSpace: 'pre-line',\n            height: '100%',\n            minHeight: 'fit-content',\n            overflowY: 'visible',\n            boxShadow: tableRefreshEnabled ? 'none' : theme.shadows.z2,\n          },\n        },\n\n        ...(tableRefreshEnabled && {\n          // The footer's top border separates it from the rows. Its bottom border would duplicate\n          // the grid frame, or leave an extra line along a refreshed borderless table.\n          '.rdg-bottom-summary-row > .rdg-cell': {\n            borderBlockEnd: 'none',\n          },\n        }),\n\n        // `table.refresh` rounds the table's top corners, matching the header's own surface.\n        ...(tableRefreshEnabled && {\n          '.rdg-header-row > .rdg-cell': {\n            // Sub-pixel scroll offsets can leave a hairline gap above the sticky header where the\n            // row scrolled underneath it shows through — invisible before this commit, since the\n            // header shared the row background, but visible now that it's its own surface. A\n            // same-color 1px shadow just above the header's own box masks it without needing to\n            // touch react-data-grid's own sticky positioning. `overflow: hidden` below (for the\n            // rounded corners) doesn't clip this: it governs the cell's own content, not a\n            // box-shadow painted at its border edge.\n            boxShadow: '0 -1px 0 0 var(--rdg-header-background-color)',\n            [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n              transition: theme.transitions.create('background-color', {\n                duration: COLUMN_SETTLE_MS,\n                easing: 'ease-out',\n              }),\n            },\n          },\n          // The `.rdg-cell.rdg-cell-frozen-start` rule above (for solid, occluding frozen body cells)\n          // also matches frozen *header* cells, at higher specificity than the plain `.rdg-cell`\n          // inheriting the header's background — so a frozen column's header cell fell back to the\n          // row background instead. Three classes' worth of specificity here beats that rule's two.\n          '.rdg-header-row > .rdg-cell.rdg-cell-frozen-start': {\n            backgroundColor: 'var(--rdg-header-background-color)',\n          },\n          // The header's corners are painted rather than clipped. A corner made by transparency needs\n          // an ancestor clipping at that exact offset: the grid's own radius above is that ancestor\n          // only while the columns reach the panel edge. When every column has a configured width\n          // they can stop short of it (nothing stretches to fill), and the table's real trailing\n          // corner then sits mid-panel with a body cell scrolling under the sticky header behind it.\n          // Filling everything outside the arc with the table's own background — the same colour as\n          // the gap beside the table, and as whatever the table sits on — makes the corner opaque, so\n          // there is nothing left to show through wherever it lands.\n          [`.rdg-header-row > .rdg-cell.${FIRST_COLUMN_CLASS}::after`]: {\n            ...headerCornerMask(cornerRadius),\n            insetInlineStart: 0,\n            background: `radial-gradient(circle at 100% 100%, transparent calc(${cornerRadius} - 0.5px), var(--rdg-background-color) ${cornerRadius})`,\n          },\n          [`.rdg-header-row > .rdg-cell.${LAST_COLUMN_CLASS}::after`]: {\n            ...headerCornerMask(cornerRadius),\n            insetInlineEnd: 0,\n            background: `radial-gradient(circle at 0 100%, transparent calc(${cornerRadius} - 0.5px), var(--rdg-background-color) ${cornerRadius})`,\n          },\n        }),\n      }),\n      // Keep shadow pseudo-elements separate from the frame overlay, inside its border.\n      gridWrapper: css({\n        position: 'relative',\n        blockSize: '100%',\n        minBlockSize: 0,\n      }),\n      // The panel around the table drops its own padding so the header surface can bleed to the\n      // panel edges, which leaves the first column's content further left than the panel title.\n      // A class of its own rather than part of `grid`: a nested table's inner grid also carries\n      // `grid`, and only the outermost table's first column lines up with the panel title.\n      firstColumnInset: css({\n        [`& > * > .rdg-cell.${FIRST_COLUMN_CLASS}`]: {\n          paddingInlineStart: TABLE.CELL_PADDING + FIRST_COLUMN_EXTRA_PADDING,\n        },\n      }),\n      lastColumnInset: css({\n        [`& > * > .rdg-cell.${LAST_COLUMN_CLASS}`]: {\n          paddingInlineEnd: TABLE.CELL_PADDING * 2,\n        },\n      }),\n      lastRowWithoutBorder: css({\n        '& > .rdg-cell': { borderBlockEnd: 'none' },\n      }),\n      gridNested: css({\n        // react-data-grid's root sets `content-visibility: auto`. The nested grid's wrapper has no\n        // definite height, so its skipped-contents size is 0, and in Firefox a zero-size element never\n        // intersects the viewport, never becomes relevant, and stays collapsed forever.\n        contentVisibility: 'visible',\n        height: '100%',\n        overflowX: tableRefreshEnabled ? 'auto' : 'scroll',\n        overflowY: 'hidden',\n        scrollbarColor: `${theme.colors.scrollbar} transparent`,\n        ...(tableRefreshEnabled && {\n          borderInline: `1px solid ${nestedBorderColor}`,\n          borderStartStartRadius: theme.shape.radius.default,\n          borderStartEndRadius: theme.shape.radius.default,\n          borderEndStartRadius: theme.shape.radius.default,\n          borderEndEndRadius: theme.shape.radius.default,\n          // The nested grid owns its bottom edge. Refreshed outer tables drop the summary cells'\n          // bottom border because PanelChrome supplies that edge, but a nested grid has no wrapper\n          // border there.\n          '.rdg-bottom-summary-row > .rdg-cell': {\n            borderBlockEnd: `1px solid ${nestedBorderColor}`,\n          },\n          [`.${NESTED_LAST_ROW_CLASS} > .rdg-cell.${FIRST_COLUMN_CLASS}, .rdg-bottom-summary-row > .rdg-cell.${FIRST_COLUMN_CLASS}`]:\n            {\n              borderEndStartRadius: theme.shape.radius.default,\n              overflow: 'hidden',\n            },\n          [`.${NESTED_LAST_ROW_CLASS} > .rdg-cell.${LAST_COLUMN_CLASS}, .rdg-bottom-summary-row > .rdg-cell.${LAST_COLUMN_CLASS}`]:\n            {\n              borderEndEndRadius: theme.shape.radius.default,\n              overflow: 'hidden',\n            },\n        }),\n        marginLeft: COLUMN.EXPANDER_WIDTH - TABLE.CELL_PADDING - 1,\n        marginBlock: TABLE.CELL_PADDING,\n        // usually row height will be set to 0 when not expanded, but auto cell height may lead to some rendering errors.\n        '&[aria-expanded=\"false\"]': {\n          display: 'none',\n        },\n      }),\n      cellNested: css({\n        [SELECTED_CELL_SELECTOR]: { outline: 'none' },\n        // beta.60 paints row hover/selection on `.rdg-row`, not `.rdg-cell`, so a transparent\n        // container cell lets that color bleed through around the nested grid. Paint the full-width\n        // container with the opaque base row background so it stays neutral.\n        backgroundColor: 'var(--rdg-row-background-color)',\n      }),\n      noDataNested: css({\n        height: TABLE.NESTED_NO_DATA_HEIGHT,\n        display: 'flex',\n        alignItems: 'center',\n        justifyContent: 'center',\n        color: theme.colors.text.secondary,\n        fontSize: theme.typography.h4.fontSize,\n      }),\n      headerRow: css({\n        paddingBlockStart: 0,\n        fontWeight: 'normal',\n        '& .rdg-cell': { height: '100%', alignItems: 'flex-end' },\n        ...(tableRefreshEnabled && {\n          '--rdg-border-color': headerBorderColor,\n          '& .rdg-cell-dragging': {\n            cursor: 'grabbing',\n            backgroundColor: headerCellDraggingBackgroundColor,\n            boxShadow: `inset 0 0 0 1px ${theme.colors.border.medium}`,\n          },\n          '& .rdg-cell-drag-over': {\n            backgroundColor: headerCellDragTargetBackgroundColor,\n            boxShadow: `inset 3px 0 0 0 ${theme.colors.primary.main}`,\n          },\n        }),\n      }),\n      displayNone: css({ display: 'none' }),\n      paginationContainer: css({\n        alignItems: 'center',\n        display: 'flex',\n        justifyContent: 'center',\n        // equal to theme.spacing(1), but taken from the same constant the grid reserves against so the\n        // two can't drift apart. Only `noPanelPadding` gets a bottom margin: with the panel's own\n        // padding in place, the controls already have that space below them.\n        marginBlockStart: PAGINATION_MARGIN,\n        marginBlockEnd: noPanelPadding ? PAGINATION_MARGIN : 0,\n        width: '100%',\n      }),\n      paginationSummary: css({\n        color: theme.colors.text.secondary,\n        fontSize: theme.typography.bodySmall.fontSize,\n        display: 'flex',\n        justifyContent: 'flex-end',\n        padding: theme.spacing(0, 1, 0, 2),\n      }),\n      menuItem: css({ maxWidth: '200px' }),\n    };\n  }\n);\n\nexport const getHeaderCellStyles = memoize((theme: GrafanaTheme2, justifyContent: Property.JustifyContent) =>\n  css({\n    display: 'flex',\n    gap: theme.spacing(0.5),\n    zIndex: theme.zIndex.tooltip - 1,\n    paddingInline: TABLE.CELL_PADDING,\n    paddingBlockEnd: TABLE.CELL_PADDING,\n    justifyContent,\n    '&:last-child': { borderInlineEnd: 'none' },\n  })\n);\n\n// Match the drop target so the highlight reads as the drag settling.\nexport const getColumnSettleStyles = memoize((theme: GrafanaTheme2, tableRefreshEnabled?: boolean) =>\n  css({\n    backgroundColor: theme.colors.emphasize(\n      getHeaderBackgroundColor(theme, false, tableRefreshEnabled),\n      HEADER_DRAG_TARGET_EMPHASIS\n    ),\n  })\n);\n\nexport const getDefaultCellStyles: TableCellStyles = memoize(\n  (theme, { textAlign, shouldOverflow, hoverOverflow, maxHeight }) =>\n    css({\n      display: 'flex',\n      alignItems: 'center',\n      textAlign,\n      justifyContent: Boolean(maxHeight) ? 'flex-start' : getJustifyContent(textAlign),\n      ...(maxHeight && { overflowY: 'hidden' }),\n      ...(shouldOverflow && { minHeight: '100%' }),\n\n      [getActiveCellSelector(false, hoverOverflow)]: {\n        ...(shouldOverflow && {\n          zIndex: theme.zIndex.tooltip - 2,\n          height: 'fit-content',\n          minWidth: 'fit-content',\n        }),\n      },\n\n      [getHoverOnlyCellSelector()]: {\n        '.table-cell-actions': { display: 'flex' },\n      },\n    }),\n  { isMatchingKey: isTableCellStylesKeyEqual }\n);\n\nexport const getMaxHeightCellStyles: TableCellStyles = memoize(\n  (_theme, { textAlign, hoverOverflow, maxHeight }) =>\n    css({\n      display: 'flex',\n      alignItems: 'center',\n      textAlign,\n      justifyContent: getJustifyContent(textAlign),\n      maxHeight,\n      width: '100%',\n      overflowY: 'hidden',\n      [getActiveCellSelector(true, hoverOverflow)]: {\n        maxHeight: 'none',\n        minHeight: '100%',\n      },\n    }),\n  { isMatchingKey: isTableCellStylesKeyEqual }\n);\n\nexport const getCellActionStyles = memoize((theme: GrafanaTheme2, textAlign: TextAlign, tableRefreshEnabled = false) =>\n  tableRefreshEnabled\n    ? css({\n        display: 'flex',\n        position: 'absolute',\n        top: '50%',\n        transform: 'translateY(-50%)',\n        [textAlign === 'right' ? 'left' : 'right']: theme.spacing(0.5),\n        borderRadius: theme.shape.radius.default,\n        padding: theme.spacing(0.5),\n        color: theme.colors.text.primary,\n        background: colorManipulator.alpha(theme.colors.background.primary, 0.9),\n        opacity: 0,\n        pointerEvents: 'none',\n        // Limit hover to the owning cell, including its optional height wrapper, not an outer nested grid.\n        // Mouse focus remains on the trigger after dismissal; only keyboard focus should keep actions visible.\n        '.rdg-cell:hover > &, .rdg-cell:hover > div > &, &:has(:focus-visible), &:has([aria-expanded=\"true\"])': {\n          opacity: 1,\n          pointerEvents: 'auto',\n        },\n        button: { margin: 0 },\n      })\n    : css({\n        display: 'none',\n        position: 'absolute',\n        top: 0,\n        margin: 'auto',\n        height: '100%',\n        color: theme.colors.text.primary,\n        background: theme.isDark ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)',\n        padding: theme.spacing.x0_5,\n        paddingInlineStart: theme.spacing.x1,\n        [textAlign === 'right' ? 'left' : 'right']: 0,\n      })\n);\n\nexport const getLinkStyles = memoize((theme: GrafanaTheme2, canBeColorized: boolean) =>\n  css({\n    a: {\n      cursor: 'pointer',\n      ...(canBeColorized\n        ? {\n            color: 'inherit',\n            textDecoration: 'underline',\n          }\n        : {\n            color: theme.colors.text.link,\n            textDecoration: 'none',\n            '&:hover': { textDecoration: 'underline' },\n          }),\n    },\n  })\n);\n\nconst caretTriangle = (direction: 'left' | 'right', bgColor: string) =>\n  `linear-gradient(to top ${direction}, transparent 62.5%, ${bgColor} 50%)`;\n\nexport const getTooltipStyles = memoize((theme: GrafanaTheme2, textAlign: TextAlign) => ({\n  tooltipContent: css({\n    height: '100%',\n    width: '100%',\n    display: 'flex',\n    alignItems: 'center',\n  }),\n  tooltipWrapper: css({\n    background: theme.colors.background.primary,\n    border: `1px solid ${theme.colors.border.weak}`,\n    borderRadius: theme.shape.radius.default,\n    boxShadow: theme.flags.visualDesignRefresh ? theme.shadows.z2 : theme.shadows.z3,\n    overflow: 'hidden',\n    padding: theme.spacing(1),\n    width: 'inherit',\n  }),\n  tooltipCaret: css({\n    cursor: 'pointer',\n    position: 'absolute',\n    top: theme.spacing(0.25),\n    [textAlign === 'right' ? 'right' : 'left']: theme.spacing(0.25),\n    width: theme.spacing(1.75),\n    height: theme.spacing(1.75),\n    background: caretTriangle(textAlign === 'right' ? 'right' : 'left', theme.colors.border.strong),\n    '&[data-warning=true]': {\n      background: caretTriangle(textAlign === 'right' ? 'right' : 'left', theme.colors.warning.main),\n    },\n    '&:focus-visible': {\n      outline: `2px solid ${theme.colors.primary.main}`,\n      outlineOffset: 1,\n    },\n  }),\n}));\n\n/**\n * A cell react-data-grid considers selected, whether or not the grid still has focus. Use this for\n * resets and stacking that have to hold for as long as the selection does — see ACTIVE_CELL_SELECTORS\n * for the visual treatment that follows focus instead.\n */\nconst SELECTED_CELL_SELECTOR = '&[aria-selected=true]';\n\nconst ACTIVE_CELL_SELECTORS = {\n  hover: {\n    nested: `.rdg-cell.${OVERFLOW_CELL_CLASS}:hover &`,\n    normal: `&.${OVERFLOW_CELL_CLASS}:hover`,\n  },\n  // react-data-grid keeps a cell selected after the grid loses focus, and offers no API to clear it\n  // (`selectCell` rejects any out-of-bounds position), so gate on `:focus-within` to release the\n  // expanded state when the user clicks away from the table.\n  selected: {\n    nested: `.rdg-cell.${OVERFLOW_CELL_CLASS}[aria-selected=true]:focus-within &`,\n    normal: `&.${OVERFLOW_CELL_CLASS}[aria-selected=true]:focus-within`,\n  },\n} as const;\n\nexport const getActiveCellSelector = memoize((isNested?: boolean, hoverOverflow = true) => {\n  const selectors = [];\n  selectors.push(ACTIVE_CELL_SELECTORS.selected[isNested ? 'nested' : 'normal']);\n  if (!IS_SAFARI_26 && hoverOverflow) {\n    selectors.push(ACTIVE_CELL_SELECTORS.hover[isNested ? 'nested' : 'normal']);\n  }\n  return selectors.join(', ');\n});\n\nconst getHoverOnlyCellSelector = memoize((isNested?: boolean) => {\n  if (IS_SAFARI_26) {\n    return '';\n  }\n  return isNested ? '.rdg-cell:hover &' : '&:hover';\n});\n\nexport const getScrollShadowOffsetStyles = (_theme: GrafanaTheme2, top: number, bottom: number, width: number) =>\n  css({\n    '&::before, &::after': { inlineSize: width },\n    '&::before': { top },\n    '&::after': { bottom },\n  });\n\nexport const getScrollShadowStyles = (theme: GrafanaTheme2) => {\n  const scrollShadowColor = theme.isDark ? 'rgba(255, 255, 255, 0.05)' : 'rgba(0, 0, 0, 0.08)';\n  return {\n    scrollShadows: css({\n      // The grid creates a stacking context; both pseudo-elements must paint above it.\n      '&::before, &::after': {\n        content: '\"\"',\n        blockSize: `max(5%, ${theme.spacing(3)})`,\n        insetInlineStart: 0,\n        opacity: 0,\n        pointerEvents: 'none',\n        position: 'absolute',\n        zIndex: 1,\n        [theme.transitions.handleMotion('no-preference', 'reduce')]: {\n          transition: theme.transitions.create('opacity'),\n        },\n      },\n      '&::before': {\n        background: `linear-gradient(0deg, transparent, ${scrollShadowColor})`,\n      },\n      '&::after': {\n        background: `linear-gradient(180deg, transparent, ${scrollShadowColor})`,\n      },\n    }),\n    scrollShadowTop: css({\n      '&::before': { opacity: 1 },\n    }),\n    scrollShadowBottom: css({\n      '&::after': { opacity: 1 },\n    }),\n  };\n};\n"],"names":[],"mappings":";;;;;;AA0BO,SAAS,kBAAkB,SAAA,EAA+C;AAC/E,EAAA,OAAO,SAAA,KAAc,QAAA,GAAW,QAAA,GAAW,SAAA,KAAc,UAAU,UAAA,GAAa,YAAA;AAClF;AAIO,MAAM,gBAAgB,MAAM;AACjC,EAAA,IAAI,aAAa,IAAA,EAAM;AACrB,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,MAAM,YAAY,SAAA,CAAU,SAAA;AAC5B,EAAA,MAAM,kBAAA,GAAqB,SAAA,CAAU,KAAA,CAAM,uBAAuB,CAAA;AAClE,EAAA,IAAI,CAAC,kBAAA,EAAoB;AACvB,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,MAAM,YAAA,GAAe,CAAC,kBAAA,CAAmB,CAAC,CAAA;AAC1C,EAAA,MAAM,YAAA,GAAe,CAAC,kBAAA,CAAmB,CAAC,CAAA;AAC1C,EAAA,OAAO,YAAA,KAAiB,MAAM,YAAA,IAAgB,CAAA;AAChD,CAAA;AAMO,MAAM,yBAAA,GAA4B,CAAC,QAAA,EAAe,GAAA,KACvD,QAAA,CAAS,CAAC,CAAA,KAAM,GAAA,CAAI,CAAC,CAAA,IACrB,QAAA,CAAS,CAAC,CAAA,CAAE,mBAAmB,GAAA,CAAI,CAAC,CAAA,CAAE,cAAA,IACtC,QAAA,CAAS,CAAC,CAAA,CAAE,aAAA,KAAkB,GAAA,CAAI,CAAC,CAAA,CAAE,aAAA,IACrC,QAAA,CAAS,CAAC,EAAE,SAAA,KAAc,GAAA,CAAI,CAAC,CAAA,CAAE,SAAA,IACj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