import { defineComponent as y, mergeModels as h, useModel as k, computed as A, onBeforeMount as x, createElementBlock as p, openBlock as u, createBlock as b, createCommentVNode as E, createVNode as d, Fragment as F, unref as l } from "vue";
import { useI18n as L } from "vue-i18n";
import { storeToRefs as M } from "pinia";
import { a as i, d as w, o as D } from "./start-CE9SawgU.js";
import "./header-Bn1EKnBE.js";
import { u as N } from "./dataTypes-DocW2t0g.js";
import { a as f } from "./constants-CwfsvyFM.js";
import { b as g } from "./number-to-tree.json_vue_type_i18n_index_0_src_true_lang-BH4ZonZZ.js";
const S = { class: "extension-config d-flex flex-wrap" }, v = /* @__PURE__ */ y({
  __name: "NumberToTreeExtension",
  props: /* @__PURE__ */ h({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(c) {
    const a = k(c, "modelValue"), { t: o } = L(), s = N(), { languages: V, isLanguagesLoading: T } = M(s);
    function m(r, e, t) {
      return r === f ? t === "tree-to-integer" : e === f ? t === "integer-to-tree" : !1;
    }
    const n = A(() => [
      {
        value: "key",
        title: o("datahub-plugin.etl.number-to-tree.Key"),
        mode: 1
      },
      {
        value: "title",
        title: o("datahub-plugin.etl.number-to-tree.Title"),
        mode: 0
      }
    ]);
    return x(s.ensureLanguages), (r, e) => (u(), p("div", S, [
      m(
        r.sourceAttributes?.[0]?.dataType,
        r.destinationAttribute?.dataType,
        "tree-to-tree"
      ) ? (u(), p(F, { key: 0 }, [
        d(l(i), {
          modelValue: a.value.sourceField,
          "onUpdate:modelValue": e[0] || (e[0] = (t) => a.value.sourceField = t),
          items: n.value,
          label: l(o)("datahub-plugin.etl.number-to-tree.SourceTreeLanguage"),
          "max-width": "567",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "label"]),
        d(l(i), {
          modelValue: a.value.destinationField,
          "onUpdate:modelValue": e[1] || (e[1] = (t) => a.value.destinationField = t),
          items: n.value,
          label: l(o)("datahub-plugin.etl.number-to-tree.DestinationField"),
          "max-width": "567",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "label"])
      ], 64)) : (u(), b(l(w), {
        key: 1,
        modelValue: a.value.separator,
        "onUpdate:modelValue": e[2] || (e[2] = (t) => a.value.separator = t),
        label: l(o)("datahub-plugin.etl.number-to-tree.Separator"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"])),
      m(
        r.sourceAttributes?.[0]?.dataType,
        r.destinationAttribute?.dataType,
        "integer-to-tree"
      ) ? (u(), b(l(i), {
        key: 2,
        modelValue: a.value.mode,
        "onUpdate:modelValue": e[3] || (e[3] = (t) => a.value.mode = t),
        items: n.value,
        "item-value": "mode",
        label: l(o)("datahub-plugin.etl.number-to-tree.DestinationField"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"])) : E("", !0),
      d(l(i), {
        modelValue: a.value.relevantLocale,
        "onUpdate:modelValue": e[4] || (e[4] = (t) => a.value.relevantLocale = t),
        items: l(V),
        loading: l(T),
        label: l(o)("datahub-plugin.etl.number-to-tree.RelevantLocale"),
        "item-title": "description",
        "item-value": "key",
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])
    ]));
  }
});
typeof g == "function" && g(v);
const O = /* @__PURE__ */ D(v, [["__scopeId", "data-v-211e8c9a"]]);
export {
  O as default
};
