"use client";
import { jsxs as t, jsx as o } from "react/jsx-runtime";
import { BuilderConfiguration as a } from "../../../config/builder.config.js";
import { useActionContext as m } from "../../../contexts/action-context.js";
import { unselectBlock as c } from "../../../store/builder-slice.js";
import { getSelectedBlock as n } from "../../../../../../store/selectors.js";
import { useAppDispatch as p } from "../../../hooks/use-app-dispatch.js";
import { useAppSelector as f } from "../../../hooks/use-app-selector.js";
import { classNames as d } from "../../../utils/index.js";
import { FiChevronLeft as h } from "../../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/fi/index.js";
import { BlockControlPanel as u } from "./block-control-panel.js";
import { BlockNavigation as b } from "./block-navigation.js";
import x from "../../icons/collapse-shape.js";
const S = () => {
  var r;
  const { isLeftPanelOpen: l } = m(), e = f(n), i = p(), s = () => {
    i(c());
  };
  return /* @__PURE__ */ t(
    "div",
    {
      className: d(
        "absolute z-30 h-full w-[290px] border-r bg-white shadow-sm transition-all duration-300",
        l ? "left-0" : "left-[-290px]"
      ),
      children: [
        e && /* @__PURE__ */ t(
          "button",
          {
            className: "relative flex h-14 w-[290px] items-center justify-center border-b bg-white",
            onClick: s,
            children: [
              /* @__PURE__ */ o(h, { size: 20, className: "absolute left-2 top-1/2 -translate-y-1/2" }),
              /* @__PURE__ */ t("span", { className: "text-base font-semibold", children: [
                "Edit ",
                (r = a.getBlock(e.type)) == null ? void 0 : r.label
              ] })
            ]
          }
        ),
        /* @__PURE__ */ t("div", { className: "relative h-full", children: [
          e ? /* @__PURE__ */ o(u, { type: e.type }, e.id) : /* @__PURE__ */ o(b, {}),
          /* @__PURE__ */ o(x, {})
        ] })
      ]
    }
  );
};
export {
  S as LeftPanel
};
//# sourceMappingURL=left-panel.js.map
