import { j as t } from "../../../../../_virtual/jsx-runtime.js";
import { useBrickManifest as v } from "../../shared/hooks/use-brick-manifest.js";
import { useDraftHelpers as g } from "../../../../../use-page-data.js";
import { tx as c } from "../../../../style-system/dist/twind.js";
import { IoIosArrowBack as j, IoIosArrowUp as y, IoIosArrowForward as C, IoIosArrowDown as B } from "../../../../../node_modules/.pnpm/react-icons@5.3.0_react@18.3.0-canary-3d9b20132-20240124/node_modules/react-icons/io/index.js";
function k({ brick: o }) {
  const e = g(), f = v(o.type), l = e.canMoveTo(o.id, "previous"), m = e.canMoveTo(o.id, "next"), p = e.getParentBrick(o.id), s = !!p, u = p ? document.getElementById(p.id) : null, r = u && getComputedStyle(u).flexDirection || "row", d = s && l && r === "row" || !s && l, x = s && m && r === "row" || !s && m, w = s && l && r === "column", h = s && m && r === "column", a = f.isContainer ? 9 : 7, i = "absolute z-[9999] flex items-center justify-center h-5 w-5 rounded-full border border-white text-white bg-upstart-500 shadow-lg hover:(bg-upstart-700)";
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
    d && /* @__PURE__ */ t.jsx(
      "button",
      {
        type: "button",
        className: c(i, `top-1/2 -left-${a} transform -translate-y-1/2`),
        onClick: (n) => {
          n.stopPropagation(), e.moveBrick(o.id, "previous");
        },
        children: /* @__PURE__ */ t.jsx(j, { className: "w-3 h-3" })
      }
    ),
    w && /* @__PURE__ */ t.jsx(
      "button",
      {
        type: "button",
        className: c(i, `-top-${a} left-1/2 transform -translate-x-1/2`),
        onClick: (n) => {
          n.stopPropagation(), e.moveBrick(o.id, "previous");
        },
        children: /* @__PURE__ */ t.jsx(y, { className: "w-3 h-3" })
      }
    ),
    x && /* @__PURE__ */ t.jsx(
      "button",
      {
        type: "button",
        className: c(i, `top-1/2 -right-${a} transform -translate-y-1/2`),
        onClick: (n) => {
          n.stopPropagation(), e.moveBrick(o.id, "next");
        },
        children: /* @__PURE__ */ t.jsx(C, { className: "w-3 h-3" })
      }
    ),
    h && /* @__PURE__ */ t.jsx(
      "button",
      {
        type: "button",
        className: c(i, `-bottom-${a} left-1/2 transform -translate-x-1/2`),
        onClick: (n) => {
          n.stopPropagation(), e.moveBrick(o.id, "next");
        },
        children: /* @__PURE__ */ t.jsx(B, { className: "w-3 h-3" })
      }
    )
  ] });
}
export {
  k as default
};
//# sourceMappingURL=EditableBrickArrows.js.map
