import { defineComponent as p, mergeModels as c, useModel as M, computed as m, createElementBlock as b, openBlock as f, createElementVNode as Y, createVNode as D, toDisplayString as _, unref as g } from "vue";
import { useI18n as h } from "vue-i18n";
import { q as y, r as T, d as V } from "./start-CE9SawgU.js";
import "pinia";
import "./header-Bn1EKnBE.js";
import { D as v, T as E } from "./constants-1J8fqgyx.js";
const F = { class: "d-flex align-center flex-wrap" }, B = { class: "text-no-wrap font-weight-bold mr-sm-2 mb-xs-0 mb-2" }, A = /* @__PURE__ */ p({
  __name: "DatahubDataTypeDateTimeValueEditor",
  props: /* @__PURE__ */ c({
    modelValue: {},
    readOnly: { type: Boolean },
    attribute: {},
    massEditing: { type: Boolean },
    label: {},
    fieldName: {},
    dataTypeInstance: {},
    loading: { type: Boolean },
    succeeded: { type: Boolean }
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(a) {
    const e = a, d = M(a, "modelValue"), o = m({
      get: () => d.value,
      set: (t) => {
        d.value = t && `${y(t)} ${t.slice(11, 16)}:00`;
      }
    }), { t: n } = h(), r = m(() => {
      if (!o.value)
        return "";
      const { dateFormat: t, timeFormat: i } = e.attribute?.configuration ?? e.attribute?.dataTypeInstance?.defaultConfiguration ?? {
        dateFormat: "short",
        timeFormat: "medium"
      }, l = n(v[t]), u = n(E[i]);
      return T(o.value).format(`${l} ${u}`);
    });
    return (t, i) => (f(), b("div", F, [
      Y("div", B, _(r.value), 1),
      D(g(V), {
        modelValue: o.value,
        "onUpdate:modelValue": i[0] || (i[0] = (l) => o.value = l),
        readonly: t.attribute?.configuration?.readOnly || t.readOnly,
        loading: t.loading,
        label: t.massEditing ? void 0 : t.label,
        type: "datetime-local",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "readonly", "loading", "label"])
    ]));
  }
});
function s(a) {
  const e = a;
  e.__i18n = e.__i18n || [], e.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "datahub-plugin": {
          dateTime: {
            "date-time-value": {
              date_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "MM/DD/YYYY" } },
              date_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "MMMM DD, YYYY" } },
              date_long: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "dddd, MMMM DD, YYYY" } },
              time_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "hh:mm A" } },
              time_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "hh:mm:ss A" } }
            }
          }
        }
      },
      "de-DE": {
        "datahub-plugin": {
          dateTime: {
            "date-time-value": {
              date_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "DD.MM.YYYY" } },
              date_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "DD. MMMM YYYY" } },
              date_long: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "dddd, DD. MMMM YYYY" } },
              time_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "HH:mm" } },
              time_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "HH:mm:ss" } }
            }
          }
        }
      }
    }
  });
}
typeof s == "function" && s(A);
export {
  A as default
};
