'use strict';

var BaseStyle = require('primevue/base/style');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var BaseStyle__default = /*#__PURE__*/_interopDefaultLegacy(BaseStyle);

var theme = function theme(_ref) {
  var dt = _ref.dt;
  return "\n.p-listbox {\n    background: ".concat(dt('listbox.background'), ";\n    color: ").concat(dt('listbox.color'), ";\n    border: 1px solid ").concat(dt('listbox.border.color'), ";\n    border-radius: ").concat(dt('rounded.base'), ";\n    transition: background-color ").concat(dt('transition.duration'), ", color ").concat(dt('transition.duration'), ", border-color ").concat(dt('transition.duration'), ", box-shadow ").concat(dt('transition.duration'), ", outline-color ").concat(dt('transition.duration'), ";\n    outline-color: transparent;\n    box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05);\n}\n\n.p-listbox.p-focus {\n    outline: 0 none;\n    border-color: ").concat(dt('listbox.focus.border.color'), ";\n}\n\n.p-listbox.p-disabled {\n    opacity: 1;\n    background: ").concat(dt('listbox.disabled.background'), ";\n    color: ").concat(dt('listbox.disabled.color'), ";\n}\n\n.p-listbox.p-invalid {\n    border-color: ").concat(dt('listbox.invalid.border.color'), ";\n}\n\n.p-listbox .p-listbox-header {\n    padding: 0.5rem 0.5rem 0 0.5rem;\n    border-bottom: 0 none;\n    margin: 0 0 0 0;\n}\n\n.p-listbox-filter-container {\n    position: relative;\n}\n\n.p-listbox-filter-icon {\n    position: absolute;\n    top: 50%;\n    margin-top: -0.5rem;\n    right: 0.75rem;\n    color: ").concat(dt('listbox.filter.icon.color'), ";\n}\n\n.p-listbox-filter {\n    width: 100%;\n    padding-right: 1.75rem;\n}\n\n.p-listbox-list-container {\n    overflow: auto;\n}\n\n.p-listbox-list {\n    list-style-type: none;\n    margin: 0;\n    padding: 0.25rem 0.25rem;\n    outline: 0 none;\n}\n\n.p-listbox-option {\n    cursor: pointer;\n    position: relative;\n    overflow: hidden;\n    margin: 2px 0;\n    padding: 0.5rem 0.75rem;\n    border: 0 none;\n    border-radius: ").concat(dt('rounded.sm'), ";\n    color: ").concat(dt('listbox.item.color'), ";\n    transition: background-color ").concat(dt('transition.duration'), ", color ").concat(dt('transition.duration'), ", border-color ").concat(dt('transition.duration'), ", box-shadow ").concat(dt('transition.duration'), ", outline-color ").concat(dt('transition.duration'), ";\n}\n\n.p-listbox-option:first-child {\n    margin-top: 0;\n}\n\n.p-listbox-option:last-child {\n    margin-bottom: 0;\n}\n\n.p-listbox .p-listbox-list .p-listbox-option.p-listbox-option-selected {\n    background: ").concat(dt('listbox.item.selected.background'), ";\n    color: ").concat(dt('listbox.item.selected.color'), ";\n}\n\n.p-listbox:not(.p-disabled) .p-listbox-option.p-listbox-option-selected.p-focus {\n    background: ").concat(dt('listbox.item.selected.focus.background'), ";\n    color: ").concat(dt('listbox.item.selected.focus.color'), ";\n}\n\n.p-listbox:not(.p-disabled) .p-listbox-option:not(.p-listbox-option-selected):not(.p-disabled).p-focus {\n    background: ").concat(dt('listbox.item.focus.background'), ";\n    color: ").concat(dt('listbox.item.focus.color'), ";\n}\n\n.p-listbox:not(.p-disabled) .p-listbox-option:not(.p-listbox-option-selected):not(.p-disabled):hover {\n    background: ").concat(dt('listbox.item.focus.background'), ";\n    color: ").concat(dt('listbox.item.focus.color'), ";\n}\n\n.p-listbox-option-group {\n    cursor: auto;\n    margin: 0;\n    padding: 0.5rem 0.75rem;\n    color: ").concat(dt('listbox.item.group.color'), ";\n    background: ").concat(dt('listbox.item.group.background'), ";\n    font-weight: 600;\n}\n\n.p-listbox-empty-message {\n    padding: 0.5rem 0.75rem;\n    background: transparent;\n}\n");
};
var classes = {
  root: function root(_ref2) {
    var props = _ref2.props;
    return ['p-listbox p-component', {
      'p-listbox-striped': props.stripedRows,
      'p-disabled': props.disabled,
      'p-invalid': props.invalid
    }];
  },
  header: 'p-listbox-header',
  filterContainer: 'p-listbox-filter-container',
  filterInput: 'p-listbox-filter',
  filterIcon: 'p-listbox-filter-icon',
  wrapper: 'p-listbox-list-container',
  list: 'p-listbox-list',
  itemGroup: 'p-listbox-option-group',
  item: function item(_ref3) {
    var instance = _ref3.instance,
      option = _ref3.option,
      index = _ref3.index,
      getItemOptions = _ref3.getItemOptions;
    return ['p-listbox-option', {
      'p-listbox-option-selected': instance.isSelected(option),
      'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
      'p-disabled': instance.isOptionDisabled(option)
    }];
  },
  emptyMessage: 'p-listbox-empty-message'
};
var ListboxStyle = BaseStyle__default["default"].extend({
  name: 'listbox',
  theme: theme,
  classes: classes
});

module.exports = ListboxStyle;
