import { defineComponent as v, ref as V, watchEffect as _, createElementBlock as k, createCommentVNode as S, openBlock as w, Fragment as g, createVNode as a, unref as l, withCtx as n, withDirectives as y, createElementVNode as $, toDisplayString as h } from "vue";
import { a as u, n as m, f as C, h as I, b as L, L as U, T as B, v as E, w as T, x as D, U as H, H as N, j as A, k as O, O as p, l as j, o as z, _ as F } from "./index-CVEvAPNs.js";
import { u as P } from "./index-BFe8XjpO.js";
import { _ as q } from "./_description.vue_vue_type_script_setup_true_lang-COx4EYgl.js";
const G = /* @__PURE__ */ v({
  __name: "slider",
  props: {
    content: {},
    disabled: { type: Boolean }
  },
  setup(c) {
    const s = c;
    P(s.content, "slider", []);
    const i = V((s.content.slider || [new u()]).map((e) => ({ key: m(), slide: e })));
    _(() => {
      s.content.slider = i.value.map(({ slide: e }) => e);
    });
    function b(e) {
      i.value.splice(e, 1);
    }
    function f(e = i.value.length) {
      i.value.splice(e, 0, { key: m(), slide: new u() });
    }
    return (e, t) => e.content.slider ? (w(), k(g, { key: 0 }, [
      a(l(C), {
        modelValue: i.value,
        "onUpdate:modelValue": t[1] || (t[1] = (d) => i.value = d),
        disabled: e.disabled
      }, {
        default: n(({ index: d, item: o }) => [
          a(l(L), null, {
            media: n(() => [
              a(l(z), { disabled: e.disabled }, null, 8, ["disabled"])
            ]),
            default: n(() => [
              a(l(U), null, {
                header: n(() => [
                  a(l(N), null, {
                    default: n(() => [
                      $("span", null, "Slide #" + h(d + 1), 1),
                      a(l(A)),
                      a(l(O), {
                        destructive: "",
                        flat: "",
                        disabled: e.disabled,
                        icon: l(p),
                        tooltip: "Slide entfernen",
                        arrow: ""
                      }, {
                        default: n(() => [
                          a(l(j), {
                            "trailing-icon": l(p),
                            label: "Entfernen bestätigen",
                            onClick: (r) => b(d)
                          }, null, 8, ["trailing-icon", "onClick"])
                        ]),
                        _: 2
                      }, 1032, ["disabled", "icon"])
                    ]),
                    _: 2
                  }, 1024)
                ]),
                default: n(() => [
                  y(a(B, {
                    round: "",
                    cursor: !e.disabled,
                    disabled: e.disabled,
                    thumbnail: o.slide,
                    hero: ""
                  }, null, 8, ["cursor", "disabled", "thumbnail"]), [
                    [l(E)]
                  ]),
                  a(l(T), { arrow: "" }, {
                    default: n(() => [
                      a(l(D), {
                        label: `Slide #${d + 1} formatieren`,
                        icon: l(H),
                        modelValue: o.slide,
                        "onUpdate:modelValue": (r) => o.slide = r
                      }, null, 8, ["label", "icon", "modelValue", "onUpdate:modelValue"])
                    ]),
                    _: 2
                  }, 1024)
                ]),
                _: 2
              }, 1024)
            ]),
            _: 2
          }, 1024)
        ]),
        end: n(() => [
          a(l(I), {
            primary: "",
            disabled: e.disabled,
            label: "Slide hinzufügen",
            onClick: t[0] || (t[0] = (d) => f())
          }, null, 8, ["disabled"])
        ]),
        _: 1
      }, 8, ["modelValue", "disabled"]),
      a(l(q), {
        modelValue: e.content.description,
        "onUpdate:modelValue": t[2] || (t[2] = (d) => e.content.description = d),
        disabled: e.disabled
      }, null, 8, ["modelValue", "disabled"])
    ], 64)) : S("", !0);
  }
}), R = /* @__PURE__ */ F(G, [["__scopeId", "data-v-46186684"]]);
export {
  R as default
};
