import { defineComponent as M, mergeModels as h, useModel as D, computed as N, onBeforeMount as S, createElementBlock as V, openBlock as n, createBlock as T, createCommentVNode as U, createVNode as d, Fragment as _, unref as t } from "vue";
import { useI18n as B } from "vue-i18n";
import { storeToRefs as I } from "pinia";
import { h as i, b as x, l as R } from "./start-BYfL32Oe.mjs";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { u as C } from "./dataTypes-nQ5Ht0CH.mjs";
import { a as y } from "./constants-CwfsvyFM.mjs";
import { b as k } from "./number-to-tree.json_vue_type_i18n_index_0_src_true_lang-D7dGzgkq.mjs";
const $ = { class: "extension-config d-flex flex-wrap" }, A = /* @__PURE__ */ M({
  __name: "NumberToTreeExtension",
  props: /* @__PURE__ */ h({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(E) {
    const l = D(E, "modelValue"), { t: o } = B(), m = C(), { languages: F, isLanguagesLoading: L } = I(m);
    function p(r, e, u) {
      return r === y ? u === "tree-to-integer" : e === y ? u === "integer-to-tree" : !1;
    }
    const s = N(() => [
      {
        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 S(m.fetchLanguages), (r, e) => {
      var u, b, f, g, v, c;
      return n(), V("div", $, [
        p(
          (b = (u = r.sourceAttributes) == null ? void 0 : u[0]) == null ? void 0 : b.dataType,
          (f = r.destinationAttribute) == null ? void 0 : f.dataType,
          "tree-to-tree"
        ) ? (n(), V(_, { key: 0 }, [
          d(t(i), {
            modelValue: l.value.sourceField,
            "onUpdate:modelValue": e[0] || (e[0] = (a) => l.value.sourceField = a),
            items: s.value,
            label: t(o)("datahub-plugin.etl.number-to-tree.SourceTreeLanguage"),
            "persistent-placeholder": ""
          }, null, 8, ["modelValue", "items", "label"]),
          d(t(i), {
            modelValue: l.value.destinationField,
            "onUpdate:modelValue": e[1] || (e[1] = (a) => l.value.destinationField = a),
            items: s.value,
            label: t(o)("datahub-plugin.etl.number-to-tree.DestinationField"),
            "persistent-placeholder": ""
          }, null, 8, ["modelValue", "items", "label"])
        ], 64)) : (n(), T(t(x), {
          key: 1,
          modelValue: l.value.separator,
          "onUpdate:modelValue": e[2] || (e[2] = (a) => l.value.separator = a),
          label: t(o)("datahub-plugin.etl.number-to-tree.Separator"),
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "label"])),
        p(
          (v = (g = r.sourceAttributes) == null ? void 0 : g[0]) == null ? void 0 : v.dataType,
          (c = r.destinationAttribute) == null ? void 0 : c.dataType,
          "integer-to-tree"
        ) ? (n(), T(t(i), {
          key: 2,
          modelValue: l.value.mode,
          "onUpdate:modelValue": e[3] || (e[3] = (a) => l.value.mode = a),
          items: s.value,
          "item-value": "mode",
          label: t(o)("datahub-plugin.etl.number-to-tree.DestinationField"),
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "label"])) : U("", !0),
        d(t(i), {
          modelValue: l.value.relevantLocale,
          "onUpdate:modelValue": e[4] || (e[4] = (a) => l.value.relevantLocale = a),
          items: t(F),
          loading: t(L),
          label: t(o)("datahub-plugin.etl.number-to-tree.RelevantLocale"),
          "item-title": "description",
          "item-value": "key",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "loading", "label"])
      ]);
    };
  }
});
typeof k == "function" && k(A);
const J = /* @__PURE__ */ R(A, [["__scopeId", "data-v-82b509a8"]]);
export {
  J as default
};
