const J = {};
function A(S, t) {
  J[S] = t;
}
class x {
  // constructor() {}
  /**
  * 获取 typeof 类型
  * @param value
  * @returns {string}
  */
  static getTypeof(t) {
    return typeof t;
  }
  static _toStringCall(t) {
    return Object.prototype.toString.call(t);
  }
  static isUndefined(t) {
    return this.getTypeof(t) === "undefined" || t === null;
  }
  static isBoolean(t) {
    return this.getTypeof(t) === "boolean";
  }
  static isString(t) {
    return this.getTypeof(t) === "string";
  }
  static isFunction(t) {
    return this.getTypeof(t) === "function" && this._toStringCall(t) === "[object Function]";
  }
  static isObject(t) {
    return !this.isUndefined(t) && this.getTypeof(t) === "object";
  }
  static isBlob(t) {
    return this._toStringCall(t) === "[object Blob]";
  }
  static isFile(t) {
    return this._toStringCall(t) === "[object File]";
  }
  static isNumber(t) {
    let e = !1;
    return this.isString(t) ? /^(-)?(([1-9]\d*)|0)(\.\d+)?$/.test(t) : (this.getTypeof(t) === "number" && (e = !0), e);
  }
  static isInt(t) {
    let e = !0;
    return this.isEmpty(t) || (e = /^[1-9]\d*$|^0$/.test(t.toString())), e;
  }
  static isHtml(t) {
    return /^<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>$/i.test(t);
  }
  static isJson(t) {
    let e = !1;
    if (this.isString(t))
      try {
        const s = JSON.parse(t);
        this.isObject(s) && (e = !0);
      } catch {
      }
    else this.isObject(t) && (e = !0);
    return e;
  }
  static isWindow(t) {
    return !this.isUndefined(t) && t === t.window;
  }
  static _isEmptyObject(t) {
    return this.isUndefined(t) ? !0 : Object.keys(t).length === 0;
  }
  static isArray(t) {
    return Array.isArray(t) && this._toStringCall(t) === "[object Array]";
  }
  static isLocationLngLat(t) {
    let e = !1;
    if (!this.isEmpty(t)) {
      let s;
      if (this.isString(t) ? s = t.split(",") : this.isArray(t) ? s = t : s = [], s.length === 2) {
        const i = s[0], n = s[1], r = /^-?(180(\.0+)?|1[0-7]?\d?(\.\d+)?|[1-9]?\d?(\.\d+)?)$/, o = /^-?(90(\.0+)?|[1-8]?\d?(\.\d+)?)$/;
        e = r.test(i) && o.test(n);
      }
    }
    return e;
  }
  static isEmpty(t, e) {
    let s = this.isUndefined(t);
    if (!s) {
      const i = this.getTypeof(t);
      if (this.isString(t) ? s = this.trim(t).length === 0 : this.isArray(t) ? s = t.length === 0 : i === "object" && (this.isFile(t) ? s = !1 : s = this._isEmptyObject(t)), !s && !this.isUndefined(e)) {
        let n = t;
        this.isNumber(t) && (n = n.toString());
        let r = e;
        this.isNumber(e) && (r = r.toString()), s = this.isEqual(n, r);
      }
    }
    return s;
  }
  static isEqual(t, e) {
    return Object.is(t, e);
  }
  static isEqualArr(t, e, s = !1) {
    let i = !1;
    const n = this.isEmpty(t), r = this.isEmpty(e);
    if (n && r)
      i = !0;
    else if (t.length === e.length)
      if (i = !0, s) {
        for (let o = 0; o < t.length; o++)
          if (t[o].toString() !== e[o].toString()) {
            i = !1;
            break;
          }
      } else {
        const o = this.getArrConvertJson(e);
        for (let c = 0; c < t.length; c++)
          if (!this.isExistJsonKey(o, t[c].toString())) {
            i = !1;
            break;
          }
      }
    else
      i = !1;
    return i;
  }
  static isEqualList(t, e, s = ["id"]) {
    let i = !1;
    const n = this.isEmpty(t), r = this.isEmpty(e);
    if (n && r)
      i = !0;
    else if (t.length === e.length) {
      const o = t.map((c) => s.map((a) => c[a].toString()).join(","));
      i = !0, e.some((c) => {
        const a = s.map((l) => c[l].toString()).join(",");
        if (!this.isExistValue(o, a))
          return i = !1, !0;
      });
    } else
      i = !1;
    return i;
  }
  /**
   * 数组1是否包含数组2
   * @param arr1
   * @param arr2
   */
  static isContainArr(t, e) {
    let s = !1;
    const i = this.isEmpty(t), n = this.isEmpty(e);
    return i && n ? s = !0 : t.length >= e.length ? (s = !0, e.some((r) => {
      if (!this.isExistValue(t, r))
        return s = !1, !0;
    })) : s = !1, s;
  }
  /**
   * 是否存在 大量循环时误用(慢)
   * @param value
   * @param key
   * @returns
   */
  static isExistValue(t, e) {
    return this.isUndefined(t) ? !1 : t.includes ? t.includes(e) : t.indexOf(e) > -1;
  }
  /**
   * 是否存在(专用json)
   * @param json
   * @param key
   * @returns
   */
  static isExistJsonKey(t, e) {
    return this.isUndefined(t) ? !1 : Object.prototype.hasOwnProperty.call(t, e);
  }
  /**
   * 操作系统类型  仅浏览器端使用
   * @returns 
   */
  static osType() {
    const t = navigator.userAgent, e = /(?:Android)/.test(t), s = /(?:Firefox)/.test(t), i = /(?:iPad|PlayBook)/.test(t) || e && !/(?:Mobile)/.test(t) || s && /(?:Tablet)/.test(t), n = /(?:iPhone)/.test(t) && !i;
    return {
      isTablet: i,
      isIOS: n,
      isAndroid: e,
      isMobile: n || e,
      isPc: !n && !e
    };
  }
  /**
  * 移除空格
  * @param value
  * @returns {string}
  */
  static trim(t) {
    if (this.isUndefined(t)) return t;
    const e = t.toString();
    return e.trim ? e.trim() : e.replace(/^\s+|\s+$/gm, "");
  }
  static split(t, e = ",") {
    let s;
    if (this.isEmpty(t))
      s = [];
    else {
      let i = t;
      e === "," && (i = i.replace(/，/g, ",")), s = i.toString().split(e);
    }
    return s;
  }
  static kebabCase(t) {
    return t.replace(/([A-Z])/g, " $1").trim().split(" ").join("-").toLowerCase();
  }
  /**
   * 获取字节长度
   * @param {string} str
   * @returns {number}
   */
  static getByteLen(t) {
    let e = 0;
    for (let s = 0; s < t.length; s += 1)
      t.charAt(s).match(/[^\x00-\xff]/ig) !== null ? e += 3 : e += 1;
    return e;
  }
  /**
   * 复制json
   * @param json {Object}
   * @returns
   */
  static getJsonClone(t, e = !1, s = {}) {
    if (e)
      return this._getJsonCloneDeep(t, s);
    {
      const i = this.isUndefined(s.exclude) ? [] : s.exclude;
      if (i.length === 0)
        return this.getJsonMerge(t);
      {
        const n = {};
        return Object.keys(t).forEach((r) => {
          this.isExistValue(i, r) || (n[r] = t[r]);
        }), n;
      }
    }
  }
  /**
   * 复制json 深拷贝
   * @param json
   * @returns
   */
  static _getJsonCloneDeep(t, e = {}) {
    const s = this.isArray(t) ? [] : {}, i = this.isUndefined(e.exclude) ? [] : e.exclude;
    return Object.keys(t).forEach((n) => {
      if (i.length === 0 || !this.isExistValue(i, n)) {
        const o = t[n];
        this.isUndefined(o) || !this.isObject(o) ? this.isArray(o) ? s[n] = this.getListClone(o, !0) : s[n] = o : s[n] = this._getJsonCloneDeep(o);
      }
    }), s;
  }
  static getJsonCloneByKeyArr(t, e) {
    const s = {};
    return e.forEach((i) => {
      const n = t[i];
      s[i] = this.isUndefined(n) ? "" : this.isObject(n) ? this.getJsonClone(n) : n;
    }), s;
  }
  static getJsonCloneByKeyJson(t, e) {
    const s = Object.keys(e);
    return this.getJsonCloneByKeyArr(t, s);
  }
  static getJsonCloneByRemoveArr(t, e) {
    const s = {};
    return e.length === 0 ? t : (Object.keys(t).forEach((i) => {
      this.isExistValue(e, i) || (s[i] = t[i]);
    }), s);
  }
  static getJsonMerge(...t) {
    return Object.assign({}, ...t);
  }
  static getJsonReversal(t) {
    const e = {};
    return Object.keys(t).forEach((s) => {
      e[t[s]] = s;
    }), e;
  }
  static getJsonMergeDeep(...t) {
    const e = {}, s = t.length;
    for (let i = 0; i < s; i++)
      this._mergeJsonDeep(e, t[i] || {});
    return e;
  }
  static _mergeJsonDeep(t, e) {
    Object.keys(e).forEach((s) => {
      const i = e[s];
      this.isUndefined(i) ? t[s] = i : this.isArray(i) ? t[s] = this.getListClone(i, !0) : this.isObject(i) && this.isExistJsonKey(t, s) ? this._mergeJsonDeep(t[s], i) : t[s] = i;
    });
  }
  static getJsonMap(t, e, s = !1) {
    const i = {};
    if (!this.isEmpty(t) && !this._isEmptyObject(e))
      for (const [n, r] of Object.entries(e)) {
        let o = r.toString(), c = "";
        if (o.indexOf("|") > -1) {
          const a = o.split("|");
          o = a[0], c = a[1];
        }
        if (o.indexOf(".") > -1) {
          const a = this.split(o, ".");
          let l = this.getJsonClone(t, !0);
          a.forEach((h, b) => {
            const f = l[h], g = this.isEmpty(f);
            b === a.length - 1 ? this.isUndefined(f) ? l = s ? "" : f : g ? l = "" : c && c.length > 0 ? l = this.isEmpty(f) ? "" : this.getValueByFormat(f, c) : l = f : l = g ? {} : f;
          }), i[n] = this.isString(l) ? this.trim(l) : l;
        } else if (this.isExistJsonKey(t, o)) {
          const a = t[o];
          let l;
          this.isUndefined(a) ? l = s ? "" : a : c && c.length > 0 ? l = this.isEmpty(a) ? "" : this.getValueByFormat(a, c) : l = a, i[n] = this.isString(l) ? this.trim(l) : l;
        } else
          s && (i[n] = "");
      }
    return i;
  }
  static getJsonByList(t, e, s = !1) {
    const i = {};
    if (!this.isEmpty(t)) {
      const n = e && !this.isEmpty(e) ? e : "id";
      t.forEach((r) => {
        let o = "";
        s ? e && (o = this.convertStringFormat(e, r)) : o = this.isExistJsonKey(r, n) ? r[n].toString() : "", o.length > 0 && (i[o] = this.getJsonClone(r));
      });
    }
    return i;
  }
  static getJsonByArr(t) {
    const e = {};
    return this.isEmpty(t) || t.forEach((s) => {
      e[s] = s;
    }), e;
  }
  static getGroupByList(t, e) {
    const s = {};
    return this.isEmpty(t) || t.forEach((i) => {
      const n = this.isExistJsonKey(i, e) ? i[e].toString() : "";
      n.length > 0 && (this.isExistJsonKey(s, n) || (s[n] = []), s[n].push(this.getJsonClone(i)));
    }), s;
  }
  static getJsonByBlob(t) {
    return new Promise((e, s) => {
      const i = new FileReader();
      i.onload = () => {
        try {
          const n = JSON.parse(i.result);
          e(n);
        } catch (n) {
          s(n);
        }
      }, i.onerror = s, i.readAsText(t);
    });
  }
  static getBase64ByFile(t) {
    return new Promise((e) => {
      if (t.length > 0) {
        const s = t[0];
        if (s instanceof File) {
          const i = new FileReader();
          i.onload = (n) => {
            e(n.target.result);
          }, i.readAsDataURL(s);
        } else
          e("");
      } else
        e("");
    });
  }
  /**
   * 获取list 层级结构
   * @param {any[]} list
   * @returns {any}
   */
  static getTreeList(t) {
    let e = [];
    const s = [], i = {}, n = {};
    return this.isEmpty(t) || (t.forEach((r) => {
      const o = r.id.toString(), c = r.parentId.toString();
      c === "0" && s.push(o), i[o] = r, this.isExistJsonKey(n, c) || (n[c] = []), n[c].push(r);
    }), s.forEach((r) => {
      e = e.concat(this._recursionChild(r, n, i));
    })), { tree: e, group: n, json: i, list: t };
  }
  static getTreeLastParent(t, e, s = !0) {
    let i = [];
    return this.isExistJsonKey(e, t) && (i = this._recursionParent(t, e), s || i.splice(0, 1), i.reverse()), i;
  }
  static _recursionChild(t, e, s) {
    const i = [], n = this.getJsonClone(s[t]);
    return this.isExistJsonKey(e, t) && (n.list = [], e[t].forEach((o) => {
      const c = o.id.toString();
      n.list = n.list.concat(this._recursionChild(c, e, s));
    })), i.push(n), i;
  }
  static _recursionParent(t, e) {
    let s = [];
    if (this.isExistJsonKey(e, t)) {
      const i = e[t], n = i.parentId.toString();
      s.push(i), s = s.concat(this._recursionParent(n, e));
    }
    return s;
  }
  /**
   * 获取list tree转list
   * @param tree 
   * @param opt 
   * @returns 
   */
  static getListByTree(t, e = {}) {
    const s = this.isEmpty(e.idKey) ? "id" : e.idKey, i = this.isEmpty(e.cKey) ? "list" : e.cKey, n = this.isEmpty(e.pKey) ? "parentId" : e.pKey, r = this.isEmpty(e.topPV) ? "0" : e.topPV;
    return this._recursionListByTree(t, r, { idKey: s, cKey: i, pKey: n });
  }
  static _recursionListByTree(t, e, s) {
    const i = [];
    return t.forEach((n) => {
      const r = this.getJsonClone(n, !1, { exclude: [s.cKey] });
      r[s.pKey] = e;
      const o = this.isUndefined(n[s.cKey]);
      if (r.isLastLevel = o, i.push(r), !o) {
        const c = this._recursionListByTree(n[s.cKey], r[s.idKey], s);
        i.push(...c);
      }
    }), i;
  }
  /**
   * 复制list
   * @param list
   */
  static getListClone(t, e = !1) {
    return this.isEmpty(t) ? [] : t.map((s) => this.isObject(s) ? this.getJsonClone(s, e) : s);
  }
  /**
   * list 合并
   * @param newList 新
   * @param oldList 旧
   * @param key id
   * @returns list
   */
  static getListMergeDeep(t, e, s = "id") {
    const i = [];
    if (t.length > 0) {
      const n = this.getJsonByList(e, s);
      t.forEach((r) => {
        let o = {}, c = r[s];
        this.isEmpty(c) || (c = c.toString(), o = this.isExistJsonKey(n, c) ? n[c] : {});
        const a = this.getJsonMergeDeep(o, r);
        i.push(a);
      });
    }
    return i;
  }
  static getRecursionParentList(t, e, s = "parentId") {
    let i = [];
    const n = e.toString();
    if (n !== "0" && this.isExistJsonKey(t, n)) {
      const r = t[n];
      i.push(r);
      const o = r[s].toString(), c = this.getRecursionParentList(t, o);
      this.isEmpty(c) || (i = i.concat(c));
    }
    return i;
  }
  static getListExistValue(t, e, s = "id") {
    let i, n = -1;
    return this.isEmpty(t) || t.forEach((r, o) => {
      this.isExistJsonKey(r, s) && r[s].toString() === e.toString() && (i = this.getJsonClone(r), n = o);
    }), n === -1 ? null : { info: i, inx: n };
  }
  /**
   * 复制数组
   * @param arr
   * @returns {Array}
   */
  static getArrClone(t) {
    return this.isEmpty(t) ? [] : t.map((e) => e);
  }
  static getArrByList(t, e = "id") {
    const s = [];
    return this.isEmpty(t) || t.forEach((i) => {
      this.isExistJsonKey(i, e) && s.push(i[e]);
    }), s;
  }
  static getArrRemoveById(t, e) {
    if (this.isEmpty(e))
      return t;
    const s = [], i = this.isArray(e) ? e : this.split(e.toString()), n = this.getArrConvertJson(i);
    return t.forEach((r) => {
      this.isExistJsonKey(n, r.toString()) || s.push(r);
    }), s;
  }
  static getArrByMinMax(t = 1, e) {
    const s = [];
    for (let i = t; i <= e; i += 1)
      s.push(i);
    return s;
  }
  /**
   * 数组去重
   * @param arr 
   * @returns 
   */
  static getArrUnique(t) {
    const e = [];
    if (t.length > 0) {
      const s = {};
      let i = null;
      for (let n = 0; n < t.length; n += 1)
        i = t[n], i !== null && !s[i] && (e.push(i), s[i] = !0);
    }
    return e;
  }
  static getArrConvertJson(t) {
    const e = {};
    return t.forEach((s) => {
      e[s.toString()] = !0;
    }), e;
  }
  // //数组排序
  static getArrAsc(t, e) {
    let s;
    switch (e) {
      case "date":
        s = (i, n) => Date.parse(i) - Date.parse(n);
        break;
      case "number":
        s = (i, n) => i - n;
        break;
      default:
        s = (i, n) => this._arrSortString(i.toString(), n.toString());
    }
    return t.sort(s);
  }
  static getArrDesc(t, e) {
    let s;
    switch (e) {
      case "date":
        s = (i, n) => Date.parse(n) - Date.parse(i);
        break;
      case "number":
        s = (i, n) => n - i;
        break;
      default:
        s = (i, n) => this._arrSortString(n.toString(), i.toString());
    }
    return t.sort(s);
  }
  static _arrSortString(t, e) {
    let s = 0;
    for (let i = 0; ; i++) {
      if (!t[i] || !e[i]) {
        s = t.length - e.length;
        break;
      }
      const n = t[i], r = this._getChartType(n), o = e[i], c = this._getChartType(o);
      if (r[0] === c[0]) {
        if (n === o)
          continue;
        r[0] === "zh" ? s = n.localeCompare(o) : r[0] === "en" ? s = n.charCodeAt(0) - o.charCodeAt(0) : s = n - o;
        break;
      } else {
        s = r[1] - c[1];
        break;
      }
    }
    return s;
  }
  static _getChartType(t) {
    return /^[0-9]$/.test(t) ? ["number", 100] : /^[a-zA-Z]$/.test(t) ? ["en", 200] : /^[\u4e00-\u9fa5]$/.test(t) ? ["zh", 300] : ["others", 999];
  }
  static getZeroCount(t) {
    if (t <= 0)
      return "";
    const e = [];
    for (let s = 0; s < t; s += 1)
      e.push("0");
    return e.join("");
  }
  /** 补全零 */
  static getFillZero(t, e = 2, s = "l") {
    const i = this.getZeroCount(e), n = this.isEmpty(t) ? "" : t.toString();
    let r = "", o = "";
    return s === "l" ? (r = i + n, o = r.substring(r.length - e)) : (r = n.toString() + i, o = r.substring(0, e)), o;
  }
  /**
   * 获取随机数
   * @param {number} len
   * @returns {any}
   */
  static getRandom(t = 3) {
    const e = t > 0 ? t : 1;
    let s = Math.random();
    return s = Math.ceil(s * 10 ** (e - 1)), this.getFillZero(s, t, "r");
  }
  /**
   * 指定范围获取随机数
   * @param {number} min
   * @param {number} max
   * @returns {number}
   */
  static getRandomRange(t, e, s = !0) {
    const i = e - t, n = Math.random();
    return t + (s ? Math.round(i * n) : i * n);
  }
  /**
   * 验证码
   */
  static getCaptcha(t = 6) {
    const e = "0123456789";
    let s = "";
    for (let i = 0; i < t; i++)
      s += e.charAt(Math.floor(Math.random() * e.length));
    return s;
  }
  /**
   * 字符串格式化(int float2)
   * @param value
   * @param type num int float float2 float3 date dateTime time  string intArray
   */
  static getValueByFormat(t, e, s = {}) {
    let i;
    switch (e) {
      case "num":
      case "int":
      case "float":
      case "float2":
      case "float3":
      case "number": {
        if (this.isNumber(t))
          if (this.isEmpty(t))
            i = (this.isBoolean(s.isEmptyDefault) ? s.isEmptyDefault : !0) ? "0" : t;
          else {
            let n = t.toString();
            if (n = this.isExistValue(n, ",") ? this.removeReplace(n) : n, e === "number")
              i = Number(n);
            else {
              let r = 0;
              if (e === "num" ? r = this.isExistValue(n, ".") ? 2 : 0 : e === "int" ? r = 0 : e === "float" ? this.isNumber(s.decimalNum) && (r = parseInt(s.decimalNum)) : e === "float2" ? r = 2 : e === "float3" && (r = 3), this.isBoolean(s.isRounding) ? s.isRounding : !0)
                i = parseFloat(n).toFixed(r);
              else if (r > 0) {
                const a = n.split("."), l = a[1].length;
                i = a[0] + "." + a[1].substring(0, l > r ? r : l);
              } else
                i = parseInt(n).toString();
              i = Number(i).toFixed(r), (this.isBoolean(s.isThousands) ? s.isThousands : !0) && (i = this.getFormatThousands(i));
            }
          }
        else
          i = t;
        break;
      }
      case "date":
      case "dateTime":
      case "time": {
        if (this.isEmpty(t))
          i = t;
        else {
          let n = "";
          this.isEmpty(s.dateFormat) ? e === "dateTime" ? n = "YYYY-MM-DD HH:mm:ss" : e === "time" ? n = "HH:mm:ss" : n = "YYYY-MM-DD" : n = s.dateFormat;
          const r = J[e];
          r ? i = r(t, n) : i = t;
        }
        break;
      }
      case "string":
        i = t.toString();
        break;
      case "intArray":
        i = t.split(",").map((n) => parseInt(n));
        break;
      default:
        i = t;
    }
    return i;
  }
  /**
   * 小时格式
   * @param start 开始
   * @param end  结束
   * @returns 格式： 01:00-02:59
   */
  static getHourInterval(t, e = "") {
    const s = this.isEmpty(e) ? t : e;
    return `${this.getFillZero(t)}:00-${this.getFillZero(s)}:59`;
  }
  /** 转化千分位 */
  static getFormatThousands(t) {
    if (!this.isNumber(t))
      return "";
    const e = this.split(t.toString(), ".");
    return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (e.length > 1 ? `.${e[1]}` : "");
  }
  /**
   * 指定位 数字加一,位之后零补充
   * @param value 值
   * @param opt  inxPos(第几位 默认第二位) isCeil(最后数字是否ceil) isRounding(是否四舍五入,优先isCeil) isEndFive (最后数字是否5/0)
   * @returns
   */
  static getNumCeil(t, e = {}) {
    if (!this.isNumber(t))
      return 0;
    const s = Number(t), i = s < 0, n = Math.abs(s);
    if (n === 0)
      return 0;
    const r = n < 1;
    let o = 0, c = n.toString(), a = -1;
    if (r) {
      if (a = -1, n > 0) {
        const d = c.split(".")[1];
        c = Number(d).toString(), o = d.length - c.length;
      }
    } else
      o = 0, a = c.indexOf("."), a > -1 && (c = c.replace(".", ""));
    const l = this.isBoolean(e.isCeil) ? e.isCeil : !0, h = this.isUndefined(e.inxPos) ? 2 : parseInt(e.inxPos), b = this.isBoolean(e.isEndFive) ? e.isEndFive : !1, f = this.isBoolean(e.isRounding) ? e.isRounding : !1;
    let g, p = "";
    h < c.length ? (g = c.substring(0, h), p = c.substring(h)) : g = c;
    let u = "";
    const m = l || f && p.length > 0 && parseInt(p.substring(0, 1)) >= 5 ? (parseInt(g) + 1).toString() : parseInt(g).toString(), y = parseInt(m.substring(m.length - 1));
    if (b)
      if (y === 5 || y === 0)
        u = m;
      else {
        const d = parseInt(m.substring(0, h - 1));
        y > 5 ? u = `${d + 1}0` : y < 5 && (u = `${d}5`), m.length > h && u.length === h && (u = `${u}0`);
      }
    else
      u = m;
    let w = "", E = 0;
    a === -1 ? E = p.length : a < h ? (E = 0, u = (Number(u) / ((h - a) * 10)).toString()) : a > h && (E = a - h), w = this.getZeroCount(E), r && (u = `0.${this.getZeroCount(o)}${u}`);
    const C = u + w;
    return Number(C) * (i ? -1 : 1);
  }
  static removeReplace(t, e = ",") {
    if (this.isUndefined(t))
      return "";
    const s = new RegExp(`[${e}]`, "g");
    return t.toString().replace(s, "");
  }
  /**
   * 转换空为零
   * @param json 
   * @param mapKey 
   * @param optExt 
   * @returns 
   */
  static conversionEmptyZero(t, e, s) {
    const i = t;
    if (!this.isEmpty(e)) {
      let n = 0, r = 0;
      if (s) {
        let o = {};
        this.isString(s) ? o.emptyDef = s : this.isObject(s) && (o = s);
        const c = this.isEmpty(o.undefinedDef);
        c || (r = o.undefinedDef), this.isEmpty(o.emptyDef) || (n = o.emptyDef, c && (r = o.emptyDef));
      }
      e.forEach((o) => {
        this.isEmpty(t[o]) && (this.isUndefined(t[o]) ? i[o] = r : i[o] = n);
      });
    }
    return i;
  }
  /**
   * 转换百分比
   * @param {any} json
   * @param {string[]} mapKey
   */
  static conversionPercentage(t, e, s = !0) {
    const i = t;
    return this.isEmpty(e) || e.forEach((n) => {
      const r = t[n];
      this.isEmpty(r) ? i[n] = 0 : this.isNumber(r) ? i[n] = s ? r * 100 : r / 100 : i[n] = r;
    }), i;
  }
  /**
   * 转换格式化的字符串
   * @param {string} strFormat
   * @param {any} json
   * @returns {string}
   */
  static convertStringFormat(t, e) {
    let s = t;
    return this.isEmpty(e) || (s = t.replace(/[$]{[^}]+}/g, (i) => {
      const n = i.replace("${", "").replace("}", "");
      return this.isExistJsonKey(e, n) ? e[n] : i;
    })), s;
  }
  static getQueryString(t, e) {
    const s = new RegExp(`(^|&)${e}=([^&]*)(&|$)`, "i"), i = t.substring(t.indexOf("?") + 1).match(s);
    return i !== null ? decodeURI(i[2]) : "";
  }
  static getQueryStringByHash(t) {
    return this.getQueryString(window.location.hash, t);
  }
  static encodeHTML(t) {
    return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
  }
  static removeHTMLTags(t) {
    return t.replace(/<[^>]*>/g, "");
  }
  static requestAnimationFrame(t) {
    const e = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
    return e ? e.call(window, t) : window.setTimeout(t, 1e3 / 60);
  }
  static cancelAnimationFrame(t) {
    const e = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;
    e ? e.call(window, t) : window.clearTimeout(t);
  }
}
export {
  x as C,
  A as r
};
//# sourceMappingURL=base-PQGakkrl.js.map
