import { defineComponent as h, createElementBlock as t, openBlock as e, Fragment as r, createElementVNode as l, createBlock as m, createCommentVNode as i, renderList as u, toDisplayString as o, createTextVNode as d, unref as p, withCtx as g } from "vue";
import { ProgressIndicator as b } from "@ontospreaded/js-core";
const y = { class: "alert alert-danger" }, k = { key: 0 }, f = { class: "mb-1" }, V = {
  key: 1,
  class: "mb-1"
}, w = {
  key: 2,
  class: "mb-0"
}, A = { key: 1 }, O = { key: 2 }, v = /* @__PURE__ */ h({
  __name: "AddictOVocab",
  props: {
    data: {},
    release: {},
    selectedSubStep: {}
  },
  emits: ["release-control"],
  setup(a) {
    return (T, n) => (e(), t(r, null, [
      n[2] || (n[2] = l("h3", null, "Publishing the release", -1)),
      a.release.state === "waiting-for-user" && a.data?.errors?.length > 0 ? (e(), t(r, { key: 0 }, [
        n[0] || (n[0] = l("div", { class: "alert alert-danger" }, [
          l("h4", null, "Errors occurred while publishing to AddictOVocab"),
          l("p", null, "Some API calls failed. Please review the errors below.")
        ], -1)),
        (e(!0), t(r, null, u(a.data.errors, (s) => (e(), t("div", y, [
          s.type === "http-error" ? (e(), t(r, { key: 0 }, [
            s.term ? (e(), t("h6", k, "Term: " + o(s.term), 1)) : i("", !0),
            l("p", f, [
              l("strong", null, "HTTP " + o(s.status_code) + ":", 1),
              d(" " + o(s.response?.["hydra:title"] ?? "Request failed"), 1)
            ]),
            s.response?.["hydra:description"] ? (e(), t("p", V, o(s.response["hydra:description"]), 1)) : i("", !0),
            s.response?.violations?.length ? (e(), t("ul", w, [
              (e(!0), t(r, null, u(s.response.violations, (c) => (e(), t("li", null, [
                l("strong", null, o(c.propertyPath), 1),
                d(": " + o(c.message), 1)
              ]))), 256))
            ])) : i("", !0)
          ], 64)) : (e(), t("pre", A, o(JSON.stringify(s, void 0, 2)), 1))
        ]))), 256))
      ], 64)) : (e(), m(p(b), {
        key: 1,
        details: a.data,
        release: a.release,
        stepName: "ADDICTO_VOCAB"
      }, {
        default: g(() => [...n[1] || (n[1] = [
          l("p", null, [
            d(" The ontologies are being published to AddictOVocab. This will take a while."),
            l("br")
          ], -1)
        ])]),
        _: 1
      }, 8, ["details", "release"])),
      a.release.state === "completed" ? (e(), t("p", O, " The ontologies were published to AddictOVocab. ")) : i("", !0)
    ], 64));
  }
});
export {
  v as AddictOVocab
};
