import { g as w, a as P, m as B } from "./UrlUtils-45b0efe7.mjs";
import { z as p } from "zod";
import H from "xregexp";
import { M as z, a as X } from "./numbers-4344265e.mjs";
class se {
  constructor() {
    this.validationMap = /* @__PURE__ */ new Map(), this.subscriber = /* @__PURE__ */ new Set();
  }
  set(e, r) {
    this.validationMap.set(e, r), this.notifySubscribers();
  }
  get(e) {
    return this.validationMap.get(e) || null;
  }
  delete(e) {
    return this.validationMap.delete(e);
  }
  clear() {
    this.validationMap = /* @__PURE__ */ new Map(), this.notifySubscribers();
  }
  listen(e) {
    this.subscriber.add(e);
  }
  unlisten(e) {
    this.subscriber.delete(e);
  }
  clearSubscriber() {
    this.subscriber = /* @__PURE__ */ new Set();
  }
  isValid(e) {
    return !this.validationMap.get(e);
  }
  isAllValid() {
    return this.validationMap.size === 0 ? !0 : Array.from(this.validationMap.values()).every((r) => r === null);
  }
  notifySubscribers() {
    Array.from(this.subscriber).forEach((e) => e());
  }
}
var $ = {}, K = {
  get exports() {
    return $;
  },
  set exports(i) {
    $ = i;
  }
};
(function(i, e) {
  Object.defineProperty(e, "__esModule", {
    value: !0
  }), e.default = c;
  var r = n(P), a = n(B);
  function n(s) {
    return s && s.__esModule ? s : { default: s };
  }
  var u = {
    ignore_whitespace: !1
  };
  function c(s, E) {
    return (0, r.default)(s), E = (0, a.default)(E, u), (E.ignore_whitespace ? s.trim().length : s.length) === 0;
  }
  i.exports = e.default, i.exports.default = e.default;
})(K, $);
const v = /* @__PURE__ */ w($);
var g = {}, Q = {
  get exports() {
    return g;
  },
  set exports(i) {
    g = i;
  }
};
(function(i, e) {
  Object.defineProperty(e, "__esModule", {
    value: !0
  }), e.default = n;
  var r = a(P);
  function a(u) {
    return u && u.__esModule ? u : { default: u };
  }
  function n(u, c, s) {
    return (0, r.default)(u), Object.prototype.toString.call(c) !== "[object RegExp]" && (c = new RegExp(c, s)), c.test(u);
  }
  i.exports = e.default, i.exports.default = e.default;
})(Q, g);
const C = /* @__PURE__ */ w(g), d = p.enum([
  "empty",
  "lessThanLengthLimit",
  "exceedLengthLimit",
  "invalidFormat",
  "lessThanMinimumValue",
  "exceedMaximumValue",
  "invalidValue",
  "notContainsLetterAndNumber",
  "notContainsUpperCaseAndLowerCase",
  "containsTwoCharactersInArrow",
  "containsBadWords",
  "containsForbiddenWords",
  "containsDecimal",
  "invalidFileExtensions",
  "exceedMaximumFileSize",
  "alreadyUsed",
  "nameIsNotAllowed",
  "exceedPageTitleLength",
  "emptyPageTitle"
]), Y = p.enum(["invalidOption"]), f = p.enum([
  d.enum.empty,
  d.enum.lessThanLengthLimit,
  d.enum.exceedLengthLimit
]), W = z, G = (i, { min: e = 1, max: r = W, isRequired: a = !0 } = {}) => {
  const n = e < 0, u = r < 0, c = r < e;
  if (n || u || c)
    throw new Error(Y.enum.invalidOption);
  return v(i) ? a ? f.enum.empty : null : i && i.length < e ? f.enum.lessThanLengthLimit : i && i.length > r ? f.enum.exceedLengthLimit : null;
};
var t = {};
Object.defineProperty(t, "__esModule", {
  value: !0
});
t.commaDecimal = t.dotDecimal = t.farsiLocales = t.arabicLocales = t.englishLocales = t.decimal = t.alphanumeric = t.alpha = void 0;
var o = {
  "en-US": /^[A-Z]+$/i,
  "az-AZ": /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,
  "bg-BG": /^[А-Я]+$/i,
  "cs-CZ": /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
  "da-DK": /^[A-ZÆØÅ]+$/i,
  "de-DE": /^[A-ZÄÖÜß]+$/i,
  "el-GR": /^[Α-ώ]+$/i,
  "es-ES": /^[A-ZÁÉÍÑÓÚÜ]+$/i,
  "fa-IR": /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
  "fi-FI": /^[A-ZÅÄÖ]+$/i,
  "fr-FR": /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
  "it-IT": /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
  "nb-NO": /^[A-ZÆØÅ]+$/i,
  "nl-NL": /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
  "nn-NO": /^[A-ZÆØÅ]+$/i,
  "hu-HU": /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
  "pl-PL": /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
  "pt-PT": /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
  "ru-RU": /^[А-ЯЁ]+$/i,
  "sl-SI": /^[A-ZČĆĐŠŽ]+$/i,
  "sk-SK": /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
  "sr-RS@latin": /^[A-ZČĆŽŠĐ]+$/i,
  "sr-RS": /^[А-ЯЂЈЉЊЋЏ]+$/i,
  "sv-SE": /^[A-ZÅÄÖ]+$/i,
  "th-TH": /^[ก-๐\s]+$/i,
  "tr-TR": /^[A-ZÇĞİıÖŞÜ]+$/i,
  "uk-UA": /^[А-ЩЬЮЯЄIЇҐі]+$/i,
  "vi-VN": /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
  "ku-IQ": /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
  ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
  he: /^[א-ת]+$/,
  fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,
  "hi-IN": /^[\u0900-\u0961]+[\u0972-\u097F]*$/i
};
t.alpha = o;
var m = {
  "en-US": /^[0-9A-Z]+$/i,
  "az-AZ": /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,
  "bg-BG": /^[0-9А-Я]+$/i,
  "cs-CZ": /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
  "da-DK": /^[0-9A-ZÆØÅ]+$/i,
  "de-DE": /^[0-9A-ZÄÖÜß]+$/i,
  "el-GR": /^[0-9Α-ω]+$/i,
  "es-ES": /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
  "fi-FI": /^[0-9A-ZÅÄÖ]+$/i,
  "fr-FR": /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
  "it-IT": /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
  "hu-HU": /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
  "nb-NO": /^[0-9A-ZÆØÅ]+$/i,
  "nl-NL": /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
  "nn-NO": /^[0-9A-ZÆØÅ]+$/i,
  "pl-PL": /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
  "pt-PT": /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
  "ru-RU": /^[0-9А-ЯЁ]+$/i,
  "sl-SI": /^[0-9A-ZČĆĐŠŽ]+$/i,
  "sk-SK": /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
  "sr-RS@latin": /^[0-9A-ZČĆŽŠĐ]+$/i,
  "sr-RS": /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
  "sv-SE": /^[0-9A-ZÅÄÖ]+$/i,
  "th-TH": /^[ก-๙\s]+$/i,
  "tr-TR": /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
  "uk-UA": /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
  "ku-IQ": /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
  "vi-VN": /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
  ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
  he: /^[0-9א-ת]+$/,
  fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,
  "hi-IN": /^[\u0900-\u0963]+[\u0966-\u097F]*$/i
};
t.alphanumeric = m;
var l = {
  "en-US": ".",
  ar: "٫"
};
t.decimal = l;
var b = ["AU", "GB", "HK", "IN", "NZ", "ZA", "ZM"];
t.englishLocales = b;
for (var h, L = 0; L < b.length; L++)
  h = "en-".concat(b[L]), o[h] = o["en-US"], m[h] = m["en-US"], l[h] = l["en-US"];
