import { j as e } from "../../../../../_virtual/jsx-runtime.js";
import { a as l } from "../../../../sdk/dist/shared/chunk-IIFTGWFZ.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-UU2MSQXY.js";
import "../../../../sdk/dist/shared/chunk-YBGPPF7T.js";
import "../../../../sdk/dist/shared/chunk-UMHXXXVP.js";
import "../../../../sdk/dist/shared/chunk-5N6MBJJ4.js";
import a from "../components/TextContent.js";
import { tx as o } from "../../../../style-system/dist/twind.js";
import { useBrickStyle as c } from "../hooks/use-brick-style.js";
import d from "../components/BrickRoot.js";
import { useBrickProps as p } from "../hooks/use-brick-props.js";
function k(s) {
  const { brick: i, editable: r } = s, t = p(s), n = c(i), m = Object.values(n);
  return /* @__PURE__ */ e.jsxs(
    d,
    {
      brick: i,
      editable: r,
      manifest: l,
      className: o(
        "flex relative overflow-hidden !flex-nowrap",
        t.imagePosition === "left" || t.imagePosition === "right" ? "flex-row" : "flex-col",
        m
      ),
      children: [
        /* @__PURE__ */ e.jsxs(
          "div",
          {
            className: o(
              "card-inner-wrapper",
              t.imagePosition === "top" ? "order-2" : t.imagePosition === "left" ? "order-last" : "order-1"
            ),
            children: [
              !t.noTitle && /* @__PURE__ */ e.jsx("div", { className: o("text-[120%] font-semibold z-auto my-4 mx-4"), children: /* @__PURE__ */ e.jsx(
                a,
                {
                  propPath: "title.content",
                  className: o("flex-1"),
                  brickId: i.id,
                  content: t.title,
                  rawContent: i.props.title,
                  editable: r,
                  inline: !0
                }
              ) }),
              t.imagePosition !== "middle" && /* @__PURE__ */ e.jsx("div", { className: o("z-auto p-4", !t.noTitle && "pt-0"), children: /* @__PURE__ */ e.jsx(
                a,
                {
                  propPath: "text.content",
                  className: o("flex-grow"),
                  brickId: i.id,
                  content: t.text,
                  rawContent: i.props.text,
                  editable: r
                }
              ) })
            ]
          }
        ),
        t.cardImage?.src && /* @__PURE__ */ e.jsx(
          "img",
          {
            className: o(
              " select-none pointer-events-none bg-transparent",
              t.cardImage.position ?? "object-center",
              t.cardImage.fit ?? "object-cover",
              t.imagePosition === "left" && "order-1",
              t.imagePosition === "right" && "order-last",
              t.imagePosition === "middle" && "order-2",
              t.imagePosition === "top" && "order-first",
              t.imagePosition === "bottom" && "order-last mt-auto",
              t.imagePosition === "left" || t.imagePosition === "right" ? "h-auto w-[clamp(100px,40%,400px)]" : "w-inherit h-[clamp(100px,50%,250px)]"
            ),
            src: t.cardImage.src,
            alt: t.cardImage.alt || "Card Image"
          }
        ),
        t.text && t.imagePosition === "middle" && /* @__PURE__ */ e.jsx("div", { className: o("z-auto p-4 order-last"), children: /* @__PURE__ */ e.jsx(
          a,
          {
            propPath: "text.content",
            className: o("flex-1"),
            brickId: i.id,
            content: t.text,
            rawContent: i.props.text,
            editable: r
          }
        ) })
      ]
    }
  );
}
export {
  k as default
};
//# sourceMappingURL=card.js.map
