import '@das-fed/ui/packages/components/form-item/style.css';
import { withInstall as Bt } from "@das-fed/utils/with-install/index";
import { getVarValue as He, getVar as zt, setThemeRule as kt } from "@das-fed/web/packages/theme/index";
import { useAttrs as Tt, inject as Kt, ref as Z, watch as Ae, computed as K, reactive as Ht, onMounted as Wt, onUnmounted as Gt, defineComponent as Zt, useCssVars as Jt, unref as l, createElementBlock as P, openBlock as S, normalizeStyle as be, normalizeClass as Fe, createElementVNode as Se, withDirectives as We, createCommentVNode as E, createBlock as Ee, createTextVNode as Ge, toDisplayString as Ze, mergeProps as D, createSlots as Je, withCtx as te, createVNode as _, renderSlot as re, isRef as I, Fragment as L } from "vue";
import { DasTreeSelectRef as Yt, DasTreeSelect as Xt } from "@das-fed/ui/packages/components/tree-select/index";
import { DasSelectInput as Qt } from "@das-fed/ui/packages/components/select-input/index";
import { DasInputDialogSelect as er } from "@das-fed/ui/packages/components/input-dialog-select/index";
import { DasInput as tr } from "@das-fed/ui/packages/components/input/index";
import { DasRadio as rr } from "@das-fed/ui/packages/components/radio/index";
import { DasCheckbox as nr } from "@das-fed/ui/packages/components/checkbox/index";
import { DasSwitch as ar } from "@das-fed/ui/packages/components/switch/index";
import { DasSelect as ir } from "@das-fed/ui/packages/components/select/index";
import { DasTooltip as or } from "@das-fed/ui/packages/components/tooltip/index";
import { DasDatePicker as sr, DasRangePicker as lr, DasTimePicker as ur, DasTimeRangePicker as fr } from "@das-fed/ui/packages/components/date-picker/index";
import { DasCascaderRef as dr, DasCascader as pr } from "@das-fed/ui/packages/components/cascader/index";
import { DasColorPicker as cr } from "@das-fed/ui/packages/components/color-picker/index";
import { DasInputNumber as gr } from "@das-fed/ui/packages/components/input-number/index";
import { vDasTooltip as Ye } from "@das-fed/ui/packages/components/text-tooltip/index";
import { DasIconFormTips as yr } from "@das-fed/ui/packages/icons/form-tips/index";
import { DasErrorOverlayModel as hr } from "@das-fed/ui/packages/components/error-overlay-model/index";
import { useModelValue as Ce } from "@das-fed/utils/vue";
import "@das-fed/ui/packages/global/theme";
const mr = (e) => ({ isShow: (...r) => r.includes(e.type) });
function J() {
  return J = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var r = arguments[t];
      for (var n in r)
        Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
    }
    return e;
  }, J.apply(this, arguments);
}
function br(e, t) {
  e.prototype = Object.create(t.prototype), e.prototype.constructor = e, pe(e, t);
}
function xe(e) {
  return xe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
    return r.__proto__ || Object.getPrototypeOf(r);
  }, xe(e);
}
function pe(e, t) {
  return pe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, a) {
    return n.__proto__ = a, n;
  }, pe(e, t);
}
function vr() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
  if (typeof Proxy == "function") return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function we(e, t, r) {
  return vr() ? we = Reflect.construct.bind() : we = function(a, i, o) {
    var u = [null];
    u.push.apply(u, i);
    var d = Function.bind.apply(a, u), g = new d();
    return o && pe(g, o.prototype), g;
  }, we.apply(null, arguments);
}
function wr(e) {
  return Function.toString.call(e).indexOf("[native code]") !== -1;
}
function De(e) {
  var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
  return De = function(n) {
    if (n === null || !wr(n)) return n;
    if (typeof n != "function")
      throw new TypeError("Super expression must either be null or a function");
    if (typeof t < "u") {
      if (t.has(n)) return t.get(n);
      t.set(n, a);
    }
    function a() {
      return we(n, arguments, xe(this).constructor);
    }
    return a.prototype = Object.create(n.prototype, {
      constructor: {
        value: a,
        enumerable: !1,
        writable: !0,
        configurable: !0
      }
    }), pe(a, n);
  }, De(e);
}
var jr = /%[sdj%]/g, Ot = function() {
};
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Ot = function(t, r) {
  typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && r.every(function(n) {
    return typeof n == "string";
  }) && console.warn(t, r);
});
function Ie(e) {
  if (!e || !e.length) return null;
  var t = {};
  return e.forEach(function(r) {
    var n = r.field;
    t[n] = t[n] || [], t[n].push(r);
  }), t;
}
function B(e) {
  for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
    r[n - 1] = arguments[n];
  var a = 0, i = r.length;
  if (typeof e == "function")
    return e.apply(null, r);
  if (typeof e == "string") {
    var o = e.replace(jr, function(u) {
      if (u === "%%")
        return "%";
      if (a >= i)
        return u;
      switch (u) {
        case "%s":
          return String(r[a++]);
        case "%d":
          return Number(r[a++]);
        case "%j":
          try {
            return JSON.stringify(r[a++]);
          } catch {
            return "[Circular]";
          }
          break;
        default:
          return u;
      }
    });
    return o;
  }
  return e;
}
function Vr(e) {
  return e === "string" || e === "url" || e === "hex" || e === "email" || e === "date" || e === "pattern";
}
function M(e, t) {
  return !!(e == null || t === "array" && Array.isArray(e) && !e.length || Vr(t) && typeof e == "string" && !e);
}
function $r(e, t, r) {
  var n = [], a = 0, i = e.length;
  function o(u) {
    n.push.apply(n, u || []), a++, a === i && r(n);
  }
  e.forEach(function(u) {
    t(u, o);
  });
}
function Xe(e, t, r) {
  var n = 0, a = e.length;
  function i(o) {
    if (o && o.length) {
      r(o);
      return;
    }
    var u = n;
    n = n + 1, u < a ? t(e[u], i) : r([]);
  }
  i([]);
}
function Tr(e) {
  var t = [];
  return Object.keys(e).forEach(function(r) {
    t.push.apply(t, e[r] || []);
  }), t;
}
var Qe = /* @__PURE__ */ function(e) {
  br(t, e);
  function t(r, n) {
    var a;
    return a = e.call(this, "Async Validation Error") || this, a.errors = r, a.fields = n, a;
  }
  return t;
}(/* @__PURE__ */ De(Error));
function Or(e, t, r, n, a) {
  if (t.first) {
    var i = new Promise(function(b, $) {
      var f = function(p) {
        return n(p), p.length ? $(new Qe(p, Ie(p))) : b(a);
      }, y = Tr(e);
      Xe(y, r, f);
    });
    return i.catch(function(b) {
      return b;
    }), i;
  }
  var o = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], u = Object.keys(e), d = u.length, g = 0, w = [], V = new Promise(function(b, $) {
    var f = function(j) {
      if (w.push.apply(w, j), g++, g === d)
        return n(w), w.length ? $(new Qe(w, Ie(w))) : b(a);
    };
    u.length || (n(w), b(a)), u.forEach(function(y) {
      var j = e[y];
      o.indexOf(y) !== -1 ? Xe(j, r, f) : $r(j, r, f);
    });
  });
  return V.catch(function(b) {
    return b;
  }), V;
}
function Ar(e) {
  return !!(e && e.message !== void 0);
}
function Fr(e, t) {
  for (var r = e, n = 0; n < t.length; n++) {
    if (r == null)
      return r;
    r = r[t[n]];
  }
  return r;
}
function et(e, t) {
  return function(r) {
    var n;
    return e.fullFields ? n = Fr(t, e.fullFields) : n = t[r.field || e.fullField], Ar(r) ? (r.field = r.field || e.fullField, r.fieldValue = n, r) : {
      message: typeof r == "function" ? r() : r,
      fieldValue: n,
      field: r.field || e.fullField
    };
  };
}
function tt(e, t) {
  if (t) {
    for (var r in t)
      if (t.hasOwnProperty(r)) {
        var n = t[r];
        typeof n == "object" && typeof e[r] == "object" ? e[r] = J({}, e[r], n) : e[r] = n;
      }
  }
  return e;
}
var At = function(t, r, n, a, i, o) {
  t.required && (!n.hasOwnProperty(t.field) || M(r, o || t.type)) && a.push(B(i.messages.required, t.fullField));
}, Sr = function(t, r, n, a, i) {
  (/^\s+$/.test(r) || r === "") && a.push(B(i.messages.whitespace, t.fullField));
}, ve, Er = function() {
  if (ve)
    return ve;
  var e = "[a-fA-F\\d:]", t = function(O) {
    return O && O.includeBoundaries ? "(?:(?<=\\s|^)(?=" + e + ")|(?<=" + e + ")(?=\\s|$))" : "";
  }, r = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", n = "[a-fA-F\\d]{1,4}", a = (`
(?:
(?:` + n + ":){7}(?:" + n + `|:)|                                    // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8
(?:` + n + ":){6}(?:" + r + "|:" + n + `|:)|                             // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4
(?:` + n + ":){5}(?::" + r + "|(?::" + n + `){1,2}|:)|                   // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4
(?:` + n + ":){4}(?:(?::" + n + "){0,1}:" + r + "|(?::" + n + `){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4
(?:` + n + ":){3}(?:(?::" + n + "){0,2}:" + r + "|(?::" + n + `){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4
(?:` + n + ":){2}(?:(?::" + n + "){0,3}:" + r + "|(?::" + n + `){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4
(?:` + n + ":){1}(?:(?::" + n + "){0,4}:" + r + "|(?::" + n + `){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4
(?::(?:(?::` + n + "){0,5}:" + r + "|(?::" + n + `){1,7}|:))             // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4
)(?:%[0-9a-zA-Z]{1,})?                                             // %eth0            %1
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), i = new RegExp("(?:^" + r + "$)|(?:^" + a + "$)"), o = new RegExp("^" + r + "$"), u = new RegExp("^" + a + "$"), d = function(O) {
    return O && O.exact ? i : new RegExp("(?:" + t(O) + r + t(O) + ")|(?:" + t(O) + a + t(O) + ")", "g");
  };
  d.v4 = function(h) {
    return h && h.exact ? o : new RegExp("" + t(h) + r + t(h), "g");
  }, d.v6 = function(h) {
    return h && h.exact ? u : new RegExp("" + t(h) + a + t(h), "g");
  };
  var g = "(?:(?:[a-z]+:)?//)", w = "(?:\\S+(?::\\S*)?@)?", V = d.v4().source, b = d.v6().source, $ = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", f = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", y = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", j = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', U = "(?:" + g + "|www\\.)" + w + "(?:localhost|" + V + "|" + b + "|" + $ + f + y + ")" + j + p;
  return ve = new RegExp("(?:^" + U + "$)", "i"), ve;
}, rt = {
  // http://emailregex.com/
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
  // url: new RegExp(
  //   '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
  //   'i',
  // ),
  hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
}, ue = {
  integer: function(t) {
    return ue.number(t) && parseInt(t, 10) === t;
  },
  float: function(t) {
    return ue.number(t) && !ue.integer(t);
  },
  array: function(t) {
    return Array.isArray(t);
  },
  regexp: function(t) {
    if (t instanceof RegExp)
      return !0;
    try {
      return !!new RegExp(t);
    } catch {
      return !1;
    }
  },
  date: function(t) {
    return typeof t.getTime == "function" && typeof t.getMonth == "function" && typeof t.getYear == "function" && !isNaN(t.getTime());
  },
  number: function(t) {
    return isNaN(t) ? !1 : typeof t == "number";
  },
  object: function(t) {
    return typeof t == "object" && !ue.array(t);
  },
  method: function(t) {
    return typeof t == "function";
  },
  email: function(t) {
    return typeof t == "string" && t.length <= 320 && !!t.match(rt.email);
  },
  url: function(t) {
    return typeof t == "string" && t.length <= 2048 && !!t.match(Er());
  },
  hex: function(t) {
    return typeof t == "string" && !!t.match(rt.hex);
  }
}, Cr = function(t, r, n, a, i) {
  if (t.required && r === void 0) {
    At(t, r, n, a, i);
    return;
  }
  var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], u = t.type;
  o.indexOf(u) > -1 ? ue[u](r) || a.push(B(i.messages.types[u], t.fullField, t.type)) : u && typeof r !== t.type && a.push(B(i.messages.types[u], t.fullField, t.type));
}, Pr = function(t, r, n, a, i) {
  var o = typeof t.len == "number", u = typeof t.min == "number", d = typeof t.max == "number", g = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, w = r, V = null, b = typeof r == "number", $ = typeof r == "string", f = Array.isArray(r);
  if (b ? V = "number" : $ ? V = "string" : f && (V = "array"), !V)
    return !1;
  f && (w = r.length), $ && (w = r.replace(g, "_").length), o ? w !== t.len && a.push(B(i.messages[V].len, t.fullField, t.len)) : u && !d && w < t.min ? a.push(B(i.messages[V].min, t.fullField, t.min)) : d && !u && w > t.max ? a.push(B(i.messages[V].max, t.fullField, t.max)) : u && d && (w < t.min || w > t.max) && a.push(B(i.messages[V].range, t.fullField, t.min, t.max));
}, ne = "enum", Mr = function(t, r, n, a, i) {
  t[ne] = Array.isArray(t[ne]) ? t[ne] : [], t[ne].indexOf(r) === -1 && a.push(B(i.messages[ne], t.fullField, t[ne].join(", ")));
}, qr = function(t, r, n, a, i) {
  if (t.pattern) {
    if (t.pattern instanceof RegExp)
      t.pattern.lastIndex = 0, t.pattern.test(r) || a.push(B(i.messages.pattern.mismatch, t.fullField, r, t.pattern));
    else if (typeof t.pattern == "string") {
      var o = new RegExp(t.pattern);
      o.test(r) || a.push(B(i.messages.pattern.mismatch, t.fullField, r, t.pattern));
    }
  }
}, v = {
  required: At,
  whitespace: Sr,
  type: Cr,
  range: Pr,
  enum: Mr,
  pattern: qr
}, xr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r, "string") && !t.required)
      return n();
    v.required(t, r, a, o, i, "string"), M(r, "string") || (v.type(t, r, a, o, i), v.range(t, r, a, o, i), v.pattern(t, r, a, o, i), t.whitespace === !0 && v.whitespace(t, r, a, o, i));
  }
  n(o);
}, Dr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && v.type(t, r, a, o, i);
  }
  n(o);
}, Ir = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (r === "" && (r = void 0), M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && (v.type(t, r, a, o, i), v.range(t, r, a, o, i));
  }
  n(o);
}, Rr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && v.type(t, r, a, o, i);
  }
  n(o);
}, Nr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), M(r) || v.type(t, r, a, o, i);
  }
  n(o);
}, _r = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && (v.type(t, r, a, o, i), v.range(t, r, a, o, i));
  }
  n(o);
}, Lr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && (v.type(t, r, a, o, i), v.range(t, r, a, o, i));
  }
  n(o);
}, Ur = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (r == null && !t.required)
      return n();
    v.required(t, r, a, o, i, "array"), r != null && (v.type(t, r, a, o, i), v.range(t, r, a, o, i));
  }
  n(o);
}, Br = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && v.type(t, r, a, o, i);
  }
  n(o);
}, zr = "enum", kr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i), r !== void 0 && v[zr](t, r, a, o, i);
  }
  n(o);
}, Kr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r, "string") && !t.required)
      return n();
    v.required(t, r, a, o, i), M(r, "string") || v.pattern(t, r, a, o, i);
  }
  n(o);
}, Hr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r, "date") && !t.required)
      return n();
    if (v.required(t, r, a, o, i), !M(r, "date")) {
      var d;
      r instanceof Date ? d = r : d = new Date(r), v.type(t, d, a, o, i), d && v.range(t, d.getTime(), a, o, i);
    }
  }
  n(o);
}, Wr = function(t, r, n, a, i) {
  var o = [], u = Array.isArray(r) ? "array" : typeof r;
  v.required(t, r, a, o, i, u), n(o);
}, Pe = function(t, r, n, a, i) {
  var o = t.type, u = [], d = t.required || !t.required && a.hasOwnProperty(t.field);
  if (d) {
    if (M(r, o) && !t.required)
      return n();
    v.required(t, r, a, u, i, o), M(r, o) || v.type(t, r, a, u, i);
  }
  n(u);
}, Gr = function(t, r, n, a, i) {
  var o = [], u = t.required || !t.required && a.hasOwnProperty(t.field);
  if (u) {
    if (M(r) && !t.required)
      return n();
    v.required(t, r, a, o, i);
  }
  n(o);
}, fe = {
  string: xr,
  method: Dr,
  number: Ir,
  boolean: Rr,
  regexp: Nr,
  integer: _r,
  float: Lr,
  array: Ur,
  object: Br,
  enum: kr,
  pattern: Kr,
  date: Hr,
  url: Pe,
  hex: Pe,
  email: Pe,
  required: Wr,
  any: Gr
};
function Re() {
  return {
    default: "Validation error on field %s",
    required: "%s is required",
    enum: "%s must be one of %s",
    whitespace: "%s cannot be empty",
    date: {
      format: "%s date %s is invalid for format %s",
      parse: "%s date could not be parsed, %s is invalid ",
      invalid: "%s date %s is invalid"
    },
    types: {
      string: "%s is not a %s",
      method: "%s is not a %s (function)",
      array: "%s is not an %s",
      object: "%s is not an %s",
      number: "%s is not a %s",
      date: "%s is not a %s",
      boolean: "%s is not a %s",
      integer: "%s is not an %s",
      float: "%s is not a %s",
      regexp: "%s is not a valid %s",
      email: "%s is not a valid %s",
      url: "%s is not a valid %s",
      hex: "%s is not a valid %s"
    },
    string: {
      len: "%s must be exactly %s characters",
      min: "%s must be at least %s characters",
      max: "%s cannot be longer than %s characters",
      range: "%s must be between %s and %s characters"
    },
    number: {
      len: "%s must equal %s",
      min: "%s cannot be less than %s",
      max: "%s cannot be greater than %s",
      range: "%s must be between %s and %s"
    },
    array: {
      len: "%s must be exactly %s in length",
      min: "%s cannot be less than %s in length",
      max: "%s cannot be greater than %s in length",
      range: "%s must be between %s and %s in length"
    },
    pattern: {
      mismatch: "%s value %s does not match pattern %s"
    },
    clone: function() {
      var t = JSON.parse(JSON.stringify(this));
      return t.clone = this.clone, t;
    }
  };
}
var Ne = Re(), ye = /* @__PURE__ */ function() {
  function e(r) {
    this.rules = null, this._messages = Ne, this.define(r);
  }
  var t = e.prototype;
  return t.define = function(n) {
    var a = this;
    if (!n)
      throw new Error("Cannot configure a schema with no rules");
    if (typeof n != "object" || Array.isArray(n))
      throw new Error("Rules must be an object");
    this.rules = {}, Object.keys(n).forEach(function(i) {
      var o = n[i];
      a.rules[i] = Array.isArray(o) ? o : [o];
    });
  }, t.messages = function(n) {
    return n && (this._messages = tt(Re(), n)), this._messages;
  }, t.validate = function(n, a, i) {
    var o = this;
    a === void 0 && (a = {}), i === void 0 && (i = function() {
    });
    var u = n, d = a, g = i;
    if (typeof d == "function" && (g = d, d = {}), !this.rules || Object.keys(this.rules).length === 0)
      return g && g(null, u), Promise.resolve(u);
    function w(y) {
      var j = [], p = {};
      function U(O) {
        if (Array.isArray(O)) {
          var q;
          j = (q = j).concat.apply(q, O);
        } else
          j.push(O);
      }
      for (var h = 0; h < y.length; h++)
        U(y[h]);
      j.length ? (p = Ie(j), g(j, p)) : g(null, u);
    }
    if (d.messages) {
      var V = this.messages();
      V === Ne && (V = Re()), tt(V, d.messages), d.messages = V;
    } else
      d.messages = this.messages();
    var b = {}, $ = d.keys || Object.keys(this.rules);
    $.forEach(function(y) {
      var j = o.rules[y], p = u[y];
      j.forEach(function(U) {
        var h = U;
        typeof h.transform == "function" && (u === n && (u = J({}, u)), p = u[y] = h.transform(p)), typeof h == "function" ? h = {
          validator: h
        } : h = J({}, h), h.validator = o.getValidationMethod(h), h.validator && (h.field = y, h.fullField = h.fullField || y, h.type = o.getType(h), b[y] = b[y] || [], b[y].push({
          rule: h,
          value: p,
          source: u,
          field: y
        }));
      });
    });
    var f = {};
    return Or(b, d, function(y, j) {
      var p = y.rule, U = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
      U = U && (p.required || !p.required && y.value), p.field = y.field;
      function h(C, R) {
        return J({}, R, {
          fullField: p.fullField + "." + C,
          fullFields: p.fullFields ? [].concat(p.fullFields, [C]) : [C]
        });
      }
      function O(C) {
        C === void 0 && (C = []);
        var R = Array.isArray(C) ? C : [C];
        !d.suppressWarning && R.length && e.warning("async-validator:", R), R.length && p.message !== void 0 && (R = [].concat(p.message));
        var T = R.map(et(p, u));
        if (d.first && T.length)
          return f[p.field] = 1, j(T);
        if (!U)
          j(T);
        else {
          if (p.required && !y.value)
            return p.message !== void 0 ? T = [].concat(p.message).map(et(p, u)) : d.error && (T = [d.error(p, B(d.messages.required, p.field))]), j(T);
          var k = {};
          p.defaultField && Object.keys(y.value).map(function(N) {
            k[N] = p.defaultField;
          }), k = J({}, k, y.rule.fields);
          var G = {};
          Object.keys(k).forEach(function(N) {
            var x = k[N], s = Array.isArray(x) ? x : [x];
            G[N] = s.map(h.bind(null, N));
          });
          var ee = new e(G);
          ee.messages(d.messages), y.rule.options && (y.rule.options.messages = d.messages, y.rule.options.error = d.error), ee.validate(y.value, y.rule.options || d, function(N) {
            var x = [];
            T && T.length && x.push.apply(x, T), N && N.length && x.push.apply(x, N), j(x.length ? x : null);
          });
        }
      }
      var q;
      if (p.asyncValidator)
        q = p.asyncValidator(p, y.value, O, y.source, d);
      else if (p.validator) {
        try {
          q = p.validator(p, y.value, O, y.source, d);
        } catch (C) {
          console.error == null || console.error(C), d.suppressValidatorError || setTimeout(function() {
            throw C;
          }, 0), O(C.message);
        }
        q === !0 ? O() : q === !1 ? O(typeof p.message == "function" ? p.message(p.fullField || p.field) : p.message || (p.fullField || p.field) + " fails") : q instanceof Array ? O(q) : q instanceof Error && O(q.message);
      }
      q && q.then && q.then(function() {
        return O();
      }, function(C) {
        return O(C);
      });
    }, function(y) {
      w(y);
    }, u);
  }, t.getType = function(n) {
    if (n.type === void 0 && n.pattern instanceof RegExp && (n.type = "pattern"), typeof n.validator != "function" && n.type && !fe.hasOwnProperty(n.type))
      throw new Error(B("Unknown rule type %s", n.type));
    return n.type || "string";
  }, t.getValidationMethod = function(n) {
    if (typeof n.validator == "function")
      return n.validator;
    var a = Object.keys(n), i = a.indexOf("message");
    return i !== -1 && a.splice(i, 1), a.length === 1 && a[0] === "required" ? fe.required : fe[this.getType(n)] || void 0;
  }, e;
}();
ye.register = function(t, r) {
  if (typeof r != "function")
    throw new Error("Cannot register a validator by type, validator is not a function");
  fe[t] = r;
};
ye.warning = Ot;
ye.messages = Ne;
ye.validators = fe;
function Zr() {
  this.__data__ = [], this.size = 0;
}
function Ft(e, t) {
  return e === t || e !== e && t !== t;
}
function Ve(e, t) {
  for (var r = e.length; r--; )
    if (Ft(e[r][0], t))
      return r;
  return -1;
}
var Jr = Array.prototype, Yr = Jr.splice;
function Xr(e) {
  var t = this.__data__, r = Ve(t, e);
  if (r < 0)
    return !1;
  var n = t.length - 1;
  return r == n ? t.pop() : Yr.call(t, r, 1), --this.size, !0;
}
function Qr(e) {
  var t = this.__data__, r = Ve(t, e);
  return r < 0 ? void 0 : t[r][1];
}
function en(e) {
  return Ve(this.__data__, e) > -1;
}
function tn(e, t) {
  var r = this.__data__, n = Ve(r, e);
  return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this;
}
function W(e) {
  var t = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++t < r; ) {
    var n = e[t];
    this.set(n[0], n[1]);
  }
}
W.prototype.clear = Zr;
W.prototype.delete = Xr;
W.prototype.get = Qr;
W.prototype.has = en;
W.prototype.set = tn;
function rn() {
  this.__data__ = new W(), this.size = 0;
}
function nn(e) {
  var t = this.__data__, r = t.delete(e);
  return this.size = t.size, r;
}
function an(e) {
  return this.__data__.get(e);
}
function on(e) {
  return this.__data__.has(e);
}
var St = typeof global == "object" && global && global.Object === Object && global, sn = typeof self == "object" && self && self.Object === Object && self, z = St || sn || Function("return this")(), ae = z.Symbol, Et = Object.prototype, ln = Et.hasOwnProperty, un = Et.toString, le = ae ? ae.toStringTag : void 0;
function fn(e) {
  var t = ln.call(e, le), r = e[le];
  try {
    e[le] = void 0;
    var n = !0;
  } catch {
  }
  var a = un.call(e);
  return n && (t ? e[le] = r : delete e[le]), a;
}
var dn = Object.prototype, pn = dn.toString;
function cn(e) {
  return pn.call(e);
}
var gn = "[object Null]", yn = "[object Undefined]", nt = ae ? ae.toStringTag : void 0;
function he(e) {
  return e == null ? e === void 0 ? yn : gn : nt && nt in Object(e) ? fn(e) : cn(e);
}
function $e(e) {
  var t = typeof e;
  return e != null && (t == "object" || t == "function");
}
var hn = "[object AsyncFunction]", mn = "[object Function]", bn = "[object GeneratorFunction]", vn = "[object Proxy]";
function Ct(e) {
  if (!$e(e))
    return !1;
  var t = he(e);
  return t == mn || t == bn || t == hn || t == vn;
}
var Me = z["__core-js_shared__"], at = function() {
  var e = /[^.]+$/.exec(Me && Me.keys && Me.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function wn(e) {
  return !!at && at in e;
}
var jn = Function.prototype, Vn = jn.toString;
function X(e) {
  if (e != null) {
    try {
      return Vn.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var $n = /[\\^$.*+?()[\]{}|]/g, Tn = /^\[object .+?Constructor\]$/, On = Function.prototype, An = Object.prototype, Fn = On.toString, Sn = An.hasOwnProperty, En = RegExp(
  "^" + Fn.call(Sn).replace($n, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function Cn(e) {
  if (!$e(e) || wn(e))
    return !1;
  var t = Ct(e) ? En : Tn;
  return t.test(X(e));
}
function Pn(e, t) {
  return e == null ? void 0 : e[t];
}
function Q(e, t) {
  var r = Pn(e, t);
  return Cn(r) ? r : void 0;
}
var ce = Q(z, "Map"), ge = Q(Object, "create");
function Mn() {
  this.__data__ = ge ? ge(null) : {}, this.size = 0;
}
function qn(e) {
  var t = this.has(e) && delete this.__data__[e];
  return this.size -= t ? 1 : 0, t;
}
var xn = "__lodash_hash_undefined__", Dn = Object.prototype, In = Dn.hasOwnProperty;
function Rn(e) {
  var t = this.__data__;
  if (ge) {
    var r = t[e];
    return r === xn ? void 0 : r;
  }
  return In.call(t, e) ? t[e] : void 0;
}
var Nn = Object.prototype, _n = Nn.hasOwnProperty;
function Ln(e) {
  var t = this.__data__;
  return ge ? t[e] !== void 0 : _n.call(t, e);
}
var Un = "__lodash_hash_undefined__";
function Bn(e, t) {
  var r = this.__data__;
  return this.size += this.has(e) ? 0 : 1, r[e] = ge && t === void 0 ? Un : t, this;
}
function Y(e) {
  var t = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++t < r; ) {
    var n = e[t];
    this.set(n[0], n[1]);
  }
}
Y.prototype.clear = Mn;
Y.prototype.delete = qn;
Y.prototype.get = Rn;
Y.prototype.has = Ln;
Y.prototype.set = Bn;
function zn() {
  this.size = 0, this.__data__ = {
    hash: new Y(),
    map: new (ce || W)(),
    string: new Y()
  };
}
function kn(e) {
  var t = typeof e;
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
function Te(e, t) {
  var r = e.__data__;
  return kn(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
}
function Kn(e) {
  var t = Te(this, e).delete(e);
  return this.size -= t ? 1 : 0, t;
}
function Hn(e) {
  return Te(this, e).get(e);
}
function Wn(e) {
  return Te(this, e).has(e);
}
function Gn(e, t) {
  var r = Te(this, e), n = r.size;
  return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
}
function oe(e) {
  var t = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++t < r; ) {
    var n = e[t];
    this.set(n[0], n[1]);
  }
}
oe.prototype.clear = zn;
oe.prototype.delete = Kn;
oe.prototype.get = Hn;
oe.prototype.has = Wn;
oe.prototype.set = Gn;
var Zn = 200;
function Jn(e, t) {
  var r = this.__data__;
  if (r instanceof W) {
    var n = r.__data__;
    if (!ce || n.length < Zn - 1)
      return n.push([e, t]), this.size = ++r.size, this;
    r = this.__data__ = new oe(n);
  }
  return r.set(e, t), this.size = r.size, this;
}
function se(e) {
  var t = this.__data__ = new W(e);
  this.size = t.size;
}
se.prototype.clear = rn;
se.prototype.delete = nn;
se.prototype.get = an;
se.prototype.has = on;
se.prototype.set = Jn;
function Yn(e, t) {
  for (var r = -1, n = e == null ? 0 : e.length; ++r < n && t(e[r], r, e) !== !1; )
    ;
  return e;
}
var it = function() {
  try {
    var e = Q(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}();
function Xn(e, t, r) {
  t == "__proto__" && it ? it(e, t, {
    configurable: !0,
    enumerable: !0,
    value: r,
    writable: !0
  }) : e[t] = r;
}
var Qn = Object.prototype, ea = Qn.hasOwnProperty;
function ta(e, t, r) {
  var n = e[t];
  (!(ea.call(e, t) && Ft(n, r)) || r === void 0 && !(t in e)) && Xn(e, t, r);
}
function ra(e, t) {
  for (var r = -1, n = Array(e); ++r < e; )
    n[r] = t(r);
  return n;
}
function me(e) {
  return e != null && typeof e == "object";
}
var na = "[object Arguments]";
function ot(e) {
  return me(e) && he(e) == na;
}
var Pt = Object.prototype, aa = Pt.hasOwnProperty, ia = Pt.propertyIsEnumerable, oa = ot(/* @__PURE__ */ function() {
  return arguments;
}()) ? ot : function(e) {
  return me(e) && aa.call(e, "callee") && !ia.call(e, "callee");
}, ze = Array.isArray;
function sa() {
  return !1;
}
var Mt = typeof exports == "object" && exports && !exports.nodeType && exports, st = Mt && typeof module == "object" && module && !module.nodeType && module, la = st && st.exports === Mt, lt = la ? z.Buffer : void 0, ua = lt ? lt.isBuffer : void 0, qt = ua || sa, fa = 9007199254740991, da = /^(?:0|[1-9]\d*)$/;
function pa(e, t) {
  var r = typeof e;
  return t = t ?? fa, !!t && (r == "number" || r != "symbol" && da.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
var ca = 9007199254740991;
function xt(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= ca;
}
var ga = "[object Arguments]", ya = "[object Array]", ha = "[object Boolean]", ma = "[object Date]", ba = "[object Error]", va = "[object Function]", wa = "[object Map]", ja = "[object Number]", Va = "[object Object]", $a = "[object RegExp]", Ta = "[object Set]", Oa = "[object String]", Aa = "[object WeakMap]", Fa = "[object ArrayBuffer]", Sa = "[object DataView]", Ea = "[object Float32Array]", Ca = "[object Float64Array]", Pa = "[object Int8Array]", Ma = "[object Int16Array]", qa = "[object Int32Array]", xa = "[object Uint8Array]", Da = "[object Uint8ClampedArray]", Ia = "[object Uint16Array]", Ra = "[object Uint32Array]", F = {};
F[Ea] = F[Ca] = F[Pa] = F[Ma] = F[qa] = F[xa] = F[Da] = F[Ia] = F[Ra] = !0;
F[ga] = F[ya] = F[Fa] = F[ha] = F[Sa] = F[ma] = F[ba] = F[va] = F[wa] = F[ja] = F[Va] = F[$a] = F[Ta] = F[Oa] = F[Aa] = !1;
function Na(e) {
  return me(e) && xt(e.length) && !!F[he(e)];
}
function ke(e) {
  return function(t) {
    return e(t);
  };
}
var Dt = typeof exports == "object" && exports && !exports.nodeType && exports, de = Dt && typeof module == "object" && module && !module.nodeType && module, _a = de && de.exports === Dt, qe = _a && St.process, ie = function() {
  try {
    var e = de && de.require && de.require("util").types;
    return e || qe && qe.binding && qe.binding("util");
  } catch {
  }
}(), ut = ie && ie.isTypedArray, La = ut ? ke(ut) : Na, Ua = Object.prototype, Ba = Ua.hasOwnProperty;
function za(e, t) {
  var r = ze(e), n = !r && oa(e), a = !r && !n && qt(e), i = !r && !n && !a && La(e), o = r || n || a || i, u = o ? ra(e.length, String) : [], d = u.length;
  for (var g in e)
    Ba.call(e, g) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
    (g == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    a && (g == "offset" || g == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    i && (g == "buffer" || g == "byteLength" || g == "byteOffset") || // Skip index properties.
    pa(g, d))) && u.push(g);
  return u;
}
var ka = Object.prototype;
function It(e) {
  var t = e && e.constructor, r = typeof t == "function" && t.prototype || ka;
  return e === r;
}
function Rt(e, t) {
  return function(r) {
    return e(t(r));
  };
}
var Ka = Rt(Object.keys, Object), Ha = Object.prototype, Wa = Ha.hasOwnProperty;
function Ga(e) {
  if (!It(e))
    return Ka(e);
  var t = [];
  for (var r in Object(e))
    Wa.call(e, r) && r != "constructor" && t.push(r);
  return t;
}
function Za(e) {
  return e != null && xt(e.length) && !Ct(e);
}
function Ja(e) {
  return Za(e) ? za(e) : Ga(e);
}
var Nt = typeof exports == "object" && exports && !exports.nodeType && exports, ft = Nt && typeof module == "object" && module && !module.nodeType && module, Ya = ft && ft.exports === Nt, dt = Ya ? z.Buffer : void 0;
dt && dt.allocUnsafe;
function Xa(e, t) {
  return e.slice();
}
function Qa(e, t) {
  for (var r = -1, n = e == null ? 0 : e.length, a = 0, i = []; ++r < n; ) {
    var o = e[r];
    t(o, r, e) && (i[a++] = o);
  }
  return i;
}
function ei() {
  return [];
}
var ti = Object.prototype, ri = ti.propertyIsEnumerable, pt = Object.getOwnPropertySymbols, ni = pt ? function(e) {
  return e == null ? [] : (e = Object(e), Qa(pt(e), function(t) {
    return ri.call(e, t);
  }));
} : ei;
function ai(e, t) {
  for (var r = -1, n = t.length, a = e.length; ++r < n; )
    e[a + r] = t[r];
  return e;
}
var ii = Rt(Object.getPrototypeOf, Object);
function oi(e, t, r) {
  var n = t(e);
  return ze(e) ? n : ai(n, r(e));
}
function si(e) {
  return oi(e, Ja, ni);
}
var _e = Q(z, "DataView"), Le = Q(z, "Promise"), Ue = Q(z, "Set"), Be = Q(z, "WeakMap"), ct = "[object Map]", li = "[object Object]", gt = "[object Promise]", yt = "[object Set]", ht = "[object WeakMap]", mt = "[object DataView]", ui = X(_e), fi = X(ce), di = X(Le), pi = X(Ue), ci = X(Be), H = he;
(_e && H(new _e(new ArrayBuffer(1))) != mt || ce && H(new ce()) != ct || Le && H(Le.resolve()) != gt || Ue && H(new Ue()) != yt || Be && H(new Be()) != ht) && (H = function(e) {
  var t = he(e), r = t == li ? e.constructor : void 0, n = r ? X(r) : "";
  if (n)
    switch (n) {
      case ui:
        return mt;
      case fi:
        return ct;
      case di:
        return gt;
      case pi:
        return yt;
      case ci:
        return ht;
    }
  return t;
});
var gi = Object.prototype, yi = gi.hasOwnProperty;
function hi(e) {
  var t = e.length, r = new e.constructor(t);
  return t && typeof e[0] == "string" && yi.call(e, "index") && (r.index = e.index, r.input = e.input), r;
}
var bt = z.Uint8Array;
function Ke(e) {
  var t = new e.constructor(e.byteLength);
  return new bt(t).set(new bt(e)), t;
}
function mi(e, t) {
  var r = Ke(e.buffer);
  return new e.constructor(r, e.byteOffset, e.byteLength);
}
var bi = /\w*$/;
function vi(e) {
  var t = new e.constructor(e.source, bi.exec(e));
  return t.lastIndex = e.lastIndex, t;
}
var vt = ae ? ae.prototype : void 0, wt = vt ? vt.valueOf : void 0;
function wi(e) {
  return wt ? Object(wt.call(e)) : {};
}
function ji(e, t) {
  var r = Ke(e.buffer);
  return new e.constructor(r, e.byteOffset, e.length);
}
var Vi = "[object Boolean]", $i = "[object Date]", Ti = "[object Map]", Oi = "[object Number]", Ai = "[object RegExp]", Fi = "[object Set]", Si = "[object String]", Ei = "[object Symbol]", Ci = "[object ArrayBuffer]", Pi = "[object DataView]", Mi = "[object Float32Array]", qi = "[object Float64Array]", xi = "[object Int8Array]", Di = "[object Int16Array]", Ii = "[object Int32Array]", Ri = "[object Uint8Array]", Ni = "[object Uint8ClampedArray]", _i = "[object Uint16Array]", Li = "[object Uint32Array]";
function Ui(e, t, r) {
  var n = e.constructor;
  switch (t) {
    case Ci:
      return Ke(e);
    case Vi:
    case $i:
      return new n(+e);
    case Pi:
      return mi(e);
    case Mi:
    case qi:
    case xi:
    case Di:
    case Ii:
    case Ri:
    case Ni:
    case _i:
    case Li:
      return ji(e);
    case Ti:
      return new n();
    case Oi:
    case Si:
      return new n(e);
    case Ai:
      return vi(e);
    case Fi:
      return new n();
    case Ei:
      return wi(e);
  }
}
var jt = Object.create, Bi = /* @__PURE__ */ function() {
  function e() {
  }
  return function(t) {
    if (!$e(t))
      return {};
    if (jt)
      return jt(t);
    e.prototype = t;
    var r = new e();
    return e.prototype = void 0, r;
  };
}();
function zi(e) {
  return typeof e.constructor == "function" && !It(e) ? Bi(ii(e)) : {};
}
var ki = "[object Map]";
function Ki(e) {
  return me(e) && H(e) == ki;
}
var Vt = ie && ie.isMap, Hi = Vt ? ke(Vt) : Ki, Wi = "[object Set]";
function Gi(e) {
  return me(e) && H(e) == Wi;
}
var $t = ie && ie.isSet, Zi = $t ? ke($t) : Gi, _t = "[object Arguments]", Ji = "[object Array]", Yi = "[object Boolean]", Xi = "[object Date]", Qi = "[object Error]", Lt = "[object Function]", eo = "[object GeneratorFunction]", to = "[object Map]", ro = "[object Number]", Ut = "[object Object]", no = "[object RegExp]", ao = "[object Set]", io = "[object String]", oo = "[object Symbol]", so = "[object WeakMap]", lo = "[object ArrayBuffer]", uo = "[object DataView]", fo = "[object Float32Array]", po = "[object Float64Array]", co = "[object Int8Array]", go = "[object Int16Array]", yo = "[object Int32Array]", ho = "[object Uint8Array]", mo = "[object Uint8ClampedArray]", bo = "[object Uint16Array]", vo = "[object Uint32Array]", A = {};
A[_t] = A[Ji] = A[lo] = A[uo] = A[Yi] = A[Xi] = A[fo] = A[po] = A[co] = A[go] = A[yo] = A[to] = A[ro] = A[Ut] = A[no] = A[ao] = A[io] = A[oo] = A[ho] = A[mo] = A[bo] = A[vo] = !0;
A[Qi] = A[Lt] = A[so] = !1;
function je(e, t, r, n, a, i) {
  var o;
  if (o !== void 0)
    return o;
  if (!$e(e))
    return e;
  var u = ze(e);
  if (u)
    o = hi(e);
  else {
    var d = H(e), g = d == Lt || d == eo;
    if (qt(e))
      return Xa(e);
    if (d == Ut || d == _t || g && !a)
      o = g ? {} : zi(e);
    else {
      if (!A[d])
        return a ? e : {};
      o = Ui(e, d);
    }
  }
  i || (i = new se());
  var w = i.get(e);
  if (w)
    return w;
  i.set(e, o), Zi(e) ? e.forEach(function($) {
    o.add(je($, t, r, $, e, i));
  }) : Hi(e) && e.forEach(function($, f) {
    o.set(f, je($, t, r, f, e, i));
  });
  var V = si, b = u ? void 0 : V(e);
  return Yn(b || e, function($, f) {
    b && (f = $, $ = e[f]), ta(o, f, je($, t, r, f, e, i));
  }), o;
}
var wo = 1, jo = 4;
function Vo(e) {
  return je(e, wo | jo);
}
const $o = (e, t, r) => {
  let n = [];
  return e.length > 0 ? n = e : t && (n = r[t] || []), n;
}, To = (e, t, r, n, a) => {
  if (t === "top")
    return "100%";
  if (r === "horizontal" && !n && !a)
    return "fit-content";
  let i = 4;
  return typeof e == "string" ? i = parseInt(e) : typeof e == "number" && (i = e), `${i * 12}px`;
}, Oo = (e, t, r) => {
  const n = Tt(), a = Kt("DasForm"), i = a.props, o = n.class, u = n.prop, d = e.labelPosition || i.labelPosition || "", g = e.labelLength || i.labelLength || 4;
  let w = (e.contentWidth ?? i.contentWidth ?? 230) + "px";
  const V = To(
    g,
    d,
    i.alignType,
    i.isSearchForm,
    i.cols
  );
  let b = Z("none");
  Ae(
    [() => e.col, () => i.marginRight],
    ([s, c]) => {
      if (s && i.cols) {
        const m = s * 100 / i.cols, Oe = parseFloat(c) / i.cols;
        b.value = `0 1 calc(${m}% - ${c} + ${Oe * s}px)`, i.labelPosition === "top" ? w = "100%" : w = `calc(100% - ${e.labelMarginRight || i.labelMarginRight} - ${V})`;
      }
    },
    {
      immediate: !0
    }
  );
  const $ = Ce(e, "modelValue"), f = Ce(e, "error"), y = Ce(e, "optionValue"), j = K(() => $o(e.rules, u, i.rules)), p = K(() => e.errorMode || i.errorMode), U = K(() => e.marginRight || i.marginRight || "30px"), h = K(() => e.marginBottom || i.marginBottom || "30px"), O = "8px", q = K(() => i.alignType === "horizontal" && !i.cols ? O : e.labelMarginRight || i.labelMarginRight), C = K(() => f.value !== "");
  Ae(
    $,
    (s, c) => {
      R();
    },
    { deep: !0 }
  ), Ae(y, (s, c) => {
    R();
  });
  const R = () => {
    f.value = "", t("update:error", "");
  }, T = Z(void 0), k = (s, c) => {
    if (N(), r("inputNumber")) {
      if (JSON.stringify(s) === JSON.stringify(T.value)) return;
      T.value = Vo(s);
    }
    t("update:modelValue", s), t("change", s, c);
  }, G = (s) => {
    t("update:modelValue", s), t("input", s);
  }, ee = (s) => {
    t("update:optionValue", s), t("select-change", s);
  }, N = async () => {
    if (u && j.value.length > 0) {
      j.value.forEach((c) => {
        !c.type && typeof $.value == "number" && (c.type = "number");
      });
      const s = new ye({
        [u]: j.value
      });
      return new Promise((c, m) => {
        s.validate({ [u]: $.value }, { firstFields: !0 }).then(() => {
          f.value = "", c(!0);
        }).catch((Oe) => {
          f.value = Oe.errors[0].message, c(!1);
        });
      });
    }
  }, x = Ht({
    timeStamp: Date.now(),
    propName: u,
    rules: j.value,
    validate: N,
    resetError: R
  });
  return Wt(() => {
    a.addField(x);
  }), Gt(() => {
    a.removeField(x);
  }), {
    innerValue: $,
    selectModelValue: y,
    errored: C,
    erroredMode: p,
    innerError: f,
    labelWidth: V,
    formLabelMarginRight: q,
    contentWidth: w,
    flexConfig: b,
    marginRight: U,
    marginBottom: h,
    formProps: i,
    className: o,
    inputHandler: G,
    changeHandler: k,
    selectChangeHandler: ee
  };
}, Ao = (e) => {
  const t = Z(), r = Z(!1), n = Z(0), a = Z({
    x: 0,
    y: 0
  }), i = K(() => ({
    "font-size": "12px",
    "background-color": He("--das-ui-form-error-label-color-bg").value,
    "box-shadow": "0px 4px 10px 0px rgba(0, 0, 0, 0.2)",
    "border-radius": "1px",
    padding: "2px 8px",
    "box-sizing": "border-box",
    "z-index": e.errorModelZIndex
  })), o = K(() => ({
    ...i.value,
    width: n.value + "px",
    position: "fixed",
    visibility: "visible",
    top: a.value.y + "px",
    left: a.value.x + "px"
  })), u = Z({
    display: "block",
    "text-align": "left",
    color: He("--das-ui-form-error-label-color").value,
    "white-space": "break-spaces"
    // 'word-break': 'break-all',
  }), d = () => {
    var f, y, j;
    n.value = (f = t.value) == null ? void 0 : f.clientWidth;
    const { top: V = 0, left: b = 0 } = ((y = t.value) == null ? void 0 : y.getBoundingClientRect()) ?? {}, $ = (j = t.value) == null ? void 0 : j.clientHeight;
    a.value.x = b, a.value.y = V + $;
  };
  return {
    $dasFormItem: t,
    isHoverInInput: r,
    errorModalBaseSyle: i,
    errorModelStyle: o,
    errorLabelStyle: u,
    errorModalInputMouseEnter: () => {
      d(), r.value = !0;
    },
    errorModallInputMouseLeave: () => {
      r.value = !1;
    }
  };
}, Fo = ["data-col"], So = { class: "label-context" }, Eo = { key: 0 }, Co = {
  inheritAttrs: !1
}, Po = /* @__PURE__ */ Zt({
  ...Co,
  __name: "Index",
  props: {
    labelLength: {},
    label: { default: "" },
    labelPosition: {},
    modelValue: {},
    optionValue: {},
    type: { default: "input" },
    required: { type: Boolean, default: !1 },
    isView: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: !1 },
    contentWidth: {},
    alignItems: { default: "center" },
    marginBottom: {},
    marginRight: {},
    options: {},
    optionsLabelKey: { default: "label" },
    optionsValueKey: { default: "value" },
    error: { default: "" },
    errorMode: {},
    helpMessage: {},
    col: { default: 1 },
    rules: { default: [] },
    tooltipAttrs: {},
    labelMarginRight: {},
    showColon: { type: Boolean },
    errorModelZIndex: { default: 2e3 }
  },
  emits: ["update:modelValue", "update:optionValue", "update:error", "change", "input", "select-change"],
  setup(e, { expose: t, emit: r }) {
    Jt((s) => ({
      "679739a0": l(p)
    }));
    const n = e, a = r, i = Tt(), o = K(() => i.width), u = Yt(), d = dr(), { isShow: g } = mr(n), {
      innerError: w,
      selectModelValue: V,
      errored: b,
      erroredMode: $,
      innerValue: f,
      labelWidth: y,
      formLabelMarginRight: j,
      contentWidth: p,
      flexConfig: U,
      formProps: h,
      marginRight: O,
      marginBottom: q,
      className: C,
      inputHandler: R,
      changeHandler: T,
      selectChangeHandler: k
    } = Oo(n, a, g), { $dasFormItem: G, isHoverInInput: ee, errorModalInputMouseEnter: N, errorModallInputMouseLeave: x } = Ao(n);
    return t({ $treeSelect: u, $cascader: d }), (s, c) => (S(), P("div", {
      class: Fe(["das-ui-form-item", [l(C), l(h).labelPosition, l(h).alignType, { "flex-layout": l(p) === "" }]]),
      style: be({ marginRight: l(O), marginBottom: l(q), alignItems: s.alignItems, flex: l(U), "min-width": 0 }),
      "data-col": s.col
    }, [
      Se(
        "div",
        {
          class: "das-ui-form-item-label",
          style: be({ width: l(y), marginRight: l(j) })
        },
        [
          Se(
            "div",
            {
              class: Fe(["label", { "required-mark": s.required, "has-help": s.helpMessage }])
            },
            [
              We((S(), P("div", So, [
                Ge(
                  Ze(s.label),
                  1
                  /* TEXT */
                )
              ])), [
                [l(Ye)]
              ]),
              s.showColon ? (S(), P("span", Eo, "：")) : E("v-if", !0),
              s.helpMessage || s.$slots.helpContent ? (S(), Ee(l(or), D({
                key: 1,
                effect: "light",
                placement: "top-start",
                content: s.helpMessage
              }, s.tooltipAttrs), Je({
                default: te(() => [
                  _(l(yr), {
                    class: Fe(["help-icon", { "no-required": !s.required }]),
                    iconColor: "#666",
                    size: "medium"
                  }, null, 8, ["class"])
                ]),
                _: 2
                /* DYNAMIC */
              }, [
                s.$slots.helpContent ? {
                  name: "content",
                  fn: te(() => [
                    re(s.$slots, "helpContent", {}, void 0, !0)
                  ]),
                  key: "0"
                } : void 0
              ]), 1040, ["content"])) : E("v-if", !0)
            ],
            2
            /* CLASS */
          )
        ],
        4
        /* STYLE */
      ),
      Se(
        "div",
        {
          ref_key: "$dasFormItem",
          ref: G,
          class: "das-ui-form-container",
          style: be({ width: l(p) }),
          onMouseenter: c[16] || (c[16] = //@ts-ignore
          (...m) => l(N) && l(N)(...m)),
          onMouseleave: c[17] || (c[17] = //@ts-ignore
          (...m) => l(x) && l(x)(...m))
        },
        [
          E(" 输入框 "),
          l(g)("input", "textarea", "password") ? (S(), Ee(l(tr), D({
            key: 0,
            modelValue: l(f),
            "onUpdate:modelValue": c[0] || (c[0] = (m) => I(f) ? f.value = m : null),
            style: { "margin-bottom": "0" },
            isView: s.isView,
            disabled: s.disabled,
            type: s.type,
            error: l(b),
            width: l(p),
            onInput: l(R),
            onChange: l(T)
          }, s.$attrs), Je({
            _: 2
            /* DYNAMIC */
          }, [
            s.$slots.suffix ? {
              name: "suffix",
              fn: te(() => [
                re(s.$slots, "suffix", {}, void 0, !0)
              ]),
              key: "0"
            } : void 0,
            s.$slots.prefix ? {
              name: "prefix",
              fn: te(() => [
                re(s.$slots, "prefix", {}, void 0, !0)
              ]),
              key: "1"
            } : void 0,
            s.$slots.prepend ? {
              name: "prepend",
              fn: te(() => [
                re(s.$slots, "prepend", {}, void 0, !0)
              ]),
              key: "2"
            } : void 0,
            s.$slots.append ? {
              name: "append",
              fn: te(() => [
                re(s.$slots, "append", {}, void 0, !0)
              ]),
              key: "3"
            } : void 0
          ]), 1040, ["modelValue", "isView", "disabled", "type", "error", "width", "onInput", "onChange"])) : l(g)("radio") ? (S(), P(
            L,
            { key: 1 },
            [
              E(" 单选框 "),
              _(l(rr), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[1] || (c[1] = (m) => I(f) ? f.value = m : null),
                isView: s.isView,
                disabled: s.disabled,
                radioType: "group",
                options: s.options,
                defaultProps: {
                  value: s.optionsValueKey,
                  label: s.optionsLabelKey
                },
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "isView", "disabled", "options", "defaultProps", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("checkbox") ? (S(), P(
            L,
            { key: 2 },
            [
              E(" 多选框 "),
              _(l(nr), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[2] || (c[2] = (m) => I(f) ? f.value = m : null),
                isView: s.isView,
                disabled: s.disabled,
                checkboxType: "group",
                options: s.options,
                defaultProps: {
                  value: s.optionsValueKey,
                  label: s.optionsLabelKey
                },
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "isView", "disabled", "options", "defaultProps", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("switch") ? (S(), P(
            L,
            { key: 3 },
            [
              E(" 开关 "),
              _(l(ar), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[3] || (c[3] = (m) => I(f) ? f.value = m : null),
                disabled: s.disabled,
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "disabled", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("select") ? (S(), P(
            L,
            { key: 4 },
            [
              E(" 下拉框 "),
              _(l(ir), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[4] || (c[4] = (m) => I(f) ? f.value = m : null),
                isView: s.isView,
                disabled: s.disabled,
                error: l(b),
                size: "small",
                options: s.options,
                width: "100%",
                fieldNames: {
                  value: s.optionsValueKey,
                  label: s.optionsLabelKey
                },
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "isView", "disabled", "error", "options", "fieldNames", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("cascader") ? (S(), P(
            L,
            { key: 5 },
            [
              E(" 级联选择器 "),
              _(l(pr), D({
                ref_key: "$cascader",
                ref: d,
                modelValue: l(f),
                "onUpdate:modelValue": c[5] || (c[5] = (m) => I(f) ? f.value = m : null),
                isView: s.isView,
                disabled: s.disabled,
                error: l(b),
                size: "small",
                options: s.options,
                width: "100%",
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "isView", "disabled", "error", "options", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("treeSelect") ? (S(), P(
            L,
            { key: 6 },
            [
              E(" 下拉树 "),
              _(l(Xt), D({
                ref_key: "$treeSelect",
                ref: u,
                modelValue: l(f),
                "onUpdate:modelValue": c[6] || (c[6] = (m) => I(f) ? f.value = m : null),
                data: s.options,
                size: "small",
                width: s.$attrs.width ? s.$attrs.width : "100%",
                isView: s.isView,
                disabled: s.disabled,
                error: l(b),
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "data", "width", "isView", "disabled", "error", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("colorPicker") ? (S(), P(
            L,
            { key: 7 },
            [
              E(" 颜色选择器 "),
              _(l(cr), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[7] || (c[7] = (m) => I(f) ? f.value = m : null),
                options: s.options,
                width: "100%",
                onChange: l(T),
                disabled: s.disabled,
                error: l(b),
                isView: s.isView
              }, s.$attrs), null, 16, ["modelValue", "options", "onChange", "disabled", "error", "isView"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("inputNumber") ? (S(), P(
            L,
            { key: 8 },
            [
              E(" 步进器 "),
              _(l(gr), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[8] || (c[8] = (m) => I(f) ? f.value = m : null),
                width: "100%",
                onInput: l(R),
                onChange: l(T),
                disabled: s.disabled,
                error: l(b),
                isView: s.isView
              }, s.$attrs), null, 16, ["modelValue", "onInput", "onChange", "disabled", "error", "isView"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("selectInput") ? (S(), P(
            L,
            { key: 9 },
            [
              E(" 搜索组件 "),
              _(l(Qt), D({
                width: "100%",
                modelValue: l(f),
                "onUpdate:modelValue": c[9] || (c[9] = (m) => I(f) ? f.value = m : null),
                isView: s.isView,
                error: l(b),
                disabled: s.disabled,
                optionValue: l(V),
                "onUpdate:optionValue": c[10] || (c[10] = (m) => I(V) ? V.value = m : null),
                options: s.options,
                optionsLabelKey: s.optionsLabelKey,
                optionsValueKey: s.optionsValueKey,
                onInputChange: l(T),
                onDasInput: l(R),
                onSelectChange: l(k)
              }, s.$attrs), null, 16, ["modelValue", "isView", "error", "disabled", "optionValue", "options", "optionsLabelKey", "optionsValueKey", "onInputChange", "onDasInput", "onSelectChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("inputDialogSelect") ? (S(), P(
            L,
            { key: 10 },
            [
              E(" 弹窗选择 "),
              _(l(er), D({
                style: { width: "100px", flex: "1" },
                size: "auto",
                isView: s.isView,
                disabled: s.disabled,
                error: l(b),
                "selected-options": s.options,
                modelValue: l(f),
                "onUpdate:modelValue": c[11] || (c[11] = (m) => I(f) ? f.value = m : null)
              }, s.$attrs, {
                optionsLabelKey: s.optionsLabelKey,
                optionsValueKey: s.optionsValueKey,
                onChange: l(T)
              }), null, 16, ["isView", "disabled", "error", "selected-options", "modelValue", "optionsLabelKey", "optionsValueKey", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("date", "dateTime", "week", "month", "quarter", "year") ? (S(), P(
            L,
            { key: 11 },
            [
              E(" 日期选择器 "),
              _(l(sr), D({
                "show-time": s.type === "dateTime",
                picker: s.type !== "dateTime" ? s.type : "date",
                modelValue: l(f),
                "onUpdate:modelValue": c[12] || (c[12] = (m) => I(f) ? f.value = m : null),
                size: "small",
                width: "100%",
                disabled: s.disabled,
                isView: s.isView,
                error: l(b),
                onChange: l(T)
              }, s.$attrs), null, 16, ["show-time", "picker", "modelValue", "disabled", "isView", "error", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("dateRange", "dateTimeRange", "weekRange", "monthRange", "yearRange") ? (S(), P(
            L,
            { key: 12 },
            [
              E(" 日期范围选择器 "),
              _(l(lr), D({
                "show-time": s.type === "dateTimeRange",
                picker: s.type !== "dateTimeRange" ? s.type.slice(0, -5) : "date",
                modelValue: l(f),
                "onUpdate:modelValue": c[13] || (c[13] = (m) => I(f) ? f.value = m : null),
                size: "small",
                width: "100%",
                disabled: s.disabled,
                isView: s.isView,
                error: l(b),
                onChange: l(T)
              }, s.$attrs), null, 16, ["show-time", "picker", "modelValue", "disabled", "isView", "error", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("time") ? (S(), P(
            L,
            { key: 13 },
            [
              E(" 时间选择器 "),
              _(l(ur), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[14] || (c[14] = (m) => I(f) ? f.value = m : null),
                size: "small",
                width: "100%",
                disabled: s.disabled,
                isView: s.isView,
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "disabled", "isView", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : l(g)("timeRange") ? (S(), P(
            L,
            { key: 14 },
            [
              E(" 时间范围选择器 "),
              _(l(fr), D({
                modelValue: l(f),
                "onUpdate:modelValue": c[15] || (c[15] = (m) => I(f) ? f.value = m : null),
                size: "small",
                width: "100%",
                disabled: s.disabled,
                isView: s.isView,
                onChange: l(T)
              }, s.$attrs), null, 16, ["modelValue", "disabled", "isView", "onChange"])
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          )) : E("v-if", !0),
          E(" 插槽 "),
          re(s.$slots, "default", {}, void 0, !0),
          E(" 错误提示 "),
          l(b) && l(w) ? (S(), P(
            L,
            { key: 15 },
            [
              l($) === "default" ? We((S(), P(
                "div",
                {
                  key: 0,
                  class: "error-label",
                  style: be({ width: o.value ? o.value : "100%" })
                },
                [
                  Ge(
                    Ze(l(w)),
                    1
                    /* TEXT */
                  )
                ],
                4
                /* STYLE */
              )), [
                [l(Ye)]
              ]) : l(ee) ? (S(), Ee(l(hr), {
                key: 1,
                errorLabel: l(w),
                getEl: () => l(G),
                errorWidth: o.value ? o.value : void 0,
                errorModelZIndex: s.errorModelZIndex
              }, null, 8, ["errorLabel", "getEl", "errorWidth", "errorModelZIndex"])) : E("v-if", !0)
            ],
            64
            /* STABLE_FRAGMENT */
          )) : E("v-if", !0)
        ],
        36
        /* STYLE, NEED_HYDRATION */
      )
    ], 14, Fo));
  }
}), Mo = (e, t) => {
  const r = e.__vccOpts || e;
  for (const [n, a] of t)
    r[n] = a;
  return r;
}, qo = /* @__PURE__ */ Mo(Po, [["__scopeId", "data-v-e9f4ce09"]]), xo = {
  "--das-ui-form-error-label-color": { light: "#fb2323" },
  "--das-ui-form-error-label-color-bg": { light: "#ffdbe0" },
  "--das-ui-form-label-normal": { light: zt("--das-ui-color-secondary") }
}, rs = Bt(qo);
kt(xo);
const ns = { title: "表单项" };
export {
  rs as DasFormItem,
  ns as default
};