var x = ["AE", "BH", "DZ", "EG", "IQ", "JO", "KW", "LB", "LY", "MA", "QM", "QA", "SA", "SD", "SY", "TN", "YE"];
t.arabicLocales = x;
for (var A, S = 0; S < x.length; S++)
  A = "ar-".concat(x[S]), o[A] = o.ar, m[A] = m.ar, l[A] = l.ar;
var I = ["IR", "AF"];
t.farsiLocales = I;
for (var T, R = 0; R < I.length; R++)
  T = "fa-".concat(I[R]), m[T] = m.fa, l[T] = l.ar;
var N = ["ar-EG", "ar-LB", "ar-LY"];
t.dotDecimal = N;
var _ = ["bg-BG", "cs-CZ", "da-DK", "de-DE", "el-GR", "en-ZM", "es-ES", "fr-CA", "fr-FR", "id-ID", "it-IT", "ku-IQ", "hi-IN", "hu-HU", "nb-NO", "nn-NO", "nl-NL", "pl-PL", "pt-PT", "ru-RU", "sl-SI", "sr-RS@latin", "sr-RS", "sv-SE", "tr-TR", "uk-UA", "vi-VN"];
t.commaDecimal = _;
for (var y = 0; y < N.length; y++)
  l[N[y]] = l["en-US"];
