import { defineComponent as f, mergeModels as v, useModel as u, computed as d, watch as x, createBlock as y, openBlock as h, unref as _, mergeProps as B } from "vue";
import { useI18n as V } from "vue-i18n";
import { b } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
const w = /* @__PURE__ */ f({
  __name: "SettingInput",
  props: /* @__PURE__ */ v({
    modelValue: {},
    data: {},
    options: {},
    settings: {},
    loading: { type: Boolean },
    readonly: { type: Boolean },
    isDefault: { type: Boolean }
  }, {
    modelValue: {},
    modelModifiers: {},
    valid: { type: Boolean, default: !0 },
    validModifiers: {}
  }),
  emits: ["update:modelValue", "update:valid"],
  setup(o) {
    const e = o, i = u(o, "modelValue"), s = u(o, "valid"), { t: g } = V(), a = d(
      () => {
        var t;
        return !e.isDefault && ((t = e.options) != null && t.regex) && !new RegExp(e.options.regex).test(i.value) ? g("setting-plugin.setting-input.regex", { pattern: e.options.regex }) : void 0;
      }
    ), c = d(() => {
      var t, n, l, p, r;
      return {
        label: (t = e.options) == null ? void 0 : t.label,
        hint: (n = e.options) == null ? void 0 : n.helperText,
        persistentHint: !!((l = e.options) != null && l.helperText),
        style: (p = e.options) != null && p.width ? { width: e.options.width } : "",
        type: (r = e.options) != null && r.encryption ? "password" : "text",
        error: !e.isDefault && (!s.value || !!a.value),
        readonly: e.readonly,
        loading: e.loading,
        errorMessages: a.value
      };
    });
    return x(a, (t) => {
      s.value = !t;
    }), (t, n) => (h(), y(_(b), B({
      modelValue: i.value,
      "onUpdate:modelValue": n[0] || (n[0] = (l) => i.value = l)
    }, c.value), null, 16, ["modelValue"]));
  }
});
function m(o) {
  const e = o;
  e.__i18n = e.__i18n || [], e.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "setting-plugin": {
          "setting-input": {
            regex: { t: 0, b: { t: 2, i: [{ t: 3, v: "Has to match " }, { t: 4, k: "pattern" }] } }
          }
        }
      },
      "de-DE": {
        "setting-plugin": {
          "setting-input": {
            regex: { t: 0, b: { t: 2, i: [{ t: 3, v: "Has to match " }, { t: 4, k: "pattern" }] } }
          }
        }
      }
    }
  });
}
typeof m == "function" && m(w);
export {
  w as default
};
