"use strict";
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);
var preset_bar_exports = {};
__export(preset_bar_exports, {
  FIX_BUTTON_PRESET: () => FIX_BUTTON_PRESET,
  PresetBar: () => PresetBar,
  PresetList: () => PresetList
});
module.exports = __toCommonJS(preset_bar_exports);
var import_design_system = require("@wix/design-system");
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_react = __toESM(require("react"));
var import_preset_bar_scss = __toESM(require("./preset-bar-scss.js"));
const FIX_BUTTON_PRESET = { id: "fix", label: "Fix", icon: /* @__PURE__ */ import_react.default.createElement(import_wix_ui_icons_common.Sparkles, null) };
const PresetBar = ({
  presets,
  selectedPresetId,
  onPresetSelect,
  showFixButton
}) => {
  return /* @__PURE__ */ import_react.default.createElement(import_design_system.HorizontalScroll, { scrollButtonSize: "tiny" }, /* @__PURE__ */ import_react.default.createElement(import_design_system.Box, { className: import_preset_bar_scss.default.root, gap: "SP1" }, showFixButton && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
    import_design_system.Button,
    {
      prefixIcon: /* @__PURE__ */ import_react.default.createElement(import_wix_ui_icons_common.Sparkles, null),
      onClick: () => {
        onPresetSelect(FIX_BUTTON_PRESET);
      },
      skin: "ai",
      priority: "secondary",
      size: "small"
    },
    "Fix it"
  ), /* @__PURE__ */ import_react.default.createElement(import_design_system.Divider, { direction: "vertical" })), presets.map((preset) => /* @__PURE__ */ import_react.default.createElement(
    PresetToggle,
    {
      key: preset.id,
      preset,
      selected: selectedPresetId === preset.id,
      onClick: () => onPresetSelect(preset)
    }
  ))));
};
const PresetList = ({
  presets,
  onPresetSelect
}) => {
  return /* @__PURE__ */ import_react.default.createElement(import_design_system.HorizontalScroll, { scrollButtonSize: "tiny" }, /* @__PURE__ */ import_react.default.createElement(import_design_system.Box, { gap: "SP1" }, presets.map((preset) => /* @__PURE__ */ import_react.default.createElement(
    "button",
    {
      key: preset.id,
      className: import_preset_bar_scss.default.presetListItem,
      onClick: () => onPresetSelect(preset),
      type: "button"
    },
    preset.icon,
    preset.label
  ))));
};
const PresetToggle = ({ preset, selected, onClick, skin }) => {
  return /* @__PURE__ */ import_react.default.createElement(
    import_design_system.ToggleButton,
    {
      key: preset.id,
      selected,
      onClick,
      skin: skin ?? "standard",
      size: "small",
      labelValue: preset.label,
      shape: "pill",
      border: true,
      children: preset.icon
    }
  );
};
//# sourceMappingURL=preset-bar.js.map