for (var M = 0; M < _.length; M++)
  l[_[M]] = ",";
o["fr-CA"] = o["fr-FR"];
m["fr-CA"] = m["fr-FR"];
o["pt-BR"] = o["pt-PT"];
m["pt-BR"] = m["pt-PT"];
l["pt-BR"] = l["pt-PT"];
o["pl-Pl"] = o["pl-PL"];
m["pl-Pl"] = m["pl-PL"];
l["pl-Pl"] = l["pl-PL"];
o["fa-AF"] = o.fa;
var Z = {};
Object.defineProperty(Z, "__esModule", {
  value: !0
});
var k = Z.default = j;
Z.locales = void 0;
var q = J(P), D = t;
function J(i) {
  return i && i.__esModule ? i : { default: i };
}
function j(i) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US", r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  (0, q.default)(i);
  var a = i, n = r.ignore;
  if (n)
    if (n instanceof RegExp)
      a = a.replace(n, "");
    else if (typeof n == "string")
      a = a.replace(new RegExp("[".concat(n.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, "\\$&"), "]"), "g"), "");
    else
      throw new Error("ignore should be instance of a String or RegExp");
  if (e in D.alphanumeric)
    return D.alphanumeric[e].test(a);
  throw new Error("Invalid locale '".concat(e, "'"));
}
var ee = Object.keys(D.alphanumeric);
Z.locales = ee;
const O = p.enum([...f.options, d.enum.invalidFormat]), le = (i, { maxLength: e = 256, isRequired: r = !0 } = {}) => v(i) ? r ? O.enum.empty : null : k(i) ? G(i, { max: e }) : O.enum.invalidFormat, U = p.enum([d.enum.invalidFormat]), ue = (i, e, { allowUnicode: r = !1 } = {}) => r && !H(e).test(i) || !r && !C(i, e) ? U.enum.invalidFormat : null, V = p.enum([
  d.enum.empty,
  d.enum.containsForbiddenWords
]), ie = (i, e, { isRequired: r = !0, isCaseSensitive: a = !1 } = {}) => {
  if (v(i))
    return r ? V.enum.empty : null;
  const n = e.filter(Boolean).map((s) => a ? s : s.toLowerCase()), u = a ? i : i.toLowerCase();
  return n.some((s) => u.includes(s)) ? V.enum.containsForbiddenWords : null;
}, F = p.enum([
  ...f.options,
  d.enum.invalidFormat,
  d.enum.containsForbiddenWords
]), oe = (i, { blockedWord: e, isRequired: r = !0, customRegex: a } = {}) => {
  const n = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,15}$";
  return v(i) ? r ? F.enum.empty : null : e && (e == null ? void 0 : e.length) > 0 && ie(i, e) ? F.enum.containsForbiddenWords : C(i, a || n) ? G(i, { max: X }) : F.enum.invalidFormat;
};
export {
  d as C,
  Y as T,
  se as V,
  t as a,
  f as b,
  U as c,
  O as d,
  F as e,
  ue as f,
  G as g,
  oe as h,
  v as i,
  C as m,
  le as v
};
