var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellRecordBoard/shellFrame/ToolBar/index.tsx
var ToolBar_exports = {};
__export(ToolBar_exports, {
  default: () => ToolBar_default
});
module.exports = __toCommonJS(ToolBar_exports);
var import_react = __toESM(require("react"));
var import_classnames = __toESM(require("classnames"));
var import_antd = require("antd");
var import_icons = require("@ant-design/icons");
var import_SwitchVertical01 = __toESM(require("@pisell/icon/es/SwitchVertical01"));
var import_ToolBar = __toESM(require("../../../pisellGridPro/ToolBar"));
var import_pisellFind = require("../../../pisellFind");
var import_pisellFilter = __toESM(require("../../../pisellFilter"));
var import_sort = __toESM(require("../../../sort"));
var import_ToolBarReset = __toESM(require("../ToolBarReset"));
var import_ToolBarQuickFilter = __toESM(require("../ToolBarQuickFilter"));
var import_ColumnSetting = __toESM(require("../ColumnSetting"));
var import_ShellBodyMetaContext = require("../ShellBodyMetaContext");
var import_useRecordBoardContext = require("../../hooks/useRecordBoardContext");
var import_locales = require("../../../../locales");
var import_recordBoardColumns = require("../../utils/recordBoardColumns");
var import_venueWallUtils = require("../ResourceWall/venueWallUtils");
var import_recordBoardToolBarConstants = require("./recordBoardToolBarConstants");
var import_recordBoardToolBarI18n = require("./recordBoardToolBarI18n");
var import_ToolBarFilter = require("./ToolBarFilter.less");
var import_recordBoardToolbar = require("./recordBoardToolbar.less");
var RecordBoardToolBar = (props) => {
  var _a, _b, _c, _d;
  const ctx = (0, import_useRecordBoardContext.useRecordBoardContext)({ displayName: "toolBar" });
  const shellMeta = (0, import_ShellBodyMetaContext.useRecordBoardShellBodyMeta)();
  const { searchParams, onSearch, bodyView, setBodyView } = ctx;
  const resourceWallFilterFieldKey = ((_a = ctx.resourceWallProps) == null ? void 0 : _a.filterFieldKey) ?? import_recordBoardToolBarConstants.RESOURCE_WALL_QUICK_FILTER_KEY;
  const hasGridInShell = (shellMeta == null ? void 0 : shellMeta.hasGridContent) ?? true;
  const hasFloorInShell = (shellMeta == null ? void 0 : shellMeta.hasFloorMapSlot) ?? ctx.floorMapProps != null;
  const hasCalendarInShell = (shellMeta == null ? void 0 : shellMeta.hasCalendarSlot) ?? ctx.calendarProps != null;
  const hasResourceWallInShell = (shellMeta == null ? void 0 : shellMeta.hasResourceWallSlot) ?? ctx.resourceWallProps != null;
  const floorForToggle = (shellMeta == null ? void 0 : shellMeta.effectiveFloorMapProps) ?? ctx.floorMapProps;
  const canFloor = hasFloorInShell && floorForToggle != null;
  const canCalendar = hasCalendarInShell;
  const canResourceWall = hasResourceWallInShell;
  const canGrid = hasGridInShell;
  const bodyViewOptionCount = (canGrid ? 1 : 0) + (canFloor ? 1 : 0) + (canCalendar ? 1 : 0) + (canResourceWall ? 1 : 0);
  const showTableFloorToggle = bodyViewOptionCount >= 2;
  const allowBodyViewToggle = showTableFloorToggle && ctx.bodyViewSwitchable !== false;
  const slots = ((_b = ctx.childComponentProps) == null ? void 0 : _b.toolBar) ?? {};
  const toolbarDensity = slots.toolbarDensity ?? "default";
  const isCompactNarrow = toolbarDensity === "compact-narrow";
  const barSize = isCompactNarrow ? "small" : toolbarDensity === "compact" ? "middle" : "large";
  const filterConfig = slots.filter;
  const filterPhoneLayout = typeof filterConfig === "object" && filterConfig !== null && "phoneLayout" in filterConfig ? Boolean(filterConfig.phoneLayout) : isCompactNarrow;
  const keyword = (searchParams == null ? void 0 : searchParams[import_recordBoardToolBarConstants.DEFAULT_SEARCH_FIELD]) ?? "";
  const handleSearch = (0, import_react.useCallback)(
    (value) => {
      onSearch({ ...searchParams, [import_recordBoardToolBarConstants.DEFAULT_SEARCH_FIELD]: value || void 0 });
    },
    [onSearch, searchParams]
  );
  const gridColumns = (_d = (_c = ctx.childComponentProps) == null ? void 0 : _c.grid) == null ? void 0 : _d.columns;
  const derivedFilterFromColumns = (0, import_react.useMemo)(
    () => Array.isArray(gridColumns) && gridColumns.length > 0 ? (0, import_recordBoardColumns.deriveFilterFromColumns)(gridColumns) : null,
    [gridColumns]
  );
  const derivedSortFromColumnsList = (0, import_react.useMemo)(
    () => Array.isArray(gridColumns) && gridColumns.length > 0 ? (0, import_recordBoardColumns.deriveSortFromColumns)(gridColumns) : [],
    [gridColumns]
  );
  const searchConfig = slots.search;
  const hideSearch = searchConfig === false;
  const searchConfigObj = typeof searchConfig === "object" && searchConfig !== null ? searchConfig : null;
  const searchDebounceMs = searchConfigObj && typeof searchConfigObj.searchDebounce === "number" && searchConfigObj.searchDebounce > 0 ? searchConfigObj.searchDebounce : 0;
  const searchDebounceEnabled = searchDebounceMs > 0;
  const searchConfigRest = (0, import_react.useMemo)(() => {
    if (!searchConfigObj) return null;
    const { searchDebounce: _omit, ...rest } = searchConfigObj;
    return rest;
  }, [searchConfigObj]);
  const [localKeyword, setLocalKeyword] = (0, import_react.useState)(keyword);
  (0, import_react.useEffect)(() => {
    setLocalKeyword(keyword);
  }, [keyword]);
  const searchInputValue = searchDebounceEnabled ? localKeyword : keyword;
  const handleSearchChange = (0, import_react.useCallback)(
    (value) => {
      if (searchDebounceEnabled) {
        setLocalKeyword(value);
        return;
      }
      handleSearch(value);
    },
    [searchDebounceEnabled, handleSearch]
  );
  const searchButtonText = (0, import_locales.getText)("pisell2.recordBoard.toolbar.find") || "Find";
  const compactNarrowSearchRest = searchConfigRest ? (() => {
    const {
      trigger: _tr,
      triggerType: _tt,
      displayType: _dt,
      triggerText: _tx,
      triggerIcon: _ti,
      buttonText: _btn,
      ...rest
    } = searchConfigRest;
    return rest;
  })() : {};
  const searchEnableScannerConfigured = searchConfigRest && typeof searchConfigRest === "object" && searchConfigRest.enableScanner === true;
  const [isFindSearchOpen, setIsFindSearchOpen] = (0, import_react.useState)(false);
  const searchConfigOnOpen = searchConfigRest == null ? void 0 : searchConfigRest.onOpen;
  const searchConfigOnClose = searchConfigRest == null ? void 0 : searchConfigRest.onClose;
  const searchNode = hideSearch ? null : isCompactNarrow ? /* @__PURE__ */ import_react.default.createElement(
    import_pisellFind.PisellFind,
    {
      ...compactNarrowSearchRest,
      ...searchDebounceEnabled ? { debounceTime: searchDebounceMs } : {},
      value: searchInputValue,
      onChange: handleSearchChange,
      onSearch: handleSearch,
      size: barSize,
      triggerType: "icon",
      className: "record-board-toolbar-find-icon",
      triggerIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.SearchOutlined, { "aria-label": searchButtonText }),
      enableScanner: searchEnableScannerConfigured && isFindSearchOpen,
      onOpen: () => {
        searchConfigOnOpen == null ? void 0 : searchConfigOnOpen();
        setIsFindSearchOpen(true);
      },
      onClose: () => {
        searchConfigOnClose == null ? void 0 : searchConfigOnClose();
        setIsFindSearchOpen(false);
      }
    }
  ) : /* @__PURE__ */ import_react.default.createElement(
    import_pisellFind.PisellFind,
    {
      triggerType: "input",
      displayType: "inline",
      showConfirmButton: searchConfigObj && "showConfirmButton" in searchConfigObj ? searchConfigObj.showConfirmButton : true,
      ...searchDebounceEnabled ? { debounceTime: searchDebounceMs } : {},
      value: searchInputValue,
      onChange: handleSearchChange,
      onSearch: handleSearch,
      ...searchConfigRest ?? {},
      size: toolbarDensity === "compact" ? barSize : typeof searchConfig === "object" && searchConfig !== null && "size" in searchConfig && searchConfig.size != null ? searchConfig.size : barSize
    }
  );
  const quickFilterConfig = slots.quickFilter;
  const quickFilterList = (0, import_react.useMemo)(() => {
    if (quickFilterConfig === false) return [];
    const fromConfig = typeof quickFilterConfig === "object" && quickFilterConfig !== null && Array.isArray(quickFilterConfig.filterList) ? quickFilterConfig.filterList : null;
    let list = fromConfig ?? (derivedFilterFromColumns == null ? void 0 : derivedFilterFromColumns.quickFilter) ?? [];
    const hideNames = typeof quickFilterConfig === "object" && quickFilterConfig !== null && Array.isArray(quickFilterConfig.hideFilterNamesOnFloorMap) ? quickFilterConfig.hideFilterNamesOnFloorMap : null;
    if ((bodyView === "floorMap" || bodyView === "calendar" || bodyView === "resourceWall") && showTableFloorToggle && hideNames != null && hideNames.length > 0) {
      const hideSet = new Set(hideNames.map(String));
      list = list.filter((item) => {
        const n = item.name ?? item.key;
        return n == null || !hideSet.has(String(n));
      });
    }
    return list;
  }, [
    quickFilterConfig,
    derivedFilterFromColumns == null ? void 0 : derivedFilterFromColumns.quickFilter,
    bodyView,
    showTableFloorToggle
  ]);
  const leftBarQuickFilterList = (0, import_react.useMemo)(() => {
    const withoutWall = quickFilterList.filter(
      (item) => (item.key ?? item.name ?? "") !== resourceWallFilterFieldKey
    );
    if (bodyView === "resourceWall") return [];
    return withoutWall;
  }, [bodyView, quickFilterList, resourceWallFilterFieldKey]);
  const showQuickFilterLeft = leftBarQuickFilterList.length > 0;
  const quickFilterNode = showQuickFilterLeft ? /* @__PURE__ */ import_react.default.createElement(
    import_ToolBarQuickFilter.default,
    {
      filterList: leftBarQuickFilterList,
      formFiltersPrefix: typeof quickFilterConfig === "object" && quickFilterConfig !== null ? quickFilterConfig.formFiltersPrefix ?? "" : "",
      size: typeof quickFilterConfig === "object" && quickFilterConfig !== null ? quickFilterConfig.size : void 0,
      phoneLayout: filterPhoneLayout
    }
  ) : null;
  const bodyViewSegmentedOptions = (0, import_react.useMemo)(() => {
    const opts = [];
    if (canFloor) opts.push({ label: (0, import_recordBoardToolBarI18n.getViewFloorMapLabel)(), value: "floorMap" });
    if (canCalendar) opts.push({ label: (0, import_recordBoardToolBarI18n.getViewCalendarLabel)(), value: "calendar" });
    if (canResourceWall) {
      opts.push({
        label: (0, import_recordBoardToolBarI18n.getViewResourceWallLabel)(),
        value: "resourceWall"
      });
    }
    if (canGrid) opts.push({ label: (0, import_recordBoardToolBarI18n.getViewGridLabel)(), value: "grid" });
    return opts;
  }, [canFloor, canCalendar, canResourceWall, canGrid]);
  const bodyViewToggle = allowBodyViewToggle ? /* @__PURE__ */ import_react.default.createElement(
    import_antd.Segmented,
    {
      className: "record-board-toolbar-body-view-segmented",
      size: barSize,
      value: bodyView,
      onChange: (v) => setBodyView(v),
      options: bodyViewSegmentedOptions
    }
  ) : null;
  const compactFloorMapToolbar = (bodyView === "floorMap" || bodyView === "calendar") && showTableFloorToggle;
  const hideBodyViewToggleInToolbarRow = slots.hideBodyViewToggle === true || allowBodyViewToggle && Boolean(slots.tabs) && (bodyView === "floorMap" || bodyView === "calendar");
  const sortConfig = slots.sort;
  const hideSort = sortConfig === false;
  const sortValue = searchParams == null ? void 0 : searchParams[import_recordBoardToolBarConstants.SORT_PARAMS_FIELD];
  const handleSortChange = (0, import_react.useCallback)(
    (val) => {
      onSearch({ ...searchParams, [import_recordBoardToolBarConstants.SORT_PARAMS_FIELD]: val || void 0 });
    },
    [onSearch, searchParams]
  );
  const sortList = (0, import_react.useMemo)(() => {
    const configuredList = typeof sortConfig === "object" && sortConfig !== null && Array.isArray(sortConfig.list) ? sortConfig.list : null;
    const base = configuredList != null && configuredList.length > 0 ? configuredList : derivedSortFromColumnsList;
    if (bodyView !== "resourceWall") {
      return base;
    }
    const extraWallKeys = typeof sortConfig === "object" && sortConfig !== null && Array.isArray(sortConfig.resourceWallSortFieldKeys) ? sortConfig.resourceWallSortFieldKeys.map(
      String
    ) : [];
    const allowedKeys = [
      ...import_venueWallUtils.DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS.map(String),
      ...extraWallKeys
    ];
    const filtered = base.filter(
      (item) => item.name != null && (0, import_venueWallUtils.matchesResourceWallStatusSortField)(String(item.name), allowedKeys)
    );
    if (filtered.length > 0) return filtered;
    return [(0, import_recordBoardToolBarI18n.buildResourceWallStatusSortFallbackItem)(sortConfig)];
  }, [sortConfig, derivedSortFromColumnsList, bodyView]);
  const sortSpreadRest = typeof sortConfig === "object" && sortConfig !== null ? (() => {
    const {
      resourceWallSortFieldKeys: _w,
      list: _omitList,
      ...rest
    } = sortConfig;
    return rest;
  })() : {};
  const sortNode = hideSort ? null : /* @__PURE__ */ import_react.default.createElement(
    import_sort.default,
    {
      ...sortSpreadRest,
      list: sortList,
      value: sortValue,
      onChange: handleSortChange,
      placement: "bottomLeft",
      button: /* @__PURE__ */ import_react.default.createElement(
        import_antd.Button,
        {
          className: "record-board-toolbar-filter-btn",
          icon: /* @__PURE__ */ import_react.default.createElement(import_SwitchVertical01.default, null),
          size: barSize
        },
        (0, import_recordBoardToolBarI18n.getSortButtonText)()
      )
    }
  );
  const hideFilter = filterConfig === false;
  const filterValue = searchParams == null ? void 0 : searchParams[import_recordBoardToolBarConstants.FILTER_PARAMS_FIELD];
  const hasFilterList = Array.isArray(filterValue == null ? void 0 : filterValue.quickFilter) && filterValue.quickFilter.length > 0 || Array.isArray(filterValue == null ? void 0 : filterValue.otherFilter) && filterValue.otherFilter.length > 0;
  const hasFilterValues = typeof (filterValue == null ? void 0 : filterValue.values) === "object" && filterValue.values !== null && Object.keys(filterValue.values).length > 0;
  const hasFilterItems = hasFilterList || hasFilterValues;
  const defaultFilterFromConfig = typeof filterConfig === "object" && filterConfig !== null && filterConfig.defaultFilterValue ? filterConfig.defaultFilterValue : null;
  const effectiveFilterValue = (0, import_react.useMemo)(() => {
    const base = filterValue != null && hasFilterItems ? filterValue : defaultFilterFromConfig ? defaultFilterFromConfig : derivedFilterFromColumns && (derivedFilterFromColumns.quickFilter.length > 0 || derivedFilterFromColumns.otherFilter.length > 0) ? derivedFilterFromColumns : (0, import_recordBoardToolBarI18n.getDefaultFilterValue)();
    const quickFilter = Array.isArray(base.quickFilter) && base.quickFilter.length > 0 ? base.quickFilter : (defaultFilterFromConfig == null ? void 0 : defaultFilterFromConfig.quickFilter) ?? [];
    let otherFilter = Array.isArray(base.otherFilter) && base.otherFilter.length > 0 ? base.otherFilter : (defaultFilterFromConfig == null ? void 0 : defaultFilterFromConfig.otherFilter) ?? [];
    if (otherFilter === base.otherFilter && Array.isArray(defaultFilterFromConfig == null ? void 0 : defaultFilterFromConfig.otherFilter) && defaultFilterFromConfig.otherFilter.length > 0) {
      const configMap = new Map(
        defaultFilterFromConfig.otherFilter.map((c) => [
          c.key ?? c.name ?? "",
          c
        ])
      );
      otherFilter = otherFilter.map((item) => {
        var _a2, _b2;
        const key = item.key ?? item.name ?? "";
        const configItem = configMap.get(key);
        if (!configItem) return item;
        return {
          ...configItem,
          ...item,
          label: configItem.label ?? item.label,
          other: {
            ...configItem == null ? void 0 : configItem.other,
            ...item == null ? void 0 : item.other,
            placeholder: ((_a2 = configItem == null ? void 0 : configItem.other) == null ? void 0 : _a2.placeholder) ?? ((_b2 = item == null ? void 0 : item.other) == null ? void 0 : _b2.placeholder)
          }
        };
      });
    }
    let outQuick = quickFilter;
    let outOther = otherFilter;
    if (bodyView === "resourceWall") {
      outQuick = [];
      outOther = quickFilterList.filter(
        (item) => (item.key ?? item.name ?? "") === resourceWallFilterFieldKey
      ).map((item) => ({ ...item }));
    }
    return {
      ...base,
      quickFilter: outQuick,
      otherFilter: outOther,
      values: base.values ?? {}
    };
  }, [
    filterValue,
    hasFilterItems,
    defaultFilterFromConfig,
    derivedFilterFromColumns,
    bodyView,
    quickFilterList
  ]);
  const filterValueForPisellFilter = (0, import_react.useMemo)(
    () => ({
      ...effectiveFilterValue,
      quickFilter: []
    }),
    [effectiveFilterValue]
  );
  const handleFilterChange = (0, import_react.useCallback)(
    (value) => {
      const currentFilter = searchParams == null ? void 0 : searchParams[import_recordBoardToolBarConstants.FILTER_PARAMS_FIELD];
      const currentValues = (currentFilter == null ? void 0 : currentFilter.values) ?? {};
      const incomingValues = (value == null ? void 0 : value.values) ?? {};
      const nextFilter = {
        ...value,
        values: { ...currentValues, ...incomingValues }
      };
      onSearch({ ...searchParams, [import_recordBoardToolBarConstants.FILTER_PARAMS_FIELD]: nextFilter });
    },
    [onSearch, searchParams]
  );
  const filterResetKey = ctx.filterResetKey ?? 0;
  const filterNode = hideFilter ? null : /* @__PURE__ */ import_react.default.createElement(
    import_pisellFilter.default,
    {
      key: `record-board-filter-${filterResetKey}`,
      value: filterValueForPisellFilter,
      onChange: handleFilterChange,
      hasForm: true,
      quickFilterMaxLength: 100,
      formFiltersPrefix: "",
      hiddenQuickFilter: true,
      placement: "bottomLeft",
      ...typeof filterConfig === "object" && filterConfig !== null ? filterConfig : {},
      phoneLayout: filterPhoneLayout,
      size: barSize,
      buttonClassName: "record-board-toolbar-filter-btn"
    }
  );
  const showColumnSetting = slots.columnSetting !== false && bodyView !== "resourceWall" && Array.isArray(gridColumns) && gridColumns.length > 0;
  const collapseActionsToGear = slots.collapseActions === "gear";
  const shouldCollapseToGear = isCompactNarrow || collapseActionsToGear;
  const settingsGearPopoverContent = shouldCollapseToGear ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-popover" }, showColumnSetting ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, /* @__PURE__ */ import_react.default.createElement(import_ColumnSetting.default, null)) : null, sortNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, sortNode) : null, filterNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, filterNode) : null, bodyView !== "resourceWall" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-settings-gear-row" }, /* @__PURE__ */ import_react.default.createElement(import_ToolBarReset.default, { size: barSize })) : null) : null;
  const settingsGearTrigger = settingsGearPopoverContent != null ? /* @__PURE__ */ import_react.default.createElement(
    import_antd.Popover,
    {
      content: settingsGearPopoverContent,
      trigger: "click",
      placement: "bottomRight",
      arrow: false,
      overlayClassName: (0, import_classnames.default)(
        "record-board-toolbar-settings-gear-overlay",
        isCompactNarrow && "record-board-toolbar-settings-gear-overlay--compact-narrow",
        !isCompactNarrow && collapseActionsToGear && "record-board-toolbar-settings-gear-overlay--collapsed-actions"
      )
    },
    /* @__PURE__ */ import_react.default.createElement(
      import_antd.Button,
      {
        className: "record-board-toolbar-settings-gear-btn",
        icon: /* @__PURE__ */ import_react.default.createElement(import_icons.SettingOutlined, null),
        size: barSize,
        type: "text",
        "aria-label": (0, import_locales.getText)("pisell2.recordBoard.toolbar.moreSettings") || "More settings"
      }
    )
  ) : null;
  const mergeQuickFilterWithCompactTrailing = isCompactNarrow && slots.mergeCompactNarrowTrailingWithQuickFilterRow === true && showQuickFilterLeft;
  const compactNarrowTrailingCluster = isCompactNarrow ? /* @__PURE__ */ import_react.default.createElement(
    import_antd.Space,
    {
      className: (0, import_classnames.default)(
        "record-board-toolbar-right-actions",
        mergeQuickFilterWithCompactTrailing && "record-board-toolbar-hud-trailing-cluster"
      ),
      size: 4
    },
    bodyView !== "resourceWall" && searchNode ? searchNode : null,
    settingsGearTrigger
  ) : null;
  const topLeft = compactFloorMapToolbar ? null : /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-top-left" }, !hideBodyViewToggleInToolbarRow ? bodyViewToggle : null, mergeQuickFilterWithCompactTrailing && quickFilterNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-hud-unified-quick-filter-row" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-quick-filter-slot" }, quickFilterNode), compactNarrowTrailingCluster) : quickFilterNode ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-quick-filter-slot" }, quickFilterNode) : null, searchNode && bodyView !== "resourceWall" && !isCompactNarrow ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-find-wrap" }, searchNode) : null, slots.topLeft ? /* @__PURE__ */ import_react.default.createElement("div", { className: "record-board-toolbar-extra-top-left" }, slots.topLeft) : null);
  const topRight = compactFloorMapToolbar ? null : isCompactNarrow ? mergeQuickFilterWithCompactTrailing ? slots.topRight ?? null : /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions", size: 4 }, bodyView !== "resourceWall" && searchNode ? searchNode : null, settingsGearTrigger, slots.topRight) : collapseActionsToGear && settingsGearTrigger ? /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions", size: 8 }, settingsGearTrigger, slots.topRight) : /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: "record-board-toolbar-right-actions" }, showColumnSetting ? /* @__PURE__ */ import_react.default.createElement(import_ColumnSetting.default, null) : null, sortNode, filterNode, bodyView !== "resourceWall" ? /* @__PURE__ */ import_react.default.createElement(import_ToolBarReset.default, { size: barSize }) : null, slots.topRight);
  return /* @__PURE__ */ import_react.default.createElement(
    import_ToolBar.default,
    {
      className: (0, import_classnames.default)(
        bodyView === "floorMap" && "pisell-record-board-toolbar--floor-map",
        bodyView === "calendar" && "pisell-record-board-toolbar--calendar",
        bodyView === "resourceWall" && "pisell-record-board-toolbar--resource-wall",
        bodyView === "grid" && "pisell-record-board-toolbar--grid",
        toolbarDensity === "compact" && "pisell-record-board-toolbar--compact",
        isCompactNarrow && "pisell-record-board-toolbar--compact pisell-record-board-toolbar--compact-narrow",
        slots.className
      ),
      style: slots.style,
      tabs: slots.tabs,
      topLeft,
      topRight,
      bottomLeft: compactFloorMapToolbar ? null : slots.bottomLeft,
      bottomRight: compactFloorMapToolbar ? null : slots.bottomRight
    }
  );
};
RecordBoardToolBar.displayName = "RecordBoard.ToolBar";
var ToolBar_default = RecordBoardToolBar;
