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/PisellScrollView/components/Actions/index.tsx
var Actions_exports = {};
__export(Actions_exports, {
  default: () => Actions_default
});
module.exports = __toCommonJS(Actions_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_iconfont = __toESM(require("../../../iconfont"));
var import_classnames = __toESM(require("classnames"));
var import_index = require("./index.less");
var ActionsContainer = ({
  containerRef,
  scrollState,
  overflow,
  scrollActionsConfig = { type: "backTop" },
  onClick
}) => {
  if (overflow !== "x" && overflow !== "y") {
    return null;
  }
  if (!scrollState.isOverflows) {
    return null;
  }
  if (!(scrollActionsConfig == null ? void 0 : scrollActionsConfig.show) || !scrollActionsConfig) {
    return null;
  }
  if (overflow === "y" && scrollActionsConfig.type === "backTop") {
    return /* @__PURE__ */ import_react.default.createElement(
      import_antd.FloatButton.BackTop,
      {
        target: () => containerRef.current || window,
        visibilityHeight: 300,
        icon: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "pisell2-chevron-up" }),
        ...scrollActionsConfig.config,
        style: {
          position: "absolute",
          ...scrollActionsConfig.style
        }
      }
    );
  }
  if (overflow === "x" && scrollActionsConfig.type === "rArrows") {
    return /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: "pisell-scroll-view-actions-rArrows-container",
        style: scrollActionsConfig.style
      },
      /* @__PURE__ */ import_react.default.createElement(
        "div",
        {
          className: (0, import_classnames.default)(
            "pisell-scroll-view-actions-rArrows",
            "pisell-scroll-view-actions-rArrows-left",
            {
              "pisell-scroll-view-actions-rArrows-hidden": scrollState.isScrollToLeft,
              "pisell-scroll-view-actions-rArrows-show": !scrollState.isScrollToLeft
            }
          ),
          onClick: () => onClick("left"),
          ...scrollActionsConfig.config
        },
        /* @__PURE__ */ import_react.default.createElement(
          import_iconfont.default,
          {
            type: "pisell2-chevron-left",
            className: (0, import_classnames.default)("pisell-scroll-view-actions-rArrows-icon", {
              "pisell-scroll-view-actions-rArrows-icon-hidden": scrollState.isScrollToLeft
            })
          }
        )
      ),
      /* @__PURE__ */ import_react.default.createElement(
        "div",
        {
          className: (0, import_classnames.default)(
            "pisell-scroll-view-actions-rArrows",
            "pisell-scroll-view-actions-rArrows-right",
            {
              "pisell-scroll-view-actions-rArrows-hidden": scrollState.isScrollToRight,
              "pisell-scroll-view-actions-rArrows-show": !scrollState.isScrollToRight
            }
          ),
          onClick: () => onClick("right"),
          ...scrollActionsConfig.config
        },
        /* @__PURE__ */ import_react.default.createElement(
          import_iconfont.default,
          {
            type: "pisell2-chevron-right",
            className: (0, import_classnames.default)("pisell-scroll-view-actions-rArrows-icon", {
              "pisell-scroll-view-actions-rArrows-icon-hidden": scrollState.isScrollToRight
            })
          }
        )
      )
    );
  }
  if (overflow === "x" && scrollActionsConfig.type === "lrArrows") {
    return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: (0, import_classnames.default)(
          "pisell-scroll-view-actions-lrArrows",
          "pisell-scroll-view-actions-lrArrows-left",
          {
            "pisell-scroll-view-actions-lrArrows-hidden": scrollState.isScrollToLeft,
            "pisell-scroll-view-actions-lrArrows-show": !scrollState.isScrollToLeft
          }
        ),
        onClick: () => onClick("left"),
        ...scrollActionsConfig.config
      },
      /* @__PURE__ */ import_react.default.createElement(
        import_iconfont.default,
        {
          type: "pisell2-chevron-left",
          className: "pisell-scroll-view-actions-lrArrows-icon"
        }
      )
    ), /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: (0, import_classnames.default)(
          "pisell-scroll-view-actions-lrArrows",
          "pisell-scroll-view-actions-lrArrows-right",
          {
            "pisell-scroll-view-actions-lrArrows-hidden": scrollState.isScrollToRight,
            "pisell-scroll-view-actions-lrArrows-show": !scrollState.isScrollToRight
          }
        ),
        onClick: () => onClick("right"),
        ...scrollActionsConfig.config
      },
      /* @__PURE__ */ import_react.default.createElement(
        import_iconfont.default,
        {
          type: "pisell2-chevron-right",
          className: "pisell-scroll-view-actions-lrArrows-icon"
        }
      )
    ));
  }
  if (overflow === "y" && scrollActionsConfig.type === "tbArrows") {
    return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: (0, import_classnames.default)(
          "pisell-scroll-view-actions-tbArrows",
          "pisell-scroll-view-actions-tbArrows-top",
          {
            "pisell-scroll-view-actions-tbArrows-hidden": scrollState.isScrollToTop,
            "pisell-scroll-view-actions-tbArrows-show": !scrollState.isScrollToTop
          }
        ),
        onClick: () => onClick("top"),
        ...scrollActionsConfig.config
      },
      /* @__PURE__ */ import_react.default.createElement(
        import_iconfont.default,
        {
          type: "pisell2-chevron-up",
          className: "pisell-scroll-view-actions-tbArrows-icon"
        }
      )
    ), /* @__PURE__ */ import_react.default.createElement(
      "div",
      {
        className: (0, import_classnames.default)(
          "pisell-scroll-view-actions-tbArrows",
          "pisell-scroll-view-actions-tbArrows-bottom",
          {
            "pisell-scroll-view-actions-tbArrows-hidden": scrollState.isScrollToBottom,
            "pisell-scroll-view-actions-tbArrows-show": !scrollState.isScrollToBottom
          }
        ),
        onClick: () => onClick("bottom"),
        ...scrollActionsConfig.config
      },
      /* @__PURE__ */ import_react.default.createElement(
        import_iconfont.default,
        {
          type: "pisell2-chevron-down",
          className: "pisell-scroll-view-actions-tbArrows-icon"
        }
      )
    ));
  }
  return null;
};
var Actions_default = ActionsContainer;
