"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _classnames = _interopRequireDefault(require("classnames"));
var _constants = require("../../constants");
var _Icon = _interopRequireDefault(require("../Icon"));
var _jsxRuntime = require("react/jsx-runtime");
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

const MultiValue = _ref => {
  let {
    baseClassName = `${_constants.CLS_PREFIX}select-multi-value`,
    onRemove,
    children,
    ...props
  } = _ref;
  const onMouseDown = e => {
    e.preventDefault();
  };
  const onClick = e => {
    e.stopPropagation();
    onRemove();
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: (0, _classnames.default)(baseClassName),
    ...props,
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: `${baseClassName}__content`,
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
        className: `${baseClassName}__label`,
        children: children
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
        className: `${baseClassName}__remove`,
        size: "12",
        onMouseDown: onMouseDown,
        onClick: onClick,
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 12 12",
          focusable: "false",
          "aria-hidden": "true",
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
            d: "M3.85 8.854a.498.498 0 1 1-.704-.704L5.296 6l-2.15-2.15a.498.498 0 0 1 .704-.704L6 5.296l2.15-2.15a.498.498 0 1 1 .704.704L6.704 6l2.15 2.15a.498.498 0 0 1-.704.704L6 6.704l-2.15 2.15z"
          })
        })
      })]
    })
  });
};
var _default = exports.default = MultiValue;