"use client";
import { jsxs as t, jsx as o } from "react/jsx-runtime";
import { BuilderConfiguration as a } from "../../../config/builder.config.js";
import { unselectBlock as m } from "../../../store/builder-slice.js";
import { getSelectedBlock as p } from "../../../../../../store/selectors.js";
import { useAppDispatch as c } from "../../../hooks/use-app-dispatch.js";
import { useAppSelector as n } from "../../../hooks/use-app-selector.js";
import { classNames as f } from "../../../../../../utils.js";
import { FiChevronLeft as d } from "../../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/fi/index.js";
import { BlockControlPanel as h } from "./block-control-panel.js";
import { BlockNavigation as u } from "./block-navigation.js";
import b from "../../icons/collapse-shape.js";
import "react";
import "../../../store/theme-slice.js";
import "../../../../../../_virtual/cjs.js";
import { useAction as k } from "../../../hooks/use-action.js";
const E = () => {
  var r;
  const { isLeftPanelOpen: l } = k(), e = n(p), i = c(), s = () => {
    i(m());
  };
  return /* @__PURE__ */ t(
    "div",
    {
      className: f(
        "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(d, { 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(h, { type: e.type }, e.id) : /* @__PURE__ */ o(u, {}),
          /* @__PURE__ */ o(b, {})
        ] })
      ]
    }
  );
};
export {
  E as LeftPanel
};
//# sourceMappingURL=left-panel.js.map
