import { defineComponent as U, mergeModels as h, useModel as v, computed as d, createElementBlock as _, openBlock as m, createVNode as b, createBlock as V, createCommentVNode as D, unref as t } from "vue";
import { useI18n as x } from "vue-i18n";
import { a, o as E } from "./start-CE9SawgU.js";
import "pinia";
import "./header-Bn1EKnBE.js";
import { u as M } from "./units-B2_QriGO.js";
const T = { class: "extension-config d-flex flex-wrap" }, c = /* @__PURE__ */ U({
  __name: "NumberToUnitExtension",
  props: /* @__PURE__ */ h({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(l) {
    const o = l, e = v(l, "modelValue"), { t: i } = x(), { units: s, isUnitsLoading: r } = M(
      () => o.destinationAttribute?.configuration?.dimensionId
    ), g = d(() => [
      {
        value: "configured_unit",
        title: i("datahub-plugin.etl.number-to-unit.ConfigureManually")
      },
      {
        value: "keep_unit",
        title: i("datahub-plugin.etl.number-to-unit.KeepUnit")
      },
      {
        value: "destination_unit",
        title: i("datahub-plugin.etl.number-to-unit.DefaultUnitDestination")
      }
    ]), f = d(
      () => e.value.mode === "configured_unit"
    );
    return (C, n) => (m(), _("div", T, [
      b(t(a), {
        modelValue: e.value.sourceUnitId,
        "onUpdate:modelValue": n[0] || (n[0] = (u) => e.value.sourceUnitId = u),
        items: t(s),
        loading: t(r),
        label: t(i)("datahub-plugin.etl.number-to-unit.SourceTreeLanguage"),
        "item-title": "symbol",
        "item-value": "id",
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"]),
      b(t(a), {
        modelValue: e.value.mode,
        "onUpdate:modelValue": n[1] || (n[1] = (u) => e.value.mode = u),
        items: g.value,
        label: t(i)("datahub-plugin.etl.number-to-unit.ModeDestinationUnit"),
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      f.value ? (m(), V(t(a), {
        key: 0,
        modelValue: e.value.configuredUnitId,
        "onUpdate:modelValue": n[2] || (n[2] = (u) => e.value.configuredUnitId = u),
        items: t(s),
        loading: t(r),
        label: t(i)("datahub-plugin.etl.number-to-unit.unitToConvertTo"),
        "item-title": "symbol",
        "item-value": "id",
        "max-width": "567",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])) : D("", !0)
    ]));
  }
});
function p(l) {
  const o = l;
  o.__i18n = o.__i18n || [], o.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "datahub-plugin": {
          etl: {
            "number-to-unit": {
              SourceTreeLanguage: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Source unit" } },
              SourceUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Source unit" } },
              ModeDestinationUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Unit mapping mode" } },
              ConfigureManually: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Configure unit manually" } },
              KeepUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Keep unit" } },
              DefaultUnitDestination: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Destination attribute unit" } },
              unitToConvertTo: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Unit to convert to" } }
            }
          }
        }
      },
      "de-DE": {
        "datahub-plugin": {
          etl: {
            "number-to-unit": {
              SourceTreeLanguage: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit des Quellattributs" } },
              SourceUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit des Quellattributs" } },
              ModeDestinationUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Zuordnungsmodus für die Einheit" } },
              ConfigureManually: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit manuell konfigurieren" } },
              KeepUnit: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit beibehalten" } },
              DefaultUnitDestination: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit des Zielattributs" } },
              unitToConvertTo: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Einheit, auf die umgerechnet wird" } }
            }
          }
        }
      }
    }
  });
}
typeof p == "function" && p(c);
const K = /* @__PURE__ */ E(c, [["__scopeId", "data-v-534aa8a0"]]);
export {
  K as default
};
