import { registerChaiBlock as p } from "@chaibuilder/runtime";
import { j as n } from "./jsx-runtime-Sp0orL4X.js";
import * as f from "react";
import { c as C, o as m, f as I, v as E, b, T as N, y as L, u as R, r as j, d as S, q as D, e as g, h as V, G as U, g as B, S as O } from "./iconBase-zweRWSz0.js";
import G from "i18next";
import { ButtonIcon as H, CodeIcon as W, HeadingIcon as X, TextIcon as Y, CursorTextIcon as Z, Link1Icon as J, ImageIcon as A, RowsIcon as K, ColumnsIcon as Q, SketchLogoIcon as ee, VideoIcon as te, DividerHorizontalIcon as le, MoonIcon as oe, SpaceBetweenVerticallyIcon as z, GroupIcon as se, InputIcon as q, RadiobuttonIcon as ae, DropdownMenuIcon as ne, CheckboxIcon as re } from "@radix-ui/react-icons";
import { isNull as ie, isEmpty as w, get as v, pick as ce, omit as de, map as M } from "lodash-es";
import "clsx";
import "tailwind-merge";
const ue = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ n.jsx("div", { className: C("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ n.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ n.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, _ = ue, o = (e) => G.t(e), pe = (e) => {
  const { blockProps: l, inBuilder: t, backgroundImage: a, children: s, tag: r = "div", styles: i } = e;
  let d = s;
  s || (d = /* @__PURE__ */ n.jsx(_, { inBuilder: t }));
  let c = {};
  return a && (c = { backgroundImage: `url(${a})` }), f.createElement(r, { ...l, ...i, style: c }, d);
}, be = {
  type: "Box",
  label: o("web_blocks.box"),
  category: "core",
  group: "basic",
  props: {
    styles: m({ default: "" }),
    tag: I({
      title: o("web_blocks.tag"),
      default: "div",
      options: [
        { value: "div", title: o("web_blocks.div") },
        { value: "header", title: o("web_blocks.header") },
        { value: "footer", title: o("web_blocks.footer") },
        { value: "section", title: o("web_blocks.section") },
        { value: "article", title: o("web_blocks.article") },
        { value: "aside", title: o("web_blocks.aside") },
        { value: "main", title: o("web_blocks.main") },
        { value: "nav", title: o("web_blocks.nav") },
        { value: "figure", title: o("web_blocks.figure") },
        { value: "details", title: o("web_blocks.details") },
        { value: "summary", title: o("web_blocks.summary") },
        { value: "dialog", title: o("web_blocks.dialog") },
        { value: "strike", title: o("web_blocks.strike") },
        { value: "caption", title: o("web_blocks.caption") },
        { value: "legend", title: o("web_blocks.legend") },
        { value: "figcaption", title: o("web_blocks.figcaption") },
        { value: "mark", title: o("web_blocks.mark") }
      ]
    }),
    backgroundImage: E({ title: o("web_blocks.background_image") })
  },
  canAcceptBlock: () => !0
}, me = (e) => {
  const { blockProps: l, iconSize: t, icon: a, content: s, iconPos: r, styles: i, children: d } = e, c = a, u = d || /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
    /* @__PURE__ */ n.jsx("span", { "data-ai-key": "content", children: s }),
    c && /* @__PURE__ */ n.jsx(
      "div",
      {
        style: { width: t + "px" },
        className: r + " " + (r === "order-first" ? "mr-2" : "ml-2") || "",
        dangerouslySetInnerHTML: { __html: c }
      }
    )
  ] });
  return f.createElement(
    "button",
    {
      ...l,
      ...i,
      type: "button"
    },
    u
  );
}, fe = {
  type: "Button",
  label: o("web_blocks.button"),
  category: "core",
  icon: H,
  group: "basic",
  props: {
    content: b({ title: o("web_blocks.label"), default: o("web_blocks.default") }),
    styles: m({ default: "text-white bg-primary px-4 py-2 rounded flex items-center" }),
    icon: N({ title: o("web_blocks.icon"), default: "" }),
    iconSize: L({ title: o("web_blocks.icon_size"), default: 24 }),
    iconPos: I({
      title: o("web_blocks.icon_position"),
      default: "order-last",
      options: [
        { title: o("web_blocks.start"), value: "order-first" },
        { title: o("web_blocks.end"), value: "order-last" }
      ]
    })
  }
}, he = (e) => {
  const { blockProps: l, styles: t, htmlCode: a, inBuilder: s } = e;
  return s ? /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
    s ? /* @__PURE__ */ n.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
    f.createElement("div", {
      ...t,
      dangerouslySetInnerHTML: { __html: a.replace(/<script.*?>.*?<\/script>/g, "") }
    })
  ] }) : f.createElement("div", {
    ...l,
    ...t,
    dangerouslySetInnerHTML: { __html: a }
  });
}, ye = {
  type: "CustomHTML",
  label: o("web_blocks.custom_html"),
  category: "core",
  icon: W,
  group: "advanced",
  props: {
    styles: m({ default: "" }),
    htmlCode: R({
      title: o("web_blocks.html_code"),
      default: "<div><p>" + o("web_blocks.default_snippet") + "</p></div>",
      placeholder: o("web_blocks.placeholder")
    })
  },
  canAcceptBlock: () => !1
}, ge = f.memo(
  (e) => {
    const { blockProps: l, styles: t } = e;
    return f.createElement("div", { ...l, ...t });
  }
), ke = {
  type: "EmptyBox",
  label: o("web_blocks.empty_box"),
  category: "core",
  group: "basic",
  props: {
    styles: m({ default: "" })
  }
}, we = (e) => {
  const { blockProps: l, styles: t, content: a, level: s = "h1", children: r = null } = e;
  return r ? f.createElement(s, { ...t, ...l }, r) : f.createElement(s, {
    ...t,
    ...l,
    "data-ai-key": "content",
    "data-ai-type": "html",
    dangerouslySetInnerHTML: { __html: a }
  });
}, _e = {
  type: "Heading",
  label: o("web_blocks.heading"),
  category: "core",
  icon: X,
  group: "typography",
  props: {
    level: I({
      title: "Level",
      default: "h1",
      binding: !1,
      options: [
        { value: "h1", title: "h1" },
        { value: "h2", title: "h2" },
        { value: "h3", title: "h3" },
        { value: "h4", title: "h4" },
        { value: "h5", title: "h5" },
        { value: "h6", title: "h6" }
      ]
    }),
    styles: m({ default: "text-3xl" }),
    content: j({ title: "Content", default: "Heading goes here" })
  },
  canAcceptBlock: (e) => e === "Span" || e === "Text"
}, xe = (e) => {
  const { blockProps: l, styles: t, content: a } = e;
  return ie(e.children) ? f.createElement("p", {
    ...t,
    ...l,
    "data-ai-key": "content",
    "data-ai-type": "html",
    dangerouslySetInnerHTML: { __html: a }
  }) : f.createElement("p", { ...t, ...l }, e.children);
}, ve = {
  type: "Paragraph",
  label: o("web_blocks.paragraph"),
  category: "core",
  icon: Y,
  group: "typography",
  props: {
    styles: m({ default: "" }),
    content: j({
      title: o("web_blocks.content"),
      default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."
    })
  },
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
}, Ie = (e) => {
  const { blockProps: l, styles: t, content: a, children: s = null, tag: r } = e;
  return s ? f.createElement("span", { ...t, ...l }, s) : f.createElement(r || "span", {
    ...t,
    ...l,
    "data-ai-key": "content",
    dangerouslySetInnerHTML: { __html: a }
  });
}, Be = {
  type: "Span",
  label: o("web_blocks.span"),
  category: "core",
  group: "typography",
  props: {
    styles: m({ default: "" }),
    content: j({ title: o("web_blocks.content"), default: "" })
  },
  canAcceptBlock: () => !0
}, Le = (e) => {
  const { blockProps: l, content: t, styles: a } = e;
  return /* @__PURE__ */ n.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ n.jsx(
    "div",
    {
      "data-ai-key": "content",
      "data-ai-type": "richtext",
      ...l,
      ...a,
      dangerouslySetInnerHTML: { __html: t }
    }
  ) });
}, je = {
  type: "RichText",
  label: o("web_blocks.richtext"),
  category: "core",
  icon: Z,
  group: "typography",
  props: {
    styles: m({ default: "" }),
    content: S({
      title: o("web_blocks.content"),
      default: "<p>This is a rich text block. You can add text, and other content here.</p>"
    })
  }
}, Ce = (e) => {
  const { blockProps: l, link: t, children: a, styles: s, inBuilder: r, content: i } = e;
  return !a && w(s == null ? void 0 : s.className) && w(i) ? /* @__PURE__ */ n.jsx(_, { inBuilder: r }) : r ? a ? /* @__PURE__ */ n.jsx("span", { ...l, ...s, children: a }) : f.createElement("span", {
    ...l,
    ...s,
    dangerouslySetInnerHTML: { __html: i }
  }) : a ? /* @__PURE__ */ n.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...s, children: a }) : f.createElement("a", {
    ...l,
    ...s,
    "data-ai-key": "content",
    href: (t == null ? void 0 : t.href) || "#",
    target: (t == null ? void 0 : t.target) || "_self",
    dangerouslySetInnerHTML: { __html: i }
  });
}, Se = {
  type: "Link",
  label: o("web_blocks.link"),
  category: "core",
  icon: J,
  group: "basic",
  props: {
    styles: m({ default: "" }),
    content: b({ title: o("web_blocks.content"), default: "" }),
    link: D({
      title: o("web_blocks.link"),
      default: { type: "page", target: "_self", href: "#" }
    })
  },
  canAcceptBlock: (e) => e !== "Link"
}, F = (e, ...l) => ({
  ...e,
  className: C(e.className, ...l)
}), Me = (e) => {
  const { blockProps: l, children: t, styles: a, inBuilder: s, content: r, href: i } = e, { hrefType: d, autoplay: c, maxWidth: u, backdropColor: y, galleryName: h } = e, k = F(a, "cb-lightbox");
  if (!t && w(a == null ? void 0 : a.className) && w(r))
    return /* @__PURE__ */ n.jsx(_, { inBuilder: s });
  if (s)
    return t ? /* @__PURE__ */ n.jsx("span", { ...l, ...k, children: t }) : f.createElement("span", {
      ...l,
      ...k,
      dangerouslySetInnerHTML: { __html: r }
    });
  const x = {};
  return x["data-vbtype"] = d, c && (x["data-autoplay"] = "true"), u && (x["data-maxwidth"] = u + "px"), y && (x["data-overlay"] = y), h && (x["data-gall"] = h), t ? /* @__PURE__ */ n.jsx("a", { ...x, href: i || "#/", ...l, ...k, children: t }) : f.createElement("a", {
    ...l,
    ...k,
    ...x,
    href: i || "#",
    dangerouslySetInnerHTML: { __html: r }
  });
}, Ee = {
  type: "LightBoxLink",
  label: o("web_blocks.lightbox_link"),
  category: "core",
  icon: A,
  group: "basic",
  props: {
    styles: m({ default: "" }),
    content: b({ title: o("web_blocks.content"), default: "Link text or drop blocks inside" }),
    href: b({ title: o("web_blocks.href"), default: "" }),
    hrefType: I({
      title: o("web_blocks.type"),
      default: "video",
      options: [
        { value: "video", title: o("web_blocks.video") },
        { value: "iframe", title: o("web_blocks.iframe") },
        { value: "inline", title: o("web_blocks.inline") },
        { value: "ajax", title: o("web_blocks.ajax") }
      ]
    }),
    autoplay: g({ title: o("web_blocks.autoplay"), default: !1 }),
    maxWidth: L({ title: o("web_blocks.max_width"), default: "" }),
    backdropColor: b({ title: o("web_blocks.backdrop_color"), default: "" }),
    galleryName: b({ title: o("web_blocks.gallery_name"), default: "" })
  },
  canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
}, Ne = (e) => {
  const { blockProps: l, children: t, listType: a, styles: s, tag: r, inBuilder: i } = e, d = C(v(s, "className", ""), a);
  return !t && w(s == null ? void 0 : s.className) ? /* @__PURE__ */ n.jsx(_, { inBuilder: i }) : f.createElement(
    r || (a === "list-decimal" ? "ol" : "ul"),
    { ...l, ...s, className: d },
    t
  );
}, Pe = {
  type: "List",
  label: o("web_blocks.list"),
  icon: K,
  category: "core",
  group: "basic",
  props: {
    styles: m({ default: "" }),
    listType: I({
      title: o("web_blocks.list_type"),
      default: "list-none",
      options: [
        { value: "list-none", title: o("web_blocks.none") },
        { value: "list-disc", title: o("web_blocks.disc") },
        { value: "list-decimal", title: o("web_blocks.number") }
      ]
    })
  },
  canAcceptBlock: (e) => e === "ListItem",
  blocks: [
    { _type: "List", _id: "a", listType: "list-none", styles: "#styles:," },
    {
      _type: "ListItem",
      _id: "b",
      _parent: "a",
      styles: "#styles:,",
      content: "Item 1"
    },
    {
      _type: "ListItem",
      _id: "c",
      _parent: "a",
      styles: "#styles:,",
      content: "Item 2"
    },
    {
      _type: "ListItem",
      _id: "d",
      _parent: "a",
      styles: "#styles:,",
      content: "Item 3"
    }
  ]
}, $e = (e) => {
  const { blockProps: l, content: t, styles: a, children: s, tag: r } = e;
  return s ? f.createElement(r || "li", { ...a, ...l }, s) : f.createElement(r || "li", {
    ...a,
    ...l,
    "data-ai-key": "content",
    dangerouslySetInnerHTML: { __html: t }
  });
}, Te = {
  type: "ListItem",
  label: o("web_blocks.listitem"),
  icon: Q,
  category: "core",
  group: "basic",
  props: {
    styles: m({ default: "" }),
    content: j({ title: o("web_blocks.content"), default: "List item" })
  },
  canAcceptBlock: (e) => e !== "ListItem",
  canBeNested: (e) => e === "List"
}, Re = (e) => {
  const { blockProps: l, icon: t, styles: a, width: s, inBuilder: r, height: i } = e, d = F(a, C(s ? `w-[${s}px]` : "", i ? `h-[${i}px]` : ""));
  if (w(t))
    return /* @__PURE__ */ n.jsx(_, { inBuilder: r, className: "h-8 w-14" });
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
  return f.createElement("span", {
    ...l,
    ...d,
    dangerouslySetInnerHTML: { __html: c }
  });
}, He = {
  type: "Icon",
  label: o("web_blocks.icon"),
  category: "core",
  icon: ee,
  group: "media",
  props: {
    styles: m({ default: "text-black" }),
    icon: N({
      title: o("web_blocks.icon"),
      default: '<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'
    }),
    width: L({ title: o("web_blocks.width"), default: "" }),
    height: L({ title: o("web_blocks.height"), default: "" })
  }
}, Ae = (e) => {
  const { blockProps: l, image: t, styles: a, alt: s, height: r, width: i } = e;
  return w(t) ? /* @__PURE__ */ n.jsx(_, { className: "h-36" }) : f.createElement("img", {
    ...l,
    ...a,
    src: t,
    alt: s,
    loading: "lazy",
    height: r,
    width: i
  });
}, ze = {
  type: "Image",
  label: o("web_blocks.image"),
  category: "core",
  icon: A,
  group: "media",
  props: {
    styles: m({ default: "" }),
    image: E({
      title: "Image",
      default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
    }),
    alt: b({ title: o("web_blocks.alt"), default: "" }),
    width: b({ title: o("web_blocks.width"), default: "" }),
    height: b({ title: o("web_blocks.height"), default: "" })
  }
}, P = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, $ = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, T = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, qe = (e) => {
  if (P.test(e)) {
    const l = e.match(P);
    return l ? `https://www.youtube.com/embed/${l[4]}` : e;
  }
  if ($.test(e)) {
    const l = e.match($);
    return l ? `https://player.vimeo.com/video/${l[3]}` : e;
  }
  if (T.test(e)) {
    const l = e.match(T);
    return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
  }
  return null;
}, Fe = f.memo(
  (e) => {
    const { blockProps: l, inBuilder: t, styles: a, url: s, controls: r } = e, i = v(r, "autoPlay", !1), d = v(r, "controls", !1), c = i || v(r, "muted", !0), u = v(r, "loop", !1);
    if (w(s))
      return /* @__PURE__ */ n.jsx(_, { inBuilder: t, className: "h-36" });
    let y = qe(s), h = null;
    if (y) {
      if (!w(y)) {
        const k = [];
        k.push(`autoplay=${i ? 1 : 0}`), k.push(`controls=${r ? 1 : 0}`), k.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), k.push(`loop=${u ? 1 : 0}`), y = `${y}?${k.join("&")}`;
      }
      h = f.createElement("iframe", {
        ...l,
        className: "absolute inset-0 w-full h-full",
        src: y,
        allow: t ? "" : "autoplay *; fullscreen *",
        allowFullScreen: !0,
        frameBorder: 0
      });
    } else
      h = f.createElement("video", {
        ...l,
        className: "absolute inset-0 w-full h-full",
        src: s,
        controls: d,
        muted: c,
        autoPlay: t ? !1 : i,
        loop: u
      });
    return /* @__PURE__ */ n.jsx("div", { ...ce(a, ["className"]), children: /* @__PURE__ */ n.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
      t ? /* @__PURE__ */ n.jsx("div", { ...l, ...de(a, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
      h
    ] }) });
  }
), De = {
  type: "Video",
  label: o("web_blocks.video"),
  category: "core",
  icon: te,
  group: "media",
  props: {
    styles: m({ default: "" }),
    url: b({
      title: "Video URL",
      default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
    }),
    controls: V({
      title: "Controls",
      properties: {
        autoPlay: g({ title: "Autoplay", default: !0 }),
        controls: g({ title: "Show controls", default: !1 }),
        loop: g({ title: "Loop", default: !1 }),
        muted: g({ title: "Muted", default: !0 })
      }
    })
  }
};
function Ve(e) {
  return U({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 32 32" }, child: [{ tag: "path", attr: { d: "M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z" }, child: [] }] })(e);
}
const Ue = (e) => {
  const { scripts: l, inBuilder: t, blockProps: a } = e;
  return t ? /* @__PURE__ */ n.jsx("div", { ...a }) : /* @__PURE__ */ n.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
}, Oe = {
  type: "CustomScript",
  label: o("web_blocks.custom_script"),
  category: "core",
  icon: Ve,
  group: "advanced",
  props: {
    scripts: R({
      title: "Script",
      default: "",
      placeholder: "<script>console.log('Hello, world!');<\/script>"
    })
  },
  canAcceptBlock: () => !1
}, Ge = (e) => {
  const { blockProps: l, styles: t } = e;
  return f.createElement("hr", { ...t, ...l });
}, We = {
  type: "Divider",
  label: o("web_blocks.divider"),
  category: "core",
  icon: le,
  group: "basic",
  props: {
    styles: m({ default: "bg-gray-900 h-0.5 py-2 my-1" })
  }
}, Xe = () => null, Ye = {
  type: "Dark Mode",
  label: o("web_blocks.dark_mode"),
  category: "core",
  icon: oe,
  group: "advanced",
  props: {},
  blocks: () => [
    { _id: "ultqCh", _type: "Span", tag: "span", styles: "#styles:,", _name: "Dark Mode Switcher" },
    {
      _id: "vroabi",
      _parent: "ultqCh",
      _type: "Button",
      // @ts-ignore
      styles_attrs: { type: "button", "x-on:click": "darkMode = 'dark'", "x-show": "darkMode === 'light'" },
      styles: "#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",
      _name: "Dark Mode Btn"
    },
    {
      _id: "eweibk",
      _parent: "vroabi",
      _type: "Span",
      tag: "span",
      styles: "#styles:,group inline-flex shrink-0 justify-center items-center size-9"
    },
    {
      _id: "nltBrv",
      _parent: "eweibk",
      _type: "Icon",
      styles: "#styles:, shrink-0 size-4",
      icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"
    },
    {
      _id: "gesydi",
      _parent: "ultqCh",
      _type: "Button",
      // @ts-ignore
      styles_attrs: { type: "button", "x-on:click": "darkMode = 'light'", "x-show": "darkMode === 'dark'" },
      styles: "#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",
      _name: "Light Mode Btn"
    },
    {
      _id: "sgbhDo",
      _parent: "gesydi",
      _type: "Span",
      tag: "span",
      styles: "#styles:,group inline-flex shrink-0 justify-center items-center size-9"
    },
    {
      _id: "AdDwBC",
      _parent: "sgbhDo",
      _type: "Icon",
      styles: "#styles:, shrink-0 size-4",
      icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"
    }
  ]
}, Ze = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ n.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Je = {
  type: "Text",
  label: o("web_blocks.text"),
  hidden: !0,
  category: "core",
  group: "typography",
  icon: z,
  props: {
    content: j({ title: o("web_blocks.content"), defaultValue: "" })
  }
}, Ke = (e) => {
  const { blockProps: l, backgroundImage: t, children: a, styles: s } = e;
  let r = {};
  return t && (r = { backgroundImage: `url(${t})` }), f.createElement("div", { ...l, ...s, style: r }, a);
}, Qe = {
  type: "Body",
  label: "Body",
  category: "core",
  group: "basic",
  hidden: !0,
  props: {
    styles: m({ default: "font-body antialiased" }),
    backgroundImage: E({ title: "Background Image" })
  },
  canAcceptBlock: () => !0,
  canDelete: () => !1,
  canMove: () => !1,
  canDuplicate: () => !1
}, et = (e) => {
  const { blockProps: l, styles: t } = e;
  return f.createElement("br", { ...l, ...t });
}, tt = {
  type: "LineBreak",
  label: "Line Break",
  category: "core",
  group: "basic",
  hidden: !0,
  icon: z,
  props: {
    styles: m({ default: "" })
  }
}, lt = (e) => {
  const { blockProps: l, errorMessage: t, name: a, _type: s, successMessage: r, action: i, styles: d, children: c } = e;
  let u = c;
  c || (u = /* @__PURE__ */ n.jsx(_, {}));
  const y = {
    "x-data": "useForm",
    "x-on:submit.prevent": "post"
  }, h = {
    "x-html": "formResponse",
    ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
  };
  return /* @__PURE__ */ n.jsxs(
    "form",
    {
      ...y,
      "data-error": t,
      "data-success": r,
      method: "post",
      action: i,
      ...l,
      ...d,
      children: [
        /* @__PURE__ */ n.jsx("div", { ...h }),
        /* @__PURE__ */ n.jsx("input", { name: "formname", type: "hidden", value: a || s }),
        u
      ]
    }
  );
}, ot = {
  type: "Form",
  label: "Form",
  category: "core",
  icon: se,
  group: "form",
  props: {
    styles: m({ default: "" }),
    action: b({
      title: "Submit URL",
      default: "/api/form/submit"
    }),
    errorMessage: S({
      title: "Error Message",
      default: "Something went wrong. Please try again"
    }),
    successMessage: S({
      title: "Success Message",
      default: "Thank you for your submission."
    })
  },
  canAcceptBlock: () => !0
}, st = (e) => {
  const { blockProps: l, inBuilder: t, label: a, styles: s, inputStyles: r, icon: i, iconPos: d } = e, c = B(), u = {
    "x-bind:disabled": "formLoading"
  };
  return /* @__PURE__ */ n.jsxs(
    "button",
    {
      id: c,
      ...u,
      ...r,
      ...s,
      ...l || {},
      type: t ? "button" : "submit",
      children: [
        a,
        i && /* @__PURE__ */ n.jsx("span", { className: d, dangerouslySetInnerHTML: { __html: i } })
      ]
    }
  );
}, at = {
  type: "FormButton",
  label: "Submit Button",
  category: "core",
  icon: H,
  group: "form",
  props: {
    label: b({ title: "Label", default: "Submit" }),
    styles: m({
      default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
    }),
    icon: N({ title: "Icon", default: "" }),
    iconPos: I({
      title: "Icon Position",
      default: "order-last",
      options: [
        { title: "Start", value: "order-first" },
        { title: "End", value: "order-last" }
      ]
    })
  }
}, nt = (e) => {
  const {
    blockProps: l,
    label: t,
    placeholder: a,
    styles: s,
    inputStyles: r,
    showLabel: i,
    required: d,
    inputType: c = "text",
    inBuilder: u,
    fieldName: y
  } = e, h = B();
  return !i || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ n.jsx(
    "input",
    {
      id: h,
      name: y,
      readOnly: u,
      ...l,
      ...r,
      ...s,
      type: c,
      placeholder: a,
      required: d
    }
  )) : /* @__PURE__ */ n.jsxs("div", { ...s, ...l, children: [
    i && /* @__PURE__ */ n.jsx("label", { htmlFor: h, children: t }),
    /* @__PURE__ */ n.jsx(
      "input",
      {
        name: y,
        readOnly: u,
        ...r,
        id: h,
        type: c,
        placeholder: a,
        required: d
      }
    )
  ] });
}, rt = {
  type: "Input",
  label: "Input",
  category: "core",
  icon: q,
  group: "form",
  props: {
    styles: m({ default: "" }),
    fieldName: b({ title: "Field Name", default: "input" }),
    inputType: I({
      title: "Type",
      options: M(
        ["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
        (e) => ({
          value: e,
          title: e
        })
      ),
      default: "text"
    }),
    value: b({ title: "Value", default: "" }),
    showLabel: g({ title: "Show label", default: !0 }),
    inputStyles: m({ default: "w-full p-1" }),
    label: b({ title: "Label", default: "Label" }),
    placeholder: b({
      title: "Placeholder",
      default: "Placeholder"
    }),
    required: g({ title: "Required", default: !1 })
  }
}, it = (e) => {
  const { blockProps: l, fieldName: t, label: a, styles: s, inputStyles: r, checked: i, required: d, showLabel: c = !0 } = e, u = B();
  return c ? /* @__PURE__ */ n.jsxs("div", { ...s, ...l, children: [
    /* @__PURE__ */ n.jsx("input", { ...r, name: t, id: u, type: "radio", required: d, defaultChecked: i }),
    a && /* @__PURE__ */ n.jsx("label", { htmlFor: u, children: a })
  ] }) : /* @__PURE__ */ n.jsx(
    "input",
    {
      id: u,
      ...l,
      ...r,
      ...s,
      type: "radio",
      required: d,
      checked: i,
      name: t
    }
  );
}, ct = {
  type: "Radio",
  label: "Radio",
  category: "core",
  icon: ae,
  group: "form",
  props: {
    styles: m({ default: "flex items-center w-max gap-x-2" }),
    fieldName: b({ title: "Field Name", default: "radio" }),
    label: b({ title: "Label", default: "Label" }),
    checked: g({ title: "Checked", default: !1 }),
    required: g({ title: "Required", default: !1 })
  }
}, dt = (e) => {
  const {
    blockProps: l,
    fieldName: t,
    label: a,
    placeholder: s,
    styles: r,
    inputStyles: i,
    required: d,
    showLabel: c,
    _multiple: u = !1
  } = e, y = B();
  return c ? /* @__PURE__ */ n.jsxs("div", { ...r, children: [
    c && /* @__PURE__ */ n.jsx("label", { htmlFor: y, children: a }),
    /* @__PURE__ */ n.jsxs("select", { ...i, id: y, required: d, multiple: u, name: t, children: [
      /* @__PURE__ */ n.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: s }),
      M(e.options, (h) => /* @__PURE__ */ n.jsx(
        "option",
        {
          selected: v(h, "selected", !1),
          value: h.value,
          dangerouslySetInnerHTML: { __html: h.label }
        },
        h.value
      ))
    ] })
  ] }) : /* @__PURE__ */ n.jsxs(
    "select",
    {
      id: y,
      ...r,
      ...l,
      required: d,
      multiple: u,
      name: t,
      children: [
        /* @__PURE__ */ n.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: s }),
        M(e.options, (h) => /* @__PURE__ */ n.jsx(
          "option",
          {
            selected: v(h, "selected", !1),
            value: h.value,
            dangerouslySetInnerHTML: { __html: h.label }
          },
          h.value
        ))
      ]
    }
  );
}, ut = {
  type: "Select",
  label: "Select",
  category: "core",
  icon: ne,
  group: "form",
  props: {
    styles: m({ default: "" }),
    fieldName: b({ title: "Field Name", default: "select" }),
    showLabel: g({ title: "Show label", default: !0 }),
    inputStyles: m({ default: "w-full p-1" }),
    label: b({ title: "Label", default: "Label" }),
    placeholder: b({
      title: "Placeholder",
      default: "Placeholder"
    }),
    required: g({ title: "Required", default: !1 }),
    _multiple: g({ title: "Multiple Choice", default: !1 }),
    options: O({
      title: "Options",
      itemProperties: {
        label: b({ title: "Label", default: "" }),
        value: b({ title: "Value", default: "" })
      }
    })
  }
}, pt = (e) => {
  const { blockProps: l, fieldName: t, label: a, placeholder: s, styles: r, inputStyles: i, _rows: d, showLabel: c } = e, u = B();
  return c ? /* @__PURE__ */ n.jsxs("div", { ...r, ...l, children: [
    c && /* @__PURE__ */ n.jsx("label", { htmlFor: u, children: a }),
    /* @__PURE__ */ n.jsx("textarea", { name: t, ...i, id: u, placeholder: s, rows: d })
  ] }) : /* @__PURE__ */ n.jsx(
    "textarea",
    {
      id: u,
      name: t,
      ...l,
      ...i,
      ...r,
      placeholder: s,
      rows: d
    }
  );
}, bt = {
  type: "TextArea",
  label: "TextArea",
  category: "core",
  icon: q,
  group: "form",
  props: {
    fieldName: b({ title: "Field Name", default: "textarea" }),
    showLabel: g({ title: "Show label", default: !0 }),
    styles: m({ default: "" }),
    inputStyles: m({ default: "w-full p-1" }),
    label: b({ title: "Label", default: "Label" }),
    placeholder: b({
      title: "Placeholder",
      default: "Placeholder"
    }),
    _rows: L({ title: "Rows", default: 3 })
  }
}, mt = (e) => {
  const { blockProps: l, fieldName: t, label: a, styles: s, inputStyles: r, required: i, checked: d, showLabel: c = !0 } = e, u = B();
  return c ? /* @__PURE__ */ n.jsxs("div", { ...s, ...l, children: [
    /* @__PURE__ */ n.jsx(
      "input",
      {
        ...r,
        name: t,
        id: u,
        type: "checkbox",
        required: i,
        defaultChecked: d
      }
    ),
    a && a !== "Label" && /* @__PURE__ */ n.jsx("label", { htmlFor: u, children: a })
  ] }) : /* @__PURE__ */ n.jsx(
    "input",
    {
      id: u,
      ...l,
      ...r,
      ...s,
      type: "checkbox",
      required: i,
      name: t
    }
  );
}, ft = {
  type: "Checkbox",
  label: "Checkbox",
  category: "core",
  icon: re,
  group: "form",
  props: {
    fieldName: b({ title: "Field Name", default: "checkbox" }),
    styles: m({ default: "flex items-center gap-x-2" }),
    label: b({ title: "Label", default: "Label" }),
    checked: g({ title: "Checked", default: !1 }),
    required: g({ title: "Required", default: !1 })
  }
}, It = () => {
  p(pe, be), p(ge, ke), p(me, fe), p(we, _e), p(xe, ve), p(Ie, Be), p(Le, je), p(Ce, Se), p(Me, Ee), p(Ne, Pe), p($e, Te), p(Re, He), p(Ae, ze), p(Fe, De), p(he, ye), p(Ze, Je), p(lt, ot), p(st, at), p(nt, rt), p(mt, ft), p(it, ct), p(dt, ut), p(pt, bt), p(et, tt), p(Ke, Qe), p(Ue, Oe), p(Ge, We), p(Xe, Ye);
};
export {
  It as loadWebBlocks
};
