"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.euiFilterGroupStyles = void 0;
var _react = require("@emotion/react");
var _global_styling = require("../../global_styling");
var _form = require("../form/form.styles");
var _filter_button = require("./filter_button.styles");
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
                                                                                                                                                                                                                                                                                           * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
                                                                                                                                                                                                                                                                                           * or more contributor license agreements. Licensed under the Elastic License
                                                                                                                                                                                                                                                                                           * 2.0 and the Server Side Public License, v 1; you may not use this file except
                                                                                                                                                                                                                                                                                           * in compliance with, at your election, the Elastic License 2.0 or the Server
                                                                                                                                                                                                                                                                                           * Side Public License, v 1.
                                                                                                                                                                                                                                                                                           */
var _ref = process.env.NODE_ENV === "production" ? {
  name: "ejknuq-fullWidth",
  styles: "display:flex;label:fullWidth;"
} : {
  name: "ejknuq-fullWidth",
  styles: "display:flex;label:fullWidth;",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var euiFilterGroupStyles = function euiFilterGroupStyles(euiThemeContext) {
  var euiTheme = euiThemeContext.euiTheme;
  var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
    backgroundColor = _euiFormVariables.backgroundColor,
    borderColor = _euiFormVariables.borderColor,
    controlBorderRadius = _euiFormVariables.controlBorderRadius,
    controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius,
    controlCompressedHeight = _euiFormVariables.controlCompressedHeight;
  return {
    euiFilterGroup: /*#__PURE__*/(0, _react.css)("display:inline-flex;", (0, _global_styling.logicalCSS)('max-width', '100%'), " overflow:hidden;background-color:", backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", borderColor, ";>*:not(.euiFilterButton){", (0, _filter_button.euiFilterButtonDisplay)(euiThemeContext), ";}.euiPopover__anchor{display:block;.euiFilterButton{", (0, _global_styling.logicalCSS)('width', '100%'), ";}}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs']), "{display:flex;.euiFilterButton{flex-grow:1;}};label:euiFilterGroup;"),
    fullWidth: _ref,
    uncompressed: /*#__PURE__*/(0, _react.css)("border-radius:", controlBorderRadius, ";", buttonChildrenBorderRadii(controlBorderRadius), ";;label:uncompressed;"),
    compressed: /*#__PURE__*/(0, _react.css)("border-radius:", controlCompressedBorderRadius, ";", buttonChildrenBorderRadii(controlCompressedBorderRadius), " .euiFilterButton{", (0, _global_styling.logicalCSS)('height', controlCompressedHeight), ";};label:compressed;"),
    /**
     * Not used in EuiFilterGroup directly, but used by EuiSearchBar and consumers
     * A fixed width is required because of the shift in widths that can be caused
     * by the loading animation that precedes the results.
     */
    euiFilterGroup__popoverPanel: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
      return x * 18;
    })), ";;label:euiFilterGroup__popoverPanel;")
  };
};

/**
 * Small util for manually rounding the borders of the first and last EuiFilterButtons
 * - this makes their focus rings appear nicely instead of being cutt off.
 * 2nd selector accounts for EuiFilterButtons nested within popover/tooltip wrappers.
 *
 * NOTE: Do not use `logicalShorthandCSS()` here, as that will cause single buttons to not be rounded
 */
exports.euiFilterGroupStyles = euiFilterGroupStyles;
var buttonChildrenBorderRadii = function buttonChildrenBorderRadii(radiusSize) {
  return "\n  > :first-child,\n  > :first-child .euiFilterButton {\n    ".concat((0, _global_styling.logicalCSS)('border-top-left-radius', radiusSize), "\n    ").concat((0, _global_styling.logicalCSS)('border-bottom-left-radius', radiusSize), "\n  }\n\n  > :last-child,\n  > :last-child .euiFilterButton {\n    ").concat((0, _global_styling.logicalCSS)('border-top-right-radius', radiusSize), "\n    ").concat((0, _global_styling.logicalCSS)('border-bottom-right-radius', radiusSize), "\n  }\n");
};