"use strict";

exports.__esModule = true;
exports.CollectionToolbarActionsGroupResponsiveLayout = CollectionToolbarActionsGroupResponsiveLayout;
var _react = _interopRequireWildcard(require("react"));
var _HorizontalAvailableSpaceBox = require("../Responsive/HorizontalAvailableSpaceBox");
var _ToolbarItem = require("../ToolbarItem/ToolbarItem");
var _HorizontalOverflowBox = require("../Responsive/HorizontalOverflowBox");
var _ToolbarGroupScrollWidthBox = require("./ToolbarGroupScrollWidthBox");
var _SearchOrCustomFilter = require("./SearchOrCustomFilter");
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _InitialLoadingConditional = require("../InitialLoadingConditional");
var _CollectionToolbarSkeletonItem = require("./CollectionToolbarSkeletonItem");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CollectionToolbar/CollectionToolbarActionsGroupResponsiveLayout.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (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 (const 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 CollectionToolbarActionsGroupResponsiveLayout(props) {
  const {
    state,
    left,
    viewsToolbarItem,
    filtersElement,
    MoreFiltersButton,
    multiLevelSorting,
    customColumns,
    exportButton,
    search,
    showCustomColumnsOnTheLeft
  } = props;
  const toolbarState = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  const {
    toolbar: {
      responsive
    }
  } = toolbarState;
  let child = /*#__PURE__*/_react.default.createElement(_react.Fragment, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 5
    }
  }, left ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, viewsToolbarItem && /*#__PURE__*/_react.default.createElement(_InitialLoadingConditional.InitialLoadingConditional, {
    state: toolbarState,
    loadingElement: /*#__PURE__*/_react.default.createElement(_CollectionToolbarSkeletonItem.CollectionToolbarSkeletonItem, {
      dataHook: "toolbar-views-skeleton",
      width: "100px",
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 41,
        columnNumber: 17
      }
    }),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 13
    }
  }, viewsToolbarItem), filtersElement) : viewsToolbarItem ? filtersElement : undefined, MoreFiltersButton && /*#__PURE__*/_react.default.createElement(_ToolbarGroupScrollWidthBox.ToolbarGroupScrollWidthBox, {
    state: responsive.filters,
    gap: "SP2",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 57,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react.default.createElement(MoreFiltersButton, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 58,
      columnNumber: 11
    }
  })), /*#__PURE__*/_react.default.createElement(_ToolbarGroupScrollWidthBox.ToolbarGroupScrollWidthBox, {
    state: responsive.actions,
    gap: "SP2",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 62,
      columnNumber: 7
    }
  }, customColumns && showCustomColumnsOnTheLeft && customColumns, multiLevelSorting, exportButton && /*#__PURE__*/(0, _react.cloneElement)(exportButton, {
    toolbarType: 'default'
  }), customColumns && !showCustomColumnsOnTheLeft && customColumns), search && /*#__PURE__*/_react.default.createElement(_SearchOrCustomFilter.SearchOrCustomFilter, {
    state: state,
    search: search,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 72,
      columnNumber: 18
    }
  }));
  child = /*#__PURE__*/_react.default.createElement(_HorizontalOverflowBox.HorizontalOverflowBox, {
    state: responsive.overflow,
    gap: "SP2",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 77,
      columnNumber: 5
    }
  }, child);
  child = /*#__PURE__*/_react.default.createElement(_ToolbarItem.ToolbarItem, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 82,
      columnNumber: 11
    }
  }, child);
  child = /*#__PURE__*/_react.default.createElement(_HorizontalAvailableSpaceBox.HorizontalAvailableSpaceBox, {
    state: responsive.actionsAvailableSpace,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 85,
      columnNumber: 5
    }
  }, child);
  return child;
}
//# sourceMappingURL=CollectionToolbarActionsGroupResponsiveLayout.js.map