import N from "./index-objectWithoutPropertiesLoose.js";
import s from "./index-extends.js";
import * as y from "react";
import { clsx as m } from "./index-clsx.m.js";
import { ArrowLeft as T, ArrowRight as I } from "./index-icons.js";
import { getPickersArrowSwitcherUtilityClass as D } from "./index-pickersArrowSwitcherClasses.js";
import { jsxs as H, jsx as e } from "react/jsx-runtime";
import M from "./index-useThemeProps.js";
import j from "./index-useTheme.js";
import _ from "./index-Typography.js";
import z from "./index-composeClasses.js";
import p from "./index-styled.js";
import U from "./index-IconButton2.js";
const W = ["children", "className", "components", "componentsProps", "isLeftDisabled", "isLeftHidden", "isRightDisabled", "isRightHidden", "leftArrowButtonText", "onLeftClick", "onRightClick", "rightArrowButtonText"], q = (t) => {
  const {
    classes: o
  } = t;
  return z({
    root: ["root"],
    spacer: ["spacer"],
    button: ["button"]
  }, D, o);
}, E = p("div", {
  name: "MuiPickersArrowSwitcher",
  slot: "Root",
  overridesResolver: (t, o) => o.root
})({
  display: "flex"
}), F = p("div", {
  name: "MuiPickersArrowSwitcher",
  slot: "Spacer",
  overridesResolver: (t, o) => o.spacer
})(({
  theme: t
}) => ({
  width: t.spacing(3)
})), S = p(U, {
  name: "MuiPickersArrowSwitcher",
  slot: "Button",
  overridesResolver: (t, o) => o.button
})(({
  ownerState: t
}) => s({}, t.hidden && {
  visibility: "hidden"
})), et = /* @__PURE__ */ y.forwardRef(function(o, w) {
  const l = M({
    props: o,
    name: "MuiPickersArrowSwitcher"
  }), {
    children: h,
    className: b,
    components: r,
    componentsProps: n,
    isLeftDisabled: k,
    isLeftHidden: v,
    isRightDisabled: P,
    isRightHidden: B,
    leftArrowButtonText: u,
    onLeftClick: x,
    onRightClick: L,
    rightArrowButtonText: f
  } = l, C = N(l, W), A = j().direction === "rtl", a = (n == null ? void 0 : n.leftArrowButton) || {}, g = (r == null ? void 0 : r.LeftArrowIcon) || T, d = (n == null ? void 0 : n.rightArrowButton) || {}, R = (r == null ? void 0 : r.RightArrowIcon) || I, i = l, c = q(i);
  return /* @__PURE__ */ H(E, s({
    ref: w,
    className: m(c.root, b),
    ownerState: i
  }, C, {
    children: [/* @__PURE__ */ e(S, s({
      as: r == null ? void 0 : r.LeftArrowButton,
      size: "small",
      "aria-label": u,
      title: u,
      disabled: k,
      edge: "end",
      onClick: x
    }, a, {
      className: m(c.button, a.className),
      ownerState: s({}, i, a, {
        hidden: v
      }),
      children: A ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(g, {})
    })), h ? /* @__PURE__ */ e(_, {
      variant: "subtitle1",
      component: "span",
      children: h
    }) : /* @__PURE__ */ e(F, {
      className: c.spacer,
      ownerState: i
    }), /* @__PURE__ */ e(S, s({
      as: r == null ? void 0 : r.RightArrowButton,
      size: "small",
      "aria-label": f,
      title: f,
      edge: "start",
      disabled: P,
      onClick: L
    }, d, {
      className: m(c.button, d.className),
      ownerState: s({}, i, d, {
        hidden: B
      }),
      children: A ? /* @__PURE__ */ e(g, {}) : /* @__PURE__ */ e(R, {})
    }))]
  }));
});
export {
  et as PickersArrowSwitcher
};
