"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = exports.SplitAction = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireWildcard(require("react"));
var _SplitActionContext = require("./SplitActionContext");
var _SplitActionSt = require("./SplitAction.st.css.js");
var _Divider = _interopRequireDefault(require("../Divider"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SplitAction/SplitAction.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var SplitAction = props => {
  var {
    children,
    className,
    dataHook,
    skin,
    priority,
    size,
    disabled
  } = props;
  var sharedProps = {
    skin,
    priority,
    size,
    disabled
  };
  return /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _SplitActionSt.st)(_SplitActionSt.classes.root, {
      size
    }, className),
    "data-hook": dataHook,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 14,
      columnNumber: 5
    }
  }, _react.Children.map(children, (child, index) => {
    if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
      return child;
    }
    return /*#__PURE__*/_react.default.createElement(_SplitActionContext.SplitActionContext.Provider, {
      value: _objectSpread({}, sharedProps),
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 20,
        columnNumber: 11
      }
    }, index > 0 && /*#__PURE__*/_react.default.createElement(_Divider.default, {
      direction: "vertical",
      className: (0, _SplitActionSt.st)(_SplitActionSt.classes.divider),
      skin: sharedProps.priority === 'secondary' && !sharedProps.skin ? 'standard' : sharedProps.skin === 'inverted' ? 'standard' : sharedProps.skin === 'transparent' ? 'light' : sharedProps.skin,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 26,
        columnNumber: 15
      }
    }), /*#__PURE__*/_react.default.createElement("div", {
      className: _SplitActionSt.classes.item,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 40,
        columnNumber: 13
      }
    }, child));
  }));
};
exports.SplitAction = SplitAction;
SplitAction.displayName = 'SplitAction';
var _default = exports.default = SplitAction;
//# sourceMappingURL=SplitAction.js.map