"use strict";
/**
* @vue/shared v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function makeMap(str, expectsLowerCase) {
  const set2 = new Set(str.split(","));
  return expectsLowerCase ? (val2) => set2.has(val2.toLowerCase()) : (val2) => set2.has(val2);
}
const EMPTY_OBJ = Object.freeze({});
const EMPTY_ARR = Object.freeze([]);
const NOOP = () => {
};
const NO = () => false;
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
const isModelListener = (key) => key.startsWith("onUpdate:");
const extend = Object.assign;
const remove = (arr, el) => {
  const i3 = arr.indexOf(el);
  if (i3 > -1) {
    arr.splice(i3, 1);
  }
};
const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
const hasOwn$1 = (val2, key) => hasOwnProperty$2.call(val2, key);
const isArray = Array.isArray;
const isMap = (val2) => toTypeString(val2) === "[object Map]";
const isSet = (val2) => toTypeString(val2) === "[object Set]";
const isFunction = (val2) => typeof val2 === "function";
const isString = (val2) => typeof val2 === "string";
const isSymbol = (val2) => typeof val2 === "symbol";
const isObject$1 = (val2) => val2 !== null && typeof val2 === "object";
const isPromise = (val2) => {
  return (isObject$1(val2) || isFunction(val2)) && isFunction(val2.then) && isFunction(val2.catch);
};
const objectToString = Object.prototype.toString;
const toTypeString = (value) => objectToString.call(value);
const toRawType = (value) => {
  return toTypeString(value).slice(8, -1);
};
const isPlainObject$1 = (val2) => toTypeString(val2) === "[object Object]";
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
const isReservedProp = /* @__PURE__ */ makeMap(
  // the leading comma is intentional so empty string "" is also included
  ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
);
const isBuiltInDirective = /* @__PURE__ */ makeMap(
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
);
const cacheStringFunction = (fn2) => {
  const cache = /* @__PURE__ */ Object.create(null);
  return (str) => {
    const hit = cache[str];
    return hit || (cache[str] = fn2(str));
  };
};
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
  return str.replace(camelizeRE, (_2, c3) => c3 ? c3.toUpperCase() : "");
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction(
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
);
const capitalize = cacheStringFunction((str) => {
  return str.charAt(0).toUpperCase() + str.slice(1);
});
const toHandlerKey = cacheStringFunction((str) => {
  const s3 = str ? `on${capitalize(str)}` : ``;
  return s3;
});
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
const invokeArrayFns$1 = (fns, arg) => {
  for (let i3 = 0; i3 < fns.length; i3++) {
    fns[i3](arg);
  }
};
const def = (obj, key, value) => {
  Object.defineProperty(obj, key, {
    configurable: true,
    enumerable: false,
    value
  });
};
const looseToNumber = (val2) => {
  const n2 = parseFloat(val2);
  return isNaN(n2) ? val2 : n2;
};
function normalizeStyle(value) {
  if (isArray(value)) {
    const res = {};
    for (let i3 = 0; i3 < value.length; i3++) {
      const item = value[i3];
      const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
      if (normalized) {
        for (const key in normalized) {
          res[key] = normalized[key];
        }
      }
    }
    return res;
  } else if (isString(value) || isObject$1(value)) {
    return value;
  }
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:([^]+)/;
const styleCommentRE = /\/\*[^]*?\*\//g;
function parseStringStyle(cssText) {
  const ret = {};
  cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
    if (item) {
      const tmp = item.split(propertyDelimiterRE);
      tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
    }
  });
  return ret;
}
function normalizeClass(value) {
  let res = "";
  if (isString(value)) {
    res = value;
  } else if (isArray(value)) {
    for (let i3 = 0; i3 < value.length; i3++) {
      const normalized = normalizeClass(value[i3]);
      if (normalized) {
        res += normalized + " ";
      }
    }
  } else if (isObject$1(value)) {
    for (const name in value) {
      if (value[name]) {
        res += name + " ";
      }
    }
  }
  return res.trim();
}
const toDisplayString = (val2) => {
  return isString(val2) ? val2 : val2 == null ? "" : isArray(val2) || isObject$1(val2) && (val2.toString === objectToString || !isFunction(val2.toString)) ? JSON.stringify(val2, replacer, 2) : String(val2);
};
const replacer = (_key, val2) => {
  if (val2 && val2.__v_isRef) {
    return replacer(_key, val2.value);
  } else if (isMap(val2)) {
    return {
      [`Map(${val2.size})`]: [...val2.entries()].reduce(
        (entries, [key, val22], i3) => {
          entries[stringifySymbol(key, i3) + " =>"] = val22;
          return entries;
        },
        {}
      )
    };
  } else if (isSet(val2)) {
    return {
      [`Set(${val2.size})`]: [...val2.values()].map((v3) => stringifySymbol(v3))
    };
  } else if (isSymbol(val2)) {
    return stringifySymbol(val2);
  } else if (isObject$1(val2) && !isArray(val2) && !isPlainObject$1(val2)) {
    return String(val2);
  }
  return val2;
};
const stringifySymbol = (v3, i3 = "") => {
  var _a;
  return isSymbol(v3) ? `Symbol(${(_a = v3.description) != null ? _a : i3})` : v3;
};
const isObject = (val2) => val2 !== null && typeof val2 === "object";
const defaultDelimiters = ["{", "}"];
class BaseFormatter {
  constructor() {
    this._caches = /* @__PURE__ */ Object.create(null);
  }
  interpolate(message, values, delimiters = defaultDelimiters) {
    if (!values) {
      return [message];
    }
    let tokens = this._caches[message];
    if (!tokens) {
      tokens = parse(message, delimiters);
      this._caches[message] = tokens;
    }
    return compile$1(tokens, values);
  }
}
const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
function parse(format, [startDelimiter, endDelimiter]) {
  const tokens = [];
  let position = 0;
  let text = "";
  while (position < format.length) {
    let char = format[position++];
    if (char === startDelimiter) {
      if (text) {
        tokens.push({ type: "text", value: text });
      }
      text = "";
      let sub = "";
      char = format[position++];
      while (char !== void 0 && char !== endDelimiter) {
        sub += char;
        char = format[position++];
      }
      const isClosed = char === endDelimiter;
      const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
      tokens.push({ value: sub, type });
    } else {
      text += char;
    }
  }
  text && tokens.push({ type: "text", value: text });
  return tokens;
}
function compile$1(tokens, values) {
  const compiled = [];
  let index2 = 0;
  const mode = Array.isArray(values) ? "list" : isObject(values) ? "named" : "unknown";
  if (mode === "unknown") {
    return compiled;
  }
  while (index2 < tokens.length) {
    const token = tokens[index2];
    switch (token.type) {
      case "text":
        compiled.push(token.value);
        break;
      case "list":
        compiled.push(values[parseInt(token.value, 10)]);
        break;
      case "named":
        if (mode === "named") {
          compiled.push(values[token.value]);
        } else {
          {
            console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);
          }
        }
        break;
      case "unknown":
        {
          console.warn(`Detect 'unknown' type of token!`);
        }
        break;
    }
    index2++;
  }
  return compiled;
}
const LOCALE_ZH_HANS = "zh-Hans";
const LOCALE_ZH_HANT = "zh-Hant";
const LOCALE_EN = "en";
const LOCALE_FR = "fr";
const LOCALE_ES = "es";
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
const hasOwn = (val2, key) => hasOwnProperty$1.call(val2, key);
const defaultFormatter = new BaseFormatter();
function include(str, parts) {
  return !!parts.find((part) => str.indexOf(part) !== -1);
}
function startsWith(str, parts) {
  return parts.find((part) => str.indexOf(part) === 0);
}
function normalizeLocale(locale, messages) {
  if (!locale) {
    return;
  }
  locale = locale.trim().replace(/_/g, "-");
  if (messages && messages[locale]) {
    return locale;
  }
  locale = locale.toLowerCase();
  if (locale === "chinese") {
    return LOCALE_ZH_HANS;
  }
  if (locale.indexOf("zh") === 0) {
    if (locale.indexOf("-hans") > -1) {
      return LOCALE_ZH_HANS;
    }
    if (locale.indexOf("-hant") > -1) {
      return LOCALE_ZH_HANT;
    }
    if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
      return LOCALE_ZH_HANT;
    }
    return LOCALE_ZH_HANS;
  }
  let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  if (messages && Object.keys(messages).length > 0) {
    locales = Object.keys(messages);
  }
  const lang = startsWith(locale, locales);
  if (lang) {
    return lang;
  }
}
class I18n {
  constructor({ locale, fallbackLocale, messages, watcher, formater: formater2 }) {
    this.locale = LOCALE_EN;
    this.fallbackLocale = LOCALE_EN;
    this.message = {};
    this.messages = {};
    this.watchers = [];
    if (fallbackLocale) {
      this.fallbackLocale = fallbackLocale;
    }
    this.formater = formater2 || defaultFormatter;
    this.messages = messages || {};
    this.setLocale(locale || LOCALE_EN);
    if (watcher) {
      this.watchLocale(watcher);
    }
  }
  setLocale(locale) {
    const oldLocale = this.locale;
    this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
    if (!this.messages[this.locale]) {
      this.messages[this.locale] = {};
    }
    this.message = this.messages[this.locale];
    if (oldLocale !== this.locale) {
      this.watchers.forEach((watcher) => {
        watcher(this.locale, oldLocale);
      });
    }
  }
  getLocale() {
    return this.locale;
  }
  watchLocale(fn2) {
    const index2 = this.watchers.push(fn2) - 1;
    return () => {
      this.watchers.splice(index2, 1);
    };
  }
  add(locale, message, override = true) {
    const curMessages = this.messages[locale];
    if (curMessages) {
      if (override) {
        Object.assign(curMessages, message);
      } else {
        Object.keys(message).forEach((key) => {
          if (!hasOwn(curMessages, key)) {
            curMessages[key] = message[key];
          }
        });
      }
    } else {
      this.messages[locale] = message;
    }
  }
  f(message, values, delimiters) {
    return this.formater.interpolate(message, values, delimiters).join("");
  }
  t(key, locale, values) {
    let message = this.message;
    if (typeof locale === "string") {
      locale = normalizeLocale(locale, this.messages);
      locale && (message = this.messages[locale]);
    } else {
      values = locale;
    }
    if (!hasOwn(message, key)) {
      console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
      return key;
    }
    return this.formater.interpolate(message[key], values).join("");
  }
}
function watchAppLocale(appVm, i18n) {
  if (appVm.$watchLocale) {
    appVm.$watchLocale((newLocale) => {
      i18n.setLocale(newLocale);
    });
  } else {
    appVm.$watch(() => appVm.$locale, (newLocale) => {
      i18n.setLocale(newLocale);
    });
  }
}
function getDefaultLocale() {
  if (typeof index !== "undefined" && index.getLocale) {
    return index.getLocale();
  }
  if (typeof global !== "undefined" && global.getLocale) {
    return global.getLocale();
  }
  return LOCALE_EN;
}
function initVueI18n(locale, messages = {}, fallbackLocale, watcher) {
  if (typeof locale !== "string") {
    const options = [
      messages,
      locale
    ];
    locale = options[0];
    messages = options[1];
  }
  if (typeof locale !== "string") {
    locale = getDefaultLocale();
  }
  if (typeof fallbackLocale !== "string") {
    fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  }
  const i18n = new I18n({
    locale,
    fallbackLocale,
    messages,
    watcher
  });
  let t2 = (key, values) => {
    if (typeof getApp !== "function") {
      t2 = function(key2, values2) {
        return i18n.t(key2, values2);
      };
    } else {
      let isWatchedAppLocale = false;
      t2 = function(key2, values2) {
        const appVm = getApp().$vm;
        if (appVm) {
          appVm.$locale;
          if (!isWatchedAppLocale) {
            isWatchedAppLocale = true;
            watchAppLocale(appVm, i18n);
          }
        }
        return i18n.t(key2, values2);
      };
    }
    return t2(key, values);
  };
  return {
    i18n,
    f(message, values, delimiters) {
      return i18n.f(message, values, delimiters);
    },
    t(key, values) {
      return t2(key, values);
    },
    add(locale2, message, override = true) {
      return i18n.add(locale2, message, override);
    },
    watch(fn2) {
      return i18n.watchLocale(fn2);
    },
    getLocale() {
      return i18n.getLocale();
    },
    setLocale(newLocale) {
      return i18n.setLocale(newLocale);
    }
  };
}
const SLOT_DEFAULT_NAME = "d";
const ON_SHOW = "onShow";
const ON_HIDE = "onHide";
const ON_LAUNCH = "onLaunch";
const ON_ERROR = "onError";
const ON_THEME_CHANGE = "onThemeChange";
const ON_PAGE_NOT_FOUND = "onPageNotFound";
const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
const ON_EXIT = "onExit";
const ON_LOAD = "onLoad";
const ON_READY = "onReady";
const ON_UNLOAD = "onUnload";
const ON_INIT = "onInit";
const ON_SAVE_EXIT_STATE = "onSaveExitState";
const ON_RESIZE = "onResize";
const ON_BACK_PRESS = "onBackPress";
const ON_PAGE_SCROLL = "onPageScroll";
const ON_TAB_ITEM_TAP = "onTabItemTap";
const ON_REACH_BOTTOM = "onReachBottom";
const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
const ON_SHARE_TIMELINE = "onShareTimeline";
const ON_SHARE_CHAT = "onShareChat";
const ON_ADD_TO_FAVORITES = "onAddToFavorites";
const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
const VIRTUAL_HOST_STYLE = "virtualHostStyle";
const VIRTUAL_HOST_CLASS = "virtualHostClass";
const VIRTUAL_HOST_HIDDEN = "virtualHostHidden";
const VIRTUAL_HOST_ID = "virtualHostId";
function hasLeadingSlash(str) {
  return str.indexOf("/") === 0;
}
function addLeadingSlash(str) {
  return hasLeadingSlash(str) ? str : "/" + str;
}
const invokeArrayFns = (fns, arg) => {
  let ret;
  for (let i3 = 0; i3 < fns.length; i3++) {
    ret = fns[i3](arg);
  }
  return ret;
};
function once(fn2, ctx = null) {
  let res;
  return (...args) => {
    if (fn2) {
      res = fn2.apply(ctx, args);
      fn2 = null;
    }
    return res;
  };
}
function getValueByDataPath(obj, path) {
  if (!isString(path)) {
    return;
  }
  path = path.replace(/\[(\d+)\]/g, ".$1");
  const parts = path.split(".");
  let key = parts[0];
  if (!obj) {
    obj = {};
  }
  if (parts.length === 1) {
    return obj[key];
  }
  return getValueByDataPath(obj[key], parts.slice(1).join("."));
}
function sortObject(obj) {
  let sortObj = {};
  if (isPlainObject$1(obj)) {
    Object.keys(obj).sort().forEach((key) => {
      const _key = key;
      sortObj[_key] = obj[_key];
    });
  }
  return !Object.keys(sortObj) ? obj : sortObj;
}
const customizeRE = /:/g;
function customizeEvent(str) {
  return camelize(str.replace(customizeRE, "-"));
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
  const res = obj ? Object.keys(obj).map((key) => {
    let val2 = obj[key];
    if (typeof val2 === void 0 || val2 === null) {
      val2 = "";
    } else if (isPlainObject$1(val2)) {
      val2 = JSON.stringify(val2);
    }
    return encodeStr(key) + "=" + encodeStr(val2);
  }).filter((x2) => x2.length > 0).join("&") : null;
  return res ? `?${res}` : "";
}
const PAGE_HOOKS = [
  ON_INIT,
  ON_LOAD,
  ON_SHOW,
  ON_HIDE,
  ON_UNLOAD,
  ON_BACK_PRESS,
  ON_PAGE_SCROLL,
  ON_TAB_ITEM_TAP,
  ON_REACH_BOTTOM,
  ON_PULL_DOWN_REFRESH,
  ON_SHARE_TIMELINE,
  ON_SHARE_APP_MESSAGE,
  ON_SHARE_CHAT,
  ON_ADD_TO_FAVORITES,
  ON_SAVE_EXIT_STATE,
  ON_NAVIGATION_BAR_BUTTON_TAP,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
];
function isRootHook(name) {
  return PAGE_HOOKS.indexOf(name) > -1;
}
const UniLifecycleHooks = [
  ON_SHOW,
  ON_HIDE,
  ON_LAUNCH,
  ON_ERROR,
  ON_THEME_CHANGE,
  ON_PAGE_NOT_FOUND,
  ON_UNHANDLE_REJECTION,
  ON_EXIT,
  ON_INIT,
  ON_LOAD,
  ON_READY,
  ON_UNLOAD,
  ON_RESIZE,
  ON_BACK_PRESS,
  ON_PAGE_SCROLL,
  ON_TAB_ITEM_TAP,
  ON_REACH_BOTTOM,
  ON_PULL_DOWN_REFRESH,
  ON_SHARE_TIMELINE,
  ON_ADD_TO_FAVORITES,
  ON_SHARE_APP_MESSAGE,
  ON_SHARE_CHAT,
  ON_SAVE_EXIT_STATE,
  ON_NAVIGATION_BAR_BUTTON_TAP,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
];
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  return {
    onPageScroll: 1,
    onShareAppMessage: 1 << 1,
    onShareTimeline: 1 << 2
  };
})();
function isUniLifecycleHook(name, value, checkType = true) {
  if (checkType && !isFunction(value)) {
    return false;
  }
  if (UniLifecycleHooks.indexOf(name) > -1) {
    return true;
  } else if (name.indexOf("on") === 0) {
    return true;
  }
  return false;
}
let vueApp;
const createVueAppHooks = [];
function onCreateVueApp(hook) {
  if (vueApp) {
    return hook(vueApp);
  }
  createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
  vueApp = app;
  createVueAppHooks.forEach((hook) => hook(app));
}
const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  return createErrorHandler2(app);
});
const E$2 = function() {
};
E$2.prototype = {
  _id: 1,
  on: function(name, callback, ctx) {
    var e3 = this.e || (this.e = {});
    (e3[name] || (e3[name] = [])).push({
      fn: callback,
      ctx,
      _id: this._id
    });
    return this._id++;
  },
  once: function(name, callback, ctx) {
    var self2 = this;
    function listener() {
      self2.off(name, listener);
      callback.apply(ctx, arguments);
    }
    listener._ = callback;
    return this.on(name, listener, ctx);
  },
  emit: function(name) {
    var data = [].slice.call(arguments, 1);
    var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
    var i3 = 0;
    var len = evtArr.length;
    for (i3; i3 < len; i3++) {
      evtArr[i3].fn.apply(evtArr[i3].ctx, data);
    }
    return this;
  },
  off: function(name, event) {
    var e3 = this.e || (this.e = {});
    var evts = e3[name];
    var liveEvents = [];
    if (evts && event) {
      for (var i3 = evts.length - 1; i3 >= 0; i3--) {
        if (evts[i3].fn === event || evts[i3].fn._ === event || evts[i3]._id === event) {
          evts.splice(i3, 1);
          break;
        }
      }
      liveEvents = evts;
    }
    liveEvents.length ? e3[name] = liveEvents : delete e3[name];
    return this;
  }
};
var E$1$1 = E$2;
/**
* @dcloudio/uni-mp-vue v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function warn$2(msg, ...args) {
  console.warn(`[Vue warn] ${msg}`, ...args);
}
let activeEffectScope;
class EffectScope {
  constructor(detached = false) {
    this.detached = detached;
    this._active = true;
    this.effects = [];
    this.cleanups = [];
    this.parent = activeEffectScope;
    if (!detached && activeEffectScope) {
      this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
        this
      ) - 1;
    }
  }
  get active() {
    return this._active;
  }
  run(fn2) {
    if (this._active) {
      const currentEffectScope = activeEffectScope;
      try {
        activeEffectScope = this;
        return fn2();
      } finally {
        activeEffectScope = currentEffectScope;
      }
    } else {
      warn$2(`cannot run an inactive effect scope.`);
    }
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  on() {
    activeEffectScope = this;
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  off() {
    activeEffectScope = this.parent;
  }
  stop(fromParent) {
    if (this._active) {
      let i3, l2;
      for (i3 = 0, l2 = this.effects.length; i3 < l2; i3++) {
        this.effects[i3].stop();
      }
      for (i3 = 0, l2 = this.cleanups.length; i3 < l2; i3++) {
        this.cleanups[i3]();
      }
      if (this.scopes) {
        for (i3 = 0, l2 = this.scopes.length; i3 < l2; i3++) {
          this.scopes[i3].stop(true);
        }
      }
      if (!this.detached && this.parent && !fromParent) {
        const last = this.parent.scopes.pop();
        if (last && last !== this) {
          this.parent.scopes[this.index] = last;
          last.index = this.index;
        }
      }
      this.parent = void 0;
      this._active = false;
    }
  }
}
function effectScope(detached) {
  return new EffectScope(detached);
}
function recordEffectScope(effect2, scope = activeEffectScope) {
  if (scope && scope.active) {
    scope.effects.push(effect2);
  }
}
function getCurrentScope() {
  return activeEffectScope;
}
function onScopeDispose(fn2) {
  if (activeEffectScope) {
    activeEffectScope.cleanups.push(fn2);
  } else {
    warn$2(
      `onScopeDispose() is called when there is no active effect scope to be associated with.`
    );
  }
}
let activeEffect;
class ReactiveEffect {
  constructor(fn2, trigger2, scheduler, scope) {
    this.fn = fn2;
    this.trigger = trigger2;
    this.scheduler = scheduler;
    this.active = true;
    this.deps = [];
    this._dirtyLevel = 4;
    this._trackId = 0;
    this._runnings = 0;
    this._shouldSchedule = false;
    this._depsLength = 0;
    recordEffectScope(this, scope);
  }
  get dirty() {
    if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
      this._dirtyLevel = 1;
      pauseTracking();
      for (let i3 = 0; i3 < this._depsLength; i3++) {
        const dep = this.deps[i3];
        if (dep.computed) {
          triggerComputed(dep.computed);
          if (this._dirtyLevel >= 4) {
            break;
          }
        }
      }
      if (this._dirtyLevel === 1) {
        this._dirtyLevel = 0;
      }
      resetTracking();
    }
    return this._dirtyLevel >= 4;
  }
  set dirty(v3) {
    this._dirtyLevel = v3 ? 4 : 0;
  }
  run() {
    this._dirtyLevel = 0;
    if (!this.active) {
      return this.fn();
    }
    let lastShouldTrack = shouldTrack;
    let lastEffect = activeEffect;
    try {
      shouldTrack = true;
      activeEffect = this;
      this._runnings++;
      preCleanupEffect(this);
      return this.fn();
    } finally {
      postCleanupEffect(this);
      this._runnings--;
      activeEffect = lastEffect;
      shouldTrack = lastShouldTrack;
    }
  }
  stop() {
    var _a;
    if (this.active) {
      preCleanupEffect(this);
      postCleanupEffect(this);
      (_a = this.onStop) == null ? void 0 : _a.call(this);
      this.active = false;
    }
  }
}
function triggerComputed(computed2) {
  return computed2.value;
}
function preCleanupEffect(effect2) {
  effect2._trackId++;
  effect2._depsLength = 0;
}
function postCleanupEffect(effect2) {
  if (effect2.deps.length > effect2._depsLength) {
    for (let i3 = effect2._depsLength; i3 < effect2.deps.length; i3++) {
      cleanupDepEffect(effect2.deps[i3], effect2);
    }
    effect2.deps.length = effect2._depsLength;
  }
}
function cleanupDepEffect(dep, effect2) {
  const trackId = dep.get(effect2);
  if (trackId !== void 0 && effect2._trackId !== trackId) {
    dep.delete(effect2);
    if (dep.size === 0) {
      dep.cleanup();
    }
  }
}
let shouldTrack = true;
let pauseScheduleStack = 0;
const trackStack = [];
function pauseTracking() {
  trackStack.push(shouldTrack);
  shouldTrack = false;
}
function resetTracking() {
  const last = trackStack.pop();
  shouldTrack = last === void 0 ? true : last;
}
function pauseScheduling() {
  pauseScheduleStack++;
}
function resetScheduling() {
  pauseScheduleStack--;
  while (!pauseScheduleStack && queueEffectSchedulers.length) {
    queueEffectSchedulers.shift()();
  }
}
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  var _a;
  if (dep.get(effect2) !== effect2._trackId) {
    dep.set(effect2, effect2._trackId);
    const oldDep = effect2.deps[effect2._depsLength];
    if (oldDep !== dep) {
      if (oldDep) {
        cleanupDepEffect(oldDep, effect2);
      }
      effect2.deps[effect2._depsLength++] = dep;
    } else {
      effect2._depsLength++;
    }
    {
      (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
    }
  }
}
const queueEffectSchedulers = [];
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  var _a;
  pauseScheduling();
  for (const effect2 of dep.keys()) {
    let tracking;
    if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
      effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
      effect2._dirtyLevel = dirtyLevel;
    }
    if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
      {
        (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
      }
      effect2.trigger();
      if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
        effect2._shouldSchedule = false;
        if (effect2.scheduler) {
          queueEffectSchedulers.push(effect2.scheduler);
        }
      }
    }
  }
  resetScheduling();
}
const createDep = (cleanup, computed2) => {
  const dep = /* @__PURE__ */ new Map();
  dep.cleanup = cleanup;
  dep.computed = computed2;
  return dep;
};
const targetMap = /* @__PURE__ */ new WeakMap();
const ITERATE_KEY = Symbol("iterate");
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
function track(target, type, key) {
  if (shouldTrack && activeEffect) {
    let depsMap = targetMap.get(target);
    if (!depsMap) {
      targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
    }
    let dep = depsMap.get(key);
    if (!dep) {
      depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
    }
    trackEffect(
      activeEffect,
      dep,
      {
        target,
        type,
        key
      }
    );
  }
}
function trigger(target, type, key, newValue, oldValue, oldTarget) {
  const depsMap = targetMap.get(target);
  if (!depsMap) {
    return;
  }
  let deps = [];
  if (type === "clear") {
    deps = [...depsMap.values()];
  } else if (key === "length" && isArray(target)) {
    const newLength = Number(newValue);
    depsMap.forEach((dep, key2) => {
      if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
        deps.push(dep);
      }
    });
  } else {
    if (key !== void 0) {
      deps.push(depsMap.get(key));
    }
    switch (type) {
      case "add":
        if (!isArray(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
          if (isMap(target)) {
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
          }
        } else if (isIntegerKey(key)) {
          deps.push(depsMap.get("length"));
        }
        break;
      case "delete":
        if (!isArray(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
          if (isMap(target)) {
            deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
          }
        }
        break;
      case "set":
        if (isMap(target)) {
          deps.push(depsMap.get(ITERATE_KEY));
        }
        break;
    }
  }
  pauseScheduling();
  for (const dep of deps) {
    if (dep) {
      triggerEffects(
        dep,
        4,
        {
          target,
          type,
          key,
          newValue,
          oldValue,
          oldTarget
        }
      );
    }
  }
  resetScheduling();
}
function getDepFromReactive(object, key) {
  var _a;
  return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
}
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
const builtInSymbols = new Set(
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
);
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
function createArrayInstrumentations() {
  const instrumentations = {};
  ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
    instrumentations[key] = function(...args) {
      const arr = toRaw(this);
      for (let i3 = 0, l2 = this.length; i3 < l2; i3++) {
        track(arr, "get", i3 + "");
      }
      const res = arr[key](...args);
      if (res === -1 || res === false) {
        return arr[key](...args.map(toRaw));
      } else {
        return res;
      }
    };
  });
  ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
    instrumentations[key] = function(...args) {
      pauseTracking();
      pauseScheduling();
      const res = toRaw(this)[key].apply(this, args);
      resetScheduling();
      resetTracking();
      return res;
    };
  });
  return instrumentations;
}
function hasOwnProperty(key) {
  const obj = toRaw(this);
  track(obj, "has", key);
  return obj.hasOwnProperty(key);
}
class BaseReactiveHandler {
  constructor(_isReadonly = false, _isShallow = false) {
    this._isReadonly = _isReadonly;
    this._isShallow = _isShallow;
  }
  get(target, key, receiver) {
    const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
    if (key === "__v_isReactive") {
      return !isReadonly2;
    } else if (key === "__v_isReadonly") {
      return isReadonly2;
    } else if (key === "__v_isShallow") {
      return isShallow2;
    } else if (key === "__v_raw") {
      if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
      // this means the reciever is a user proxy of the reactive proxy
      Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
        return target;
      }
      return;
    }
    const targetIsArray = isArray(target);
    if (!isReadonly2) {
      if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
        return Reflect.get(arrayInstrumentations, key, receiver);
      }
      if (key === "hasOwnProperty") {
        return hasOwnProperty;
      }
    }
    const res = Reflect.get(target, key, receiver);
    if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
      return res;
    }
    if (!isReadonly2) {
      track(target, "get", key);
    }
    if (isShallow2) {
      return res;
    }
    if (isRef(res)) {
      return targetIsArray && isIntegerKey(key) ? res : res.value;
    }
    if (isObject$1(res)) {
      return isReadonly2 ? readonly(res) : reactive(res);
    }
    return res;
  }
}
class MutableReactiveHandler extends BaseReactiveHandler {
  constructor(isShallow2 = false) {
    super(false, isShallow2);
  }
  set(target, key, value, receiver) {
    let oldValue = target[key];
    if (!this._isShallow) {
      const isOldValueReadonly = isReadonly(oldValue);
      if (!isShallow(value) && !isReadonly(value)) {
        oldValue = toRaw(oldValue);
        value = toRaw(value);
      }
      if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
        if (isOldValueReadonly) {
          return false;
        } else {
          oldValue.value = value;
          return true;
        }
      }
    }
    const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
    const result = Reflect.set(target, key, value, receiver);
    if (target === toRaw(receiver)) {
      if (!hadKey) {
        trigger(target, "add", key, value);
      } else if (hasChanged(value, oldValue)) {
        trigger(target, "set", key, value, oldValue);
      }
    }
    return result;
  }
  deleteProperty(target, key) {
    const hadKey = hasOwn$1(target, key);
    const oldValue = target[key];
    const result = Reflect.deleteProperty(target, key);
    if (result && hadKey) {
      trigger(target, "delete", key, void 0, oldValue);
    }
    return result;
  }
  has(target, key) {
    const result = Reflect.has(target, key);
    if (!isSymbol(key) || !builtInSymbols.has(key)) {
      track(target, "has", key);
    }
    return result;
  }
  ownKeys(target) {
    track(
      target,
      "iterate",
      isArray(target) ? "length" : ITERATE_KEY
    );
    return Reflect.ownKeys(target);
  }
}
class ReadonlyReactiveHandler extends BaseReactiveHandler {
  constructor(isShallow2 = false) {
    super(true, isShallow2);
  }
  set(target, key) {
    {
      warn$2(
        `Set operation on key "${String(key)}" failed: target is readonly.`,
        target
      );
    }
    return true;
  }
  deleteProperty(target, key) {
    {
      warn$2(
        `Delete operation on key "${String(key)}" failed: target is readonly.`,
        target
      );
    }
    return true;
  }
}
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  true
);
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
const toShallow = (value) => value;
const getProto = (v3) => Reflect.getPrototypeOf(v3);
function get(target, key, isReadonly2 = false, isShallow2 = false) {
  target = target["__v_raw"];
  const rawTarget = toRaw(target);
  const rawKey = toRaw(key);
  if (!isReadonly2) {
    if (hasChanged(key, rawKey)) {
      track(rawTarget, "get", key);
    }
    track(rawTarget, "get", rawKey);
  }
  const { has: has2 } = getProto(rawTarget);
  const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  if (has2.call(rawTarget, key)) {
    return wrap(target.get(key));
  } else if (has2.call(rawTarget, rawKey)) {
    return wrap(target.get(rawKey));
  } else if (target !== rawTarget) {
    target.get(key);
  }
}
function has$1(key, isReadonly2 = false) {
  const target = this["__v_raw"];
  const rawTarget = toRaw(target);
  const rawKey = toRaw(key);
  if (!isReadonly2) {
    if (hasChanged(key, rawKey)) {
      track(rawTarget, "has", key);
    }
    track(rawTarget, "has", rawKey);
  }
  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
}
function size(target, isReadonly2 = false) {
  target = target["__v_raw"];
  !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  return Reflect.get(target, "size", target);
}
function add(value) {
  value = toRaw(value);
  const target = toRaw(this);
  const proto = getProto(target);
  const hadKey = proto.has.call(target, value);
  if (!hadKey) {
    target.add(value);
    trigger(target, "add", value, value);
  }
  return this;
}
function set$1(key, value) {
  value = toRaw(value);
  const target = toRaw(this);
  const { has: has2, get: get2 } = getProto(target);
  let hadKey = has2.call(target, key);
  if (!hadKey) {
    key = toRaw(key);
    hadKey = has2.call(target, key);
  } else {
    checkIdentityKeys(target, has2, key);
  }
  const oldValue = get2.call(target, key);
  target.set(key, value);
  if (!hadKey) {
    trigger(target, "add", key, value);
  } else if (hasChanged(value, oldValue)) {
    trigger(target, "set", key, value, oldValue);
  }
  return this;
}
function deleteEntry(key) {
  const target = toRaw(this);
  const { has: has2, get: get2 } = getProto(target);
  let hadKey = has2.call(target, key);
  if (!hadKey) {
    key = toRaw(key);
    hadKey = has2.call(target, key);
  } else {
    checkIdentityKeys(target, has2, key);
  }
  const oldValue = get2 ? get2.call(target, key) : void 0;
  const result = target.delete(key);
  if (hadKey) {
    trigger(target, "delete", key, void 0, oldValue);
  }
  return result;
}
function clear() {
  const target = toRaw(this);
  const hadItems = target.size !== 0;
  const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  const result = target.clear();
  if (hadItems) {
    trigger(target, "clear", void 0, void 0, oldTarget);
  }
  return result;
}
function createForEach(isReadonly2, isShallow2) {
  return function forEach(callback, thisArg) {
    const observed = this;
    const target = observed["__v_raw"];
    const rawTarget = toRaw(target);
    const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
    !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
    return target.forEach((value, key) => {
      return callback.call(thisArg, wrap(value), wrap(key), observed);
    });
  };
}
function createIterableMethod(method, isReadonly2, isShallow2) {
  return function(...args) {
    const target = this["__v_raw"];
    const rawTarget = toRaw(target);
    const targetIsMap = isMap(rawTarget);
    const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
    const isKeyOnly = method === "keys" && targetIsMap;
    const innerIterator = target[method](...args);
    const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
    !isReadonly2 && track(
      rawTarget,
      "iterate",
      isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
    );
    return {
      // iterator protocol
      next() {
        const { value, done } = innerIterator.next();
        return done ? { value, done } : {
          value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
          done
        };
      },
      // iterable protocol
      [Symbol.iterator]() {
        return this;
      }
    };
  };
}
function createReadonlyMethod(type) {
  return function(...args) {
    {
      const key = args[0] ? `on key "${args[0]}" ` : ``;
      warn$2(
        `${capitalize(type)} operation ${key}failed: target is readonly.`,
        toRaw(this)
      );
    }
    return type === "delete" ? false : type === "clear" ? void 0 : this;
  };
}
function createInstrumentations() {
  const mutableInstrumentations2 = {
    get(key) {
      return get(this, key);
    },
    get size() {
      return size(this);
    },
    has: has$1,
    add,
    set: set$1,
    delete: deleteEntry,
    clear,
    forEach: createForEach(false, false)
  };
  const shallowInstrumentations2 = {
    get(key) {
      return get(this, key, false, true);
    },
    get size() {
      return size(this);
    },
    has: has$1,
    add,
    set: set$1,
    delete: deleteEntry,
    clear,
    forEach: createForEach(false, true)
  };
  const readonlyInstrumentations2 = {
    get(key) {
      return get(this, key, true);
    },
    get size() {
      return size(this, true);
    },
    has(key) {
      return has$1.call(this, key, true);
    },
    add: createReadonlyMethod("add"),
    set: createReadonlyMethod("set"),
    delete: createReadonlyMethod("delete"),
    clear: createReadonlyMethod("clear"),
    forEach: createForEach(true, false)
  };
  const shallowReadonlyInstrumentations2 = {
    get(key) {
      return get(this, key, true, true);
    },
    get size() {
      return size(this, true);
    },
    has(key) {
      return has$1.call(this, key, true);
    },
    add: createReadonlyMethod("add"),
    set: createReadonlyMethod("set"),
    delete: createReadonlyMethod("delete"),
    clear: createReadonlyMethod("clear"),
    forEach: createForEach(true, true)
  };
  const iteratorMethods = [
    "keys",
    "values",
    "entries",
    Symbol.iterator
  ];
  iteratorMethods.forEach((method) => {
    mutableInstrumentations2[method] = createIterableMethod(method, false, false);
    readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
    shallowInstrumentations2[method] = createIterableMethod(method, false, true);
    shallowReadonlyInstrumentations2[method] = createIterableMethod(
      method,
      true,
      true
    );
  });
  return [
    mutableInstrumentations2,
    readonlyInstrumentations2,
    shallowInstrumentations2,
    shallowReadonlyInstrumentations2
  ];
}
const [
  mutableInstrumentations,
  readonlyInstrumentations,
  shallowInstrumentations,
  shallowReadonlyInstrumentations
] = /* @__PURE__ */ createInstrumentations();
function createInstrumentationGetter(isReadonly2, shallow) {
  const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  return (target, key, receiver) => {
    if (key === "__v_isReactive") {
      return !isReadonly2;
    } else if (key === "__v_isReadonly") {
      return isReadonly2;
    } else if (key === "__v_raw") {
      return target;
    }
    return Reflect.get(
      hasOwn$1(instrumentations, key) && key in target ? instrumentations : target,
      key,
      receiver
    );
  };
}
const mutableCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(false, false)
};
const shallowCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(false, true)
};
const readonlyCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(true, false)
};
const shallowReadonlyCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
};
function checkIdentityKeys(target, has2, key) {
  const rawKey = toRaw(key);
  if (rawKey !== key && has2.call(target, rawKey)) {
    const type = toRawType(target);
    warn$2(
      `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
    );
  }
}
const reactiveMap = /* @__PURE__ */ new WeakMap();
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
const readonlyMap = /* @__PURE__ */ new WeakMap();
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
function targetTypeMap(rawType) {
  switch (rawType) {
    case "Object":
    case "Array":
      return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
      return 2;
    default:
      return 0;
  }
}
function getTargetType(value) {
  return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
}
function reactive(target) {
  if (isReadonly(target)) {
    return target;
  }
  return createReactiveObject(
    target,
    false,
    mutableHandlers,
    mutableCollectionHandlers,
    reactiveMap
  );
}
function shallowReactive(target) {
  return createReactiveObject(
    target,
    false,
    shallowReactiveHandlers,
    shallowCollectionHandlers,
    shallowReactiveMap
  );
}
function readonly(target) {
  return createReactiveObject(
    target,
    true,
    readonlyHandlers,
    readonlyCollectionHandlers,
    readonlyMap
  );
}
function shallowReadonly(target) {
  return createReactiveObject(
    target,
    true,
    shallowReadonlyHandlers,
    shallowReadonlyCollectionHandlers,
    shallowReadonlyMap
  );
}
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  if (!isObject$1(target)) {
    {
      warn$2(`value cannot be made reactive: ${String(target)}`);
    }
    return target;
  }
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
    return target;
  }
  const existingProxy = proxyMap.get(target);
  if (existingProxy) {
    return existingProxy;
  }
  const targetType = getTargetType(target);
  if (targetType === 0) {
    return target;
  }
  const proxy = new Proxy(
    target,
    targetType === 2 ? collectionHandlers : baseHandlers
  );
  proxyMap.set(target, proxy);
  return proxy;
}
function isReactive(value) {
  if (isReadonly(value)) {
    return isReactive(value["__v_raw"]);
  }
  return !!(value && value["__v_isReactive"]);
}
function isReadonly(value) {
  return !!(value && value["__v_isReadonly"]);
}
function isShallow(value) {
  return !!(value && value["__v_isShallow"]);
}
function isProxy(value) {
  return isReactive(value) || isReadonly(value);
}
function toRaw(observed) {
  const raw = observed && observed["__v_raw"];
  return raw ? toRaw(raw) : observed;
}
function markRaw(value) {
  if (Object.isExtensible(value)) {
    def(value, "__v_skip", true);
  }
  return value;
}
const toReactive = (value) => isObject$1(value) ? reactive(value) : value;
const toReadonly = (value) => isObject$1(value) ? readonly(value) : value;
const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided.  Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
class ComputedRefImpl {
  constructor(getter, _setter, isReadonly2, isSSR) {
    this.getter = getter;
    this._setter = _setter;
    this.dep = void 0;
    this.__v_isRef = true;
    this["__v_isReadonly"] = false;
    this.effect = new ReactiveEffect(
      () => getter(this._value),
      () => triggerRefValue(
        this,
        this.effect._dirtyLevel === 2 ? 2 : 3
      )
    );
    this.effect.computed = this;
    this.effect.active = this._cacheable = !isSSR;
    this["__v_isReadonly"] = isReadonly2;
  }
  get value() {
    const self2 = toRaw(this);
    if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) {
      triggerRefValue(self2, 4);
    }
    trackRefValue(self2);
    if (self2.effect._dirtyLevel >= 2) {
      if (this._warnRecursive) {
        warn$2(COMPUTED_SIDE_EFFECT_WARN, `

getter: `, this.getter);
      }
      triggerRefValue(self2, 2);
    }
    return self2._value;
  }
  set value(newValue) {
    this._setter(newValue);
  }
  // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  get _dirty() {
    return this.effect.dirty;
  }
  set _dirty(v3) {
    this.effect.dirty = v3;
  }
  // #endregion
}
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  let getter;
  let setter;
  const onlyGetter = isFunction(getterOrOptions);
  if (onlyGetter) {
    getter = getterOrOptions;
    setter = () => {
      warn$2("Write operation failed: computed value is readonly");
    };
  } else {
    getter = getterOrOptions.get;
    setter = getterOrOptions.set;
  }
  const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  if (debugOptions && !isSSR) {
    cRef.effect.onTrack = debugOptions.onTrack;
    cRef.effect.onTrigger = debugOptions.onTrigger;
  }
  return cRef;
}
function trackRefValue(ref2) {
  var _a;
  if (shouldTrack && activeEffect) {
    ref2 = toRaw(ref2);
    trackEffect(
      activeEffect,
      (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
        () => ref2.dep = void 0,
        ref2 instanceof ComputedRefImpl ? ref2 : void 0
      ),
      {
        target: ref2,
        type: "get",
        key: "value"
      }
    );
  }
}
function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
  ref2 = toRaw(ref2);
  const dep = ref2.dep;
  if (dep) {
    triggerEffects(
      dep,
      dirtyLevel,
      {
        target: ref2,
        type: "set",
        key: "value",
        newValue: newVal
      }
    );
  }
}
function isRef(r2) {
  return !!(r2 && r2.__v_isRef === true);
}
function ref(value) {
  return createRef(value, false);
}
function createRef(rawValue, shallow) {
  if (isRef(rawValue)) {
    return rawValue;
  }
  return new RefImpl(rawValue, shallow);
}
class RefImpl {
  constructor(value, __v_isShallow) {
    this.__v_isShallow = __v_isShallow;
    this.dep = void 0;
    this.__v_isRef = true;
    this._rawValue = __v_isShallow ? value : toRaw(value);
    this._value = __v_isShallow ? value : toReactive(value);
  }
  get value() {
    trackRefValue(this);
    return this._value;
  }
  set value(newVal) {
    const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
    newVal = useDirectValue ? newVal : toRaw(newVal);
    if (hasChanged(newVal, this._rawValue)) {
      this._rawValue = newVal;
      this._value = useDirectValue ? newVal : toReactive(newVal);
      triggerRefValue(this, 4, newVal);
    }
  }
}
function unref(ref2) {
  return isRef(ref2) ? ref2.value : ref2;
}
const shallowUnwrapHandlers = {
  get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  set: (target, key, value, receiver) => {
    const oldValue = target[key];
    if (isRef(oldValue) && !isRef(value)) {
      oldValue.value = value;
      return true;
    } else {
      return Reflect.set(target, key, value, receiver);
    }
  }
};
function proxyRefs(objectWithRefs) {
  return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
}
function toRefs(object) {
  if (!isProxy(object)) {
    warn$2(`toRefs() expects a reactive object but received a plain one.`);
  }
  const ret = isArray(object) ? new Array(object.length) : {};
  for (const key in object) {
    ret[key] = propertyToRef(object, key);
  }
  return ret;
}
class ObjectRefImpl {
  constructor(_object, _key, _defaultValue) {
    this._object = _object;
    this._key = _key;
    this._defaultValue = _defaultValue;
    this.__v_isRef = true;
  }
  get value() {
    const val2 = this._object[this._key];
    return val2 === void 0 ? this._defaultValue : val2;
  }
  set value(newVal) {
    this._object[this._key] = newVal;
  }
  get dep() {
    return getDepFromReactive(toRaw(this._object), this._key);
  }
}
class GetterRefImpl {
  constructor(_getter) {
    this._getter = _getter;
    this.__v_isRef = true;
    this.__v_isReadonly = true;
  }
  get value() {
    return this._getter();
  }
}
function toRef(source, key, defaultValue) {
  if (isRef(source)) {
    return source;
  } else if (isFunction(source)) {
    return new GetterRefImpl(source);
  } else if (isObject$1(source) && arguments.length > 1) {
    return propertyToRef(source, key, defaultValue);
  } else {
    return ref(source);
  }
}
function propertyToRef(source, key, defaultValue) {
  const val2 = source[key];
  return isRef(val2) ? val2 : new ObjectRefImpl(source, key, defaultValue);
}
const stack = [];
function pushWarningContext(vnode) {
  stack.push(vnode);
}
function popWarningContext() {
  stack.pop();
}
function warn$1(msg, ...args) {
  pauseTracking();
  const instance = stack.length ? stack[stack.length - 1].component : null;
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
  const trace = getComponentTrace();
  if (appWarnHandler) {
    callWithErrorHandling(
      appWarnHandler,
      instance,
      11,
      [
        msg + args.map((a3) => {
          var _a, _b;
          return (_b = (_a = a3.toString) == null ? void 0 : _a.call(a3)) != null ? _b : JSON.stringify(a3);
        }).join(""),
        instance && instance.proxy,
        trace.map(
          ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
        ).join("\n"),
        trace
      ]
    );
  } else {
    const warnArgs = [`[Vue warn]: ${msg}`, ...args];
    if (trace.length && // avoid spamming console during tests
    true) {
      warnArgs.push(`
`, ...formatTrace(trace));
    }
    console.warn(...warnArgs);
  }
  resetTracking();
}
function getComponentTrace() {
  let currentVNode = stack[stack.length - 1];
  if (!currentVNode) {
    return [];
  }
  const normalizedStack = [];
  while (currentVNode) {
    const last = normalizedStack[0];
    if (last && last.vnode === currentVNode) {
      last.recurseCount++;
    } else {
      normalizedStack.push({
        vnode: currentVNode,
        recurseCount: 0
      });
    }
    const parentInstance = currentVNode.component && currentVNode.component.parent;
    currentVNode = parentInstance && parentInstance.vnode;
  }
  return normalizedStack;
}
function formatTrace(trace) {
  const logs = [];
  trace.forEach((entry, i3) => {
    logs.push(...i3 === 0 ? [] : [`
`], ...formatTraceEntry(entry));
  });
  return logs;
}
function formatTraceEntry({ vnode, recurseCount }) {
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  const isRoot = vnode.component ? vnode.component.parent == null : false;
  const open = ` at <${formatComponentName(
    vnode.component,
    vnode.type,
    isRoot
  )}`;
  const close = `>` + postfix;
  return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
}
function formatProps(props) {
  const res = [];
  const keys = Object.keys(props);
  keys.slice(0, 3).forEach((key) => {
    res.push(...formatProp(key, props[key]));
  });
  if (keys.length > 3) {
    res.push(` ...`);
  }
  return res;
}
function formatProp(key, value, raw) {
  if (isString(value)) {
    value = JSON.stringify(value);
    return raw ? value : [`${key}=${value}`];
  } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
    return raw ? value : [`${key}=${value}`];
  } else if (isRef(value)) {
    value = formatProp(key, toRaw(value.value), true);
    return raw ? value : [`${key}=Ref<`, value, `>`];
  } else if (isFunction(value)) {
    return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  } else {
    value = toRaw(value);
    return raw ? value : [`${key}=`, value];
  }
}
const ErrorTypeStrings = {
  ["sp"]: "serverPrefetch hook",
  ["bc"]: "beforeCreate hook",
  ["c"]: "created hook",
  ["bm"]: "beforeMount hook",
  ["m"]: "mounted hook",
  ["bu"]: "beforeUpdate hook",
  ["u"]: "updated",
  ["bum"]: "beforeUnmount hook",
  ["um"]: "unmounted hook",
  ["a"]: "activated hook",
  ["da"]: "deactivated hook",
  ["ec"]: "errorCaptured hook",
  ["rtc"]: "renderTracked hook",
  ["rtg"]: "renderTriggered hook",
  [0]: "setup function",
  [1]: "render function",
  [2]: "watcher getter",
  [3]: "watcher callback",
  [4]: "watcher cleanup function",
  [5]: "native event handler",
  [6]: "component event handler",
  [7]: "vnode hook",
  [8]: "directive hook",
  [9]: "transition hook",
  [10]: "app errorHandler",
  [11]: "app warnHandler",
  [12]: "ref function",
  [13]: "async component loader",
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
};
function callWithErrorHandling(fn2, instance, type, args) {
  try {
    return args ? fn2(...args) : fn2();
  } catch (err) {
    handleError(err, instance, type);
  }
}
function callWithAsyncErrorHandling(fn2, instance, type, args) {
  if (isFunction(fn2)) {
    const res = callWithErrorHandling(fn2, instance, type, args);
    if (res && isPromise(res)) {
      res.catch((err) => {
        handleError(err, instance, type);
      });
    }
    return res;
  }
  const values = [];
  for (let i3 = 0; i3 < fn2.length; i3++) {
    values.push(callWithAsyncErrorHandling(fn2[i3], instance, type, args));
  }
  return values;
}
function handleError(err, instance, type, throwInDev = true) {
  const contextVNode = instance ? instance.vnode : null;
  if (instance) {
    let cur = instance.parent;
    const exposedInstance = instance.proxy;
    const errorInfo = ErrorTypeStrings[type] || type;
    while (cur) {
      const errorCapturedHooks = cur.ec;
      if (errorCapturedHooks) {
        for (let i3 = 0; i3 < errorCapturedHooks.length; i3++) {
          if (errorCapturedHooks[i3](err, exposedInstance, errorInfo) === false) {
            return;
          }
        }
      }
      cur = cur.parent;
    }
    const appErrorHandler = instance.appContext.config.errorHandler;
    if (appErrorHandler) {
      callWithErrorHandling(
        appErrorHandler,
        null,
        10,
        [err, exposedInstance, errorInfo]
      );
      return;
    }
  }
  logError(err, type, contextVNode, throwInDev);
}
function logError(err, type, contextVNode, throwInDev = true) {
  {
    const info = ErrorTypeStrings[type] || type;
    if (contextVNode) {
      pushWarningContext(contextVNode);
    }
    warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
    if (contextVNode) {
      popWarningContext();
    }
    if (throwInDev) {
      console.error(err);
    } else {
      console.error(err);
    }
  }
}
let isFlushing = false;
let isFlushPending = false;
const queue$1 = [];
let flushIndex = 0;
const pendingPostFlushCbs = [];
let activePostFlushCbs = null;
let postFlushIndex = 0;
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
let currentFlushPromise = null;
const RECURSION_LIMIT = 100;
function nextTick$1(fn2) {
  const p22 = currentFlushPromise || resolvedPromise;
  return fn2 ? p22.then(this ? fn2.bind(this) : fn2) : p22;
}
function findInsertionIndex(id) {
  let start = flushIndex + 1;
  let end = queue$1.length;
  while (start < end) {
    const middle = start + end >>> 1;
    const middleJob = queue$1[middle];
    const middleJobId = getId(middleJob);
    if (middleJobId < id || middleJobId === id && middleJob.pre) {
      start = middle + 1;
    } else {
      end = middle;
    }
  }
  return start;
}
function queueJob(job) {
  if (!queue$1.length || !queue$1.includes(
    job,
    isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  )) {
    if (job.id == null) {
      queue$1.push(job);
    } else {
      queue$1.splice(findInsertionIndex(job.id), 0, job);
    }
    queueFlush();
  }
}
function queueFlush() {
  if (!isFlushing && !isFlushPending) {
    isFlushPending = true;
    currentFlushPromise = resolvedPromise.then(flushJobs);
  }
}
function hasQueueJob(job) {
  return queue$1.indexOf(job) > -1;
}
function invalidateJob(job) {
  const i3 = queue$1.indexOf(job);
  if (i3 > flushIndex) {
    queue$1.splice(i3, 1);
  }
}
function queuePostFlushCb(cb) {
  if (!isArray(cb)) {
    if (!activePostFlushCbs || !activePostFlushCbs.includes(
      cb,
      cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
    )) {
      pendingPostFlushCbs.push(cb);
    }
  } else {
    pendingPostFlushCbs.push(...cb);
  }
  queueFlush();
}
function flushPreFlushCbs(instance, seen, i3 = isFlushing ? flushIndex + 1 : 0) {
  {
    seen = seen || /* @__PURE__ */ new Map();
  }
  for (; i3 < queue$1.length; i3++) {
    const cb = queue$1[i3];
    if (cb && cb.pre) {
      if (checkRecursiveUpdates(seen, cb)) {
        continue;
      }
      queue$1.splice(i3, 1);
      i3--;
      cb();
    }
  }
}
function flushPostFlushCbs(seen) {
  if (pendingPostFlushCbs.length) {
    const deduped = [...new Set(pendingPostFlushCbs)].sort(
      (a3, b2) => getId(a3) - getId(b2)
    );
    pendingPostFlushCbs.length = 0;
    if (activePostFlushCbs) {
      activePostFlushCbs.push(...deduped);
      return;
    }
    activePostFlushCbs = deduped;
    {
      seen = seen || /* @__PURE__ */ new Map();
    }
    for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
      if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
        continue;
      }
      activePostFlushCbs[postFlushIndex]();
    }
    activePostFlushCbs = null;
    postFlushIndex = 0;
  }
}
const getId = (job) => job.id == null ? Infinity : job.id;
const comparator = (a3, b2) => {
  const diff2 = getId(a3) - getId(b2);
  if (diff2 === 0) {
    if (a3.pre && !b2.pre)
      return -1;
    if (b2.pre && !a3.pre)
      return 1;
  }
  return diff2;
};
function flushJobs(seen) {
  isFlushPending = false;
  isFlushing = true;
  {
    seen = seen || /* @__PURE__ */ new Map();
  }
  queue$1.sort(comparator);
  const check = (job) => checkRecursiveUpdates(seen, job);
  try {
    for (flushIndex = 0; flushIndex < queue$1.length; flushIndex++) {
      const job = queue$1[flushIndex];
      if (job && job.active !== false) {
        if (check(job)) {
          continue;
        }
        callWithErrorHandling(job, null, 14);
      }
    }
  } finally {
    flushIndex = 0;
    queue$1.length = 0;
    flushPostFlushCbs(seen);
    isFlushing = false;
    currentFlushPromise = null;
    if (queue$1.length || pendingPostFlushCbs.length) {
      flushJobs(seen);
    }
  }
}
function checkRecursiveUpdates(seen, fn2) {
  if (!seen.has(fn2)) {
    seen.set(fn2, 1);
  } else {
    const count = seen.get(fn2);
    if (count > RECURSION_LIMIT) {
      const instance = fn2.ownerInstance;
      const componentName = instance && getComponentName(instance.type);
      handleError(
        `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
        null,
        10
      );
      return true;
    } else {
      seen.set(fn2, count + 1);
    }
  }
}
let devtools;
let buffer = [];
let devtoolsNotInstalled = false;
function emit$1(event, ...args) {
  if (devtools) {
    devtools.emit(event, ...args);
  } else if (!devtoolsNotInstalled) {
    buffer.push({ event, args });
  }
}
function setDevtoolsHook(hook, target) {
  var _a, _b;
  devtools = hook;
  if (devtools) {
    devtools.enabled = true;
    buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
    buffer = [];
  } else if (
    // handle late devtools injection - only do this if we are in an actual
    // browser environment to avoid the timer handle stalling test runner exit
    // (#4815)
    typeof window !== "undefined" && // some envs mock window but not fully
    window.HTMLElement && // also exclude jsdom
    !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  ) {
    const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
    replay.push((newHook) => {
      setDevtoolsHook(newHook, target);
    });
    setTimeout(() => {
      if (!devtools) {
        target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
        devtoolsNotInstalled = true;
        buffer = [];
      }
    }, 3e3);
  } else {
    devtoolsNotInstalled = true;
    buffer = [];
  }
}
function devtoolsInitApp(app, version2) {
  emit$1("app:init", app, version2, {
    Fragment,
    Text,
    Comment,
    Static
  });
}
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:added"
  /* COMPONENT_ADDED */
);
const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:updated"
  /* COMPONENT_UPDATED */
);
const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  "component:removed"
  /* COMPONENT_REMOVED */
);
const devtoolsComponentRemoved = (component) => {
  if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  !devtools.cleanupBuffer(component)) {
    _devtoolsComponentRemoved(component);
  }
};
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function createDevtoolsComponentHook(hook) {
  return (component) => {
    emit$1(
      hook,
      component.appContext.app,
      component.uid,
      // fixed by xxxxxx
      // 为 0 是 App，无 parent 是 Page 指向 App
      component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
      component
    );
  };
}
const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  "perf:start"
  /* PERFORMANCE_START */
);
const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  "perf:end"
  /* PERFORMANCE_END */
);
function createDevtoolsPerformanceHook(hook) {
  return (component, type, time) => {
    emit$1(hook, component.appContext.app, component.uid, component, type, time);
  };
}
function devtoolsComponentEmit(component, event, params) {
  emit$1(
    "component:emit",
    component.appContext.app,
    component,
    event,
    params
  );
}
function emit(instance, event, ...rawArgs) {
  if (instance.isUnmounted)
    return;
  const props = instance.vnode.props || EMPTY_OBJ;
  {
    const {
      emitsOptions,
      propsOptions: [propsOptions]
    } = instance;
    if (emitsOptions) {
      if (!(event in emitsOptions) && true) {
        if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
          warn$1(
            `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
          );
        }
      } else {
        const validator = emitsOptions[event];
        if (isFunction(validator)) {
          const isValid = validator(...rawArgs);
          if (!isValid) {
            warn$1(
              `Invalid event arguments: event validation failed for event "${event}".`
            );
          }
        }
      }
    }
  }
  let args = rawArgs;
  const isModelListener2 = event.startsWith("update:");
  const modelArg = isModelListener2 && event.slice(7);
  if (modelArg && modelArg in props) {
    const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
    const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
    if (trim) {
      args = rawArgs.map((a3) => isString(a3) ? a3.trim() : a3);
    }
    if (number) {
      args = rawArgs.map(looseToNumber);
    }
  }
  {
    devtoolsComponentEmit(instance, event, args);
  }
  {
    const lowerCaseEvent = event.toLowerCase();
    if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
      warn$1(
        `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
          instance,
          instance.type
        )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
          event
        )}" instead of "${event}".`
      );
    }
  }
  let handlerName;
  let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  props[handlerName = toHandlerKey(camelize(event))];
  if (!handler && isModelListener2) {
    handler = props[handlerName = toHandlerKey(hyphenate(event))];
  }
  if (handler) {
    callWithAsyncErrorHandling(
      handler,
      instance,
      6,
      args
    );
  }
  const onceHandler = props[handlerName + `Once`];
  if (onceHandler) {
    if (!instance.emitted) {
      instance.emitted = {};
    } else if (instance.emitted[handlerName]) {
      return;
    }
    instance.emitted[handlerName] = true;
    callWithAsyncErrorHandling(
      onceHandler,
      instance,
      6,
      args
    );
  }
}
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  const cache = appContext.emitsCache;
  const cached = cache.get(comp);
  if (cached !== void 0) {
    return cached;
  }
  const raw = comp.emits;
  let normalized = {};
  let hasExtends = false;
  if (!isFunction(comp)) {
    const extendEmits = (raw2) => {
      const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
      if (normalizedFromExtend) {
        hasExtends = true;
        extend(normalized, normalizedFromExtend);
      }
    };
    if (!asMixin && appContext.mixins.length) {
      appContext.mixins.forEach(extendEmits);
    }
    if (comp.extends) {
      extendEmits(comp.extends);
    }
    if (comp.mixins) {
      comp.mixins.forEach(extendEmits);
    }
  }
  if (!raw && !hasExtends) {
    if (isObject$1(comp)) {
      cache.set(comp, null);
    }
    return null;
  }
  if (isArray(raw)) {
    raw.forEach((key) => normalized[key] = null);
  } else {
    extend(normalized, raw);
  }
  if (isObject$1(comp)) {
    cache.set(comp, normalized);
  }
  return normalized;
}
function isEmitListener(options, key) {
  if (!options || !isOn(key)) {
    return false;
  }
  key = key.slice(2).replace(/Once$/, "");
  return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
}
let currentRenderingInstance = null;
function setCurrentRenderingInstance(instance) {
  const prev = currentRenderingInstance;
  currentRenderingInstance = instance;
  instance && instance.type.__scopeId || null;
  return prev;
}
const COMPONENTS = "components";
function resolveComponent(name, maybeSelfReference) {
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
}
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  const instance = currentRenderingInstance || currentInstance;
  if (instance) {
    const Component2 = instance.type;
    if (type === COMPONENTS) {
      const selfName = getComponentName(
        Component2,
        false
      );
      if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
        return Component2;
      }
    }
    const res = (
      // local registration
      // check instance[type] first which is resolved for options API
      resolve(instance[type] || Component2[type], name) || // global registration
      resolve(instance.appContext[type], name)
    );
    if (!res && maybeSelfReference) {
      return Component2;
    }
    if (warnMissing && !res) {
      const extra = type === COMPONENTS ? `
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
      warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
    }
    return res;
  } else {
    warn$1(
      `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
    );
  }
}
function resolve(registry, name) {
  return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
}
const INITIAL_WATCHER_VALUE = {};
function watch(source, cb, options) {
  if (!isFunction(cb)) {
    warn$1(
      `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
    );
  }
  return doWatch(source, cb, options);
}
function doWatch(source, cb, {
  immediate,
  deep,
  flush,
  once: once2,
  onTrack,
  onTrigger
} = EMPTY_OBJ) {
  if (cb && once2) {
    const _cb = cb;
    cb = (...args) => {
      _cb(...args);
      unwatch();
    };
  }
  if (deep !== void 0 && typeof deep === "number") {
    warn$1(
      `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
    );
  }
  if (!cb) {
    if (immediate !== void 0) {
      warn$1(
        `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
    if (deep !== void 0) {
      warn$1(
        `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
    if (once2 !== void 0) {
      warn$1(
        `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
      );
    }
  }
  const warnInvalidSource = (s22) => {
    warn$1(
      `Invalid watch source: `,
      s22,
      `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
    );
  };
  const instance = currentInstance;
  const reactiveGetter = (source2) => deep === true ? source2 : (
    // for deep: false, only traverse root-level properties
    traverse(source2, deep === false ? 1 : void 0)
  );
  let getter;
  let forceTrigger = false;
  let isMultiSource = false;
  if (isRef(source)) {
    getter = () => source.value;
    forceTrigger = isShallow(source);
  } else if (isReactive(source)) {
    getter = () => reactiveGetter(source);
    forceTrigger = true;
  } else if (isArray(source)) {
    isMultiSource = true;
    forceTrigger = source.some((s22) => isReactive(s22) || isShallow(s22));
    getter = () => source.map((s22) => {
      if (isRef(s22)) {
        return s22.value;
      } else if (isReactive(s22)) {
        return reactiveGetter(s22);
      } else if (isFunction(s22)) {
        return callWithErrorHandling(s22, instance, 2);
      } else {
        warnInvalidSource(s22);
      }
    });
  } else if (isFunction(source)) {
    if (cb) {
      getter = () => callWithErrorHandling(source, instance, 2);
    } else {
      getter = () => {
        if (cleanup) {
          cleanup();
        }
        return callWithAsyncErrorHandling(
          source,
          instance,
          3,
          [onCleanup]
        );
      };
    }
  } else {
    getter = NOOP;
    warnInvalidSource(source);
  }
  if (cb && deep) {
    const baseGetter = getter;
    getter = () => traverse(baseGetter());
  }
  let cleanup;
  let onCleanup = (fn2) => {
    cleanup = effect2.onStop = () => {
      callWithErrorHandling(fn2, instance, 4);
      cleanup = effect2.onStop = void 0;
    };
  };
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  const job = () => {
    if (!effect2.active || !effect2.dirty) {
      return;
    }
    if (cb) {
      const newValue = effect2.run();
      if (deep || forceTrigger || (isMultiSource ? newValue.some((v3, i3) => hasChanged(v3, oldValue[i3])) : hasChanged(newValue, oldValue)) || false) {
        if (cleanup) {
          cleanup();
        }
        callWithAsyncErrorHandling(cb, instance, 3, [
          newValue,
          // pass undefined as the old value when it's changed for the first time
          oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
          onCleanup
        ]);
        oldValue = newValue;
      }
    } else {
      effect2.run();
    }
  };
  job.allowRecurse = !!cb;
  let scheduler;
  if (flush === "sync") {
    scheduler = job;
  } else if (flush === "post") {
    scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  } else {
    job.pre = true;
    if (instance)
      job.id = instance.uid;
    scheduler = () => queueJob(job);
  }
  const effect2 = new ReactiveEffect(getter, NOOP, scheduler);
  const scope = getCurrentScope();
  const unwatch = () => {
    effect2.stop();
    if (scope) {
      remove(scope.effects, effect2);
    }
  };
  {
    effect2.onTrack = onTrack;
    effect2.onTrigger = onTrigger;
  }
  if (cb) {
    if (immediate) {
      job();
    } else {
      oldValue = effect2.run();
    }
  } else if (flush === "post") {
    queuePostRenderEffect$1(
      effect2.run.bind(effect2),
      instance && instance.suspense
    );
  } else {
    effect2.run();
  }
  return unwatch;
}
function instanceWatch(source, value, options) {
  const publicThis = this.proxy;
  const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  let cb;
  if (isFunction(value)) {
    cb = value;
  } else {
    cb = value.handler;
    options = value;
  }
  const reset = setCurrentInstance(this);
  const res = doWatch(getter, cb.bind(publicThis), options);
  reset();
  return res;
}
function createPathGetter(ctx, path) {
  const segments = path.split(".");
  return () => {
    let cur = ctx;
    for (let i3 = 0; i3 < segments.length && cur; i3++) {
      cur = cur[segments[i3]];
    }
    return cur;
  };
}
function traverse(value, depth, currentDepth = 0, seen) {
  if (!isObject$1(value) || value["__v_skip"]) {
    return value;
  }
  if (depth && depth > 0) {
    if (currentDepth >= depth) {
      return value;
    }
    currentDepth++;
  }
  seen = seen || /* @__PURE__ */ new Set();
  if (seen.has(value)) {
    return value;
  }
  seen.add(value);
  if (isRef(value)) {
    traverse(value.value, depth, currentDepth, seen);
  } else if (isArray(value)) {
    for (let i3 = 0; i3 < value.length; i3++) {
      traverse(value[i3], depth, currentDepth, seen);
    }
  } else if (isSet(value) || isMap(value)) {
    value.forEach((v3) => {
      traverse(v3, depth, currentDepth, seen);
    });
  } else if (isPlainObject$1(value)) {
    for (const key in value) {
      traverse(value[key], depth, currentDepth, seen);
    }
  }
  return value;
}
function validateDirectiveName(name) {
  if (isBuiltInDirective(name)) {
    warn$1("Do not use built-in directive ids as custom directive id: " + name);
  }
}
function createAppContext() {
  return {
    app: null,
    config: {
      isNativeTag: NO,
      performance: false,
      globalProperties: {},
      optionMergeStrategies: {},
      errorHandler: void 0,
      warnHandler: void 0,
      compilerOptions: {}
    },
    mixins: [],
    components: {},
    directives: {},
    provides: /* @__PURE__ */ Object.create(null),
    optionsCache: /* @__PURE__ */ new WeakMap(),
    propsCache: /* @__PURE__ */ new WeakMap(),
    emitsCache: /* @__PURE__ */ new WeakMap()
  };
}
let uid$1 = 0;
function createAppAPI(render, hydrate) {
  return function createApp2(rootComponent, rootProps = null) {
    if (!isFunction(rootComponent)) {
      rootComponent = extend({}, rootComponent);
    }
    if (rootProps != null && !isObject$1(rootProps)) {
      warn$1(`root props passed to app.mount() must be an object.`);
      rootProps = null;
    }
    const context = createAppContext();
    const installedPlugins = /* @__PURE__ */ new WeakSet();
    const app = context.app = {
      _uid: uid$1++,
      _component: rootComponent,
      _props: rootProps,
      _container: null,
      _context: context,
      _instance: null,
      version,
      get config() {
        return context.config;
      },
      set config(v3) {
        {
          warn$1(
            `app.config cannot be replaced. Modify individual options instead.`
          );
        }
      },
      use(plugin2, ...options) {
        if (installedPlugins.has(plugin2)) {
          warn$1(`Plugin has already been applied to target app.`);
        } else if (plugin2 && isFunction(plugin2.install)) {
          installedPlugins.add(plugin2);
          plugin2.install(app, ...options);
        } else if (isFunction(plugin2)) {
          installedPlugins.add(plugin2);
          plugin2(app, ...options);
        } else {
          warn$1(
            `A plugin must either be a function or an object with an "install" function.`
          );
        }
        return app;
      },
      mixin(mixin) {
        {
          if (!context.mixins.includes(mixin)) {
            context.mixins.push(mixin);
          } else {
            warn$1(
              "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
            );
          }
        }
        return app;
      },
      component(name, component) {
        {
          validateComponentName(name, context.config);
        }
        if (!component) {
          return context.components[name];
        }
        if (context.components[name]) {
          warn$1(`Component "${name}" has already been registered in target app.`);
        }
        context.components[name] = component;
        return app;
      },
      directive(name, directive) {
        {
          validateDirectiveName(name);
        }
        if (!directive) {
          return context.directives[name];
        }
        if (context.directives[name]) {
          warn$1(`Directive "${name}" has already been registered in target app.`);
        }
        context.directives[name] = directive;
        return app;
      },
      // fixed by xxxxxx
      mount() {
      },
      // fixed by xxxxxx
      unmount() {
      },
      provide(key, value) {
        if (key in context.provides) {
          warn$1(
            `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
          );
        }
        context.provides[key] = value;
        return app;
      },
      runWithContext(fn2) {
        const lastApp = currentApp;
        currentApp = app;
        try {
          return fn2();
        } finally {
          currentApp = lastApp;
        }
      }
    };
    return app;
  };
}
let currentApp = null;
function provide(key, value) {
  if (!currentInstance) {
    {
      warn$1(`provide() can only be used inside setup().`);
    }
  } else {
    let provides = currentInstance.provides;
    const parentProvides = currentInstance.parent && currentInstance.parent.provides;
    if (parentProvides === provides) {
      provides = currentInstance.provides = Object.create(parentProvides);
    }
    provides[key] = value;
    if (currentInstance.type.mpType === "app") {
      currentInstance.appContext.app.provide(key, value);
    }
  }
}
function inject(key, defaultValue, treatDefaultAsFactory = false) {
  const instance = currentInstance || currentRenderingInstance;
  if (instance || currentApp) {
    const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
    if (provides && key in provides) {
      return provides[key];
    } else if (arguments.length > 1) {
      return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
    } else {
      warn$1(`injection "${String(key)}" not found.`);
    }
  } else {
    warn$1(`inject() can only be used inside setup() or functional components.`);
  }
}
function hasInjectionContext() {
  return !!(currentInstance || currentRenderingInstance || currentApp);
}
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
function onActivated(hook, target) {
  registerKeepAliveHook(hook, "a", target);
}
function onDeactivated(hook, target) {
  registerKeepAliveHook(hook, "da", target);
}
function registerKeepAliveHook(hook, type, target = currentInstance) {
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
    let current = target;
    while (current) {
      if (current.isDeactivated) {
        return;
      }
      current = current.parent;
    }
    return hook();
  });
  injectHook(type, wrappedHook, target);
  if (target) {
    let current = target.parent;
    while (current && current.parent) {
      if (isKeepAlive(current.parent.vnode)) {
        injectToKeepAliveRoot(wrappedHook, type, target, current);
      }
      current = current.parent;
    }
  }
}
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  const injected = injectHook(
    type,
    hook,
    keepAliveRoot,
    true
    /* prepend */
  );
  onUnmounted(() => {
    remove(keepAliveRoot[type], injected);
  }, target);
}
function injectHook(type, hook, target = currentInstance, prepend = false) {
  if (target) {
    if (isRootHook(type)) {
      target = target.root;
    }
    const hooks = target[type] || (target[type] = []);
    const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
      if (target.isUnmounted) {
        return;
      }
      pauseTracking();
      const reset = setCurrentInstance(target);
      const res = callWithAsyncErrorHandling(hook, target, type, args);
      reset();
      resetTracking();
      return res;
    });
    if (prepend) {
      hooks.unshift(wrappedHook);
    } else {
      hooks.push(wrappedHook);
    }
    return wrappedHook;
  } else {
    const apiName = toHandlerKey(
      (ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, "")
    );
    warn$1(
      `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`
    );
  }
}
const createHook = (lifecycle) => (hook, target = currentInstance) => (
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
);
const onBeforeMount = createHook("bm");
const onMounted = createHook("m");
const onBeforeUpdate = createHook("bu");
const onUpdated = createHook("u");
const onBeforeUnmount = createHook("bum");
const onUnmounted = createHook("um");
const onServerPrefetch = createHook("sp");
const onRenderTriggered = createHook(
  "rtg"
);
const onRenderTracked = createHook(
  "rtc"
);
function onErrorCaptured(hook, target = currentInstance) {
  injectHook("ec", hook, target);
}
const getPublicInstance = (i3) => {
  if (!i3)
    return null;
  if (isStatefulComponent(i3))
    return getExposeProxy(i3) || i3.proxy;
  return getPublicInstance(i3.parent);
};
function getComponentInternalInstance(i3) {
  return i3;
}
const publicPropertiesMap = (
  // Move PURE marker to new line to workaround compiler discarding it
  // due to type annotation
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
    // fixed by xxxxxx
    $: getComponentInternalInstance,
    // fixed by xxxxxx vue-i18n 在 dev 模式，访问了 $el，故模拟一个假的
    // $el: i => i.vnode.el,
    $el: (i3) => i3.__$el || (i3.__$el = {}),
    $data: (i3) => i3.data,
    $props: (i3) => shallowReadonly(i3.props),
    $attrs: (i3) => shallowReadonly(i3.attrs),
    $slots: (i3) => shallowReadonly(i3.slots),
    $refs: (i3) => shallowReadonly(i3.refs),
    $parent: (i3) => getPublicInstance(i3.parent),
    $root: (i3) => getPublicInstance(i3.root),
    $emit: (i3) => i3.emit,
    $options: (i3) => resolveMergedOptions(i3),
    $forceUpdate: (i3) => i3.f || (i3.f = () => {
      i3.effect.dirty = true;
      queueJob(i3.update);
    }),
    // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
    $watch: (i3) => instanceWatch.bind(i3)
  })
);
const isReservedPrefix = (key) => key === "_" || key === "$";
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
const PublicInstanceProxyHandlers = {
  get({ _: instance }, key) {
    const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
    if (key === "__isVue") {
      return true;
    }
    let normalizedProps;
    if (key[0] !== "$") {
      const n2 = accessCache[key];
      if (n2 !== void 0) {
        switch (n2) {
          case 1:
            return setupState[key];
          case 2:
            return data[key];
          case 4:
            return ctx[key];
          case 3:
            return props[key];
        }
      } else if (hasSetupBinding(setupState, key)) {
        accessCache[key] = 1;
        return setupState[key];
      } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
        accessCache[key] = 2;
        return data[key];
      } else if (
        // only cache other properties when instance has declared (thus stable)
        // props
        (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
      ) {
        accessCache[key] = 3;
        return props[key];
      } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
        accessCache[key] = 4;
        return ctx[key];
      } else if (shouldCacheAccess) {
        accessCache[key] = 0;
      }
    }
    const publicGetter = publicPropertiesMap[key];
    let cssModule, globalProperties;
    if (publicGetter) {
      if (key === "$attrs") {
        track(instance, "get", key);
      } else if (key === "$slots") {
        track(instance, "get", key);
      }
      return publicGetter(instance);
    } else if (
      // css module (injected by vue-loader)
      (cssModule = type.__cssModules) && (cssModule = cssModule[key])
    ) {
      return cssModule;
    } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
      accessCache[key] = 4;
      return ctx[key];
    } else if (
      // global properties
      globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
    ) {
      {
        return globalProperties[key];
      }
    } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
    // to infinite warning loop
    key.indexOf("__v") !== 0)) {
      if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
        warn$1(
          `Property ${JSON.stringify(
            key
          )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
        );
      } else if (instance === currentRenderingInstance) {
        warn$1(
          `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
        );
      }
    }
  },
  set({ _: instance }, key, value) {
    const { data, setupState, ctx } = instance;
    if (hasSetupBinding(setupState, key)) {
      setupState[key] = value;
      return true;
    } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
      warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
      return false;
    } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
      data[key] = value;
      return true;
    } else if (hasOwn$1(instance.props, key)) {
      warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
      return false;
    }
    if (key[0] === "$" && key.slice(1) in instance) {
      warn$1(
        `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
      );
      return false;
    } else {
      if (key in instance.appContext.config.globalProperties) {
        Object.defineProperty(ctx, key, {
          enumerable: true,
          configurable: true,
          value
        });
      } else {
        ctx[key] = value;
      }
    }
    return true;
  },
  has({
    _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  }, key) {
    let normalizedProps;
    return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
  },
  defineProperty(target, key, descriptor) {
    if (descriptor.get != null) {
      target._.accessCache[key] = 0;
    } else if (hasOwn$1(descriptor, "value")) {
      this.set(target, key, descriptor.value, null);
    }
    return Reflect.defineProperty(target, key, descriptor);
  }
};
{
  PublicInstanceProxyHandlers.ownKeys = (target) => {
    warn$1(
      `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
    );
    return Reflect.ownKeys(target);
  };
}
function createDevRenderContext(instance) {
  const target = {};
  Object.defineProperty(target, `_`, {
    configurable: true,
    enumerable: false,
    get: () => instance
  });
  Object.keys(publicPropertiesMap).forEach((key) => {
    Object.defineProperty(target, key, {
      configurable: true,
      enumerable: false,
      get: () => publicPropertiesMap[key](instance),
      // intercepted by the proxy so no need for implementation,
      // but needed to prevent set errors
      set: NOOP
    });
  });
  return target;
}
function exposePropsOnRenderContext(instance) {
  const {
    ctx,
    propsOptions: [propsOptions]
  } = instance;
  if (propsOptions) {
    Object.keys(propsOptions).forEach((key) => {
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => instance.props[key],
        set: NOOP
      });
    });
  }
}
function exposeSetupStateOnRenderContext(instance) {
  const { ctx, setupState } = instance;
  Object.keys(toRaw(setupState)).forEach((key) => {
    if (!setupState.__isScriptSetup) {
      if (isReservedPrefix(key[0])) {
        warn$1(
          `setup() return property ${JSON.stringify(
            key
          )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
        );
        return;
      }
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => setupState[key],
        set: NOOP
      });
    }
  });
}
function normalizePropsOrEmits(props) {
  return isArray(props) ? props.reduce(
    (normalized, p22) => (normalized[p22] = null, normalized),
    {}
  ) : props;
}
function createDuplicateChecker() {
  const cache = /* @__PURE__ */ Object.create(null);
  return (type, key) => {
    if (cache[key]) {
      warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
    } else {
      cache[key] = type;
    }
  };
}
let shouldCacheAccess = true;
function applyOptions$1(instance) {
  const options = resolveMergedOptions(instance);
  const publicThis = instance.proxy;
  const ctx = instance.ctx;
  shouldCacheAccess = false;
  if (options.beforeCreate) {
    callHook$1(options.beforeCreate, instance, "bc");
  }
  const {
    // state
    data: dataOptions,
    computed: computedOptions,
    methods,
    watch: watchOptions,
    provide: provideOptions,
    inject: injectOptions,
    // lifecycle
    created,
    beforeMount,
    mounted,
    beforeUpdate,
    updated,
    activated,
    deactivated,
    beforeDestroy,
    beforeUnmount,
    destroyed,
    unmounted,
    render,
    renderTracked,
    renderTriggered,
    errorCaptured,
    serverPrefetch,
    // public API
    expose,
    inheritAttrs,
    // assets
    components,
    directives,
    filters
  } = options;
  const checkDuplicateProperties = createDuplicateChecker();
  {
    const [propsOptions] = instance.propsOptions;
    if (propsOptions) {
      for (const key in propsOptions) {
        checkDuplicateProperties("Props", key);
      }
    }
  }
  function initInjections() {
    if (injectOptions) {
      resolveInjections(injectOptions, ctx, checkDuplicateProperties);
    }
  }
  {
    initInjections();
  }
  if (methods) {
    for (const key in methods) {
      const methodHandler = methods[key];
      if (isFunction(methodHandler)) {
        {
          Object.defineProperty(ctx, key, {
            value: methodHandler.bind(publicThis),
            configurable: true,
            enumerable: true,
            writable: true
          });
        }
        {
          checkDuplicateProperties("Methods", key);
        }
      } else {
        warn$1(
          `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
        );
      }
    }
  }
  if (dataOptions) {
    if (!isFunction(dataOptions)) {
      warn$1(
        `The data option must be a function. Plain object usage is no longer supported.`
      );
    }
    const data = dataOptions.call(publicThis, publicThis);
    if (isPromise(data)) {
      warn$1(
        `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
      );
    }
    if (!isObject$1(data)) {
      warn$1(`data() should return an object.`);
    } else {
      instance.data = reactive(data);
      {
        for (const key in data) {
          checkDuplicateProperties("Data", key);
          if (!isReservedPrefix(key[0])) {
            Object.defineProperty(ctx, key, {
              configurable: true,
              enumerable: true,
              get: () => data[key],
              set: NOOP
            });
          }
        }
      }
    }
  }
  shouldCacheAccess = true;
  if (computedOptions) {
    for (const key in computedOptions) {
      const opt = computedOptions[key];
      const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
      if (get2 === NOOP) {
        warn$1(`Computed property "${key}" has no getter.`);
      }
      const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
        warn$1(
          `Write operation failed: computed property "${key}" is readonly.`
        );
      };
      const c22 = computed({
        get: get2,
        set: set2
      });
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => c22.value,
        set: (v3) => c22.value = v3
      });
      {
        checkDuplicateProperties("Computed", key);
      }
    }
  }
  if (watchOptions) {
    for (const key in watchOptions) {
      createWatcher(watchOptions[key], ctx, publicThis, key);
    }
  }
  function initProvides() {
    if (provideOptions) {
      const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
      Reflect.ownKeys(provides).forEach((key) => {
        provide(key, provides[key]);
      });
    }
  }
  {
    initProvides();
  }
  {
    if (created) {
      callHook$1(created, instance, "c");
    }
  }
  function registerLifecycleHook(register, hook) {
    if (isArray(hook)) {
      hook.forEach((_hook) => register(_hook.bind(publicThis)));
    } else if (hook) {
      register(hook.bind(publicThis));
    }
  }
  registerLifecycleHook(onBeforeMount, beforeMount);
  registerLifecycleHook(onMounted, mounted);
  registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  registerLifecycleHook(onUpdated, updated);
  registerLifecycleHook(onActivated, activated);
  registerLifecycleHook(onDeactivated, deactivated);
  registerLifecycleHook(onErrorCaptured, errorCaptured);
  registerLifecycleHook(onRenderTracked, renderTracked);
  registerLifecycleHook(onRenderTriggered, renderTriggered);
  registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  registerLifecycleHook(onUnmounted, unmounted);
  registerLifecycleHook(onServerPrefetch, serverPrefetch);
  if (isArray(expose)) {
    if (expose.length) {
      const exposed = instance.exposed || (instance.exposed = {});
      expose.forEach((key) => {
        Object.defineProperty(exposed, key, {
          get: () => publicThis[key],
          set: (val2) => publicThis[key] = val2
        });
      });
    } else if (!instance.exposed) {
      instance.exposed = {};
    }
  }
  if (render && instance.render === NOOP) {
    instance.render = render;
  }
  if (inheritAttrs != null) {
    instance.inheritAttrs = inheritAttrs;
  }
  if (components)
    instance.components = components;
  if (directives)
    instance.directives = directives;
  if (instance.ctx.$onApplyOptions) {
    instance.ctx.$onApplyOptions(options, instance, publicThis);
  }
}
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  if (isArray(injectOptions)) {
    injectOptions = normalizeInject(injectOptions);
  }
  for (const key in injectOptions) {
    const opt = injectOptions[key];
    let injected;
    if (isObject$1(opt)) {
      if ("default" in opt) {
        injected = inject(
          opt.from || key,
          opt.default,
          true
        );
      } else {
        injected = inject(opt.from || key);
      }
    } else {
      injected = inject(opt);
    }
    if (isRef(injected)) {
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => injected.value,
        set: (v3) => injected.value = v3
      });
    } else {
      ctx[key] = injected;
    }
    {
      checkDuplicateProperties("Inject", key);
    }
  }
}
function callHook$1(hook, instance, type) {
  callWithAsyncErrorHandling(
    isArray(hook) ? hook.map((h22) => h22.bind(instance.proxy)) : hook.bind(instance.proxy),
    instance,
    type
  );
}
function createWatcher(raw, ctx, publicThis, key) {
  const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  if (isString(raw)) {
    const handler = ctx[raw];
    if (isFunction(handler)) {
      watch(getter, handler);
    } else {
      warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
    }
  } else if (isFunction(raw)) {
    watch(getter, raw.bind(publicThis));
  } else if (isObject$1(raw)) {
    if (isArray(raw)) {
      raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
    } else {
      const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
      if (isFunction(handler)) {
        watch(getter, handler, raw);
      } else {
        warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
      }
    }
  } else {
    warn$1(`Invalid watch option: "${key}"`, raw);
  }
}
function resolveMergedOptions(instance) {
  const base = instance.type;
  const { mixins, extends: extendsOptions } = base;
  const {
    mixins: globalMixins,
    optionsCache: cache,
    config: { optionMergeStrategies }
  } = instance.appContext;
  const cached = cache.get(base);
  let resolved;
  if (cached) {
    resolved = cached;
  } else if (!globalMixins.length && !mixins && !extendsOptions) {
    {
      resolved = base;
    }
  } else {
    resolved = {};
    if (globalMixins.length) {
      globalMixins.forEach(
        (m22) => mergeOptions(resolved, m22, optionMergeStrategies, true)
      );
    }
    mergeOptions(resolved, base, optionMergeStrategies);
  }
  if (isObject$1(base)) {
    cache.set(base, resolved);
  }
  return resolved;
}
function mergeOptions(to2, from, strats, asMixin = false) {
  const { mixins, extends: extendsOptions } = from;
  if (extendsOptions) {
    mergeOptions(to2, extendsOptions, strats, true);
  }
  if (mixins) {
    mixins.forEach(
      (m22) => mergeOptions(to2, m22, strats, true)
    );
  }
  for (const key in from) {
    if (asMixin && key === "expose") {
      warn$1(
        `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
      );
    } else {
      const strat = internalOptionMergeStrats[key] || strats && strats[key];
      to2[key] = strat ? strat(to2[key], from[key]) : from[key];
    }
  }
  return to2;
}
const internalOptionMergeStrats = {
  data: mergeDataFn,
  props: mergeEmitsOrPropsOptions,
  emits: mergeEmitsOrPropsOptions,
  // objects
  methods: mergeObjectOptions,
  computed: mergeObjectOptions,
  // lifecycle
  beforeCreate: mergeAsArray$1,
  created: mergeAsArray$1,
  beforeMount: mergeAsArray$1,
  mounted: mergeAsArray$1,
  beforeUpdate: mergeAsArray$1,
  updated: mergeAsArray$1,
  beforeDestroy: mergeAsArray$1,
  beforeUnmount: mergeAsArray$1,
  destroyed: mergeAsArray$1,
  unmounted: mergeAsArray$1,
  activated: mergeAsArray$1,
  deactivated: mergeAsArray$1,
  errorCaptured: mergeAsArray$1,
  serverPrefetch: mergeAsArray$1,
  // assets
  components: mergeObjectOptions,
  directives: mergeObjectOptions,
  // watch
  watch: mergeWatchOptions,
  // provide / inject
  provide: mergeDataFn,
  inject: mergeInject
};
function mergeDataFn(to2, from) {
  if (!from) {
    return to2;
  }
  if (!to2) {
    return from;
  }
  return function mergedDataFn() {
    return extend(
      isFunction(to2) ? to2.call(this, this) : to2,
      isFunction(from) ? from.call(this, this) : from
    );
  };
}
function mergeInject(to2, from) {
  return mergeObjectOptions(normalizeInject(to2), normalizeInject(from));
}
function normalizeInject(raw) {
  if (isArray(raw)) {
    const res = {};
    for (let i3 = 0; i3 < raw.length; i3++) {
      res[raw[i3]] = raw[i3];
    }
    return res;
  }
  return raw;
}
function mergeAsArray$1(to2, from) {
  return to2 ? [...new Set([].concat(to2, from))] : from;
}
function mergeObjectOptions(to2, from) {
  return to2 ? extend(/* @__PURE__ */ Object.create(null), to2, from) : from;
}
function mergeEmitsOrPropsOptions(to2, from) {
  if (to2) {
    if (isArray(to2) && isArray(from)) {
      return [.../* @__PURE__ */ new Set([...to2, ...from])];
    }
    return extend(
      /* @__PURE__ */ Object.create(null),
      normalizePropsOrEmits(to2),
      normalizePropsOrEmits(from != null ? from : {})
    );
  } else {
    return from;
  }
}
function mergeWatchOptions(to2, from) {
  if (!to2)
    return from;
  if (!from)
    return to2;
  const merged = extend(/* @__PURE__ */ Object.create(null), to2);
  for (const key in from) {
    merged[key] = mergeAsArray$1(to2[key], from[key]);
  }
  return merged;
}
function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  const props = {};
  const attrs = {};
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  setFullProps(instance, rawProps, props, attrs);
  for (const key in instance.propsOptions[0]) {
    if (!(key in props)) {
      props[key] = void 0;
    }
  }
  {
    validateProps(rawProps || {}, props, instance);
  }
  if (isStateful) {
    instance.props = isSSR ? props : shallowReactive(props);
  } else {
    if (!instance.type.props) {
      instance.props = attrs;
    } else {
      instance.props = props;
    }
  }
  instance.attrs = attrs;
}
function isInHmrContext(instance) {
}
function updateProps(instance, rawProps, rawPrevProps, optimized) {
  const {
    props,
    attrs,
    vnode: { patchFlag }
  } = instance;
  const rawCurrentProps = toRaw(props);
  const [options] = instance.propsOptions;
  let hasAttrsChanged = false;
  if (
    // always force full diff in dev
    // - #1942 if hmr is enabled with sfc component
    // - vite#872 non-sfc component used by sfc component
    !isInHmrContext() && (optimized || patchFlag > 0) && !(patchFlag & 16)
  ) {
    if (patchFlag & 8) {
      const propsToUpdate = instance.vnode.dynamicProps;
      for (let i3 = 0; i3 < propsToUpdate.length; i3++) {
        let key = propsToUpdate[i3];
        if (isEmitListener(instance.emitsOptions, key)) {
          continue;
        }
        const value = rawProps[key];
        if (options) {
          if (hasOwn$1(attrs, key)) {
            if (value !== attrs[key]) {
              attrs[key] = value;
              hasAttrsChanged = true;
            }
          } else {
            const camelizedKey = camelize(key);
            props[camelizedKey] = resolvePropValue$1(
              options,
              rawCurrentProps,
              camelizedKey,
              value,
              instance,
              false
            );
          }
        } else {
          if (value !== attrs[key]) {
            attrs[key] = value;
            hasAttrsChanged = true;
          }
        }
      }
    }
  } else {
    if (setFullProps(instance, rawProps, props, attrs)) {
      hasAttrsChanged = true;
    }
    let kebabKey;
    for (const key in rawCurrentProps) {
      if (!rawProps || // for camelCase
      !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
      // and converted to camelCase (#955)
      ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
        if (options) {
          if (rawPrevProps && // for camelCase
          (rawPrevProps[key] !== void 0 || // for kebab-case
          rawPrevProps[kebabKey] !== void 0)) {
            props[key] = resolvePropValue$1(
              options,
              rawCurrentProps,
              key,
              void 0,
              instance,
              true
            );
          }
        } else {
          delete props[key];
        }
      }
    }
    if (attrs !== rawCurrentProps) {
      for (const key in attrs) {
        if (!rawProps || !hasOwn$1(rawProps, key) && true) {
          delete attrs[key];
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (hasAttrsChanged) {
    trigger(instance, "set", "$attrs");
  }
  {
    validateProps(rawProps || {}, props, instance);
  }
}
function setFullProps(instance, rawProps, props, attrs) {
  const [options, needCastKeys] = instance.propsOptions;
  let hasAttrsChanged = false;
  let rawCastValues;
  if (rawProps) {
    for (let key in rawProps) {
      if (isReservedProp(key)) {
        continue;
      }
      const value = rawProps[key];
      let camelKey;
      if (options && hasOwn$1(options, camelKey = camelize(key))) {
        if (!needCastKeys || !needCastKeys.includes(camelKey)) {
          props[camelKey] = value;
        } else {
          (rawCastValues || (rawCastValues = {}))[camelKey] = value;
        }
      } else if (!isEmitListener(instance.emitsOptions, key)) {
        if (!(key in attrs) || value !== attrs[key]) {
          attrs[key] = value;
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (needCastKeys) {
    const rawCurrentProps = toRaw(props);
    const castValues = rawCastValues || EMPTY_OBJ;
    for (let i3 = 0; i3 < needCastKeys.length; i3++) {
      const key = needCastKeys[i3];
      props[key] = resolvePropValue$1(
        options,
        rawCurrentProps,
        key,
        castValues[key],
        instance,
        !hasOwn$1(castValues, key)
      );
    }
  }
  return hasAttrsChanged;
}
function resolvePropValue$1(options, props, key, value, instance, isAbsent) {
  const opt = options[key];
  if (opt != null) {
    const hasDefault = hasOwn$1(opt, "default");
    if (hasDefault && value === void 0) {
      const defaultValue = opt.default;
      if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
        const { propsDefaults } = instance;
        if (key in propsDefaults) {
          value = propsDefaults[key];
        } else {
          const reset = setCurrentInstance(instance);
          value = propsDefaults[key] = defaultValue.call(
            null,
            props
          );
          reset();
        }
      } else {
        value = defaultValue;
      }
    }
    if (opt[
      0
      /* shouldCast */
    ]) {
      if (isAbsent && !hasDefault) {
        value = false;
      } else if (opt[
        1
        /* shouldCastTrue */
      ] && (value === "" || value === hyphenate(key))) {
        value = true;
      }
    }
  }
  return value;
}
function normalizePropsOptions(comp, appContext, asMixin = false) {
  const cache = appContext.propsCache;
  const cached = cache.get(comp);
  if (cached) {
    return cached;
  }
  const raw = comp.props;
  const normalized = {};
  const needCastKeys = [];
  let hasExtends = false;
  if (!isFunction(comp)) {
    const extendProps = (raw2) => {
      hasExtends = true;
      const [props, keys] = normalizePropsOptions(raw2, appContext, true);
      extend(normalized, props);
      if (keys)
        needCastKeys.push(...keys);
    };
    if (!asMixin && appContext.mixins.length) {
      appContext.mixins.forEach(extendProps);
    }
    if (comp.extends) {
      extendProps(comp.extends);
    }
    if (comp.mixins) {
      comp.mixins.forEach(extendProps);
    }
  }
  if (!raw && !hasExtends) {
    if (isObject$1(comp)) {
      cache.set(comp, EMPTY_ARR);
    }
    return EMPTY_ARR;
  }
  if (isArray(raw)) {
    for (let i3 = 0; i3 < raw.length; i3++) {
      if (!isString(raw[i3])) {
        warn$1(`props must be strings when using array syntax.`, raw[i3]);
      }
      const normalizedKey = camelize(raw[i3]);
      if (validatePropName(normalizedKey)) {
        normalized[normalizedKey] = EMPTY_OBJ;
      }
    }
  } else if (raw) {
    if (!isObject$1(raw)) {
      warn$1(`invalid props options`, raw);
    }
    for (const key in raw) {
      const normalizedKey = camelize(key);
      if (validatePropName(normalizedKey)) {
        const opt = raw[key];
        const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
        if (prop) {
          const booleanIndex = getTypeIndex(Boolean, prop.type);
          const stringIndex = getTypeIndex(String, prop.type);
          prop[
            0
            /* shouldCast */
          ] = booleanIndex > -1;
          prop[
            1
            /* shouldCastTrue */
          ] = stringIndex < 0 || booleanIndex < stringIndex;
          if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
            needCastKeys.push(normalizedKey);
          }
        }
      }
    }
  }
  const res = [normalized, needCastKeys];
  if (isObject$1(comp)) {
    cache.set(comp, res);
  }
  return res;
}
function validatePropName(key) {
  if (key[0] !== "$" && !isReservedProp(key)) {
    return true;
  } else {
    warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  }
  return false;
}
function getType$1(ctor) {
  if (ctor === null) {
    return "null";
  }
  if (typeof ctor === "function") {
    return ctor.name || "";
  } else if (typeof ctor === "object") {
    const name = ctor.constructor && ctor.constructor.name;
    return name || "";
  }
  return "";
}
function isSameType(a3, b2) {
  return getType$1(a3) === getType$1(b2);
}
function getTypeIndex(type, expectedTypes) {
  if (isArray(expectedTypes)) {
    return expectedTypes.findIndex((t2) => isSameType(t2, type));
  } else if (isFunction(expectedTypes)) {
    return isSameType(expectedTypes, type) ? 0 : -1;
  }
  return -1;
}
function validateProps(rawProps, props, instance) {
  const resolvedValues = toRaw(props);
  const options = instance.propsOptions[0];
  for (const key in options) {
    let opt = options[key];
    if (opt == null)
      continue;
    validateProp$1(
      key,
      resolvedValues[key],
      opt,
      shallowReadonly(resolvedValues),
      !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key))
    );
  }
}
function validateProp$1(name, value, prop, props, isAbsent) {
  const { type, required, validator, skipCheck } = prop;
  if (required && isAbsent) {
    warn$1('Missing required prop: "' + name + '"');
    return;
  }
  if (value == null && !required) {
    return;
  }
  if (type != null && type !== true && !skipCheck) {
    let isValid = false;
    const types = isArray(type) ? type : [type];
    const expectedTypes = [];
    for (let i3 = 0; i3 < types.length && !isValid; i3++) {
      const { valid, expectedType } = assertType$1(value, types[i3]);
      expectedTypes.push(expectedType || "");
      isValid = valid;
    }
    if (!isValid) {
      warn$1(getInvalidTypeMessage$1(name, value, expectedTypes));
      return;
    }
  }
  if (validator && !validator(value, props)) {
    warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  }
}
const isSimpleType$1 = /* @__PURE__ */ makeMap(
  "String,Number,Boolean,Function,Symbol,BigInt"
);
function assertType$1(value, type) {
  let valid;
  const expectedType = getType$1(type);
  if (isSimpleType$1(expectedType)) {
    const t2 = typeof value;
    valid = t2 === expectedType.toLowerCase();
    if (!valid && t2 === "object") {
      valid = value instanceof type;
    }
  } else if (expectedType === "Object") {
    valid = isObject$1(value);
  } else if (expectedType === "Array") {
    valid = isArray(value);
  } else if (expectedType === "null") {
    valid = value === null;
  } else {
    valid = value instanceof type;
  }
  return {
    valid,
    expectedType
  };
}
function getInvalidTypeMessage$1(name, value, expectedTypes) {
  if (expectedTypes.length === 0) {
    return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  }
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  const expectedType = expectedTypes[0];
  const receivedType = toRawType(value);
  const expectedValue = styleValue$1(value, expectedType);
  const receivedValue = styleValue$1(value, receivedType);
  if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
    message += ` with value ${expectedValue}`;
  }
  message += `, got ${receivedType} `;
  if (isExplicable$1(receivedType)) {
    message += `with value ${receivedValue}.`;
  }
  return message;
}
function styleValue$1(value, type) {
  if (type === "String") {
    return `"${value}"`;
  } else if (type === "Number") {
    return `${Number(value)}`;
  } else {
    return `${value}`;
  }
}
function isExplicable$1(type) {
  const explicitTypes = ["string", "number", "boolean"];
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
}
function isBoolean$1(...args) {
  return args.some((elem) => elem.toLowerCase() === "boolean");
}
let supported;
let perf;
function startMeasure(instance, type) {
  if (instance.appContext.config.performance && isSupported()) {
    perf.mark(`vue-${type}-${instance.uid}`);
  }
  {
    devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  }
}
function endMeasure(instance, type) {
  if (instance.appContext.config.performance && isSupported()) {
    const startTag = `vue-${type}-${instance.uid}`;
    const endTag = startTag + `:end`;
    perf.mark(endTag);
    perf.measure(
      `<${formatComponentName(instance, instance.type)}> ${type}`,
      startTag,
      endTag
    );
    perf.clearMarks(startTag);
    perf.clearMarks(endTag);
  }
  {
    devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  }
}
function isSupported() {
  if (supported !== void 0) {
    return supported;
  }
  if (typeof window !== "undefined" && window.performance) {
    supported = true;
    perf = window.performance;
  } else {
    supported = false;
  }
  return supported;
}
const queuePostRenderEffect$1 = queuePostFlushCb;
const Fragment = Symbol.for("v-fgt");
const Text = Symbol.for("v-txt");
const Comment = Symbol.for("v-cmt");
const Static = Symbol.for("v-stc");
function isVNode(value) {
  return value ? value.__v_isVNode === true : false;
}
const InternalObjectKey = `__vInternal`;
function guardReactiveProps(props) {
  if (!props)
    return null;
  return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
}
const emptyAppContext = createAppContext();
let uid = 0;
function createComponentInstance(vnode, parent, suspense) {
  const type = vnode.type;
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  const instance = {
    uid: uid++,
    vnode,
    type,
    parent,
    appContext,
    root: null,
    // to be immediately set
    next: null,
    subTree: null,
    // will be set synchronously right after creation
    effect: null,
    update: null,
    // will be set synchronously right after creation
    scope: new EffectScope(
      true
      /* detached */
    ),
    render: null,
    proxy: null,
    exposed: null,
    exposeProxy: null,
    withProxy: null,
    provides: parent ? parent.provides : Object.create(appContext.provides),
    accessCache: null,
    renderCache: [],
    // local resolved assets
    components: null,
    directives: null,
    // resolved props and emits options
    propsOptions: normalizePropsOptions(type, appContext),
    emitsOptions: normalizeEmitsOptions(type, appContext),
    // emit
    emit: null,
    // to be set immediately
    emitted: null,
    // props default value
    propsDefaults: EMPTY_OBJ,
    // inheritAttrs
    inheritAttrs: type.inheritAttrs,
    // state
    ctx: EMPTY_OBJ,
    data: EMPTY_OBJ,
    props: EMPTY_OBJ,
    attrs: EMPTY_OBJ,
    slots: EMPTY_OBJ,
    refs: EMPTY_OBJ,
    setupState: EMPTY_OBJ,
    setupContext: null,
    attrsProxy: null,
    slotsProxy: null,
    // suspense related
    suspense,
    suspenseId: suspense ? suspense.pendingId : 0,
    asyncDep: null,
    asyncResolved: false,
    // lifecycle hooks
    // not using enums here because it results in computed properties
    isMounted: false,
    isUnmounted: false,
    isDeactivated: false,
    bc: null,
    c: null,
    bm: null,
    m: null,
    bu: null,
    u: null,
    um: null,
    bum: null,
    da: null,
    a: null,
    rtg: null,
    rtc: null,
    ec: null,
    sp: null,
    // fixed by xxxxxx 用于存储uni-app的元素缓存
    $uniElements: /* @__PURE__ */ new Map(),
    $templateUniElementRefs: [],
    $templateUniElementStyles: {},
    $eS: {},
    $eA: {}
  };
  {
    instance.ctx = createDevRenderContext(instance);
  }
  instance.root = parent ? parent.root : instance;
  instance.emit = emit.bind(null, instance);
  if (vnode.ce) {
    vnode.ce(instance);
  }
  return instance;
}
let currentInstance = null;
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
let internalSetCurrentInstance;
let setInSSRSetupState;
{
  internalSetCurrentInstance = (i3) => {
    currentInstance = i3;
  };
  setInSSRSetupState = (v3) => {
    isInSSRComponentSetup = v3;
  };
}
const setCurrentInstance = (instance) => {
  const prev = currentInstance;
  internalSetCurrentInstance(instance);
  instance.scope.on();
  return () => {
    instance.scope.off();
    internalSetCurrentInstance(prev);
  };
};
const unsetCurrentInstance = () => {
  currentInstance && currentInstance.scope.off();
  internalSetCurrentInstance(null);
};
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
function validateComponentName(name, { isNativeTag }) {
  if (isBuiltInTag(name) || isNativeTag(name)) {
    warn$1(
      "Do not use built-in or reserved HTML elements as component id: " + name
    );
  }
}
function isStatefulComponent(instance) {
  return instance.vnode.shapeFlag & 4;
}
let isInSSRComponentSetup = false;
function setupComponent(instance, isSSR = false) {
  isSSR && setInSSRSetupState(isSSR);
  const {
    props
    /*, children*/
  } = instance.vnode;
  const isStateful = isStatefulComponent(instance);
  initProps$1(instance, props, isStateful, isSSR);
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  isSSR && setInSSRSetupState(false);
  return setupResult;
}
function setupStatefulComponent(instance, isSSR) {
  const Component2 = instance.type;
  {
    if (Component2.name) {
      validateComponentName(Component2.name, instance.appContext.config);
    }
    if (Component2.components) {
      const names = Object.keys(Component2.components);
      for (let i3 = 0; i3 < names.length; i3++) {
        validateComponentName(names[i3], instance.appContext.config);
      }
    }
    if (Component2.directives) {
      const names = Object.keys(Component2.directives);
      for (let i3 = 0; i3 < names.length; i3++) {
        validateDirectiveName(names[i3]);
      }
    }
    if (Component2.compilerOptions && isRuntimeOnly()) {
      warn$1(
        `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
      );
    }
  }
  instance.accessCache = /* @__PURE__ */ Object.create(null);
  instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  {
    exposePropsOnRenderContext(instance);
  }
  const { setup } = Component2;
  if (setup) {
    const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
    const reset = setCurrentInstance(instance);
    pauseTracking();
    const setupResult = callWithErrorHandling(
      setup,
      instance,
      0,
      [
        shallowReadonly(instance.props),
        setupContext
      ]
    );
    resetTracking();
    reset();
    if (isPromise(setupResult)) {
      setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
      {
        warn$1(
          `setup() returned a Promise, but the version of Vue you are using does not support it yet.`
        );
      }
    } else {
      handleSetupResult(instance, setupResult, isSSR);
    }
  } else {
    finishComponentSetup(instance, isSSR);
  }
}
function handleSetupResult(instance, setupResult, isSSR) {
  if (isFunction(setupResult)) {
    {
      instance.render = setupResult;
    }
  } else if (isObject$1(setupResult)) {
    if (isVNode(setupResult)) {
      warn$1(
        `setup() should not return VNodes directly - return a render function instead.`
      );
    }
    {
      instance.devtoolsRawSetupState = setupResult;
    }
    instance.setupState = proxyRefs(setupResult);
    {
      exposeSetupStateOnRenderContext(instance);
    }
  } else if (setupResult !== void 0) {
    warn$1(
      `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
    );
  }
  finishComponentSetup(instance, isSSR);
}
let compile;
const isRuntimeOnly = () => !compile;
function finishComponentSetup(instance, isSSR, skipOptions) {
  const Component2 = instance.type;
  if (!instance.render) {
    instance.render = Component2.render || NOOP;
  }
  {
    const reset = setCurrentInstance(instance);
    pauseTracking();
    try {
      applyOptions$1(instance);
    } finally {
      resetTracking();
      reset();
    }
  }
  if (!Component2.render && instance.render === NOOP && !isSSR) {
    if (Component2.template) {
      warn$1(
        `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
      );
    } else {
      warn$1(`Component is missing template or render function.`);
    }
  }
}
function getAttrsProxy(instance) {
  return instance.attrsProxy || (instance.attrsProxy = new Proxy(
    instance.attrs,
    {
      get(target, key) {
        track(instance, "get", "$attrs");
        return target[key];
      },
      set() {
        warn$1(`setupContext.attrs is readonly.`);
        return false;
      },
      deleteProperty() {
        warn$1(`setupContext.attrs is readonly.`);
        return false;
      }
    }
  ));
}
function getSlotsProxy(instance) {
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
    get(target, key) {
      track(instance, "get", "$slots");
      return target[key];
    }
  }));
}
function createSetupContext(instance) {
  const expose = (exposed) => {
    {
      if (instance.exposed) {
        warn$1(`expose() should be called only once per setup().`);
      }
      if (exposed != null) {
        let exposedType = typeof exposed;
        if (exposedType === "object") {
          if (isArray(exposed)) {
            exposedType = "array";
          } else if (isRef(exposed)) {
            exposedType = "ref";
          }
        }
        if (exposedType !== "object") {
          warn$1(
            `expose() should be passed a plain object, received ${exposedType}.`
          );
        }
      }
    }
    instance.exposed = exposed || {};
  };
  {
    return Object.freeze({
      get attrs() {
        return getAttrsProxy(instance);
      },
      get slots() {
        return getSlotsProxy(instance);
      },
      get emit() {
        return (event, ...args) => instance.emit(event, ...args);
      },
      expose
    });
  }
}
function getExposeProxy(instance) {
  if (instance.exposed) {
    return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
      get(target, key) {
        if (key in target) {
          return target[key];
        }
        return instance.proxy[key];
      },
      has(target, key) {
        return key in target || key in publicPropertiesMap;
      }
    }));
  }
}
const classifyRE = /(?:^|[-_])(\w)/g;
const classify = (str) => str.replace(classifyRE, (c22) => c22.toUpperCase()).replace(/[-_]/g, "");
function getComponentName(Component2, includeInferred = true) {
  return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
}
function formatComponentName(instance, Component2, isRoot = false) {
  let name = getComponentName(Component2);
  if (!name && Component2.__file) {
    const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
    if (match) {
      name = match[1];
    }
  }
  if (!name && instance && instance.parent) {
    const inferFromRegistry = (registry) => {
      for (const key in registry) {
        if (registry[key] === Component2) {
          return key;
        }
      }
    };
    name = inferFromRegistry(
      instance.components || instance.parent.type.components
    ) || inferFromRegistry(instance.appContext.components);
  }
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
}
const computed = (getterOrOptions, debugOptions) => {
  const c22 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  {
    const i3 = getCurrentInstance();
    if (i3 && i3.appContext.config.warnRecursiveComputed) {
      c22._warnRecursive = true;
    }
  }
  return c22;
};
const version = "3.4.21";
const warn = warn$1;
function unwrapper(target) {
  return unref(target);
}
const ARRAYTYPE = "[object Array]";
const OBJECTTYPE = "[object Object]";
function diff(current, pre) {
  const result = {};
  syncKeys(current, pre);
  _diff(current, pre, "", result);
  return result;
}
function syncKeys(current, pre) {
  current = unwrapper(current);
  if (current === pre)
    return;
  const rootCurrentType = toTypeString(current);
  const rootPreType = toTypeString(pre);
  if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
    for (let key in pre) {
      const currentValue = current[key];
      if (currentValue === void 0) {
        current[key] = null;
      } else {
        syncKeys(currentValue, pre[key]);
      }
    }
  } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
    if (current.length >= pre.length) {
      pre.forEach((item, index2) => {
        syncKeys(current[index2], item);
      });
    }
  }
}
function _diff(current, pre, path, result) {
  current = unwrapper(current);
  if (current === pre)
    return;
  const rootCurrentType = toTypeString(current);
  const rootPreType = toTypeString(pre);
  if (rootCurrentType == OBJECTTYPE) {
    if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
      setResult(result, path, current);
    } else {
      for (let key in current) {
        const currentValue = unwrapper(current[key]);
        const preValue = pre[key];
        const currentType = toTypeString(currentValue);
        const preType = toTypeString(preValue);
        if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
          if (currentValue != preValue) {
            setResult(
              result,
              (path == "" ? "" : path + ".") + key,
              currentValue
            );
          }
        } else if (currentType == ARRAYTYPE) {
          if (preType != ARRAYTYPE) {
            setResult(
              result,
              (path == "" ? "" : path + ".") + key,
              currentValue
            );
          } else {
            if (currentValue.length < preValue.length) {
              setResult(
                result,
                (path == "" ? "" : path + ".") + key,
                currentValue
              );
            } else {
              currentValue.forEach((item, index2) => {
                _diff(
                  item,
                  preValue[index2],
                  (path == "" ? "" : path + ".") + key + "[" + index2 + "]",
                  result
                );
              });
            }
          }
        } else if (currentType == OBJECTTYPE) {
          if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
            setResult(
              result,
              (path == "" ? "" : path + ".") + key,
              currentValue
            );
          } else {
            for (let subKey in currentValue) {
              _diff(
                currentValue[subKey],
                preValue[subKey],
                (path == "" ? "" : path + ".") + key + "." + subKey,
                result
              );
            }
          }
        }
      }
    }
  } else if (rootCurrentType == ARRAYTYPE) {
    if (rootPreType != ARRAYTYPE) {
      setResult(result, path, current);
    } else {
      if (current.length < pre.length) {
        setResult(result, path, current);
      } else {
        current.forEach((item, index2) => {
          _diff(item, pre[index2], path + "[" + index2 + "]", result);
        });
      }
    }
  } else {
    setResult(result, path, current);
  }
}
function setResult(result, k2, v3) {
  result[k2] = v3;
}
function hasComponentEffect(instance) {
  return queue$1.includes(instance.update);
}
function flushCallbacks(instance) {
  const ctx = instance.ctx;
  const callbacks = ctx.__next_tick_callbacks;
  if (callbacks && callbacks.length) {
    const copies = callbacks.slice(0);
    callbacks.length = 0;
    for (let i3 = 0; i3 < copies.length; i3++) {
      copies[i3]();
    }
  }
}
function nextTick(instance, fn2) {
  const ctx = instance.ctx;
  if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
    return nextTick$1(fn2 && fn2.bind(instance.proxy));
  }
  let _resolve;
  if (!ctx.__next_tick_callbacks) {
    ctx.__next_tick_callbacks = [];
  }
  ctx.__next_tick_callbacks.push(() => {
    if (fn2) {
      callWithErrorHandling(
        fn2.bind(instance.proxy),
        instance,
        14
      );
    } else if (_resolve) {
      _resolve(instance.proxy);
    }
  });
  return new Promise((resolve2) => {
    _resolve = resolve2;
  });
}
function clone(src, seen) {
  src = unwrapper(src);
  const type = typeof src;
  if (type === "object" && src !== null) {
    let copy = seen.get(src);
    if (typeof copy !== "undefined") {
      return copy;
    }
    if (isArray(src)) {
      const len = src.length;
      copy = new Array(len);
      seen.set(src, copy);
      for (let i3 = 0; i3 < len; i3++) {
        copy[i3] = clone(src[i3], seen);
      }
    } else {
      copy = {};
      seen.set(src, copy);
      for (const name in src) {
        if (hasOwn$1(src, name)) {
          copy[name] = clone(src[name], seen);
        }
      }
    }
    return copy;
  }
  if (type !== "symbol") {
    return src;
  }
}
function deepCopy(src) {
  return clone(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
}
function getMPInstanceData(instance, keys) {
  const data = instance.data;
  const ret = /* @__PURE__ */ Object.create(null);
  keys.forEach((key) => {
    ret[key] = data[key];
  });
  return ret;
}
function patch(instance, data, oldData) {
  if (!data) {
    return;
  }
  data = deepCopy(data);
  data.$eS = instance.$eS || {};
  data.$eA = instance.$eA || {};
  const ctx = instance.ctx;
  const mpType = ctx.mpType;
  if (mpType === "page" || mpType === "component") {
    data.r0 = 1;
    const mpInstance = ctx.$scope;
    const keys = Object.keys(data);
    const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
    if (Object.keys(diffData).length) {
      ctx.__next_tick_pending = true;
      mpInstance.setData(diffData, () => {
        ctx.__next_tick_pending = false;
        flushCallbacks(instance);
      });
      flushPreFlushCbs();
    } else {
      flushCallbacks(instance);
    }
  }
}
function initAppConfig(appConfig) {
  appConfig.globalProperties.$nextTick = function $nextTick(fn2) {
    return nextTick(this.$, fn2);
  };
}
function onApplyOptions(options, instance, publicThis) {
  instance.appContext.config.globalProperties.$applyOptions(
    options,
    instance,
    publicThis
  );
  const computedOptions = options.computed;
  if (computedOptions) {
    const keys = Object.keys(computedOptions);
    if (keys.length) {
      const ctx = instance.ctx;
      if (!ctx.$computedKeys) {
        ctx.$computedKeys = [];
      }
      ctx.$computedKeys.push(...keys);
    }
  }
  delete instance.ctx.$onApplyOptions;
}
function setRef$1(instance, isUnmount = false) {
  const {
    setupState,
    $templateRefs,
    $templateUniElementRefs,
    ctx: { $scope, $mpPlatform }
  } = instance;
  if ($mpPlatform === "mp-alipay") {
    return;
  }
  if (!$scope || !$templateRefs && !$templateUniElementRefs) {
    return;
  }
  if (isUnmount) {
    $templateRefs && $templateRefs.forEach(
      (templateRef) => setTemplateRef(templateRef, null, setupState)
    );
    $templateUniElementRefs && $templateUniElementRefs.forEach(
      (templateRef) => setTemplateRef(templateRef, null, setupState)
    );
    return;
  }
  const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  const doSetByRefs = (refs) => {
    if (refs.length === 0) {
      return [];
    }
    const mpComponents = (
      // 字节小程序 selectAllComponents 可能返回 null
      // https://github.com/dcloudio/uni-app/issues/3954
      ($scope.selectAllComponents(".r") || []).concat(
        $scope.selectAllComponents(".r-i-f") || []
      )
    );
    return refs.filter((templateRef) => {
      const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
      if (check && refValue === null) {
        return true;
      }
      setTemplateRef(templateRef, refValue, setupState);
      return false;
    });
  };
  const doSet = () => {
    if ($templateRefs) {
      const refs = doSetByRefs($templateRefs);
      if (refs.length && instance.proxy && instance.proxy.$scope) {
        instance.proxy.$scope.setData({ r1: 1 }, () => {
          doSetByRefs(refs);
        });
      }
    }
  };
  if ($templateUniElementRefs && $templateUniElementRefs.length) {
    nextTick(instance, () => {
      $templateUniElementRefs.forEach((templateRef) => {
        if (isArray(templateRef.v)) {
          templateRef.v.forEach((v3) => {
            setTemplateRef(templateRef, v3, setupState);
          });
        } else {
          setTemplateRef(templateRef, templateRef.v, setupState);
        }
      });
    });
  }
  if ($scope._$setRef) {
    $scope._$setRef(doSet);
  } else {
    nextTick(instance, doSet);
  }
}
function toSkip(value) {
  if (isObject$1(value)) {
    markRaw(value);
  }
  return value;
}
function findComponentPublicInstance(mpComponents, id) {
  const mpInstance = mpComponents.find(
    (com) => com && (com.properties || com.props).uI === id
  );
  if (mpInstance) {
    const vm = mpInstance.$vm;
    if (vm) {
      return getExposeProxy(vm.$) || vm;
    }
    return toSkip(mpInstance);
  }
  return null;
}
function setTemplateRef({ r: r2, f: f22 }, refValue, setupState) {
  if (isFunction(r2)) {
    r2(refValue, {});
  } else {
    const _isString = isString(r2);
    const _isRef = isRef(r2);
    if (_isString || _isRef) {
      if (f22) {
        if (!_isRef) {
          return;
        }
        if (!isArray(r2.value)) {
          r2.value = [];
        }
        const existing = r2.value;
        if (existing.indexOf(refValue) === -1) {
          existing.push(refValue);
          if (!refValue) {
            return;
          }
          if (refValue.$) {
            onBeforeUnmount(() => remove(existing, refValue), refValue.$);
          }
        }
      } else if (_isString) {
        if (hasOwn$1(setupState, r2)) {
          setupState[r2] = refValue;
        }
      } else if (isRef(r2)) {
        r2.value = refValue;
      } else {
        warnRef(r2);
      }
    } else {
      warnRef(r2);
    }
  }
}
function warnRef(ref2) {
  warn("Invalid template ref type:", ref2, `(${typeof ref2})`);
}
const queuePostRenderEffect = queuePostFlushCb;
function mountComponent(initialVNode, options) {
  const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  instance.renderer = options.mpType ? options.mpType : "component";
  {
    instance.ctx.$onApplyOptions = onApplyOptions;
    instance.ctx.$children = [];
  }
  if (options.mpType === "app") {
    instance.render = NOOP;
  }
  if (options.onBeforeSetup) {
    options.onBeforeSetup(instance, options);
  }
  {
    pushWarningContext(initialVNode);
    startMeasure(instance, `mount`);
  }
  {
    startMeasure(instance, `init`);
  }
  setupComponent(instance);
  {
    endMeasure(instance, `init`);
  }
  {
    if (options.parentComponent && instance.proxy) {
      options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
    }
  }
  setupRenderEffect(instance);
  {
    popWarningContext();
    endMeasure(instance, `mount`);
  }
  return instance.proxy;
}
const getFunctionalFallthrough = (attrs) => {
  let res;
  for (const key in attrs) {
    if (key === "class" || key === "style" || isOn(key)) {
      (res || (res = {}))[key] = attrs[key];
    }
  }
  return res;
};
function renderComponentRoot(instance) {
  const {
    type: Component2,
    vnode,
    proxy,
    withProxy,
    props,
    propsOptions: [propsOptions],
    slots,
    attrs,
    emit: emit2,
    render,
    renderCache,
    data,
    setupState,
    ctx,
    uid: uid2,
    appContext: {
      app: {
        config: {
          globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 }
        }
      }
    },
    inheritAttrs
  } = instance;
  instance.$uniElementIds = /* @__PURE__ */ new Map();
  instance.$templateRefs = [];
  instance.$templateUniElementRefs = [];
  instance.$templateUniElementStyles = {};
  instance.$ei = 0;
  pruneComponentPropsCache2(uid2);
  instance.__counter = instance.__counter === 0 ? 1 : 0;
  let result;
  const prev = setCurrentRenderingInstance(instance);
  try {
    if (vnode.shapeFlag & 4) {
      fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
      const proxyToUse = withProxy || proxy;
      result = render.call(
        proxyToUse,
        proxyToUse,
        renderCache,
        props,
        setupState,
        data,
        ctx
      );
    } else {
      fallthroughAttrs(
        inheritAttrs,
        props,
        propsOptions,
        Component2.props ? attrs : getFunctionalFallthrough(attrs)
      );
      const render2 = Component2;
      result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
        props,
        null
        /* we know it doesn't need it */
      );
    }
  } catch (err) {
    handleError(err, instance, 1);
    result = false;
  }
  setRef$1(instance);
  setCurrentRenderingInstance(prev);
  return result;
}
function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  if (props && fallthroughAttrs2 && inheritAttrs !== false) {
    const keys = Object.keys(fallthroughAttrs2).filter(
      (key) => key !== "class" && key !== "style"
    );
    if (!keys.length) {
      return;
    }
    if (propsOptions && keys.some(isModelListener)) {
      keys.forEach((key) => {
        if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
          props[key] = fallthroughAttrs2[key];
        }
      });
    } else {
      keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
    }
  }
}
const updateComponentPreRender = (instance) => {
  pauseTracking();
  flushPreFlushCbs();
  resetTracking();
};
function componentUpdateScopedSlotsFn() {
  const scopedSlotsData = this.$scopedSlotsData;
  if (!scopedSlotsData || scopedSlotsData.length === 0) {
    return;
  }
  const mpInstance = this.ctx.$scope;
  const oldData = mpInstance.data;
  const diffData = /* @__PURE__ */ Object.create(null);
  scopedSlotsData.forEach(({ path, index: index2, data }) => {
    const oldScopedSlotData = getValueByDataPath(oldData, path);
    const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
    if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
      diffData[diffPath] = data;
    } else {
      const diffScopedSlotData = diff(
        data,
        oldScopedSlotData[index2]
      );
      Object.keys(diffScopedSlotData).forEach((name) => {
        diffData[diffPath + "." + name] = diffScopedSlotData[name];
      });
    }
  });
  scopedSlotsData.length = 0;
  if (Object.keys(diffData).length) {
    mpInstance.setData(diffData);
  }
}
function toggleRecurse({ effect: effect2, update }, allowed) {
  effect2.allowRecurse = update.allowRecurse = allowed;
}
function setupRenderEffect(instance) {
  const updateScopedSlots = componentUpdateScopedSlotsFn.bind(
    instance
  );
  instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  const componentUpdateFn = () => {
    if (!instance.isMounted) {
      onBeforeUnmount(() => {
        setRef$1(instance, true);
      }, instance);
      {
        startMeasure(instance, `patch`);
      }
      patch(instance, renderComponentRoot(instance));
      {
        endMeasure(instance, `patch`);
      }
      {
        devtoolsComponentAdded(instance);
      }
    } else {
      const { next, bu, u: u2 } = instance;
      {
        pushWarningContext(next || instance.vnode);
      }
      toggleRecurse(instance, false);
      updateComponentPreRender();
      if (bu) {
        invokeArrayFns$1(bu);
      }
      toggleRecurse(instance, true);
      {
        startMeasure(instance, `patch`);
      }
      patch(instance, renderComponentRoot(instance));
      {
        endMeasure(instance, `patch`);
      }
      if (u2) {
        queuePostRenderEffect(u2);
      }
      {
        devtoolsComponentUpdated(instance);
      }
      {
        popWarningContext();
      }
    }
  };
  const effect2 = instance.effect = new ReactiveEffect(
    componentUpdateFn,
    NOOP,
    () => queueJob(update),
    instance.scope
    // track it in component's effect scope
  );
  const update = instance.update = () => {
    if (effect2.dirty) {
      effect2.run();
    }
  };
  update.id = instance.uid;
  toggleRecurse(instance, true);
  {
    effect2.onTrack = instance.rtc ? (e22) => invokeArrayFns$1(instance.rtc, e22) : void 0;
    effect2.onTrigger = instance.rtg ? (e22) => invokeArrayFns$1(instance.rtg, e22) : void 0;
    update.ownerInstance = instance;
  }
  {
    update();
  }
}
function unmountComponent(instance) {
  const { bum, scope, update, um } = instance;
  if (bum) {
    invokeArrayFns$1(bum);
  }
  {
    const parentInstance = instance.parent;
    if (parentInstance) {
      const $children = parentInstance.ctx.$children;
      const target = getExposeProxy(instance) || instance.proxy;
      const index2 = $children.indexOf(target);
      if (index2 > -1) {
        $children.splice(index2, 1);
      }
    }
  }
  scope.stop();
  if (update) {
    update.active = false;
  }
  if (um) {
    queuePostRenderEffect(um);
  }
  queuePostRenderEffect(() => {
    instance.isUnmounted = true;
  });
  {
    devtoolsComponentRemoved(instance);
  }
}
const oldCreateApp = createAppAPI();
function getTarget() {
  if (typeof window !== "undefined") {
    return window;
  }
  if (typeof globalThis !== "undefined") {
    return globalThis;
  }
  if (typeof global !== "undefined") {
    return global;
  }
  if (typeof my !== "undefined") {
    return my;
  }
}
function createVueApp(rootComponent, rootProps = null) {
  const target = getTarget();
  target.__VUE__ = true;
  {
    setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  }
  const app = oldCreateApp(rootComponent, rootProps);
  const appContext = app._context;
  initAppConfig(appContext.config);
  const createVNode2 = (initialVNode) => {
    initialVNode.appContext = appContext;
    initialVNode.shapeFlag = 6;
    return initialVNode;
  };
  const createComponent2 = function createComponent22(initialVNode, options) {
    return mountComponent(createVNode2(initialVNode), options);
  };
  const destroyComponent = function destroyComponent2(component) {
    return component && unmountComponent(component.$);
  };
  app.mount = function mount() {
    rootComponent.render = NOOP;
    const instance = mountComponent(
      createVNode2({ type: rootComponent }),
      {
        mpType: "app",
        mpInstance: null,
        parentComponent: null,
        slots: [],
        props: null
      }
    );
    app._instance = instance.$;
    {
      devtoolsInitApp(app, version);
    }
    instance.$app = app;
    instance.$createComponent = createComponent2;
    instance.$destroyComponent = destroyComponent;
    appContext.$appInstance = instance;
    return instance;
  };
  app.unmount = function unmount() {
    warn(`Cannot unmount an app.`);
  };
  return app;
}
function injectLifecycleHook(name, hook, publicThis, instance) {
  if (isFunction(hook)) {
    injectHook(name, hook.bind(publicThis), instance);
  }
}
function initHooks$1(options, instance, publicThis) {
  const mpType = options.mpType || publicThis.$mpType;
  if (!mpType || mpType === "component" || // instance.renderer 标识页面是否作为组件渲染
  mpType === "page" && instance.renderer === "component") {
    return;
  }
  Object.keys(options).forEach((name) => {
    if (isUniLifecycleHook(name, options[name], false)) {
      const hooks = options[name];
      if (isArray(hooks)) {
        hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
      } else {
        injectLifecycleHook(name, hooks, publicThis, instance);
      }
    }
  });
}
function applyOptions$2(options, instance, publicThis) {
  initHooks$1(options, instance, publicThis);
}
function set$2(target, key, val2) {
  return target[key] = val2;
}
function $callMethod(method, ...args) {
  const fn2 = this[method];
  if (fn2) {
    return fn2(...args);
  }
  console.error(`method ${method} not found`);
  return null;
}
function createErrorHandler(app) {
  const userErrorHandler = app.config.errorHandler;
  return function errorHandler(err, instance, info) {
    if (userErrorHandler) {
      userErrorHandler(err, instance, info);
    }
    const appInstance = app._instance;
    if (!appInstance || !appInstance.proxy) {
      throw err;
    }
    if (appInstance[ON_ERROR]) {
      {
        appInstance.proxy.$callHook(ON_ERROR, err);
      }
    } else {
      logError(err, info, instance ? instance.$.vnode : null, false);
    }
  };
}
function mergeAsArray(to2, from) {
  return to2 ? [...new Set([].concat(to2, from))] : from;
}
function initOptionMergeStrategies(optionMergeStrategies) {
  UniLifecycleHooks.forEach((name) => {
    optionMergeStrategies[name] = mergeAsArray;
  });
}
let realAtob;
const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
if (typeof atob !== "function") {
  realAtob = function(str) {
    str = String(str).replace(/[\t\n\f\r ]+/g, "");
    if (!b64re.test(str)) {
      throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
    }
    str += "==".slice(2 - (str.length & 3));
    var bitmap;
    var result = "";
    var r1;
    var r2;
    var i3 = 0;
    for (; i3 < str.length; ) {
      bitmap = b64.indexOf(str.charAt(i3++)) << 18 | b64.indexOf(str.charAt(i3++)) << 12 | (r1 = b64.indexOf(str.charAt(i3++))) << 6 | (r2 = b64.indexOf(str.charAt(i3++)));
      result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
    }
    return result;
  };
} else {
  realAtob = atob;
}
function b64DecodeUnicode(str) {
  return decodeURIComponent(realAtob(str).split("").map(function(c22) {
    return "%" + ("00" + c22.charCodeAt(0).toString(16)).slice(-2);
  }).join(""));
}
function getCurrentUserInfo() {
  const token = index.getStorageSync("uni_id_token") || "";
  const tokenArr = token.split(".");
  if (!token || tokenArr.length !== 3) {
    return {
      uid: null,
      role: [],
      permission: [],
      tokenExpired: 0
    };
  }
  let userInfo;
  try {
    userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  } catch (error) {
    throw new Error("获取当前用户信息出错，详细错误信息为：" + error.message);
  }
  userInfo.tokenExpired = userInfo.exp * 1e3;
  delete userInfo.exp;
  delete userInfo.iat;
  return userInfo;
}
function uniIdMixin(globalProperties) {
  globalProperties.uniIDHasRole = function(roleId) {
    const { role } = getCurrentUserInfo();
    return role.indexOf(roleId) > -1;
  };
  globalProperties.uniIDHasPermission = function(permissionId) {
    const { permission } = getCurrentUserInfo();
    return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  };
  globalProperties.uniIDTokenValid = function() {
    const { tokenExpired } = getCurrentUserInfo();
    return tokenExpired > Date.now();
  };
}
function initApp(app) {
  const appConfig = app.config;
  appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  initOptionMergeStrategies(appConfig.optionMergeStrategies);
  const globalProperties = appConfig.globalProperties;
  {
    uniIdMixin(globalProperties);
  }
  {
    globalProperties.$set = set$2;
    globalProperties.$applyOptions = applyOptions$2;
    globalProperties.$callMethod = $callMethod;
  }
  {
    index.invokeCreateVueAppHook(app);
  }
}
const propsCaches = /* @__PURE__ */ Object.create(null);
function renderProps(props) {
  const { uid: uid2, __counter } = getCurrentInstance();
  const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  return uid2 + "," + propsId + "," + __counter;
}
function pruneComponentPropsCache(uid2) {
  delete propsCaches[uid2];
}
function findComponentPropsData(up) {
  if (!up) {
    return;
  }
  const [uid2, propsId] = up.split(",");
  if (!propsCaches[uid2]) {
    return;
  }
  return propsCaches[uid2][parseInt(propsId)];
}
var plugin = {
  install(app) {
    initApp(app);
    app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
    const oldMount = app.mount;
    app.mount = function mount(rootContainer) {
      const instance = oldMount.call(app, rootContainer);
      const createApp2 = getCreateApp();
      if (createApp2) {
        createApp2(instance);
      } else {
        if (typeof createMiniProgramApp !== "undefined") {
          createMiniProgramApp(instance);
        }
      }
      return instance;
    };
  }
};
function getCreateApp() {
  const method = "createApp";
  if (typeof global !== "undefined" && typeof global[method] !== "undefined") {
    return global[method];
  } else if (typeof my !== "undefined") {
    return my[method];
  }
}
function stringifyStyle(value) {
  if (isString(value)) {
    return value;
  }
  return stringify(normalizeStyle(value));
}
function stringify(styles) {
  let ret = "";
  if (!styles || isString(styles)) {
    return ret;
  }
  for (const key in styles) {
    ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  }
  return ret;
}
function vOn(value, key) {
  const instance = getCurrentInstance();
  const ctx = instance.ctx;
  const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq" || ctx.$mpPlatform === "mp-xhs") && (isString(key) || typeof key === "number") ? "_" + key : "";
  const name = "e" + instance.$ei++ + extraKey;
  const mpInstance = ctx.$scope;
  if (!value) {
    delete mpInstance[name];
    return name;
  }
  const existingInvoker = mpInstance[name];
  if (existingInvoker) {
    existingInvoker.value = value;
  } else {
    mpInstance[name] = createInvoker(value, instance);
  }
  return name;
}
function createInvoker(initialValue, instance) {
  const invoker = (e22) => {
    patchMPEvent(e22);
    let args = [e22];
    if (instance && instance.ctx.$getTriggerEventDetail) {
      if (typeof e22.detail === "number") {
        e22.detail = instance.ctx.$getTriggerEventDetail(e22.detail);
      }
    }
    if (e22.detail && e22.detail.__args__) {
      args = e22.detail.__args__;
    }
    const eventValue = invoker.value;
    const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e22, eventValue), instance, 5, args);
    const eventTarget = e22.target;
    const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
    if (bubbles.includes(e22.type) && !eventSync) {
      setTimeout(invoke);
    } else {
      const res = invoke();
      if (e22.type === "input" && (isArray(res) || isPromise(res))) {
        return;
      }
      return res;
    }
  };
  invoker.value = initialValue;
  return invoker;
}
const bubbles = [
  // touch事件暂不做延迟，否则在 Android 上会影响性能，比如一些拖拽跟手手势等
  // 'touchstart',
  // 'touchmove',
  // 'touchcancel',
  // 'touchend',
  "tap",
  "longpress",
  "longtap",
  "transitionend",
  "animationstart",
  "animationiteration",
  "animationend",
  "touchforcechange"
];
function patchMPEvent(event, instance) {
  if (event.type && event.target) {
    event.preventDefault = NOOP;
    event.stopPropagation = NOOP;
    event.stopImmediatePropagation = NOOP;
    if (!hasOwn$1(event, "detail")) {
      event.detail = {};
    }
    if (hasOwn$1(event, "markerId")) {
      event.detail = typeof event.detail === "object" ? event.detail : {};
      event.detail.markerId = event.markerId;
    }
    if (isPlainObject$1(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
      event.detail.value = event.detail.checked;
    }
    if (isPlainObject$1(event.detail)) {
      event.target = extend({}, event.target, event.detail);
    }
  }
}
function patchStopImmediatePropagation(e22, value) {
  if (isArray(value)) {
    const originalStop = e22.stopImmediatePropagation;
    e22.stopImmediatePropagation = () => {
      originalStop && originalStop.call(e22);
      e22._stopped = true;
    };
    return value.map((fn2) => (e3) => !e3._stopped && fn2(e3));
  } else {
    return value;
  }
}
function vFor(source, renderItem) {
  let ret;
  if (isArray(source) || isString(source)) {
    ret = new Array(source.length);
    for (let i3 = 0, l2 = source.length; i3 < l2; i3++) {
      ret[i3] = renderItem(source[i3], i3, i3);
    }
  } else if (typeof source === "number") {
    if (!Number.isInteger(source)) {
      warn(`The v-for range expect an integer value but got ${source}.`);
      return [];
    }
    ret = new Array(source);
    for (let i3 = 0; i3 < source; i3++) {
      ret[i3] = renderItem(i3 + 1, i3, i3);
    }
  } else if (isObject$1(source)) {
    if (source[Symbol.iterator]) {
      ret = Array.from(source, (item, i3) => renderItem(item, i3, i3));
    } else {
      const keys = Object.keys(source);
      ret = new Array(keys.length);
      for (let i3 = 0, l2 = keys.length; i3 < l2; i3++) {
        const key = keys[i3];
        ret[i3] = renderItem(source[key], key, i3);
      }
    }
  } else {
    ret = [];
  }
  return ret;
}
function setRef(ref2, id, opts = {}) {
  const { $templateRefs } = getCurrentInstance();
  $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
}
const o$2 = (value, key) => vOn(value, key);
const f$2 = (source, renderItem) => vFor(source, renderItem);
const s$2 = (value) => stringifyStyle(value);
const e$2 = (target, ...sources) => extend(target, ...sources);
const n$2 = (value) => normalizeClass(value);
const t$2 = (val2) => toDisplayString(val2);
const p$2 = (props) => renderProps(props);
const sr = (ref2, id, opts) => setRef(ref2, id, opts);
function createApp$1(rootComponent, rootProps = null) {
  rootComponent && (rootComponent.mpType = "app");
  return createVueApp(rootComponent, rootProps).use(plugin);
}
const createSSRApp = createApp$1;
function getLocaleLanguage$1() {
  var _a;
  let localeLanguage = "";
  {
    const appBaseInfo = ((_a = wx.getAppBaseInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
    const language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
    localeLanguage = normalizeLocale(language) || LOCALE_EN;
  }
  return localeLanguage;
}
function validateProtocolFail(name, msg) {
  console.warn(`${name}: ${msg}`);
}
function validateProtocol(name, data, protocol, onFail) {
  if (!onFail) {
    onFail = validateProtocolFail;
  }
  for (const key in protocol) {
    const errMsg = validateProp(key, data[key], protocol[key], !hasOwn$1(data, key));
    if (isString(errMsg)) {
      onFail(name, errMsg);
    }
  }
}
function validateProtocols(name, args, protocol, onFail) {
  if (!protocol) {
    return;
  }
  if (!isArray(protocol)) {
    return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  }
  const len = protocol.length;
  const argsLen = args.length;
  for (let i3 = 0; i3 < len; i3++) {
    const opts = protocol[i3];
    const data = /* @__PURE__ */ Object.create(null);
    if (argsLen > i3) {
      data[opts.name] = args[i3];
    }
    validateProtocol(name, data, { [opts.name]: opts }, onFail);
  }
}
function validateProp(name, value, prop, isAbsent) {
  if (!isPlainObject$1(prop)) {
    prop = { type: prop };
  }
  const { type, required, validator } = prop;
  if (required && isAbsent) {
    return 'Missing required args: "' + name + '"';
  }
  if (value == null && !required) {
    return;
  }
  if (type != null) {
    let isValid = false;
    const types = isArray(type) ? type : [type];
    const expectedTypes = [];
    for (let i3 = 0; i3 < types.length && !isValid; i3++) {
      const { valid, expectedType } = assertType(value, types[i3]);
      expectedTypes.push(expectedType || "");
      isValid = valid;
    }
    if (!isValid) {
      return getInvalidTypeMessage(name, value, expectedTypes);
    }
  }
  if (validator) {
    return validator(value);
  }
}
const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
function assertType(value, type) {
  let valid;
  const expectedType = getType(type);
  if (isSimpleType(expectedType)) {
    const t2 = typeof value;
    valid = t2 === expectedType.toLowerCase();
    if (!valid && t2 === "object") {
      valid = value instanceof type;
    }
  } else if (expectedType === "Object") {
    valid = isObject$1(value);
  } else if (expectedType === "Array") {
    valid = isArray(value);
  } else {
    {
      valid = value instanceof type;
    }
  }
  return {
    valid,
    expectedType
  };
}
function getInvalidTypeMessage(name, value, expectedTypes) {
  let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  const expectedType = expectedTypes[0];
  const receivedType = toRawType(value);
  const expectedValue = styleValue(value, expectedType);
  const receivedValue = styleValue(value, receivedType);
  if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
    message += ` with value ${expectedValue}`;
  }
  message += `, got ${receivedType} `;
  if (isExplicable(receivedType)) {
    message += `with value ${receivedValue}.`;
  }
  return message;
}
function getType(ctor) {
  const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  return match ? match[1] : "";
}
function styleValue(value, type) {
  if (type === "String") {
    return `"${value}"`;
  } else if (type === "Number") {
    return `${Number(value)}`;
  } else {
    return `${value}`;
  }
}
function isExplicable(type) {
  const explicitTypes = ["string", "number", "boolean"];
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
}
function isBoolean(...args) {
  return args.some((elem) => elem.toLowerCase() === "boolean");
}
function tryCatch(fn2) {
  return function() {
    try {
      return fn2.apply(fn2, arguments);
    } catch (e3) {
      console.error(e3);
    }
  };
}
let invokeCallbackId = 1;
const invokeCallbacks = {};
function addInvokeCallback(id, name, callback, keepAlive = false) {
  invokeCallbacks[id] = {
    name,
    keepAlive,
    callback
  };
  return id;
}
function invokeCallback(id, res, extras) {
  if (typeof id === "number") {
    const opts = invokeCallbacks[id];
    if (opts) {
      if (!opts.keepAlive) {
        delete invokeCallbacks[id];
      }
      return opts.callback(res, extras);
    }
  }
  return res;
}
const API_SUCCESS = "success";
const API_FAIL = "fail";
const API_COMPLETE = "complete";
function getApiCallbacks(args) {
  const apiCallbacks = {};
  for (const name in args) {
    const fn2 = args[name];
    if (isFunction(fn2)) {
      apiCallbacks[name] = tryCatch(fn2);
      delete args[name];
    }
  }
  return apiCallbacks;
}
function normalizeErrMsg(errMsg, name) {
  if (!errMsg || errMsg.indexOf(":fail") === -1) {
    return name + ":ok";
  }
  return name + errMsg.substring(errMsg.indexOf(":fail"));
}
function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  if (!isPlainObject$1(args)) {
    args = {};
  }
  const { success, fail, complete } = getApiCallbacks(args);
  const hasSuccess = isFunction(success);
  const hasFail = isFunction(fail);
  const hasComplete = isFunction(complete);
  const callbackId = invokeCallbackId++;
  addInvokeCallback(callbackId, name, (res) => {
    res = res || {};
    res.errMsg = normalizeErrMsg(res.errMsg, name);
    isFunction(beforeAll) && beforeAll(res);
    if (res.errMsg === name + ":ok") {
      isFunction(beforeSuccess) && beforeSuccess(res, args);
      hasSuccess && success(res);
    } else {
      hasFail && fail(res);
    }
    hasComplete && complete(res);
  });
  return callbackId;
}
const HOOK_SUCCESS = "success";
const HOOK_FAIL = "fail";
const HOOK_COMPLETE = "complete";
const globalInterceptors = {};
const scopedInterceptors = {};
function wrapperHook(hook, params) {
  return function(data) {
    return hook(data, params) || data;
  };
}
function queue(hooks, data, params) {
  let promise = false;
  for (let i3 = 0; i3 < hooks.length; i3++) {
    const hook = hooks[i3];
    if (promise) {
      promise = Promise.resolve(wrapperHook(hook, params));
    } else {
      const res = hook(data, params);
      if (isPromise(res)) {
        promise = Promise.resolve(res);
      }
      if (res === false) {
        return {
          then() {
          },
          catch() {
          }
        };
      }
    }
  }
  return promise || {
    then(callback) {
      return callback(data);
    },
    catch() {
    }
  };
}
function wrapperOptions(interceptors2, options = {}) {
  [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
    const hooks = interceptors2[name];
    if (!isArray(hooks)) {
      return;
    }
    const oldCallback = options[name];
    options[name] = function callbackInterceptor(res) {
      queue(hooks, res, options).then((res2) => {
        return isFunction(oldCallback) && oldCallback(res2) || res2;
      });
    };
  });
  return options;
}
function wrapperReturnValue(method, returnValue) {
  const returnValueHooks = [];
  if (isArray(globalInterceptors.returnValue)) {
    returnValueHooks.push(...globalInterceptors.returnValue);
  }
  const interceptor = scopedInterceptors[method];
  if (interceptor && isArray(interceptor.returnValue)) {
    returnValueHooks.push(...interceptor.returnValue);
  }
  returnValueHooks.forEach((hook) => {
    returnValue = hook(returnValue) || returnValue;
  });
  return returnValue;
}
function getApiInterceptorHooks(method) {
  const interceptor = /* @__PURE__ */ Object.create(null);
  Object.keys(globalInterceptors).forEach((hook) => {
    if (hook !== "returnValue") {
      interceptor[hook] = globalInterceptors[hook].slice();
    }
  });
  const scopedInterceptor = scopedInterceptors[method];
  if (scopedInterceptor) {
    Object.keys(scopedInterceptor).forEach((hook) => {
      if (hook !== "returnValue") {
        interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
      }
    });
  }
  return interceptor;
}
function invokeApi(method, api, options, params) {
  const interceptor = getApiInterceptorHooks(method);
  if (interceptor && Object.keys(interceptor).length) {
    if (isArray(interceptor.invoke)) {
      const res = queue(interceptor.invoke, options);
      return res.then((options2) => {
        return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
      });
    } else {
      return api(wrapperOptions(interceptor, options), ...params);
    }
  }
  return api(options, ...params);
}
function hasCallback(args) {
  if (isPlainObject$1(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) {
    return true;
  }
  return false;
}
function handlePromise(promise) {
  return promise;
}
function promisify$1(name, fn2) {
  return (args = {}, ...rest) => {
    if (hasCallback(args)) {
      return wrapperReturnValue(name, invokeApi(name, fn2, extend({}, args), rest));
    }
    return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
      invokeApi(name, fn2, extend({}, args, { success: resolve2, fail: reject }), rest);
    })));
  };
}
function formatApiArgs(args, options) {
  args[0];
  {
    return;
  }
}
function invokeSuccess(id, name, res) {
  const result = {
    errMsg: name + ":ok"
  };
  return invokeCallback(id, extend(res || {}, result));
}
function invokeFail(id, name, errMsg, errRes = {}) {
  const errMsgPrefix = name + ":fail";
  let apiErrMsg = "";
  if (!errMsg) {
    apiErrMsg = errMsgPrefix;
  } else if (errMsg.indexOf(errMsgPrefix) === 0) {
    apiErrMsg = errMsg;
  } else {
    apiErrMsg = errMsgPrefix + " " + errMsg;
  }
  {
    delete errRes.errCode;
  }
  let res = extend({ errMsg: apiErrMsg }, errRes);
  return invokeCallback(id, res);
}
function beforeInvokeApi(name, args, protocol, options) {
  {
    validateProtocols(name, args, protocol);
  }
  const errMsg = formatApiArgs(args);
  if (errMsg) {
    return errMsg;
  }
}
function parseErrMsg(errMsg) {
  if (!errMsg || isString(errMsg)) {
    return errMsg;
  }
  if (errMsg.stack) {
    if (typeof globalThis === "undefined" || !globalThis.harmonyChannel) {
      console.error(errMsg.message + "\n" + errMsg.stack);
    }
    return errMsg.message;
  }
  return errMsg;
}
function wrapperTaskApi(name, fn2, protocol, options) {
  return (args) => {
    const id = createAsyncApiCallback(name, args, options);
    const errMsg = beforeInvokeApi(name, [args], protocol);
    if (errMsg) {
      return invokeFail(id, name, errMsg);
    }
    return fn2(args, {
      resolve: (res) => invokeSuccess(id, name, res),
      reject: (errMsg2, errRes) => invokeFail(id, name, parseErrMsg(errMsg2), errRes)
    });
  };
}
function wrapperSyncApi(name, fn2, protocol, options) {
  return (...args) => {
    const errMsg = beforeInvokeApi(name, args, protocol);
    if (errMsg) {
      throw new Error(errMsg);
    }
    return fn2.apply(null, args);
  };
}
function wrapperAsyncApi(name, fn2, protocol, options) {
  return wrapperTaskApi(name, fn2, protocol, options);
}
function defineSyncApi(name, fn2, protocol, options) {
  return wrapperSyncApi(name, fn2, protocol);
}
function defineAsyncApi(name, fn2, protocol, options) {
  return promisify$1(name, wrapperAsyncApi(name, fn2, protocol, options));
}
const API_UPX2PX = "upx2px";
const Upx2pxProtocol = [
  {
    name: "upx",
    type: [Number, String],
    required: true
  }
];
const EPS = 1e-4;
const BASE_DEVICE_WIDTH = 750;
let isIOS = false;
let deviceWidth = 0;
let deviceDPR = 0;
function checkDeviceWidth() {
  var _a, _b;
  let windowWidth, pixelRatio, platform;
  {
    const windowInfo = ((_a = wx.getWindowInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
    const deviceInfo = ((_b = wx.getDeviceInfo) === null || _b === void 0 ? void 0 : _b.call(wx)) || wx.getSystemInfoSync();
    windowWidth = windowInfo.windowWidth;
    pixelRatio = windowInfo.pixelRatio;
    platform = deviceInfo.platform;
  }
  deviceWidth = windowWidth;
  deviceDPR = pixelRatio;
  isIOS = platform === "ios";
}
const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  if (deviceWidth === 0) {
    checkDeviceWidth();
  }
  number = Number(number);
  if (number === 0) {
    return 0;
  }
  let width = newDeviceWidth || deviceWidth;
  let result = number / BASE_DEVICE_WIDTH * width;
  if (result < 0) {
    result = -result;
  }
  result = Math.floor(result + EPS);
  if (result === 0) {
    if (deviceDPR === 1 || !isIOS) {
      result = 1;
    } else {
      result = 0.5;
    }
  }
  return number < 0 ? -result : result;
}, Upx2pxProtocol);
function __f__(type, filename, ...args) {
  if (filename) {
    args.push(filename);
  }
  console[type].apply(console, args);
}
const API_ADD_INTERCEPTOR = "addInterceptor";
const API_REMOVE_INTERCEPTOR = "removeInterceptor";
const AddInterceptorProtocol = [
  {
    name: "method",
    type: [String, Object],
    required: true
  }
];
const RemoveInterceptorProtocol = AddInterceptorProtocol;
function mergeInterceptorHook(interceptors2, interceptor) {
  Object.keys(interceptor).forEach((hook) => {
    if (isFunction(interceptor[hook])) {
      interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
    }
  });
}
function removeInterceptorHook(interceptors2, interceptor) {
  if (!interceptors2 || !interceptor) {
    return;
  }
  Object.keys(interceptor).forEach((name) => {
    const hooks = interceptors2[name];
    const hook = interceptor[name];
    if (isArray(hooks) && isFunction(hook)) {
      remove(hooks, hook);
    }
  });
}
function mergeHook(parentVal, childVal) {
  const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
  return res ? dedupeHooks(res) : res;
}
function dedupeHooks(hooks) {
  const res = [];
  for (let i3 = 0; i3 < hooks.length; i3++) {
    if (res.indexOf(hooks[i3]) === -1) {
      res.push(hooks[i3]);
    }
  }
  return res;
}
const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  if (isString(method) && isPlainObject$1(interceptor)) {
    mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  } else if (isPlainObject$1(method)) {
    mergeInterceptorHook(globalInterceptors, method);
  }
}, AddInterceptorProtocol);
const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  if (isString(method)) {
    if (isPlainObject$1(interceptor)) {
      removeInterceptorHook(scopedInterceptors[method], interceptor);
    } else {
      delete scopedInterceptors[method];
    }
  } else if (isPlainObject$1(method)) {
    removeInterceptorHook(globalInterceptors, method);
  }
}, RemoveInterceptorProtocol);
const interceptors = {};
const API_ON = "$on";
const OnProtocol = [
  {
    name: "event",
    type: String,
    required: true
  },
  {
    name: "callback",
    type: Function,
    required: true
  }
];
const API_ONCE = "$once";
const OnceProtocol = OnProtocol;
const API_OFF = "$off";
const OffProtocol = [
  {
    name: "event",
    type: [String, Array]
  },
  {
    name: "callback",
    type: [Function, Number]
  }
];
const API_EMIT = "$emit";
const EmitProtocol = [
  {
    name: "event",
    type: String,
    required: true
  }
];
class EventBus {
  constructor() {
    this.$emitter = new E$1$1();
  }
  on(name, callback) {
    return this.$emitter.on(name, callback);
  }
  once(name, callback) {
    return this.$emitter.once(name, callback);
  }
  off(name, callback) {
    if (!name) {
      this.$emitter.e = {};
      return;
    }
    this.$emitter.off(name, callback);
  }
  emit(name, ...args) {
    this.$emitter.emit(name, ...args);
  }
}
const eventBus = new EventBus();
const $on = defineSyncApi(API_ON, (name, callback) => {
  eventBus.on(name, callback);
  return () => eventBus.off(name, callback);
}, OnProtocol);
const $once = defineSyncApi(API_ONCE, (name, callback) => {
  eventBus.once(name, callback);
  return () => eventBus.off(name, callback);
}, OnceProtocol);
const $off = defineSyncApi(API_OFF, (name, callback) => {
  if (!isArray(name))
    name = name ? [name] : [];
  name.forEach((n2) => {
    eventBus.off(n2, callback);
  });
}, OffProtocol);
const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  eventBus.emit(name, ...args);
}, EmitProtocol);
let cid;
let cidErrMsg;
let enabled;
function normalizePushMessage(message) {
  try {
    return JSON.parse(message);
  } catch (e3) {
  }
  return message;
}
function invokePushCallback(args) {
  if (args.type === "enabled") {
    enabled = true;
  } else if (args.type === "clientId") {
    cid = args.cid;
    cidErrMsg = args.errMsg;
    invokeGetPushCidCallbacks(cid, args.errMsg);
  } else if (args.type === "pushMsg") {
    const message = {
      type: "receive",
      data: normalizePushMessage(args.message)
    };
    for (let i3 = 0; i3 < onPushMessageCallbacks.length; i3++) {
      const callback = onPushMessageCallbacks[i3];
      callback(message);
      if (message.stopped) {
        break;
      }
    }
  } else if (args.type === "click") {
    onPushMessageCallbacks.forEach((callback) => {
      callback({
        type: "click",
        data: normalizePushMessage(args.message)
      });
    });
  }
}
const getPushCidCallbacks = [];
function invokeGetPushCidCallbacks(cid2, errMsg) {
  getPushCidCallbacks.forEach((callback) => {
    callback(cid2, errMsg);
  });
  getPushCidCallbacks.length = 0;
}
const API_GET_PUSH_CLIENT_ID = "getPushClientId";
const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_2, { resolve: resolve2, reject }) => {
  Promise.resolve().then(() => {
    if (typeof enabled === "undefined") {
      enabled = false;
      cid = "";
      cidErrMsg = "uniPush is not enabled";
    }
    getPushCidCallbacks.push((cid2, errMsg) => {
      if (cid2) {
        resolve2({ cid: cid2 });
      } else {
        reject(errMsg);
      }
    });
    if (typeof cid !== "undefined") {
      invokeGetPushCidCallbacks(cid, cidErrMsg);
    }
  });
});
const onPushMessageCallbacks = [];
const onPushMessage = (fn2) => {
  if (onPushMessageCallbacks.indexOf(fn2) === -1) {
    onPushMessageCallbacks.push(fn2);
  }
};
const offPushMessage = (fn2) => {
  if (!fn2) {
    onPushMessageCallbacks.length = 0;
  } else {
    const index2 = onPushMessageCallbacks.indexOf(fn2);
    if (index2 > -1) {
      onPushMessageCallbacks.splice(index2, 1);
    }
  }
};
const SYNC_API_RE = /^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
const CONTEXT_API_RE = /^create|Manager$/;
const CONTEXT_API_RE_EXC = ["createBLEConnection"];
const TASK_APIS = ["request", "downloadFile", "uploadFile", "connectSocket"];
const ASYNC_API = ["createBLEConnection"];
const CALLBACK_API_RE = /^on|^off/;
function isContextApi(name) {
  return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
}
function isSyncApi(name) {
  return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
}
function isCallbackApi(name) {
  return CALLBACK_API_RE.test(name) && name !== "onPush";
}
function isTaskApi(name) {
  return TASK_APIS.indexOf(name) !== -1;
}
function shouldPromise(name) {
  if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
    return false;
  }
  return true;
}
if (!Promise.prototype.finally) {
  Promise.prototype.finally = function(onfinally) {
    const promise = this.constructor;
    return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
      throw reason;
    }));
  };
}
function promisify(name, api) {
  if (!shouldPromise(name)) {
    return api;
  }
  if (!isFunction(api)) {
    return api;
  }
  return function promiseApi(options = {}, ...rest) {
    if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
      return wrapperReturnValue(name, invokeApi(name, api, extend({}, options), rest));
    }
    return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
      invokeApi(name, api, extend({}, options, {
        success: resolve2,
        fail: reject
      }), rest);
    })));
  };
}
const CALLBACKS = ["success", "fail", "cancel", "complete"];
function initWrapper(protocols2) {
  function processCallback(methodName, method, returnValue) {
    return function(res) {
      return method(processReturnValue(methodName, res, returnValue));
    };
  }
  function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
    if (isPlainObject$1(fromArgs)) {
      const toArgs = keepFromArgs === true ? fromArgs : {};
      if (isFunction(argsOption)) {
        argsOption = argsOption(fromArgs, toArgs) || {};
      }
      for (const key in fromArgs) {
        if (hasOwn$1(argsOption, key)) {
          let keyOption = argsOption[key];
          if (isFunction(keyOption)) {
            keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
          }
          if (!keyOption) {
            console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
          } else if (isString(keyOption)) {
            toArgs[keyOption] = fromArgs[key];
          } else if (isPlainObject$1(keyOption)) {
            toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
          }
        } else if (CALLBACKS.indexOf(key) !== -1) {
          const callback = fromArgs[key];
          if (isFunction(callback)) {
            toArgs[key] = processCallback(methodName, callback, returnValue);
          }
        } else {
          if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
            toArgs[key] = fromArgs[key];
          }
        }
      }
      return toArgs;
    } else if (isFunction(fromArgs)) {
      if (isFunction(argsOption)) {
        argsOption(fromArgs, {});
      }
      fromArgs = processCallback(methodName, fromArgs, returnValue);
    }
    return fromArgs;
  }
  function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
    if (isFunction(protocols2.returnValue)) {
      res = protocols2.returnValue(methodName, res);
    }
    const realKeepReturnValue = keepReturnValue || false;
    return processArgs(methodName, res, returnValue, {}, realKeepReturnValue);
  }
  return function wrapper(methodName, method) {
    const hasProtocol = hasOwn$1(protocols2, methodName);
    if (!hasProtocol && typeof wx[methodName] !== "function") {
      return method;
    }
    const needWrapper = hasProtocol || isFunction(protocols2.returnValue) || isContextApi(methodName) || isTaskApi(methodName);
    const hasMethod = hasProtocol || isFunction(method);
    if (!hasProtocol && !method) {
      return function() {
        console.error(`微信小程序 暂不支持${methodName}`);
      };
    }
    if (!needWrapper || !hasMethod) {
      return method;
    }
    const protocol = protocols2[methodName];
    return function(arg1, arg2) {
      let options = protocol || {};
      if (isFunction(protocol)) {
        options = protocol(arg1);
      }
      arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
      const args = [arg1];
      if (typeof arg2 !== "undefined") {
        args.push(arg2);
      }
      const returnValue = wx[options.name || methodName].apply(wx, args);
      if (isContextApi(methodName) || isTaskApi(methodName)) {
        if (returnValue && !returnValue.__v_skip) {
          returnValue.__v_skip = true;
        }
      }
      if (isSyncApi(methodName)) {
        return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
      }
      return returnValue;
    };
  };
}
const getLocale = () => {
  const app = isFunction(getApp) && getApp({ allowDefault: true });
  if (app && app.$vm) {
    return app.$vm.$locale;
  }
  return getLocaleLanguage$1();
};
const setLocale = (locale) => {
  const app = isFunction(getApp) && getApp();
  if (!app) {
    return false;
  }
  const oldLocale = app.$vm.$locale;
  if (oldLocale !== locale) {
    app.$vm.$locale = locale;
    onLocaleChangeCallbacks.forEach((fn2) => fn2({ locale }));
    return true;
  }
  return false;
};
const onLocaleChangeCallbacks = [];
const onLocaleChange = (fn2) => {
  if (onLocaleChangeCallbacks.indexOf(fn2) === -1) {
    onLocaleChangeCallbacks.push(fn2);
  }
};
if (typeof global !== "undefined") {
  global.getLocale = getLocale;
}
const UUID_KEY = "__DC_STAT_UUID";
let deviceId;
function useDeviceId(global2 = wx) {
  return function addDeviceId(_2, toRes) {
    deviceId = deviceId || global2.getStorageSync(UUID_KEY);
    if (!deviceId) {
      deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
      wx.setStorage({
        key: UUID_KEY,
        data: deviceId
      });
    }
    toRes.deviceId = deviceId;
  };
}
function addSafeAreaInsets(fromRes, toRes) {
  if (fromRes.safeArea) {
    const safeArea = fromRes.safeArea;
    toRes.safeAreaInsets = {
      top: safeArea.top,
      left: safeArea.left,
      right: fromRes.windowWidth - safeArea.right,
      bottom: fromRes.screenHeight - safeArea.bottom
    };
  }
}
function getOSInfo(system, platform) {
  let osName = "";
  let osVersion = "";
  if (platform && false) {
    osName = platform;
    osVersion = system;
  } else {
    osName = system.split(" ")[0] || platform;
    osVersion = system.split(" ")[1] || "";
  }
  osName = osName.toLowerCase();
  switch (osName) {
    case "harmony":
    case "ohos":
    case "openharmony":
      osName = "harmonyos";
      break;
    case "iphone os":
      osName = "ios";
      break;
    case "mac":
    case "darwin":
      osName = "macos";
      break;
    case "windows_nt":
      osName = "windows";
      break;
  }
  return {
    osName,
    osVersion
  };
}
function populateParameters(fromRes, toRes) {
  const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  const { osName, osVersion } = getOSInfo(system, platform);
  let hostVersion = version2;
  let deviceType = getGetDeviceType(fromRes, model);
  let deviceBrand = getDeviceBrand(brand);
  let _hostName = getHostName(fromRes);
  let _deviceOrientation = deviceOrientation;
  let _devicePixelRatio = pixelRatio;
  let _SDKVersion = SDKVersion;
  const hostLanguage = (language || "").replace(/_/g, "-");
  const parameters = {
    appId: "__UNI__A6CDB98",
    appName: "tk-mini-program",
    appVersion: "1.0.0",
    appVersionCode: "100",
    appLanguage: getAppLanguage(hostLanguage),
    uniCompileVersion: "4.75",
    uniCompilerVersion: "4.75",
    uniRuntimeVersion: "4.75",
    uniPlatform: "mp-weixin",
    deviceBrand,
    deviceModel: model,
    deviceType,
    devicePixelRatio: _devicePixelRatio,
    deviceOrientation: _deviceOrientation,
    osName,
    osVersion,
    hostTheme: theme,
    hostVersion,
    hostLanguage,
    hostName: _hostName,
    hostSDKVersion: _SDKVersion,
    hostFontSizeSetting: fontSizeSetting,
    windowTop: 0,
    windowBottom: 0,
    // TODO
    osLanguage: void 0,
    osTheme: void 0,
    ua: void 0,
    hostPackageName: void 0,
    browserName: void 0,
    browserVersion: void 0,
    isUniAppX: false
  };
  extend(toRes, parameters);
}
function getGetDeviceType(fromRes, model) {
  let deviceType = fromRes.deviceType || "phone";
  {
    const deviceTypeMaps = {
      ipad: "pad",
      windows: "pc",
      mac: "pc"
    };
    const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
    const _model = model.toLowerCase();
    for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
      const _m = deviceTypeMapsKeys[index2];
      if (_model.indexOf(_m) !== -1) {
        deviceType = deviceTypeMaps[_m];
        break;
      }
    }
  }
  return deviceType;
}
function getDeviceBrand(brand) {
  let deviceBrand = brand;
  if (deviceBrand) {
    deviceBrand = deviceBrand.toLowerCase();
  }
  return deviceBrand;
}
function getAppLanguage(defaultLanguage) {
  return getLocale ? getLocale() : defaultLanguage;
}
function getHostName(fromRes) {
  const _platform = "WeChat";
  let _hostName = fromRes.hostName || _platform;
  {
    if (fromRes.environment) {
      _hostName = fromRes.environment;
    } else if (fromRes.host && fromRes.host.env) {
      _hostName = fromRes.host.env;
    }
  }
  return _hostName;
}
const getSystemInfo = {
  returnValue: (fromRes, toRes) => {
    addSafeAreaInsets(fromRes, toRes);
    useDeviceId()(fromRes, toRes);
    populateParameters(fromRes, toRes);
  }
};
const getSystemInfoSync = getSystemInfo;
const redirectTo = {};
const previewImage = {
  args(fromArgs, toArgs) {
    let currentIndex = parseInt(fromArgs.current);
    if (isNaN(currentIndex)) {
      return;
    }
    const urls = fromArgs.urls;
    if (!isArray(urls)) {
      return;
    }
    const len = urls.length;
    if (!len) {
      return;
    }
    if (currentIndex < 0) {
      currentIndex = 0;
    } else if (currentIndex >= len) {
      currentIndex = len - 1;
    }
    if (currentIndex > 0) {
      toArgs.current = urls[currentIndex];
      toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
    } else {
      toArgs.current = urls[0];
    }
    return {
      indicator: false,
      loop: false
    };
  }
};
const showActionSheet = {
  args(fromArgs, toArgs) {
    toArgs.alertText = fromArgs.title;
  }
};
const getDeviceInfo = {
  returnValue: (fromRes, toRes) => {
    const { brand, model, system = "", platform = "" } = fromRes;
    let deviceType = getGetDeviceType(fromRes, model);
    let deviceBrand = getDeviceBrand(brand);
    useDeviceId()(fromRes, toRes);
    const { osName, osVersion } = getOSInfo(system, platform);
    toRes = sortObject(extend(toRes, {
      deviceType,
      deviceBrand,
      deviceModel: model,
      osName,
      osVersion
    }));
  }
};
const getAppBaseInfo = {
  returnValue: (fromRes, toRes) => {
    const { version: version2, language, SDKVersion, theme } = fromRes;
    let _hostName = getHostName(fromRes);
    let hostLanguage = (language || "").replace(/_/g, "-");
    const parameters = {
      hostVersion: version2,
      hostLanguage,
      hostName: _hostName,
      hostSDKVersion: SDKVersion,
      hostTheme: theme,
      appId: "__UNI__A6CDB98",
      appName: "tk-mini-program",
      appVersion: "1.0.0",
      appVersionCode: "100",
      appLanguage: getAppLanguage(hostLanguage),
      isUniAppX: false,
      uniPlatform: "mp-weixin",
      uniCompileVersion: "4.75",
      uniCompilerVersion: "4.75",
      uniRuntimeVersion: "4.75"
    };
    extend(toRes, parameters);
  }
};
const getWindowInfo = {
  returnValue: (fromRes, toRes) => {
    addSafeAreaInsets(fromRes, toRes);
    toRes = sortObject(extend(toRes, {
      windowTop: 0,
      windowBottom: 0
    }));
  }
};
const getAppAuthorizeSetting = {
  returnValue: function(fromRes, toRes) {
    const { locationReducedAccuracy } = fromRes;
    toRes.locationAccuracy = "unsupported";
    if (locationReducedAccuracy === true) {
      toRes.locationAccuracy = "reduced";
    } else if (locationReducedAccuracy === false) {
      toRes.locationAccuracy = "full";
    }
  }
};
const onError = {
  args(fromArgs) {
    const app = getApp({ allowDefault: true }) || {};
    if (!app.$vm) {
      if (!wx.$onErrorHandlers) {
        wx.$onErrorHandlers = [];
      }
      wx.$onErrorHandlers.push(fromArgs);
    } else {
      injectHook(ON_ERROR, fromArgs, app.$vm.$);
    }
  }
};
const offError = {
  args(fromArgs) {
    const app = getApp({ allowDefault: true }) || {};
    if (!app.$vm) {
      if (!wx.$onErrorHandlers) {
        return;
      }
      const index2 = wx.$onErrorHandlers.findIndex((fn2) => fn2 === fromArgs);
      if (index2 !== -1) {
        wx.$onErrorHandlers.splice(index2, 1);
      }
    } else if (fromArgs.__weh) {
      const onErrors = app.$vm.$[ON_ERROR];
      if (onErrors) {
        const index2 = onErrors.indexOf(fromArgs.__weh);
        if (index2 > -1) {
          onErrors.splice(index2, 1);
        }
      }
    }
  }
};
const onSocketOpen = {
  args() {
    if (wx.__uni_console__) {
      if (wx.__uni_console_warned__) {
        return;
      }
      wx.__uni_console_warned__ = true;
      console.warn(`开发模式下小程序日志回显会使用 socket 连接，为了避免冲突，建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)`);
    }
  }
};
const onSocketMessage = onSocketOpen;
const baseApis = {
  $on,
  $off,
  $once,
  $emit,
  upx2px,
  rpx2px: upx2px,
  interceptors,
  addInterceptor,
  removeInterceptor,
  onCreateVueApp,
  invokeCreateVueAppHook,
  getLocale,
  setLocale,
  onLocaleChange,
  getPushClientId,
  onPushMessage,
  offPushMessage,
  invokePushCallback,
  __f__
};
function initUni(api, protocols2, platform = wx) {
  const wrapper = initWrapper(protocols2);
  const UniProxyHandlers = {
    get(target, key) {
      if (hasOwn$1(target, key)) {
        return target[key];
      }
      if (hasOwn$1(api, key)) {
        return promisify(key, api[key]);
      }
      if (hasOwn$1(baseApis, key)) {
        return promisify(key, baseApis[key]);
      }
      return promisify(key, wrapper(key, platform[key]));
    }
  };
  return new Proxy({}, UniProxyHandlers);
}
function initGetProvider(providers) {
  return function getProvider2({ service, success, fail, complete }) {
    let res;
    if (providers[service]) {
      res = {
        errMsg: "getProvider:ok",
        service,
        provider: providers[service]
      };
      isFunction(success) && success(res);
    } else {
      res = {
        errMsg: "getProvider:fail:服务[" + service + "]不存在"
      };
      isFunction(fail) && fail(res);
    }
    isFunction(complete) && complete(res);
  };
}
const objectKeys = [
  "qy",
  "env",
  "error",
  "version",
  "lanDebug",
  "cloud",
  "serviceMarket",
  "router",
  "worklet",
  "__webpack_require_UNI_MP_PLUGIN__"
];
const singlePageDisableKey = ["lanDebug", "router", "worklet"];
const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
function isWxKey(key) {
  if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
    return false;
  }
  return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
}
function initWx() {
  const newWx = {};
  for (const key in wx) {
    if (isWxKey(key)) {
      newWx[key] = wx[key];
    }
  }
  if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
    globalThis.wx = newWx;
  }
  return newWx;
}
const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
const getProvider = initGetProvider({
  oauth: ["weixin"],
  share: ["weixin"],
  payment: ["wxpay"],
  push: ["weixin"]
});
function initComponentMocks(component) {
  const res = /* @__PURE__ */ Object.create(null);
  mocks$1.forEach((name) => {
    res[name] = component[name];
  });
  return res;
}
function createSelectorQuery() {
  const query = wx$2.createSelectorQuery();
  const oldIn = query.in;
  query.in = function newIn(component) {
    if (component.$scope) {
      return oldIn.call(this, component.$scope);
    }
    return oldIn.call(this, initComponentMocks(component));
  };
  return query;
}
const wx$2 = initWx();
if (!wx$2.canIUse("getAppBaseInfo")) {
  wx$2.getAppBaseInfo = wx$2.getSystemInfoSync;
}
if (!wx$2.canIUse("getWindowInfo")) {
  wx$2.getWindowInfo = wx$2.getSystemInfoSync;
}
if (!wx$2.canIUse("getDeviceInfo")) {
  wx$2.getDeviceInfo = wx$2.getSystemInfoSync;
}
let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
if (!baseInfo) {
  baseInfo = wx$2.getSystemInfoSync();
}
const host = baseInfo ? baseInfo.host : null;
const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
var shims = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  createSelectorQuery,
  getProvider,
  shareVideoMessage
});
const compressImage = {
  args(fromArgs, toArgs) {
    if (fromArgs.compressedHeight && !toArgs.compressHeight) {
      toArgs.compressHeight = fromArgs.compressedHeight;
    }
    if (fromArgs.compressedWidth && !toArgs.compressWidth) {
      toArgs.compressWidth = fromArgs.compressedWidth;
    }
  }
};
var protocols = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  compressImage,
  getAppAuthorizeSetting,
  getAppBaseInfo,
  getDeviceInfo,
  getSystemInfo,
  getSystemInfoSync,
  getWindowInfo,
  offError,
  onError,
  onSocketMessage,
  onSocketOpen,
  previewImage,
  redirectTo,
  showActionSheet
});
const wx$1 = initWx();
var index = initUni(shims, protocols, wx$1);
function initRuntimeSocket(hosts, port, id) {
  if (hosts == "" || port == "" || id == "")
    return Promise.resolve(null);
  return hosts.split(",").reduce((promise, host2) => {
    return promise.then((socket) => {
      if (socket != null)
        return Promise.resolve(socket);
      return tryConnectSocket(host2, port, id);
    });
  }, Promise.resolve(null));
}
const SOCKET_TIMEOUT = 500;
function tryConnectSocket(host2, port, id) {
  return new Promise((resolve2, reject) => {
    const socket = index.connectSocket({
      url: `ws://${host2}:${port}/${id}`,
      multiple: true,
      // 支付宝小程序 是否开启多实例
      fail() {
        resolve2(null);
      }
    });
    const timer = setTimeout(() => {
      socket.close({
        code: 1006,
        reason: "connect timeout"
      });
      resolve2(null);
    }, SOCKET_TIMEOUT);
    socket.onOpen((e3) => {
      clearTimeout(timer);
      resolve2(socket);
    });
    socket.onClose((e3) => {
      clearTimeout(timer);
      resolve2(null);
    });
    socket.onError((e3) => {
      clearTimeout(timer);
      resolve2(null);
    });
  });
}
const CONSOLE_TYPES = ["log", "warn", "error", "info", "debug"];
const originalConsole = /* @__PURE__ */ CONSOLE_TYPES.reduce((methods, type) => {
  methods[type] = console[type].bind(console);
  return methods;
}, {});
let sendError = null;
const errorQueue = /* @__PURE__ */ new Set();
const errorExtra = {};
function sendErrorMessages(errors) {
  if (sendError == null) {
    errors.forEach((error) => {
      errorQueue.add(error);
    });
    return;
  }
  const data = errors.map((err) => {
    if (typeof err === "string") {
      return err;
    }
    const isPromiseRejection = err && "promise" in err && "reason" in err;
    const prefix = isPromiseRejection ? "UnhandledPromiseRejection: " : "";
    if (isPromiseRejection) {
      err = err.reason;
    }
    if (err instanceof Error && err.stack) {
      if (err.message && !err.stack.includes(err.message)) {
        return `${prefix}${err.message}
${err.stack}`;
      }
      return `${prefix}${err.stack}`;
    }
    if (typeof err === "object" && err !== null) {
      try {
        return prefix + JSON.stringify(err);
      } catch (err2) {
        return prefix + String(err2);
      }
    }
    return prefix + String(err);
  }).filter(Boolean);
  if (data.length > 0) {
    sendError(JSON.stringify(Object.assign({
      type: "error",
      data
    }, errorExtra)));
  }
}
function setSendError(value, extra = {}) {
  sendError = value;
  Object.assign(errorExtra, extra);
  if (value != null && errorQueue.size > 0) {
    const errors = Array.from(errorQueue);
    errorQueue.clear();
    sendErrorMessages(errors);
  }
}
function initOnError() {
  function onError2(error) {
    try {
      if (typeof PromiseRejectionEvent !== "undefined" && error instanceof PromiseRejectionEvent && error.reason instanceof Error && error.reason.message && error.reason.message.includes(`Cannot create property 'errMsg' on string 'taskId`)) {
        return;
      }
      if (true) {
        originalConsole.error(error);
      }
      sendErrorMessages([error]);
    } catch (err) {
      originalConsole.error(err);
    }
  }
  if (typeof index.onError === "function") {
    index.onError(onError2);
  }
  if (typeof index.onUnhandledRejection === "function") {
    index.onUnhandledRejection(onError2);
  }
  return function offError2() {
    if (typeof index.offError === "function") {
      index.offError(onError2);
    }
    if (typeof index.offUnhandledRejection === "function") {
      index.offUnhandledRejection(onError2);
    }
  };
}
function formatMessage(type, args) {
  try {
    return {
      type,
      args: formatArgs(args)
    };
  } catch (e3) {
  }
  return {
    type,
    args: []
  };
}
function formatArgs(args) {
  return args.map((arg) => formatArg(arg));
}
function formatArg(arg, depth = 0) {
  if (depth >= 7) {
    return {
      type: "object",
      value: "[Maximum depth reached]"
    };
  }
  const type = typeof arg;
  switch (type) {
    case "string":
      return formatString(arg);
    case "number":
      return formatNumber(arg);
    case "boolean":
      return formatBoolean(arg);
    case "object":
      try {
        return formatObject(arg, depth);
      } catch (e3) {
        return {
          type: "object",
          value: {
            properties: []
          }
        };
      }
    case "undefined":
      return formatUndefined();
    case "function":
      return formatFunction(arg);
    case "symbol": {
      return formatSymbol(arg);
    }
    case "bigint":
      return formatBigInt(arg);
  }
}
function formatFunction(value) {
  return {
    type: "function",
    value: `function ${value.name}() {}`
  };
}
function formatUndefined() {
  return {
    type: "undefined"
  };
}
function formatBoolean(value) {
  return {
    type: "boolean",
    value: String(value)
  };
}
function formatNumber(value) {
  return {
    type: "number",
    value: String(value)
  };
}
function formatBigInt(value) {
  return {
    type: "bigint",
    value: String(value)
  };
}
function formatString(value) {
  return {
    type: "string",
    value
  };
}
function formatSymbol(value) {
  return {
    type: "symbol",
    value: value.description
  };
}
function formatObject(value, depth) {
  if (value === null) {
    return {
      type: "null"
    };
  }
  {
    if (isComponentPublicInstance(value)) {
      return formatComponentPublicInstance(value, depth);
    }
    if (isComponentInternalInstance(value)) {
      return formatComponentInternalInstance(value, depth);
    }
    if (isUniElement(value)) {
      return formatUniElement(value, depth);
    }
    if (isCSSStyleDeclaration(value)) {
      return formatCSSStyleDeclaration(value, depth);
    }
  }
  if (Array.isArray(value)) {
    return {
      type: "object",
      subType: "array",
      value: {
        properties: value.map((v3, i3) => formatArrayElement(v3, i3, depth + 1))
      }
    };
  }
  if (value instanceof Set) {
    return {
      type: "object",
      subType: "set",
      className: "Set",
      description: `Set(${value.size})`,
      value: {
        entries: Array.from(value).map((v3) => formatSetEntry(v3, depth + 1))
      }
    };
  }
  if (value instanceof Map) {
    return {
      type: "object",
      subType: "map",
      className: "Map",
      description: `Map(${value.size})`,
      value: {
        entries: Array.from(value.entries()).map((v3) => formatMapEntry(v3, depth + 1))
      }
    };
  }
  if (value instanceof Promise) {
    return {
      type: "object",
      subType: "promise",
      value: {
        properties: []
      }
    };
  }
  if (value instanceof RegExp) {
    return {
      type: "object",
      subType: "regexp",
      value: String(value),
      className: "Regexp"
    };
  }
  if (value instanceof Date) {
    return {
      type: "object",
      subType: "date",
      value: String(value),
      className: "Date"
    };
  }
  if (value instanceof Error) {
    return {
      type: "object",
      subType: "error",
      value: value.message || String(value),
      className: value.name || "Error"
    };
  }
  let className = void 0;
  {
    const constructor = value.constructor;
    if (constructor) {
      if (constructor.get$UTSMetadata$) {
        className = constructor.get$UTSMetadata$().name;
      }
    }
  }
  let entries = Object.entries(value);
  if (isHarmonyBuilderParams(value)) {
    entries = entries.filter(([key]) => key !== "modifier" && key !== "nodeContent");
  }
  return {
    type: "object",
    className,
    value: {
      properties: entries.map((entry) => formatObjectProperty(entry[0], entry[1], depth + 1))
    }
  };
}
function isHarmonyBuilderParams(value) {
  return value.modifier && value.modifier._attribute && value.nodeContent;
}
function isComponentPublicInstance(value) {
  return value.$ && isComponentInternalInstance(value.$);
}
function isComponentInternalInstance(value) {
  return value.type && value.uid != null && value.appContext;
}
function formatComponentPublicInstance(value, depth) {
  return {
    type: "object",
    className: "ComponentPublicInstance",
    value: {
      properties: Object.entries(value.$.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
    }
  };
}
function formatComponentInternalInstance(value, depth) {
  return {
    type: "object",
    className: "ComponentInternalInstance",
    value: {
      properties: Object.entries(value.type).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
    }
  };
}
function isUniElement(value) {
  return value.style && value.tagName != null && value.nodeName != null;
}
function formatUniElement(value, depth) {
  return {
    type: "object",
    // 非 x 没有 UniElement 的概念
    // className: 'UniElement',
    value: {
      properties: Object.entries(value).filter(([name]) => [
        "id",
        "tagName",
        "nodeName",
        "dataset",
        "offsetTop",
        "offsetLeft",
        "style"
      ].includes(name)).map(([name, value2]) => formatObjectProperty(name, value2, depth + 1))
    }
  };
}
function isCSSStyleDeclaration(value) {
  return typeof value.getPropertyValue === "function" && typeof value.setProperty === "function" && value.$styles;
}
function formatCSSStyleDeclaration(style, depth) {
  return {
    type: "object",
    value: {
      properties: Object.entries(style.$styles).map(([name, value]) => formatObjectProperty(name, value, depth + 1))
    }
  };
}
function formatObjectProperty(name, value, depth) {
  const result = formatArg(value, depth);
  result.name = name;
  return result;
}
function formatArrayElement(value, index2, depth) {
  const result = formatArg(value, depth);
  result.name = `${index2}`;
  return result;
}
function formatSetEntry(value, depth) {
  return {
    value: formatArg(value, depth)
  };
}
function formatMapEntry(value, depth) {
  return {
    key: formatArg(value[0], depth),
    value: formatArg(value[1], depth)
  };
}
let sendConsole = null;
const messageQueue = [];
const messageExtra = {};
const EXCEPTION_BEGIN_MARK = "---BEGIN:EXCEPTION---";
const EXCEPTION_END_MARK = "---END:EXCEPTION---";
function sendConsoleMessages(messages) {
  if (sendConsole == null) {
    messageQueue.push(...messages);
    return;
  }
  sendConsole(JSON.stringify(Object.assign({
    type: "console",
    data: messages
  }, messageExtra)));
}
function setSendConsole(value, extra = {}) {
  sendConsole = value;
  Object.assign(messageExtra, extra);
  if (value != null && messageQueue.length > 0) {
    const messages = messageQueue.slice();
    messageQueue.length = 0;
    sendConsoleMessages(messages);
  }
}
const atFileRegex = /^\s*at\s+[\w/./-]+:\d+$/;
function rewriteConsole() {
  function wrapConsole(type) {
    return function(...args) {
      {
        const originalArgs = [...args];
        if (originalArgs.length) {
          const maybeAtFile = originalArgs[originalArgs.length - 1];
          if (typeof maybeAtFile === "string" && atFileRegex.test(maybeAtFile)) {
            originalArgs.pop();
          }
        }
        originalConsole[type](...originalArgs);
      }
      if (type === "error" && args.length === 1) {
        const arg = args[0];
        if (typeof arg === "string" && arg.startsWith(EXCEPTION_BEGIN_MARK)) {
          const startIndex = EXCEPTION_BEGIN_MARK.length;
          const endIndex = arg.length - EXCEPTION_END_MARK.length;
          sendErrorMessages([arg.slice(startIndex, endIndex)]);
          return;
        } else if (arg instanceof Error) {
          sendErrorMessages([arg]);
          return;
        }
      }
      sendConsoleMessages([formatMessage(type, args)]);
    };
  }
  if (isConsoleWritable()) {
    CONSOLE_TYPES.forEach((type) => {
      console[type] = wrapConsole(type);
    });
    return function restoreConsole() {
      CONSOLE_TYPES.forEach((type) => {
        console[type] = originalConsole[type];
      });
    };
  } else {
    {
      if (typeof index !== "undefined" && index.__f__) {
        const oldLog = index.__f__;
        if (oldLog) {
          index.__f__ = function(...args) {
            const [type, filename, ...rest] = args;
            oldLog(type, "", ...rest);
            sendConsoleMessages([formatMessage(type, [...rest, filename])]);
          };
          return function restoreConsole() {
            index.__f__ = oldLog;
          };
        }
      }
    }
  }
  return function restoreConsole() {
  };
}
function isConsoleWritable() {
  const value = console.log;
  const sym = Symbol();
  try {
    console.log = sym;
  } catch (ex) {
    return false;
  }
  const isWritable = console.log === sym;
  console.log = value;
  return isWritable;
}
function initRuntimeSocketService() {
  const hosts = "192.168.1.112,127.0.0.1";
  const port = "8090";
  const id = "mp-weixin_Ck4vXb";
  const lazy = typeof swan !== "undefined";
  let restoreError = lazy ? () => {
  } : initOnError();
  let restoreConsole = lazy ? () => {
  } : rewriteConsole();
  return Promise.resolve().then(() => {
    if (lazy) {
      restoreError = initOnError();
      restoreConsole = rewriteConsole();
    }
    return initRuntimeSocket(hosts, port, id).then((socket) => {
      if (!socket) {
        restoreError();
        restoreConsole();
        originalConsole.error(wrapError("开发模式下日志通道建立 socket 连接失败。"));
        {
          originalConsole.error(wrapError("小程序平台，请勾选不校验合法域名配置。"));
        }
        originalConsole.error(wrapError("如果是运行到真机，请确认手机与电脑处于同一网络。"));
        return false;
      }
      {
        initMiniProgramGlobalFlag();
      }
      socket.onClose(() => {
        {
          originalConsole.error(wrapError("开发模式下日志通道 socket 连接关闭，请在 HBuilderX 中重新运行。"));
        }
        restoreError();
        restoreConsole();
      });
      setSendConsole((data) => {
        socket.send({
          data
        });
      });
      setSendError((data) => {
        socket.send({
          data
        });
      });
      return true;
    });
  });
}
const ERROR_CHAR = "‌";
function wrapError(error) {
  return `${ERROR_CHAR}${error}${ERROR_CHAR}`;
}
function initMiniProgramGlobalFlag() {
  if (typeof wx$1 !== "undefined") {
    wx$1.__uni_console__ = true;
  } else if (typeof my !== "undefined") {
    my.__uni_console__ = true;
  } else if (typeof tt !== "undefined") {
    tt.__uni_console__ = true;
  } else if (typeof swan !== "undefined") {
    swan.__uni_console__ = true;
  } else if (typeof qq !== "undefined") {
    qq.__uni_console__ = true;
  } else if (typeof ks !== "undefined") {
    ks.__uni_console__ = true;
  } else if (typeof jd !== "undefined") {
    jd.__uni_console__ = true;
  } else if (typeof xhs !== "undefined") {
    xhs.__uni_console__ = true;
  } else if (typeof has !== "undefined") {
    has.__uni_console__ = true;
  } else if (typeof qa !== "undefined") {
    qa.__uni_console__ = true;
  }
}
initRuntimeSocketService();
const _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val2] of props) {
    target[key] = val2;
  }
  return target;
};
function initVueIds(vueIds, mpInstance) {
  if (!vueIds) {
    return;
  }
  const ids = vueIds.split(",");
  const len = ids.length;
  if (len === 1) {
    mpInstance._$vueId = ids[0];
  } else if (len === 2) {
    mpInstance._$vueId = ids[0];
    mpInstance._$vuePid = ids[1];
  }
}
const EXTRAS = ["externalClasses"];
function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  EXTRAS.forEach((name) => {
    if (hasOwn$1(vueOptions, name)) {
      miniProgramComponentOptions[name] = vueOptions[name];
    }
  });
}
const WORKLET_RE = /_(.*)_worklet_factory_/;
function initWorkletMethods(mpMethods, vueMethods) {
  if (vueMethods) {
    Object.keys(vueMethods).forEach((name) => {
      const matches = name.match(WORKLET_RE);
      if (matches) {
        const workletName = matches[1];
        mpMethods[name] = vueMethods[name];
        mpMethods[workletName] = vueMethods[workletName];
      }
    });
  }
}
function initWxsCallMethods(methods, wxsCallMethods) {
  if (!isArray(wxsCallMethods)) {
    return;
  }
  wxsCallMethods.forEach((callMethod) => {
    methods[callMethod] = function(args) {
      return this.$vm[callMethod](args);
    };
  });
}
function selectAllComponents(mpInstance, selector, $refs) {
  const components = mpInstance.selectAllComponents(selector);
  components.forEach((component) => {
    const ref2 = component.properties.uR;
    $refs[ref2] = component.$vm || component;
  });
}
function initRefs(instance, mpInstance) {
  Object.defineProperty(instance, "refs", {
    get() {
      const $refs = {};
      selectAllComponents(mpInstance, ".r", $refs);
      const forComponents = mpInstance.selectAllComponents(".r-i-f");
      forComponents.forEach((component) => {
        const ref2 = component.properties.uR;
        if (!ref2) {
          return;
        }
        if (!$refs[ref2]) {
          $refs[ref2] = [];
        }
        $refs[ref2].push(component.$vm || component);
      });
      return $refs;
    }
  });
}
function findVmByVueId(instance, vuePid) {
  const $children = instance.$children;
  for (let i3 = $children.length - 1; i3 >= 0; i3--) {
    const childVm = $children[i3];
    if (childVm.$scope._$vueId === vuePid) {
      return childVm;
    }
  }
  let parentVm;
  for (let i3 = $children.length - 1; i3 >= 0; i3--) {
    parentVm = findVmByVueId($children[i3], vuePid);
    if (parentVm) {
      return parentVm;
    }
  }
}
function getLocaleLanguage() {
  var _a;
  let localeLanguage = "";
  {
    const appBaseInfo = ((_a = wx.getAppBaseInfo) === null || _a === void 0 ? void 0 : _a.call(wx)) || wx.getSystemInfoSync();
    const language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
    localeLanguage = normalizeLocale(language) || LOCALE_EN;
  }
  return localeLanguage;
}
const MP_METHODS = [
  "createSelectorQuery",
  "createIntersectionObserver",
  "selectAllComponents",
  "selectComponent"
];
function createEmitFn(oldEmit, ctx) {
  return function emit2(event, ...args) {
    const scope = ctx.$scope;
    if (scope && event) {
      const detail = { __args__: args };
      {
        scope.triggerEvent(event, detail);
      }
    }
    return oldEmit.apply(this, [event, ...args]);
  };
}
function initBaseInstance(instance, options) {
  const ctx = instance.ctx;
  ctx.mpType = options.mpType;
  ctx.$mpType = options.mpType;
  ctx.$mpPlatform = "mp-weixin";
  ctx.$scope = options.mpInstance;
  {
    Object.defineProperties(ctx, {
      // only id
      [VIRTUAL_HOST_ID]: {
        get() {
          const id = this.$scope.data[VIRTUAL_HOST_ID];
          return id === void 0 ? "" : id;
        }
      }
    });
  }
  ctx.$mp = {};
  {
    ctx._self = {};
  }
  instance.slots = {};
  if (isArray(options.slots) && options.slots.length) {
    options.slots.forEach((name) => {
      instance.slots[name] = true;
    });
    if (instance.slots[SLOT_DEFAULT_NAME]) {
      instance.slots.default = true;
    }
  }
  ctx.getOpenerEventChannel = function() {
    {
      return options.mpInstance.getOpenerEventChannel();
    }
  };
  ctx.$hasHook = hasHook;
  ctx.$callHook = callHook;
  instance.emit = createEmitFn(instance.emit, ctx);
}
function initComponentInstance(instance, options) {
  initBaseInstance(instance, options);
  const ctx = instance.ctx;
  MP_METHODS.forEach((method) => {
    ctx[method] = function(...args) {
      const mpInstance = ctx.$scope;
      if (mpInstance && mpInstance[method]) {
        return mpInstance[method].apply(mpInstance, args);
      }
    };
  });
}
function initMocks(instance, mpInstance, mocks2) {
  const ctx = instance.ctx;
  mocks2.forEach((mock) => {
    if (hasOwn$1(mpInstance, mock)) {
      instance[mock] = ctx[mock] = mpInstance[mock];
    }
  });
}
function hasHook(name) {
  const hooks = this.$[name];
  if (hooks && hooks.length) {
    return true;
  }
  return false;
}
function callHook(name, args) {
  if (name === "mounted") {
    callHook.call(this, "bm");
    this.$.isMounted = true;
    name = "m";
  }
  const hooks = this.$[name];
  return hooks && invokeArrayFns(hooks, args);
}
const PAGE_INIT_HOOKS = [
  ON_LOAD,
  ON_SHOW,
  ON_HIDE,
  ON_UNLOAD,
  ON_RESIZE,
  ON_TAB_ITEM_TAP,
  ON_REACH_BOTTOM,
  ON_PULL_DOWN_REFRESH,
  ON_ADD_TO_FAVORITES
  // 'onReady', // lifetimes.ready
  // 'onPageScroll', // 影响性能，开发者手动注册
  // 'onShareTimeline', // 右上角菜单，开发者手动注册
  // 'onShareAppMessage' // 右上角菜单，开发者手动注册
];
function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
  if (vueOptions) {
    Object.keys(vueOptions).forEach((name) => {
      if (isUniLifecycleHook(name, vueOptions[name])) {
        hooks.add(name);
      }
    });
    {
      const { extends: extendsOptions, mixins } = vueOptions;
      if (mixins) {
        mixins.forEach((mixin) => findHooks(mixin, hooks));
      }
      if (extendsOptions) {
        findHooks(extendsOptions, hooks);
      }
    }
  }
  return hooks;
}
function initHook(mpOptions, hook, excludes) {
  if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
    mpOptions[hook] = function(args) {
      return this.$vm && this.$vm.$callHook(hook, args);
    };
  }
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
  hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
  if (!runtimeHooks) {
    return;
  }
  const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  hooks.forEach((hook) => {
    if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
      initHook(mpOptions, hook, []);
    }
  });
}
const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  const runtimeHooks = [];
  const app = isFunction(getApp) && getApp({ allowDefault: true });
  if (app && app.$vm && app.$vm.$) {
    const mixins = app.$vm.$.appContext.mixins;
    if (isArray(mixins)) {
      const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
      mixins.forEach((mixin) => {
        hooks.forEach((hook) => {
          if (hasOwn$1(mixin, hook) && !runtimeHooks.includes(hook)) {
            runtimeHooks.push(hook);
          }
        });
      });
    }
  }
  return runtimeHooks;
});
function initMixinRuntimeHooks(mpOptions) {
  initHooks(mpOptions, findMixinRuntimeHooks());
}
const HOOKS = [
  ON_SHOW,
  ON_HIDE,
  ON_ERROR,
  ON_THEME_CHANGE,
  ON_PAGE_NOT_FOUND,
  ON_UNHANDLE_REJECTION
];
function parseApp(instance, parseAppOptions) {
  const internalInstance = instance.$;
  const appOptions = {
    globalData: instance.$options && instance.$options.globalData || {},
    $vm: instance,
    // mp-alipay 组件 data 初始化比 onLaunch 早，提前挂载
    onLaunch(options) {
      this.$vm = instance;
      const ctx = internalInstance.ctx;
      if (this.$vm && ctx.$scope && ctx.$callHook) {
        return;
      }
      initBaseInstance(internalInstance, {
        mpType: "app",
        mpInstance: this,
        slots: []
      });
      ctx.globalData = this.globalData;
      instance.$callHook(ON_LAUNCH, options);
    }
  };
  const onErrorHandlers = wx.$onErrorHandlers;
  if (onErrorHandlers) {
    onErrorHandlers.forEach((fn2) => {
      injectHook(ON_ERROR, fn2, internalInstance);
    });
    onErrorHandlers.length = 0;
  }
  initLocale(instance);
  const vueOptions = instance.$.type;
  initHooks(appOptions, HOOKS);
  initUnknownHooks(appOptions, vueOptions);
  {
    const methods = vueOptions.methods;
    methods && extend(appOptions, methods);
  }
  return appOptions;
}
function initCreateApp(parseAppOptions) {
  return function createApp2(vm) {
    return App(parseApp(vm));
  };
}
function initCreateSubpackageApp(parseAppOptions) {
  return function createApp2(vm) {
    const appOptions = parseApp(vm);
    const app = isFunction(getApp) && getApp({
      allowDefault: true
    });
    if (!app)
      return;
    vm.$.ctx.$scope = app;
    const globalData = app.globalData;
    if (globalData) {
      Object.keys(appOptions.globalData).forEach((name) => {
        if (!hasOwn$1(globalData, name)) {
          globalData[name] = appOptions.globalData[name];
        }
      });
    }
    Object.keys(appOptions).forEach((name) => {
      if (!hasOwn$1(app, name)) {
        app[name] = appOptions[name];
      }
    });
    initAppLifecycle(appOptions, vm);
  };
}
function initAppLifecycle(appOptions, vm) {
  if (isFunction(appOptions.onLaunch)) {
    const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
    appOptions.onLaunch(args);
  }
  if (isFunction(appOptions.onShow) && wx.onAppShow) {
    wx.onAppShow((args) => {
      vm.$callHook("onShow", args);
    });
  }
  if (isFunction(appOptions.onHide) && wx.onAppHide) {
    wx.onAppHide((args) => {
      vm.$callHook("onHide", args);
    });
  }
}
function initLocale(appVm) {
  const locale = ref(getLocaleLanguage());
  Object.defineProperty(appVm, "$locale", {
    get() {
      return locale.value;
    },
    set(v3) {
      locale.value = v3;
    }
  });
}
const builtInProps = [
  // 百度小程序,快手小程序自定义组件不支持绑定动态事件，动态dataset，故通过props传递事件信息
  // event-opts
  "eO",
  // 组件 ref
  "uR",
  // 组件 ref-in-for
  "uRIF",
  // 组件 id
  "uI",
  // 组件类型 m: 小程序组件
  "uT",
  // 组件 props
  "uP",
  // 小程序不能直接定义 $slots 的 props，所以通过 vueSlots 转换到 $slots
  "uS"
];
function initDefaultProps(options, isBehavior = false) {
  const properties = {};
  if (!isBehavior) {
    let observerSlots = function(newVal) {
      const $slots = /* @__PURE__ */ Object.create(null);
      newVal && newVal.forEach((slotName) => {
        $slots[slotName] = true;
      });
      this.setData({
        $slots
      });
    };
    builtInProps.forEach((name) => {
      properties[name] = {
        type: null,
        value: ""
      };
    });
    properties.uS = {
      type: null,
      value: []
    };
    {
      properties.uS.observer = observerSlots;
    }
  }
  if (options.behaviors) {
    if (options.behaviors.includes("wx://form-field")) {
      if (!options.properties || !options.properties.name) {
        properties.name = {
          type: null,
          value: ""
        };
      }
      if (!options.properties || !options.properties.value) {
        properties.value = {
          type: null,
          value: ""
        };
      }
    }
  }
  return properties;
}
function initVirtualHostProps(options) {
  const properties = {};
  {
    if (options && options.virtualHost) {
      properties[VIRTUAL_HOST_STYLE] = {
        type: null,
        value: ""
      };
      properties[VIRTUAL_HOST_CLASS] = {
        type: null,
        value: ""
      };
      properties[VIRTUAL_HOST_HIDDEN] = {
        type: null,
        value: ""
      };
      properties[VIRTUAL_HOST_ID] = {
        type: null,
        value: ""
      };
    }
  }
  return properties;
}
function initProps(mpComponentOptions) {
  if (!mpComponentOptions.properties) {
    mpComponentOptions.properties = {};
  }
  extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
  if (isArray(type) && type.length === 1) {
    return type[0];
  }
  return type;
}
function normalizePropType(type, defaultValue) {
  const res = parsePropType(type);
  return PROP_TYPES.indexOf(res) !== -1 ? res : null;
}
function initPageProps({ properties }, rawProps) {
  if (isArray(rawProps)) {
    rawProps.forEach((key) => {
      properties[key] = {
        type: String,
        value: ""
      };
    });
  } else if (isPlainObject$1(rawProps)) {
    Object.keys(rawProps).forEach((key) => {
      const opts = rawProps[key];
      if (isPlainObject$1(opts)) {
        let value = opts.default;
        if (isFunction(value)) {
          value = value();
        }
        const type = opts.type;
        opts.type = normalizePropType(type);
        properties[key] = {
          type: opts.type,
          value
        };
      } else {
        properties[key] = {
          type: normalizePropType(opts)
        };
      }
    });
  }
}
function findPropsData(properties, isPage2) {
  return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(resolvePropValue(properties.uP))) || {};
}
function findPagePropsData(properties) {
  const propsData = {};
  if (isPlainObject$1(properties)) {
    Object.keys(properties).forEach((name) => {
      if (builtInProps.indexOf(name) === -1) {
        propsData[name] = resolvePropValue(properties[name]);
      }
    });
  }
  return propsData;
}
function initFormField(vm) {
  const vueOptions = vm.$options;
  if (isArray(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
    vm.$watch("modelValue", () => {
      vm.$scope && vm.$scope.setData({
        name: vm.name,
        value: vm.modelValue
      });
    }, {
      immediate: true
    });
  }
}
function resolvePropValue(prop) {
  return prop;
}
function initData(_2) {
  return {};
}
function initPropsObserver(componentOptions) {
  const observe = function observe2() {
    const up = this.properties.uP;
    if (!up) {
      return;
    }
    if (this.$vm) {
      updateComponentProps(resolvePropValue(up), this.$vm.$);
    } else if (resolvePropValue(this.properties.uT) === "m") {
      updateMiniProgramComponentProperties(resolvePropValue(up), this);
    }
  };
  {
    if (!componentOptions.observers) {
      componentOptions.observers = {};
    }
    componentOptions.observers.uP = observe;
  }
}
function updateMiniProgramComponentProperties(up, mpInstance) {
  const prevProps = mpInstance.properties;
  const nextProps = findComponentPropsData(up) || {};
  if (hasPropsChanged(prevProps, nextProps, false)) {
    mpInstance.setData(nextProps);
  }
}
function updateComponentProps(up, instance) {
  const prevProps = toRaw(instance.props);
  const nextProps = findComponentPropsData(up) || {};
  if (hasPropsChanged(prevProps, nextProps)) {
    updateProps(instance, nextProps, prevProps, false);
    if (hasQueueJob(instance.update)) {
      invalidateJob(instance.update);
    }
    {
      instance.update();
    }
  }
}
function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  const nextKeys = Object.keys(nextProps);
  if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
    return true;
  }
  for (let i3 = 0; i3 < nextKeys.length; i3++) {
    const key = nextKeys[i3];
    if (nextProps[key] !== prevProps[key]) {
      return true;
    }
  }
  return false;
}
function initBehaviors(vueOptions) {
  const vueBehaviors = vueOptions.behaviors;
  let vueProps = vueOptions.props;
  if (!vueProps) {
    vueOptions.props = vueProps = [];
  }
  const behaviors = [];
  if (isArray(vueBehaviors)) {
    vueBehaviors.forEach((behavior) => {
      behaviors.push(behavior.replace("uni://", "wx://"));
      if (behavior === "uni://form-field") {
        if (isArray(vueProps)) {
          vueProps.push("name");
          vueProps.push("modelValue");
        } else {
          vueProps.name = {
            type: String,
            default: ""
          };
          vueProps.modelValue = {
            type: [String, Number, Boolean, Array, Object, Date],
            default: ""
          };
        }
      }
    });
  }
  return behaviors;
}
function applyOptions(componentOptions, vueOptions) {
  componentOptions.data = initData();
  componentOptions.behaviors = initBehaviors(vueOptions);
}
function parseComponent(vueOptions, { parse: parse2, mocks: mocks2, isPage: isPage2, isPageInProject, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  vueOptions = vueOptions.default || vueOptions;
  const options = {
    multipleSlots: true,
    // styleIsolation: 'apply-shared',
    addGlobalClass: true,
    pureDataPattern: /^uP$/
  };
  if (isArray(vueOptions.mixins)) {
    vueOptions.mixins.forEach((item) => {
      if (isObject$1(item.options)) {
        extend(options, item.options);
      }
    });
  }
  if (vueOptions.options) {
    extend(options, vueOptions.options);
  }
  const mpComponentOptions = {
    options,
    lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
    pageLifetimes: {
      show() {
        this.$vm && this.$vm.$callHook("onPageShow");
      },
      hide() {
        this.$vm && this.$vm.$callHook("onPageHide");
      },
      resize(size2) {
        this.$vm && this.$vm.$callHook("onPageResize", size2);
      }
    },
    methods: {
      __l: handleLink2
    }
  };
  {
    applyOptions(mpComponentOptions, vueOptions);
  }
  initProps(mpComponentOptions);
  initPropsObserver(mpComponentOptions);
  initExtraOptions(mpComponentOptions, vueOptions);
  initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  {
    initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
  }
  if (parse2) {
    parse2(mpComponentOptions, { handleLink: handleLink2 });
  }
  return mpComponentOptions;
}
function initCreateComponent(parseOptions2) {
  return function createComponent2(vueComponentOptions) {
    return Component(parseComponent(vueComponentOptions, parseOptions2));
  };
}
let $createComponentFn;
let $destroyComponentFn;
function getAppVm() {
  return getApp().$vm;
}
function $createComponent(initialVNode, options) {
  if (!$createComponentFn) {
    $createComponentFn = getAppVm().$createComponent;
  }
  const proxy = $createComponentFn(initialVNode, options);
  return getExposeProxy(proxy.$) || proxy;
}
function $destroyComponent(instance) {
  if (!$destroyComponentFn) {
    $destroyComponentFn = getAppVm().$destroyComponent;
  }
  return $destroyComponentFn(instance);
}
function parsePage(vueOptions, parseOptions2) {
  const { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  const miniProgramPageOptions = parseComponent(vueOptions, {
    mocks: mocks2,
    isPage: isPage2,
    isPageInProject: true,
    initRelation: initRelation2,
    handleLink: handleLink2,
    initLifetimes: initLifetimes2
  });
  initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  const methods = miniProgramPageOptions.methods;
  methods.onLoad = function(query) {
    {
      this.options = query;
    }
    this.$page = {
      fullPath: addLeadingSlash(this.route + stringifyQuery(query))
    };
    return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  };
  initHooks(methods, PAGE_INIT_HOOKS);
  {
    initUnknownHooks(methods, vueOptions);
  }
  initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  initMixinRuntimeHooks(methods);
  parse2 && parse2(miniProgramPageOptions, { handleLink: handleLink2 });
  return miniProgramPageOptions;
}
function initCreatePage(parseOptions2) {
  return function createPage2(vuePageOptions) {
    return Component(parsePage(vuePageOptions, parseOptions2));
  };
}
function initCreatePluginApp(parseAppOptions) {
  return function createApp2(vm) {
    initAppLifecycle(parseApp(vm), vm);
  };
}
const MPPage = Page;
const MPComponent = Component;
function initTriggerEvent(mpInstance) {
  const oldTriggerEvent = mpInstance.triggerEvent;
  const newTriggerEvent = function(event, ...args) {
    return oldTriggerEvent.apply(mpInstance, [
      customizeEvent(event),
      ...args
    ]);
  };
  try {
    mpInstance.triggerEvent = newTriggerEvent;
  } catch (error) {
    mpInstance._triggerEvent = newTriggerEvent;
  }
}
function initMiniProgramHook(name, options, isComponent) {
  const oldHook = options[name];
  if (!oldHook) {
    options[name] = function() {
      initTriggerEvent(this);
    };
  } else {
    options[name] = function(...args) {
      initTriggerEvent(this);
      return oldHook.apply(this, args);
    };
  }
}
Page = function(options) {
  initMiniProgramHook(ON_LOAD, options);
  return MPPage(options);
};
Component = function(options) {
  initMiniProgramHook("created", options);
  const isVueComponent = options.properties && options.properties.uP;
  if (!isVueComponent) {
    initProps(options);
    initPropsObserver(options);
  }
  return MPComponent(options);
};
function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  return {
    attached() {
      let properties = this.properties;
      initVueIds(properties.uI, this);
      const relationOptions = {
        vuePid: this._$vuePid
      };
      initRelation2(this, relationOptions);
      const mpInstance = this;
      const isMiniProgramPage = isPage2(mpInstance);
      let propsData = properties;
      this.$vm = $createComponent({
        type: vueOptions,
        props: findPropsData(propsData, isMiniProgramPage)
      }, {
        mpType: isMiniProgramPage ? "page" : "component",
        mpInstance,
        slots: properties.uS || {},
        // vueSlots
        parentComponent: relationOptions.parent && relationOptions.parent.$,
        onBeforeSetup(instance, options) {
          initRefs(instance, mpInstance);
          initMocks(instance, mpInstance, mocks2);
          initComponentInstance(instance, options);
        }
      });
      if (!isMiniProgramPage) {
        initFormField(this.$vm);
      }
    },
    ready() {
      if (this.$vm) {
        {
          this.$vm.$callHook("mounted");
          this.$vm.$callHook(ON_READY);
        }
      }
    },
    detached() {
      if (this.$vm) {
        pruneComponentPropsCache(this.$vm.$.uid);
        $destroyComponent(this.$vm);
      }
    }
  };
}
const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
function isPage(mpInstance) {
  return !!mpInstance.route;
}
function initRelation(mpInstance, detail) {
  mpInstance.triggerEvent("__l", detail);
}
function handleLink(event) {
  const detail = event.detail || event.value;
  const vuePid = detail.vuePid;
  let parentVm;
  if (vuePid) {
    parentVm = findVmByVueId(this.$vm, vuePid);
  }
  if (!parentVm) {
    parentVm = this.$vm;
  }
  detail.parent = parentVm;
}
var parseOptions = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  handleLink,
  initLifetimes,
  initRelation,
  isPage,
  mocks
});
const createApp = initCreateApp();
const createPage = initCreatePage(parseOptions);
const createComponent = initCreateComponent(parseOptions);
const createPluginApp = initCreatePluginApp();
const createSubpackageApp = initCreateSubpackageApp();
{
  wx.createApp = global.createApp = createApp;
  wx.createPage = createPage;
  wx.createComponent = createComponent;
  wx.createPluginApp = global.createPluginApp = createPluginApp;
  wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
}
var isVue2 = false;
function set(target, key, val2) {
  if (Array.isArray(target)) {
    target.length = Math.max(target.length, key);
    target.splice(key, 1, val2);
    return val2;
  }
  target[key] = val2;
  return val2;
}
function del(target, key) {
  if (Array.isArray(target)) {
    target.splice(key, 1);
    return;
  }
  delete target[key];
}
/*!
 * pinia v2.1.7
 * (c) 2023 Eduardo San Martin Morote
 * @license MIT
 */
let activePinia;
const setActivePinia = (pinia) => activePinia = pinia;
const piniaSymbol = Symbol("pinia");
function isPlainObject(o2) {
  return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
}
var MutationType;
(function(MutationType2) {
  MutationType2["direct"] = "direct";
  MutationType2["patchObject"] = "patch object";
  MutationType2["patchFunction"] = "patch function";
})(MutationType || (MutationType = {}));
const IS_CLIENT = typeof window !== "undefined";
const USE_DEVTOOLS = IS_CLIENT;
const componentStateTypes = [];
const getStoreType = (id) => "🍍 " + id;
function addStoreToDevtools(app, store) {
  if (!componentStateTypes.includes(getStoreType(store.$id))) {
    componentStateTypes.push(getStoreType(store.$id));
  }
}
function patchActionForGrouping(store, actionNames, wrapWithProxy) {
  const actions = actionNames.reduce((storeActions, actionName) => {
    storeActions[actionName] = toRaw(store)[actionName];
    return storeActions;
  }, {});
  for (const actionName in actions) {
    store[actionName] = function() {
      const trackedStore = wrapWithProxy ? new Proxy(store, {
        get(...args) {
          return Reflect.get(...args);
        },
        set(...args) {
          return Reflect.set(...args);
        }
      }) : store;
      const retValue = actions[actionName].apply(trackedStore, arguments);
      return retValue;
    };
  }
}
function devtoolsPlugin({ app, store, options }) {
  if (store.$id.startsWith("__hot:")) {
    return;
  }
  store._isOptionsAPI = !!options.state;
  patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);
  const originalHotUpdate = store._hotUpdate;
  toRaw(store)._hotUpdate = function(newStore) {
    originalHotUpdate.apply(this, arguments);
    patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);
  };
  addStoreToDevtools(
    app,
    // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
    store
  );
}
function createPinia() {
  const scope = effectScope(true);
  const state = scope.run(() => ref({}));
  let _p = [];
  let toBeInstalled = [];
  const pinia = markRaw({
    install(app) {
      setActivePinia(pinia);
      {
        pinia._a = app;
        app.provide(piniaSymbol, pinia);
        app.config.globalProperties.$pinia = pinia;
        toBeInstalled.forEach((plugin2) => _p.push(plugin2));
        toBeInstalled = [];
      }
    },
    use(plugin2) {
      if (!this._a && !isVue2) {
        toBeInstalled.push(plugin2);
      } else {
        _p.push(plugin2);
      }
      return this;
    },
    _p,
    // it's actually undefined here
    // @ts-expect-error
    _a: null,
    _e: scope,
    _s: /* @__PURE__ */ new Map(),
    state
  });
  if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
    pinia.use(devtoolsPlugin);
  }
  return pinia;
}
function patchObject(newState, oldState) {
  for (const key in oldState) {
    const subPatch = oldState[key];
    if (!(key in newState)) {
      continue;
    }
    const targetValue = newState[key];
    if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) {
      newState[key] = patchObject(targetValue, subPatch);
    } else {
      {
        newState[key] = subPatch;
      }
    }
  }
  return newState;
}
const noop = () => {
};
function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
  subscriptions.push(callback);
  const removeSubscription = () => {
    const idx = subscriptions.indexOf(callback);
    if (idx > -1) {
      subscriptions.splice(idx, 1);
      onCleanup();
    }
  };
  if (!detached && getCurrentScope()) {
    onScopeDispose(removeSubscription);
  }
  return removeSubscription;
}
function triggerSubscriptions(subscriptions, ...args) {
  subscriptions.slice().forEach((callback) => {
    callback(...args);
  });
}
const fallbackRunWithContext = (fn2) => fn2();
function mergeReactiveObjects(target, patchToApply) {
  if (target instanceof Map && patchToApply instanceof Map) {
    patchToApply.forEach((value, key) => target.set(key, value));
  }
  if (target instanceof Set && patchToApply instanceof Set) {
    patchToApply.forEach(target.add, target);
  }
  for (const key in patchToApply) {
    if (!patchToApply.hasOwnProperty(key))
      continue;
    const subPatch = patchToApply[key];
    const targetValue = target[key];
    if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
      target[key] = mergeReactiveObjects(targetValue, subPatch);
    } else {
      target[key] = subPatch;
    }
  }
  return target;
}
const skipHydrateSymbol = Symbol("pinia:skipHydration");
function shouldHydrate(obj) {
  return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
}
const { assign } = Object;
function isComputed(o2) {
  return !!(isRef(o2) && o2.effect);
}
function createOptionsStore(id, options, pinia, hot) {
  const { state, actions, getters } = options;
  const initialState = pinia.state.value[id];
  let store;
  function setup() {
    if (!initialState && !hot) {
      {
        pinia.state.value[id] = state ? state() : {};
      }
    }
    const localState = hot ? (
      // use ref() to unwrap refs inside state TODO: check if this is still necessary
      toRefs(ref(state ? state() : {}).value)
    ) : toRefs(pinia.state.value[id]);
    return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
      if (name in localState) {
        console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
      }
      computedGetters[name] = markRaw(computed(() => {
        setActivePinia(pinia);
        const store2 = pinia._s.get(id);
        return getters[name].call(store2, store2);
      }));
      return computedGetters;
    }, {}));
  }
  store = createSetupStore(id, setup, options, pinia, hot, true);
  return store;
}
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
  let scope;
  const optionsForPlugin = assign({ actions: {} }, options);
  if (!pinia._e.active) {
    throw new Error("Pinia destroyed");
  }
  const $subscribeOptions = {
    deep: true
    // flush: 'post',
  };
  {
    $subscribeOptions.onTrigger = (event) => {
      if (isListening) {
        debuggerEvents = event;
      } else if (isListening == false && !store._hotUpdating) {
        if (Array.isArray(debuggerEvents)) {
          debuggerEvents.push(event);
        } else {
          console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
        }
      }
    };
  }
  let isListening;
  let isSyncListening;
  let subscriptions = [];
  let actionSubscriptions = [];
  let debuggerEvents;
  const initialState = pinia.state.value[$id];
  if (!isOptionsStore && !initialState && !hot) {
    {
      pinia.state.value[$id] = {};
    }
  }
  const hotState = ref({});
  let activeListener;
  function $patch(partialStateOrMutator) {
    let subscriptionMutation;
    isListening = isSyncListening = false;
    {
      debuggerEvents = [];
    }
    if (typeof partialStateOrMutator === "function") {
      partialStateOrMutator(pinia.state.value[$id]);
      subscriptionMutation = {
        type: MutationType.patchFunction,
        storeId: $id,
        events: debuggerEvents
      };
    } else {
      mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
      subscriptionMutation = {
        type: MutationType.patchObject,
        payload: partialStateOrMutator,
        storeId: $id,
        events: debuggerEvents
      };
    }
    const myListenerId = activeListener = Symbol();
    nextTick$1().then(() => {
      if (activeListener === myListenerId) {
        isListening = true;
      }
    });
    isSyncListening = true;
    triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
  }
  const $reset = isOptionsStore ? function $reset2() {
    const { state } = options;
    const newState = state ? state() : {};
    this.$patch(($state) => {
      assign($state, newState);
    });
  } : (
    /* istanbul ignore next */
    () => {
      throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
    }
  );
  function $dispose() {
    scope.stop();
    subscriptions = [];
    actionSubscriptions = [];
    pinia._s.delete($id);
  }
  function wrapAction(name, action) {
    return function() {
      setActivePinia(pinia);
      const args = Array.from(arguments);
      const afterCallbackList = [];
      const onErrorCallbackList = [];
      function after(callback) {
        afterCallbackList.push(callback);
      }
      function onError2(callback) {
        onErrorCallbackList.push(callback);
      }
      triggerSubscriptions(actionSubscriptions, {
        args,
        name,
        store,
        after,
        onError: onError2
      });
      let ret;
      try {
        ret = action.apply(this && this.$id === $id ? this : store, args);
      } catch (error) {
        triggerSubscriptions(onErrorCallbackList, error);
        throw error;
      }
      if (ret instanceof Promise) {
        return ret.then((value) => {
          triggerSubscriptions(afterCallbackList, value);
          return value;
        }).catch((error) => {
          triggerSubscriptions(onErrorCallbackList, error);
          return Promise.reject(error);
        });
      }
      triggerSubscriptions(afterCallbackList, ret);
      return ret;
    };
  }
  const _hmrPayload = /* @__PURE__ */ markRaw({
    actions: {},
    getters: {},
    state: [],
    hotState
  });
  const partialStore = {
    _p: pinia,
    // _s: scope,
    $id,
    $onAction: addSubscription.bind(null, actionSubscriptions),
    $patch,
    $reset,
    $subscribe(callback, options2 = {}) {
      const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
      const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
        if (options2.flush === "sync" ? isSyncListening : isListening) {
          callback({
            storeId: $id,
            type: MutationType.direct,
            events: debuggerEvents
          }, state);
        }
      }, assign({}, $subscribeOptions, options2)));
      return removeSubscription;
    },
    $dispose
  };
  const store = reactive(assign(
    {
      _hmrPayload,
      _customProperties: markRaw(/* @__PURE__ */ new Set())
      // devtools custom properties
    },
    partialStore
    // must be added later
    // setupStore
  ));
  pinia._s.set($id, store);
  const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
  const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(setup)));
  for (const key in setupStore) {
    const prop = setupStore[key];
    if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
      if (hot) {
        set(hotState.value, key, toRef(setupStore, key));
      } else if (!isOptionsStore) {
        if (initialState && shouldHydrate(prop)) {
          if (isRef(prop)) {
            prop.value = initialState[key];
          } else {
            mergeReactiveObjects(prop, initialState[key]);
          }
        }
        {
          pinia.state.value[$id][key] = prop;
        }
      }
      {
        _hmrPayload.state.push(key);
      }
    } else if (typeof prop === "function") {
      const actionValue = hot ? prop : wrapAction(key, prop);
      {
        setupStore[key] = actionValue;
      }
      {
        _hmrPayload.actions[key] = prop;
      }
      optionsForPlugin.actions[key] = prop;
    } else {
      if (isComputed(prop)) {
        _hmrPayload.getters[key] = isOptionsStore ? (
          // @ts-expect-error
          options.getters[key]
        ) : prop;
        if (IS_CLIENT) {
          const getters = setupStore._getters || // @ts-expect-error: same
          (setupStore._getters = markRaw([]));
          getters.push(key);
        }
      }
    }
  }
  {
    assign(store, setupStore);
    assign(toRaw(store), setupStore);
  }
  Object.defineProperty(store, "$state", {
    get: () => hot ? hotState.value : pinia.state.value[$id],
    set: (state) => {
      if (hot) {
        throw new Error("cannot set hotState");
      }
      $patch(($state) => {
        assign($state, state);
      });
    }
  });
  {
    store._hotUpdate = markRaw((newStore) => {
      store._hotUpdating = true;
      newStore._hmrPayload.state.forEach((stateKey) => {
        if (stateKey in store.$state) {
          const newStateTarget = newStore.$state[stateKey];
          const oldStateSource = store.$state[stateKey];
          if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) {
            patchObject(newStateTarget, oldStateSource);
          } else {
            newStore.$state[stateKey] = oldStateSource;
          }
        }
        set(store, stateKey, toRef(newStore.$state, stateKey));
      });
      Object.keys(store.$state).forEach((stateKey) => {
        if (!(stateKey in newStore.$state)) {
          del(store, stateKey);
        }
      });
      isListening = false;
      isSyncListening = false;
      pinia.state.value[$id] = toRef(newStore._hmrPayload, "hotState");
      isSyncListening = true;
      nextTick$1().then(() => {
        isListening = true;
      });
      for (const actionName in newStore._hmrPayload.actions) {
        const action = newStore[actionName];
        set(store, actionName, wrapAction(actionName, action));
      }
      for (const getterName in newStore._hmrPayload.getters) {
        const getter = newStore._hmrPayload.getters[getterName];
        const getterValue = isOptionsStore ? (
          // special handling of options api
          computed(() => {
            setActivePinia(pinia);
            return getter.call(store, store);
          })
        ) : getter;
        set(store, getterName, getterValue);
      }
      Object.keys(store._hmrPayload.getters).forEach((key) => {
        if (!(key in newStore._hmrPayload.getters)) {
          del(store, key);
        }
      });
      Object.keys(store._hmrPayload.actions).forEach((key) => {
        if (!(key in newStore._hmrPayload.actions)) {
          del(store, key);
        }
      });
      store._hmrPayload = newStore._hmrPayload;
      store._getters = newStore._getters;
      store._hotUpdating = false;
    });
  }
  if (USE_DEVTOOLS) {
    const nonEnumerable = {
      writable: true,
      configurable: true,
      // avoid warning on devtools trying to display this property
      enumerable: false
    };
    ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p3) => {
      Object.defineProperty(store, p3, assign({ value: store[p3] }, nonEnumerable));
    });
  }
  pinia._p.forEach((extender) => {
    if (USE_DEVTOOLS) {
      const extensions = scope.run(() => extender({
        store,
        app: pinia._a,
        pinia,
        options: optionsForPlugin
      }));
      Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
      assign(store, extensions);
    } else {
      assign(store, scope.run(() => extender({
        store,
        app: pinia._a,
        pinia,
        options: optionsForPlugin
      })));
    }
  });
  if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
    console.warn(`[🍍]: The "state" must be a plain object. It cannot be
	state: () => new MyClass()
Found in store "${store.$id}".`);
  }
  if (initialState && isOptionsStore && options.hydrate) {
    options.hydrate(store.$state, initialState);
  }
  isListening = true;
  isSyncListening = true;
  return store;
}
function defineStore(idOrOptions, setup, setupOptions) {
  let id;
  let options;
  const isSetupStore = typeof setup === "function";
  if (typeof idOrOptions === "string") {
    id = idOrOptions;
    options = isSetupStore ? setupOptions : setup;
  } else {
    options = idOrOptions;
    id = idOrOptions.id;
    if (typeof id !== "string") {
      throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`);
    }
  }
  function useStore(pinia, hot) {
    const hasContext = hasInjectionContext();
    pinia = // in test mode, ignore the argument provided as we can always retrieve a
    // pinia instance with getActivePinia()
    pinia || (hasContext ? inject(piniaSymbol, null) : null);
    if (pinia)
      setActivePinia(pinia);
    if (!activePinia) {
      throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
This will fail in production.`);
    }
    pinia = activePinia;
    if (!pinia._s.has(id)) {
      if (isSetupStore) {
        createSetupStore(id, setup, options, pinia);
      } else {
        createOptionsStore(id, options, pinia);
      }
      {
        useStore._pinia = pinia;
      }
    }
    const store = pinia._s.get(id);
    if (hot) {
      const hotId = "__hot:" + id;
      const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
      hot._hotUpdate(newStore);
      delete pinia.state.value[hotId];
      pinia._s.delete(hotId);
    }
    if (IS_CLIENT) {
      const currentInstance2 = getCurrentInstance();
      if (currentInstance2 && currentInstance2.proxy && // avoid adding stores that are just built for hot module replacement
      !hot) {
        const vm = currentInstance2.proxy;
        const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
        cache[id] = store;
      }
    }
    return store;
  }
  useStore.$id = id;
  return useStore;
}
var e$1, t$1;
!function(e3) {
  e3.UNIAPP = "uniapp", e3.REACT_NATIVE = "rn", e3.COCOS = "cocos", e3.UNKNOWN = "unknown";
}(e$1 || (e$1 = {}));
let s$1 = class s {
  constructor() {
    this.framework = null, this.methods = { [e$1.UNIAPP]: this.isUniApp, [e$1.REACT_NATIVE]: this.isReactNative, [e$1.COCOS]: this.isCocos };
    const t2 = this.methods, s3 = Object.keys(t2);
    for (const e3 of s3) {
      if ((0, t2[e3])()) {
        this.framework = e3;
        break;
      }
    }
    this.framework = this.framework || e$1.UNKNOWN, this.framework;
  }
  static currentFramework() {
    return this.instance || (this.instance = new s()), this.instance.framework;
  }
  isUniApp() {
    try {
      return "function" == typeof index.getSystemInfoSync;
    } catch (e3) {
      return false;
    }
  }
  isReactNative() {
    try {
      return "object" == typeof navigator && "ReactNative" === navigator.product;
    } catch (e3) {
      return false;
    }
  }
  isTaro() {
    try {
      return void 0 !== process.env.TARO_ENV;
    } catch (e3) {
      return false;
    }
  }
  isCocos() {
    try {
      return void 0 !== cc.sys.localStorage;
    } catch (e3) {
      return false;
    }
  }
};
let i$1 = class i {
  static init(t2) {
    s$1.currentFramework() === e$1.REACT_NATIVE && (this.validate(t2), this.platform = t2.platform, this.asyncStorage = t2.asyncStorage);
  }
  static validate(e3) {
    if (!e3)
      throw new Error("'reactNativeOptions' is missing when calling GoEasy.getInstance()");
    if (!e3.platform)
      throw new Error("'platform' is missing in GoEasy 'reactNativeOptions'");
    if (!e3.asyncStorage)
      throw new Error("'asyncStorage' is missing in GoEasy 'reactNativeOptions'");
  }
};
!function(e3) {
  e3.DISCONNECTED = "disconnected", e3.DISCONNECTING = "disconnecting", e3.CONNECTING = "connecting", e3.CONNECTED = "connected", e3.RECONNECTING = "reconnecting", e3.RECONNECTED = "reconnected", e3.EXPIRED_RECONNECTED = "reconnected", e3.CONNECT_FAILED = "connect_failed";
}(t$1 || (t$1 = {}));
const n$1 = "2.13.17";
var o$1, r$1;
!function(e3) {
  e3.PRIVATE = "private", e3.GROUP = "group", e3.SYSTEM = "system", e3.CS = "cs";
}(o$1 || (o$1 = {})), function(e3) {
  e3.NEW = "new", e3.SENDING = "sending", e3.SUCCESS = "success", e3.FAIL = "fail";
}(r$1 || (r$1 = {}));
let a$1 = class a {
};
let c$1 = class c {
  constructor(e3, t2) {
    this.id = e3, this.data = t2;
  }
};
let u$1 = new class {
  isDef(e3) {
    return !this.isUndef(e3);
  }
  isUndef(e3) {
    return null == e3;
  }
  isPrimitive(e3) {
    return "string" == typeof e3 || "number" == typeof e3 || "symbol" == typeof e3 || "boolean" == typeof e3;
  }
  isObject(e3) {
    return null !== e3 && "object" == typeof e3;
  }
  isPlainObject(e3) {
    return "[object Object]" === Object.prototype.toString.call(e3);
  }
  isRegExp(e3) {
    return "[object RegExp]" === Object.prototype.toString.call(e3);
  }
  isValidArrayIndex(e3) {
    let t2 = parseFloat(String(e3));
    return t2 >= 0 && Math.floor(t2) === t2 && isFinite(e3);
  }
  isString(e3) {
    return "string" == typeof e3;
  }
  isNumber(e3) {
    return "number" == typeof e3;
  }
  isStringOrNumber(e3) {
    return this.isString(e3) || this.isNumber(e3);
  }
  isArray(e3) {
    return "[object Array]" === Object.prototype.toString.call(e3);
  }
  isEmpty(e3) {
    return this.isArray(e3) ? 0 === e3.length : this.isObject(e3) ? !this.isDef(e3) : !this.isNumber(e3) && (this.isString(e3) ? "" === e3.trim() : !this.isDef(e3));
  }
  isNative(e3) {
    return "function" == typeof e3 && /native code/.test(e3.toString());
  }
  isFunction(e3) {
    return "function" == typeof e3;
  }
  isBoolean(e3) {
    return "boolean" == typeof e3;
  }
  isTrue(e3) {
    return true === e3;
  }
  isFalse(e3) {
    return false === e3;
  }
  isNull(e3) {
    return null === e3;
  }
}();
var l$1;
!function(e3) {
  e3.MP_WX = "mp-wx", e3.MP_WGAME = "mp-wgame", e3.MP_BYTE = "mp-byte", e3.MP_BAIDU = "mp-baidu", e3.MP_ALI = "mp-ali", e3.BROWSER = "browser", e3.NODE = "node", e3.UNI_IOS = "uni-ios", e3.UNI_ANDROID = "uni-android", e3.COCOS_IOS = "cocos-ios", e3.COCOS_ANDROID = "cocos-android", e3.RN_IOS = "rn-ios", e3.RN_ANDROID = "rn-android", e3.UNKNOWN = "unknown";
}(l$1 || (l$1 = {}));
let d$1 = class d {
  constructor() {
    this.platform = null, this.methods = { [l$1.BROWSER]: this.isBrowser, [l$1.MP_WX]: this.isMPWX, [l$1.MP_WGAME]: this.isMPWeGame, [l$1.MP_BYTE]: this.isMPByte, [l$1.MP_BAIDU]: this.isMPBaidu, [l$1.MP_ALI]: this.isMPAli, [l$1.NODE]: this.isNode, [l$1.UNI_IOS]: this.isUniAppIOS, [l$1.UNI_ANDROID]: this.isUniAppAndroid, [l$1.COCOS_IOS]: this.isCocosIOS, [l$1.COCOS_ANDROID]: this.isCocosAndroid, [l$1.RN_IOS]: this.isRNiOS, [l$1.RN_ANDROID]: this.isRNAndroid };
    const e3 = this.methods, t2 = Object.keys(e3);
    for (const s3 of t2) {
      if ((0, e3[s3])()) {
        this.platform = s3;
        break;
      }
    }
    this.platform = this.platform || l$1.UNKNOWN, this.platform;
  }
  static currentPlatform() {
    return this.instance || (this.instance = new d()), d.instance.platform;
  }
  isBrowser() {
    return "undefined" != typeof navigator && "Taro" !== navigator.product && "ReactNative" !== navigator.product && "undefined" == typeof GameGlobal && ("undefined" == typeof cc || null !== cc.sys.browserType) && "undefined" == typeof my && "undefined" == typeof tt && "undefined" == typeof swan;
  }
  isMPWX() {
    return "object" == typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && "undefined" == typeof WebSocket && "undefined" == typeof XMLHttpRequest && "undefined" == typeof plus && "undefined" == typeof tt;
  }
  isMPWeGame() {
    return "object" == typeof GameGlobal;
  }
  isMPByte() {
    return "object" == typeof tt && "function" == typeof tt.getSystemInfoSync;
  }
  isMPBaidu() {
    return "object" == typeof swan && "function" == typeof swan.getSystemInfoSync;
  }
  isMPAli() {
    return "object" == typeof my && "function" == typeof my.getSystemInfoSync;
  }
  isNode() {
    try {
      return "node" === process.release.name;
    } catch (e3) {
      return false;
    }
  }
  isUniAppIOS() {
    try {
      return "ios" === index.getSystemInfoSync().platform && "app" === index.getSystemInfoSync().uniPlatform;
    } catch (e3) {
      return false;
    }
  }
  isUniAppAndroid() {
    try {
      return "android" === index.getSystemInfoSync().platform && "app" === index.getSystemInfoSync().uniPlatform;
    } catch (e3) {
      return false;
    }
  }
  isCocosIOS() {
    try {
      return "iOS" === cc.sys.os;
    } catch (e3) {
      return false;
    }
  }
  isCocosAndroid() {
    try {
      return "Android" === cc.sys.os;
    } catch (e3) {
      return false;
    }
  }
  isRNiOS() {
    try {
      return "ios" === i$1.platform.OS;
    } catch (e3) {
      return false;
    }
  }
  isRNAndroid() {
    try {
      return "android" === i$1.platform.OS;
    } catch (e3) {
      return false;
    }
  }
};
let h$1 = class h {
};
h$1.type = l$1, h$1.current = d$1.currentPlatform();
let p$1 = class p {
  onFrontend(e3) {
    this.onFrontendCallback = e3;
  }
};
let m$1 = class m extends p$1 {
  constructor() {
    super(...arguments), this.runningBackend = false;
  }
  startCheck() {
    "object" == typeof plus && (plus.globalEvent.addEventListener("resume", () => {
      this.runningBackend = false, this.runningBackend, this.onFrontendCallback && this.onFrontendCallback();
    }, false), plus.globalEvent.addEventListener("pause", () => {
      this.runningBackend = true, this.runningBackend;
    }, false));
  }
  isBackend() {
    return this.runningBackend;
  }
  support() {
    const e3 = d$1.currentPlatform();
    return [l$1.UNI_IOS, l$1.UNI_ANDROID].includes(e3);
  }
};
let f$1 = class f extends p$1 {
  constructor() {
    super(...arguments), this.runningBackend = false;
  }
  startCheck() {
    wx$1.onAppShow(() => {
      this.runningBackend = false;
    }), wx$1.onAppHide(() => {
      this.runningBackend = true;
    });
  }
  isBackend() {
    return this.runningBackend;
  }
  support() {
    return d$1.currentPlatform() === l$1.MP_WX;
  }
};
const g$1 = new class {
  constructor() {
    [new m$1(), new f$1()].forEach((e3) => {
      if (e3.support())
        return this.checker = e3, void this.checker.startCheck();
    });
  }
  isBackend() {
    return this.checker && this.checker.isBackend();
  }
  onFrontend(e3) {
    this.checker.onFrontend(e3);
  }
}();
var y$1, S$1, E$1 = Object.freeze({ __proto__: null, runStatus: g$1 });
!function(e3) {
  e3.authorize = "authorize", e3.manualDisconnect = "manualDisconnect", e3.subscribe = "subscribe", e3.unsubscribe = "unsubscribe", e3.publish = "publish", e3.ack = "ack", e3.historyMessages = "historyMessages", e3.hereNow = "hereNow", e3.hereNowByUserIds = "hereNowByUserIds", e3.PUBSUB_PRESENCE_SUBSCRIBE = "PUBSUB_PRESENCE_SUBSCRIBE", e3.PUBSUB_PRESENCE_UNSUBSCRIBE = "PUBSUB_PRESENCE_UNSUBSCRIBE", e3.PUBSUB_PRESENCE_HERENOW = "PUBSUB_PRESENCE_HERENOW", e3.imLastConversations = "imLastConversations", e3.markPrivateMessageAsRead = "markPrivateMessageAsRead", e3.markGroupMessageAsRead = "markGroupMessageAsRead", e3.imGroupOnlineCount = "imGroupOnlineCount", e3.imHereNow = "imHereNow", e3.imGroupHereNow = "imGroupHereNow", e3.publishIM = "publishIM", e3.subscribeUserPresence = "subscribeUserPresence", e3.unsubscribeUserPresence = "unsubscribeUserPresence", e3.subscribeGroupPresence = "subscribeGroupPresence", e3.unsubscribeGroupPresence = "unsubscribeGroupPresence", e3.removeConversation = "removeConversation", e3.topConversation = "topConversation", e3.imData = "imData", e3.subscribeGroups = "subscribeGroups", e3.unsubscribeGroup = "unsubscribeGroup", e3.IM_DELETE_MESSAGE = "IM_DELETE_MESSAGE", e3.IM_HISTORY = "IM_HISTORY", e3.IM_HISTORY_CHANGE = "IM_HISTORY_CHANGE", e3.IM_RECALL_MESSAGE = "IM_RECALL_MESSAGE", e3.IM_MARK_AS_READ = "IM_MARK_AS_READ", e3.CS_PENDING_CONVERSATION = "CS_PENDING_CONVERSATION", e3.CS_ACCEPT = "CS_ACCEPT", e3.CS_END = "CS_END", e3.CS_TRANSFER = "CS_TRANSFER", e3.CS_AGENTS = "CS_AGENTS", e3.CS_CUSTOMER_STATUS = "CS_CUSTOMER_STATUS", e3.CS_MY_TEAMS = "CS_MY_TEAMS", e3.CS_ONLINE = "CS_ONLINE", e3.CS_OFFLINE = "CS_OFFLINE", e3.CS_LIVE_SESSION = "CS_LIVE_SESSION", e3.CS_QUIT_LIVE = "CS_QUIT_LIVE", e3.SET_IOS_BADGE = "SET_IOS_BADGE", e3.MD_CMD = "MD_CMD";
}(y$1 || (y$1 = {})), function(e3) {
  e3[e3.connect = 3e3] = "connect", e3[e3.reconnectionDelayMax = 3e3] = "reconnectionDelayMax", e3[e3.commonQuerySingle = 2500] = "commonQuerySingle", e3[e3.commonQueryTotal = 12e3] = "commonQueryTotal", e3[e3.commonRequestSingle = 1700] = "commonRequestSingle", e3[e3.commonRequestTotal = 12e3] = "commonRequestTotal", e3[e3.commonInfiniteSingle = 1700] = "commonInfiniteSingle", e3[e3.commonInfiniteTotal = 864e5] = "commonInfiniteTotal";
}(S$1 || (S$1 = {}));
let v$1 = class v {
  static onSuccess(e3, t2) {
    u$1.isFunction(e3.onSuccess) && e3.onSuccess(t2);
  }
  static onFailed(e3, t2) {
    if (!u$1.isObject(e3) || !u$1.isFunction(e3.onFailed))
      throw t2;
    e3.onFailed(t2);
  }
};
function b$1(e3, t2, s3, i3) {
  return new (s3 || (s3 = Promise))(function(n2, o2) {
    function r2(e4) {
      try {
        c3(i3.next(e4));
      } catch (e5) {
        o2(e5);
      }
    }
    function a3(e4) {
      try {
        c3(i3.throw(e4));
      } catch (e5) {
        o2(e5);
      }
    }
    function c3(e4) {
      var t3;
      e4.done ? n2(e4.value) : (t3 = e4.value, t3 instanceof s3 ? t3 : new s3(function(e5) {
        e5(t3);
      })).then(r2, a3);
    }
    c3((i3 = i3.apply(e3, t2 || [])).next());
  });
}
"function" == typeof SuppressedError && SuppressedError;
var C$1 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function w$1(e3) {
  if (e3.__esModule)
    return e3;
  var t2 = Object.defineProperty({}, "__esModule", { value: true });
  return Object.keys(e3).forEach(function(s3) {
    var i3 = Object.getOwnPropertyDescriptor(e3, s3);
    Object.defineProperty(t2, s3, i3.get ? i3 : { enumerable: true, get: function() {
      return e3[s3];
    } });
  }), t2;
}
var M$1 = { exports: {} };
!function(e3) {
  function t2(e4) {
    if (e4)
      return function(e5) {
        for (var s3 in t2.prototype)
          e5[s3] = t2.prototype[s3];
        return e5;
      }(e4);
  }
  M$1.exports = t2, t2.prototype.on = t2.prototype.addEventListener = function(e4, t3) {
    return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e4] = this._callbacks["$" + e4] || []).push(t3), this;
  }, t2.prototype.once = function(e4, t3) {
    function s3() {
      this.off(e4, s3), t3.apply(this, arguments);
    }
    return s3.fn = t3, this.on(e4, s3), this;
  }, t2.prototype.off = t2.prototype.removeListener = t2.prototype.removeAllListeners = t2.prototype.removeEventListener = function(e4, t3) {
    if (this._callbacks = this._callbacks || {}, 0 == arguments.length)
      return this._callbacks = {}, this;
    var s3, i3 = this._callbacks["$" + e4];
    if (!i3)
      return this;
    if (1 == arguments.length)
      return delete this._callbacks["$" + e4], this;
    for (var n2 = 0; n2 < i3.length; n2++)
      if ((s3 = i3[n2]) === t3 || s3.fn === t3) {
        i3.splice(n2, 1);
        break;
      }
    return this;
  }, t2.prototype.emit = function(e4) {
    this._callbacks = this._callbacks || {};
    var t3 = [].slice.call(arguments, 1), s3 = this._callbacks["$" + e4];
    if (s3)
      for (var i3 = 0, n2 = (s3 = s3.slice(0)).length; i3 < n2; ++i3)
        s3[i3].apply(this, t3);
    return this;
  }, t2.prototype.listeners = function(e4) {
    return this._callbacks = this._callbacks || {}, this._callbacks["$" + e4] || [];
  }, t2.prototype.hasListeners = function(e4) {
    return !!this.listeners(e4).length;
  };
}();
var I$1 = M$1.exports, N$1 = { exports: {} }, T$1 = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof window.msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto);
if (T$1) {
  var O$1 = new Uint8Array(16);
  N$1.exports = function() {
    return T$1(O$1), O$1;
  };
} else {
  var R$1 = new Array(16);
  N$1.exports = function() {
    for (var e3, t2 = 0; t2 < 16; t2++)
      0 == (3 & t2) && (e3 = 4294967296 * Math.random()), R$1[t2] = e3 >>> ((3 & t2) << 3) & 255;
    return R$1;
  };
}
for (var A$1 = [], P$1 = 0; P$1 < 256; ++P$1)
  A$1[P$1] = (P$1 + 256).toString(16).substr(1);
var k$1, _$1, D$1 = function(e3, t2) {
  var s3 = t2 || 0, i3 = A$1;
  return [i3[e3[s3++]], i3[e3[s3++]], i3[e3[s3++]], i3[e3[s3++]], "-", i3[e3[s3++]], i3[e3[s3++]], "-", i3[e3[s3++]], i3[e3[s3++]], "-", i3[e3[s3++]], i3[e3[s3++]], "-", i3[e3[s3++]], i3[e3[s3++]], i3[e3[s3++]], i3[e3[s3++]], i3[e3[s3++]], i3[e3[s3++]]].join("");
}, x$1 = N$1.exports, U$1 = D$1, F$1 = 0, G$1 = 0;
var L$1 = function(e3, t2, s3) {
  var i3 = t2 && s3 || 0, n2 = t2 || [], o2 = (e3 = e3 || {}).node || k$1, r2 = void 0 !== e3.clockseq ? e3.clockseq : _$1;
  if (null == o2 || null == r2) {
    var a3 = x$1();
    null == o2 && (o2 = k$1 = [1 | a3[0], a3[1], a3[2], a3[3], a3[4], a3[5]]), null == r2 && (r2 = _$1 = 16383 & (a3[6] << 8 | a3[7]));
  }
  var c3 = void 0 !== e3.msecs ? e3.msecs : (/* @__PURE__ */ new Date()).getTime(), u2 = void 0 !== e3.nsecs ? e3.nsecs : G$1 + 1, l2 = c3 - F$1 + (u2 - G$1) / 1e4;
  if (l2 < 0 && void 0 === e3.clockseq && (r2 = r2 + 1 & 16383), (l2 < 0 || c3 > F$1) && void 0 === e3.nsecs && (u2 = 0), u2 >= 1e4)
    throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  F$1 = c3, G$1 = u2, _$1 = r2;
  var d3 = (1e4 * (268435455 & (c3 += 122192928e5)) + u2) % 4294967296;
  n2[i3++] = d3 >>> 24 & 255, n2[i3++] = d3 >>> 16 & 255, n2[i3++] = d3 >>> 8 & 255, n2[i3++] = 255 & d3;
  var h3 = c3 / 4294967296 * 1e4 & 268435455;
  n2[i3++] = h3 >>> 8 & 255, n2[i3++] = 255 & h3, n2[i3++] = h3 >>> 24 & 15 | 16, n2[i3++] = h3 >>> 16 & 255, n2[i3++] = r2 >>> 8 | 128, n2[i3++] = 255 & r2;
  for (var p3 = 0; p3 < 6; ++p3)
    n2[i3 + p3] = o2[p3];
  return t2 || U$1(n2);
}, B$1 = N$1.exports, q$1 = D$1;
var j$1 = function(e3, t2, s3) {
  var i3 = t2 && s3 || 0;
  "string" == typeof e3 && (t2 = "binary" === e3 ? new Array(16) : null, e3 = null);
  var n2 = (e3 = e3 || {}).random || (e3.rng || B$1)();
  if (n2[6] = 15 & n2[6] | 64, n2[8] = 63 & n2[8] | 128, t2)
    for (var o2 = 0; o2 < 16; ++o2)
      t2[i3 + o2] = n2[o2];
  return t2 || q$1(n2);
}, H$1 = L$1, V$1 = j$1, z$1 = V$1;
z$1.v1 = H$1, z$1.v4 = V$1;
var W$1 = z$1;
let X$1 = class X {
  support() {
    return true;
  }
  getParams() {
    return this.params;
  }
  setData(e3) {
    this.active = e3.a, this.data = e3.d;
  }
  preConnect(e3) {
  }
  postConnect() {
  }
};
let J$1 = class J {
  static initModule(e3) {
    e3.support() && this.modules.set(e3.name, e3);
  }
  static getParams() {
    return b$1(this, void 0, void 0, function* () {
      let e3 = {};
      for (const [t2, s3] of this.modules)
        e3[t2] = (yield s3.getParams()) || null;
      return e3;
    });
  }
  static setDatas(e3) {
    Object.keys(e3).forEach((t2) => {
      this.modules.get(t2).setData(e3[t2]);
    });
  }
  static preConnect(e3) {
    this.modules.forEach((t2, s3) => {
      t2.preConnect(e3);
    });
  }
  static postConnect() {
    this.modules.forEach((e3, t2) => {
      e3.postConnect();
    });
  }
};
J$1.Module = X$1, J$1.modules = /* @__PURE__ */ new Map();
const Y$1 = I$1;
let $$1 = class $ {
  constructor() {
    this.emitter = new Y$1();
  }
  on(e3, t2) {
    return this.emitter.on(e3, t2), this;
  }
  once(e3, t2) {
    return this.emitter.once(e3, t2), this;
  }
  off(e3, t2) {
    return this.emitter.off(e3, t2), this;
  }
  fire(e3, t2) {
    return this.emitter.emit(e3, t2), this;
  }
};
let Q$1 = class Q {
  constructor() {
    this.eventDriver = new $$1();
  }
  on(e3, t2) {
    this.eventDriver.on(e3, t2);
  }
  off(e3, t2) {
    this.eventDriver.off(e3, t2);
  }
  fire(e3, t2) {
    this.eventDriver.fire(e3, t2);
  }
};
let K$1 = new class {
  isDef(e3) {
    return !this.isUndef(e3);
  }
  isUndef(e3) {
    return null == e3;
  }
  isPrimitive(e3) {
    return "string" == typeof e3 || "number" == typeof e3 || "symbol" == typeof e3 || "boolean" == typeof e3;
  }
  isObject(e3) {
    return null !== e3 && "object" == typeof e3;
  }
  isPlainObject(e3) {
    return "[object Object]" === Object.prototype.toString.call(e3);
  }
  isRegExp(e3) {
    return "[object RegExp]" === Object.prototype.toString.call(e3);
  }
  isValidArrayIndex(e3) {
    let t2 = parseFloat(String(e3));
    return t2 >= 0 && Math.floor(t2) === t2 && isFinite(e3);
  }
  isString(e3) {
    return "string" == typeof e3;
  }
  isNumber(e3) {
    return "number" == typeof e3;
  }
  isStringOrNumber(e3) {
    return this.isString(e3) || this.isNumber(e3);
  }
  isArray(e3) {
    return "[object Array]" === Object.prototype.toString.call(e3);
  }
  isEmpty(e3) {
    return this.isArray(e3) ? 0 === e3.length : this.isObject(e3) ? !this.isDef(e3) : !this.isNumber(e3) && (this.isString(e3) ? "" === e3.trim() : !this.isDef(e3));
  }
  isNative(e3) {
    return "function" == typeof e3 && /native code/.test(e3.toString());
  }
  isFunction(e3) {
    return "function" == typeof e3;
  }
  isBoolean(e3) {
    return "boolean" == typeof e3;
  }
  isTrue(e3) {
    return true === e3;
  }
  isFalse(e3) {
    return false === e3;
  }
  isNull(e3) {
    return null === e3;
  }
}();
const Z$1 = I$1;
let ee$1 = class ee {
  constructor() {
    this.emitter = new Z$1();
  }
  on(e3, t2) {
    if (!K$1.isString(e3))
      throw Error("event require a string.");
    if (!K$1.isFunction(t2))
      throw Error("callback must be a function");
    this.emitter.on(e3, t2);
  }
  fire(e3, t2) {
    this.emitter.emit(e3, t2);
  }
  off(e3, t2) {
    this.emitter.off(e3, t2);
  }
};
let te$1 = class te {
  static init(e3, t2, s3, i3, n2, o2) {
    this.Socket = e3, this.N = t2, this.Member = s3, this.v = i3, this.Platform = n2, this.GModules = o2;
  }
};
const se$1 = W$1;
let ie$1 = class ie {
  static get() {
    return se$1.v1().replace(/-/g, "");
  }
};
var ne$1, oe$1;
(oe$1 = ne$1 || (ne$1 = {})).WRITE = "WRITE", oe$1.READ = "READ", oe$1.NONE = "NONE";
let re$1 = class re {
  constructor(e3) {
    this.permission = ne$1.NONE, this.singleTimeout = 0, this.totalTimeout = 0, this.startTime = 0, this.complete = false, this.retried = 0, this.unique = false, this.uuid = ie$1.get(), this.name = e3.name, this.params = e3.params, this.permission = e3.permission, this.totalTimeout = e3.totalTimeout, this.singleTimeout = e3.singleTimeout, e3.unique && (this.unique = e3.unique), this.success = (t2) => {
      this.complete || (this.end(), e3.success(t2));
    }, this.fail = (t2) => {
      this.complete || (this.end(), e3.fail(t2));
    };
  }
  start() {
    this.startTime = Date.now(), this.initAutoTimeout();
  }
  end() {
    this.complete = true, clearTimeout(this.timeoutHandler);
  }
  initAutoTimeout() {
    this.timeoutHandler = setTimeout(() => {
      this.complete || this.fail({ resultCode: 408, content: "Host unreachable or timeout" });
    }, this.totalTimeout);
  }
};
let ae$1 = class ae extends X$1 {
  static init() {
    return this.module = new ae(), this.module.name = this.GN_MODULE_NAME, this.module;
  }
  static setRegId(e3, t2) {
    if (e3) {
      this.module.regIdPromise = e3;
      let s3 = t2;
      this.module.params = { v: { npv: s3 } };
    }
  }
  preConnect(e3) {
    this.wxmpId = e3.wxmpId;
  }
  getParams() {
    return b$1(this, void 0, void 0, function* () {
      if (this.params = this.params || {}, this.regIdPromise)
        try {
          const e3 = new Promise((e4, t2) => {
            setTimeout(() => t2("timeout"), 1e3);
          });
          this.params.regId = yield Promise.race([this.regIdPromise, e3]);
        } catch (e3) {
          index.__f__("warn", "at node_modules/goeasy/goeasy.esm.min.js:1", "Failed to register the Manufacturers Push service:" + JSON.stringify(e3));
        }
      return this.params.wxmpId = this.wxmpId, this.params;
    });
  }
};
ae$1.GN_MODULE_NAME = "GN";
let ce$1 = class ce {
  static init(e3) {
    this.allowNotification = true === e3;
    let t2 = ae$1.init();
    J$1.initModule(t2), this.supportAppNotification() && (this.uniappPlugin = index.requireNativePlugin("GoEasy-Uniapp"), this.uniappPlugin ? (this.regIdPromise = this.askRegId(), this.v = this.uniappPlugin.v(), ae$1.setRegId(this.regIdPromise, this.v)) : index.__f__("warn", "at node_modules/goeasy/goeasy.esm.min.js:1", "No GoEasy-Uniapp Native Plugin."), this.setClientBadge(0));
  }
  static addAssembler(e3) {
    this.payloadAssemblers.push(e3);
  }
  static assemblePayload(e3) {
    let t2 = this.payloadAssemblers.find((t3) => t3.support(e3));
    return t2 ? t2.assemble(e3) : e3;
  }
  static createLocalNotification(e3, t2, s3, i3, n2) {
    g$1.isBackend() && (s3.g = 1, "undefined" != typeof plus && (i3 ? (this.uniappPlugin && this.uniappPlugin.playSound(i3), plus.push.createMessage(t2, JSON.stringify(s3), { title: e3, sound: "none" })) : plus.push.createMessage(t2, JSON.stringify(s3), { title: e3 }), "+1" === n2 && this.setClientBadge(ce.badge + 1)));
  }
  static setBadge(e3) {
    if (!Number.isInteger(e3.badge) || e3.badge < 0)
      v$1.onFailed(e3, "badge must be an integer greater than or equal to 0.");
    else if (ce.supportAppNotification())
      if (this.uniappPlugin && d$1.currentPlatform() === l$1.UNI_IOS) {
        let t2 = new re$1({ name: y$1.SET_IOS_BADGE, params: { badge: e3.badge }, unique: true, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, permission: ne$1.WRITE, success: () => {
          v$1.onSuccess(e3), this.setClientBadge(e3.badge);
        }, fail: (t3) => {
          v$1.onFailed(e3, t3.content);
        } });
        te$1.Socket.e(t2);
      } else
        v$1.onSuccess(e3), this.setClientBadge(e3.badge);
  }
  static setClientBadge(e3) {
    "vivo" !== plus.device.vendor && (ce.badge = e3, plus.runtime.setBadgeNumber(e3));
  }
  static askRegId() {
    let e3 = null, t2 = 0;
    const s3 = () => new Promise((i3, n2) => {
      this.uniappPlugin.regId((e4) => {
        i3(e4);
      }, (i4) => {
        if (!(1e6 === i4.data.code && t2 <= 10))
          return clearTimeout(e3), n2(i4);
        e3 = setTimeout(() => {
          t2++, this.regIdPromise = s3();
        }, 3500);
      });
    });
    return s3();
  }
  static getRegIdPromise() {
    return this.regIdPromise;
  }
  static supportAppNotification() {
    const e3 = d$1.currentPlatform();
    return this.allowNotification && (e3 === l$1.UNI_ANDROID || e3 === l$1.UNI_IOS);
  }
  static listenPlusClickNotification() {
    plus.push.addEventListener("click", (e3) => {
      try {
        if (e3) {
          const t2 = "string" == typeof e3.payload ? JSON.parse(e3.payload) : e3.payload;
          if (this.availableIntent(t2)) {
            let e4 = this.assemblePayload(t2);
            plus.push.clear(), this.onClickNotificationCallback(e4);
          }
        }
      } catch (e4) {
      }
    });
  }
  static availableIntent(e3) {
    return e3 && Object.keys(e3).length && e3.g && 1 === parseInt(e3.g);
  }
  static getIntentData() {
    this.uniappPlugin.getIntentData((e3) => {
      if (!this.availableIntent(e3))
        return;
      let t2 = this.assemblePayload(e3);
      const s3 = d$1.currentPlatform();
      plus.push.clear(), s3 === l$1.UNI_ANDROID && this.uniappPlugin.clearAll(), this.onClickNotificationCallback(t2);
    });
  }
  static listenClick() {
    this.listenPlusClickNotification();
    const e3 = d$1.currentPlatform();
    this.uniappPlugin && e3 === l$1.UNI_ANDROID && (this.getIntentData(), g$1.onFrontend(() => {
      this.getIntentData();
    }));
  }
  static onClickNotification(e3) {
    if (ce.supportAppNotification()) {
      if (!u$1.isFunction(e3))
        throw new Error("The arguments must be a function.");
      null === this.onClickNotificationCallback ? (this.onClickNotificationCallback = e3, this.listenClick()) : index.__f__("warn", "at node_modules/goeasy/goeasy.esm.min.js:1", "The onClickNotification event has been listened on. Please do not listen to it more than once.");
    } else
      index.__f__("warn", "at node_modules/goeasy/goeasy.esm.min.js:1", "The current environment doesn't support or allowNotification is false.");
  }
};
function ue$1(...e3) {
}
ce$1.uniappPlugin = null, ce$1.v = null, ce$1.regIdPromise = null, ce$1.onClickNotificationCallback = null, ce$1.payloadAssemblers = new Array();
const le$1 = new class {
  validateId(e3, t2) {
    if (u$1.isEmpty(e3))
      throw { code: 400, content: ` ${t2} is required.` };
    if (!u$1.isString(e3))
      throw { code: 400, content: `TypeError: ${t2} require string.` };
  }
  validateIdArray(e3, t2) {
    if (!Array.isArray(e3) || 0 === e3.length)
      throw { code: 400, content: `TypeError: ${t2} require array.` };
    if (e3.length > 100)
      throw { code: 400, content: `${t2} is over max length 100.` };
    for (let s3 = 0; s3 < e3.length; s3++) {
      if (!u$1.isStringOrNumber(e3[s3]))
        throw { code: 400, content: `TypeError: ${t2} item require string or number.` };
      if (u$1.isNumber(e3[s3]) && (e3[s3] = e3[s3].toString()), 0 == e3[s3].length)
        throw { code: 400, content: `${t2} has empty item.` };
    }
    if (Array.from(new Set(e3)).length < e3.length)
      throw { code: 400, content: `Duplicate element in ${t2}` };
  }
  validateChannel(e3, t2) {
    if (u$1.isEmpty(e3))
      throw { code: 400, content: ` ${t2} is required.` };
    if (!u$1.isStringOrNumber(e3))
      throw { code: 400, content: `TypeError: ${t2} require string or number.` };
  }
  validateChannelArray(e3, t2) {
    this.validateIdArray(e3, t2);
  }
  validateChannelAndChannels(e3, t2) {
    let s3 = !u$1.isEmpty(e3), i3 = !u$1.isEmpty(t2);
    if (!s3 && !i3)
      throw { code: 400, content: "channel is required." };
    if (s3 && i3)
      throw { code: 400, content: "subscribe to either channel or channels, not both." };
    s3 && this.validateChannel(e3, "channel"), i3 && this.validateChannelArray(t2, "channels");
  }
  validateCallbackOptions(e3) {
    if (!u$1.isObject(e3))
      throw { code: 400, content: "bad parameters" };
  }
  validateNotification(e3) {
    function t2(e4, t3, s4) {
      if (!(u$1.isString(e4[t3]) && e4[t3].length <= s4))
        throw { code: 400, content: `notification.${t3} must be a string of no more than ${s4} characters` };
    }
    function s3(e4, t3, s4, i3) {
      let n2 = e4[t3];
      if (u$1.isObject(n2) && u$1.isDef(n2[s4])) {
        let e5 = { code: 400, content: `notification.vendorOptions.${t3}.${s4} require a ${i3}}` }, o2 = n2[s4];
        if ("string" === i3 && !u$1.isString(o2))
          throw e5;
        if ("number" === i3 && !u$1.isNumber(o2))
          throw e5;
      }
    }
    if (!u$1.isObject(e3))
      throw { code: 400, content: "TypeError: notification requires an object." };
    {
      if (t2(e3, "title", 32), t2(e3, "body", 50), u$1.isDef(e3.sound) && !u$1.isString(e3.sound))
        throw { code: 400, content: "notification.sound must be a string" };
      if (u$1.isDef(e3.badge) && !u$1.isString(e3.badge))
        throw { code: 400, content: "notification.badge must be a string" };
      e3.badge = e3.badge || "0";
      let i3 = e3.vendorOptions;
      u$1.isObject(i3) && (s3(i3, "huawei", "category", "string"), s3(i3, "xiaomi", "channel_id", "string"), s3(i3, "oppo", "channel_id", "string"), s3(i3, "vivo", "classification", "number"), s3(i3, "vivo", "category", "string"));
    }
  }
  validateValIsEmpty(e3, t2) {
    if (u$1.isUndef(e3) || u$1.isEmpty(e3))
      throw { code: 400, content: `${t2} is empty` };
  }
  validateWXMPTemplateMsg(e3) {
    if (u$1.isObject(e3)) {
      if (!u$1.isString(e3.template_id))
        throw { code: 400, content: "template_id must be string." };
      if (!u$1.isEmpty(e3.url) && !u$1.isString(e3.url))
        throw { code: 400, content: "url must be string" };
      if (!(u$1.isEmpty(e3.miniprogram) || u$1.isString(e3.miniprogram.appid) && u$1.isString(e3.miniprogram.pagepath)))
        throw { code: 400, content: "miniprogram.appid and miniprogram.pagepath must be strings." };
      if (!u$1.isObject(e3.data))
        throw { code: 400, content: "data requires an object." };
    } else if (u$1.isPrimitive(e3))
      throw { code: 400, content: "wxmpTemplateMsg must be an object." };
  }
  validateObject(e3, t2) {
    if (u$1.isUndef(e3) || !u$1.isObject(e3))
      throw { code: 400, content: t2 + " must be an object." };
  }
  validateString(e3, t2) {
    if (u$1.isUndef(e3) || !u$1.isString(e3))
      throw { code: 400, content: t2 + " must be a string." };
  }
}();
function de$1(e3) {
  if (null === e3 || "object" != typeof e3 || "isActiveClone" in e3)
    return e3;
  let t2 = e3 instanceof Array ? [] : {};
  for (let s3 in e3)
    "object" == typeof e3[s3] ? t2[s3] = de$1(e3[s3]) : t2[s3] = e3[s3];
  return t2;
}
let he$1 = class he {
  publish(e3) {
    u$1.isFunction(e3.onFailed) || (e3.onFailed = ue$1), u$1.isFunction(e3.onSuccess) || (e3.onSuccess = ue$1), this.validate(e3), e3.channel = e3.channel.toString();
    let t2 = { channel: e3.channel, content: e3.message, nt: e3.notification, at: e3.accessToken, guid: ie$1.get(), q: e3.qos };
    e3.wxmpTemplateMsg && (t2.wxmpTemplateMsg = de$1(e3.wxmpTemplateMsg), t2.wxmpTemplateMsg.data = JSON.stringify(t2.wxmpTemplateMsg.data));
    let s3 = new re$1({ name: y$1.publish, params: t2, unique: true, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, permission: ne$1.WRITE, success: function(t3) {
      e3.onSuccess({ code: 200, content: "ok" });
    }, fail: function(t3) {
      e3.onFailed({ code: t3.resultCode, content: t3.content });
    } });
    te$1.Socket.e(s3);
  }
  validate(e3) {
    if (le$1.validateChannel(e3.channel, "channel"), u$1.isEmpty(e3.message))
      throw { code: 400, content: "message is required." };
    if (!u$1.isString(e3.message))
      throw { code: 400, content: "TypeError: message requires string." };
    if (e3.message.length > 1e4)
      throw { code: 400, content: "Message over max length 10000." };
    if (e3.qos && !(e3.qos in [0, 1]))
      throw { code: 400, content: "Qos must be 0 or 1." };
    e3.wxmpTemplateMsg && le$1.validateWXMPTemplateMsg(e3.wxmpTemplateMsg), u$1.isDef(e3.notification) && le$1.validateNotification(e3.notification);
  }
};
let pe$1 = class pe {
  constructor(e3) {
    if (this.options = e3, this.channels = e3.channels || [e3.channel], !u$1.isEmpty(e3.channel)) {
      let t2 = e3.channel.toString();
      this.channels = [t2];
    }
    u$1.isEmpty(e3.channels) || (this.channels = e3.channels.toString().split(","));
  }
};
var me$1, fe$1, ge$1;
!function(e3) {
  e3.message = "message", e3.imMessage = "imMessage", e3.userPresence = "userPresence", e3.groupPresence = "groupPresence", e3.PS_PRESENCE_EVENT = "PS_PRESENCE_EVENT", e3.IM_MSG_READ = "IM_MSG_READ", e3.IM_MSG_DELETED = "IM_MSG_DELETED", e3.IM_MSG_RECALLED = "IM_MSG_RECALLED", e3.CS_ONLINE_CHANGED = "CS_ONLINE_CHANGED";
}(me$1 || (me$1 = {})), function(e3) {
  e3.CONNECTED = "CONNECTED", e3.RECONNECTED = "RECONNECTED", e3.DISCONNECTED = "DISCONNECTED", e3.LOST = "LOST", e3.EXPIRED_RECONNECTED = "EXPIRED_RECONNECTED", e3.NEW_MESSAGE = "NEW_MESSAGE", e3.CONNECTING = "CONNECTING";
}(fe$1 || (fe$1 = {}));
let ye$1 = class ye {
  constructor() {
    this.subscriptions = [], te$1.Socket.onMessage(me$1.message, this.onNewMessage.bind(this)), te$1.Socket.on(fe$1.EXPIRED_RECONNECTED, this.expiredResubscribe.bind(this)), te$1.Socket.on(fe$1.RECONNECTED, this.resubscribePresenceChannel.bind(this));
  }
  expiredResubscribe() {
    this.subscriptions.forEach((e3) => {
      this.doSubscribe(e3, false);
    });
  }
  resubscribePresenceChannel() {
    this.subscriptions.forEach((e3) => {
      let t2 = e3.options;
      t2.presence && t2.presence.enable && this.doSubscribe(e3, true);
    });
  }
  onNewMessage(e3) {
    if (e3.n.indexOf("_presence") > -1)
      return;
    e3.a && te$1.Socket.sendAck("ack", { i: e3.i, c: e3.n });
    let t2 = { time: e3.t, channel: e3.n, content: e3.c };
    this.createNotification(e3), this.findSubscriptionByChannel(t2.channel).options.onMessage(t2);
  }
  createNotification(e3) {
    const t2 = te$1.N.supportAppNotification();
    if (!u$1.isObject(e3.nt) || !t2)
      return;
    const s3 = { ch: e3.n, ctt: e3.c };
    te$1.N.createLocalNotification(e3.nt.t, e3.nt.c, s3, e3.nt.sound, e3.nt.badge);
  }
  subscribe(e3) {
    if (le$1.validateChannelAndChannels(e3.channel, e3.channels), u$1.isDef(e3.presence)) {
      let t3 = e3.presence.enable;
      if (!u$1.isBoolean(t3))
        throw { code: 400, content: "Subscription failed. presence.enable must be a boolean" };
      if (t3 && !te$1.Socket.user().id)
        throw { code: 400, content: "Subscription failed. If presence is enable, the id must be specified when calling the connect method" };
    }
    let t2 = new pe$1(e3);
    this.doSubscribe(t2, false).then(() => {
      this.subscriptions.push(t2), v$1.onSuccess(e3, { code: 200, content: "ok" });
    }).catch((t3) => {
      v$1.onFailed(e3, { code: t3.resultCode, content: t3.content });
    });
  }
  doSubscribe(e3, t2) {
    let s3 = e3.options;
    return new Promise((i3, n2) => {
      let o2 = new re$1({ name: y$1.subscribe, permission: ne$1.READ, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, params: { channels: e3.channels, accessToken: s3.accessToken, presence: s3.presence, resubscribe: t2 }, success: () => {
        i3();
      }, fail: (e4) => {
        n2(e4);
      } });
      te$1.Socket.e(o2);
    });
  }
  unsubscribe(e3) {
    le$1.validateChannel(e3.channel, "channel"), e3.channel = e3.channel.toString();
    const t2 = this.findSubscriptionByChannel(e3.channel);
    if (!t2)
      return void e3.onFailed({ code: 400, content: "channel[" + e3.channel + "] is not subscribed" });
    let s3 = new re$1({ name: y$1.unsubscribe, params: { channel: e3.channel, presence: t2.options.presence }, permission: ne$1.READ, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: () => {
      e3.onSuccess({ code: 200, content: "ok" }), this.removeChannel(e3.channel);
    }, fail: function(t3) {
      e3.onFailed({ code: t3.resultCode, content: t3.content });
    } });
    te$1.Socket.e(s3);
  }
  removeChannel(e3) {
    for (let t2 = this.subscriptions.length - 1; t2 >= 0; t2--) {
      const s3 = this.subscriptions[t2].channels, i3 = s3.indexOf(e3);
      if (i3 > -1) {
        s3.splice(i3, 1), 0 === s3.length && this.subscriptions.splice(t2, 1);
        break;
      }
    }
  }
  findSubscriptionByChannel(e3) {
    let t2 = false, s3 = null;
    for (let i3 = this.subscriptions.length - 1; i3 >= 0; i3--) {
      let n2 = this.subscriptions[i3].channels;
      for (let o2 = 0; o2 < n2.length; o2++)
        if (n2[o2] == e3) {
          t2 = true, s3 = this.subscriptions[i3];
          break;
        }
      if (t2)
        break;
    }
    return s3;
  }
};
let Se$1 = class Se {
  get(e3) {
    u$1.isFunction(e3.onSuccess) || (e3.onSuccess = ue$1), u$1.isFunction(e3.onFailed) || (e3.onFailed = ue$1), le$1.validateChannel(e3.channel, "channel"), e3.channel = e3.channel.toString();
    let t2 = new re$1({ name: y$1.historyMessages, permission: ne$1.READ, params: e3, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, success: (t3) => {
      e3.onSuccess({ code: t3.resultCode || t3.code || 200, content: t3.content });
    }, fail: (t3) => {
      e3.onFailed({ code: t3.resultCode || t3.code, content: t3.content });
    } });
    te$1.Socket.e(t2);
  }
};
let Ee$1 = class Ee {
  constructor() {
    this.channelPresenceMap = /* @__PURE__ */ new Map(), this.onPresenceEvent = (e3) => {
      let t2 = this.channelPresenceMap.get(e3.channel);
      null == t2 || t2.onPresence(e3);
    }, this.expireAllChannelPresences = () => {
      this.channelPresenceMap.forEach((e3, t2) => {
        e3.expire();
      });
    }, this.resubscribe = () => {
      this.channelPresenceMap.forEach((e3, t2) => {
        e3.subscribed() && e3.doSubscribe();
      });
    }, te$1.Socket.on(fe$1.LOST, this.expireAllChannelPresences), te$1.Socket.on(fe$1.RECONNECTED, this.resubscribe), te$1.Socket.onMessage(me$1.PS_PRESENCE_EVENT, this.onPresenceEvent);
  }
  hereNow(e3) {
    le$1.validateChannel(e3.channel, "channel");
    let t2, s3 = this.channelPresenceMap.get(e3.channel.toString());
    s3 && s3.queryPromise ? (e3.limit && e3.limit > s3.membersLimit && s3.doQuery(e3.limit), t2 = s3.queryPromise) : t2 = be$1(e3.channel, e3.limit), t2.then((t3) => {
      e3.onSuccess(t3);
    }).catch((t3) => {
      e3.onFailed(t3);
    });
  }
  subscribe(e3) {
    if (le$1.validateChannel(e3.channel, "channel"), u$1.isUndef(e3.onPresence) || !u$1.isFunction(e3.onPresence))
      throw { code: 400, content: "Subscription Presence failed. onPresence callback function is required" };
    let t2 = e3.channel.toString(), s3 = this.channelPresenceMap.get(t2);
    s3 || (s3 = new ve$1(t2), this.channelPresenceMap.set(t2, s3)), s3.subscribe(e3);
  }
  unsubscribe(e3) {
    le$1.validateChannel(e3.channel, "channel");
    let t2 = e3.channel.toString();
    if (this.channelPresenceMap.get(t2)) {
      let s3 = new re$1({ name: y$1.PUBSUB_PRESENCE_UNSUBSCRIBE, permission: ne$1.READ, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, params: { channel: t2 }, success: (s4) => {
        this.channelPresenceMap.delete(t2), e3.onSuccess();
      }, fail: (t3) => {
        e3.onFailed(t3);
      } });
      te$1.Socket.e(s3);
    } else
      e3.onSuccess();
  }
};
let ve$1 = class ve {
  constructor(e3) {
    this.membersLimit = 10, this.queried = false, this.channel = e3;
  }
  onPresence(e3) {
    return b$1(this, void 0, void 0, function* () {
      this.queried ? this.update(e3) : yield this.queryPromise, this.on({ channel: this.channel, action: e3.action, member: e3.member, time: e3.time, amount: this.amount, members: this.membersByLimit() });
    });
  }
  membersByLimit() {
    return this.members.slice(0, this.membersLimit);
  }
  subscribe(e3) {
    return b$1(this, void 0, void 0, function* () {
      if (e3.membersLimit && (this.membersLimit = Math.min(e3.membersLimit, 300)), !this.subscribed())
        try {
          yield this.doSubscribe();
        } catch (t2) {
          return void e3.onFailed(t2);
        }
      this.on = e3.onPresence, e3.onSuccess();
    });
  }
  doSubscribe() {
    return this.doQuery(this.membersLimit), new Promise((e3, t2) => {
      let s3 = new re$1({ name: y$1.PUBSUB_PRESENCE_SUBSCRIBE, permission: ne$1.READ, params: { channel: this.channel }, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: (t3) => {
        e3();
      }, fail: (e4) => {
        t2(e4);
      } });
      te$1.Socket.e(s3);
    });
  }
  doQuery(e3) {
    this.queryPromise = be$1(this.channel, e3), this.queryPromise.then((e4) => {
      this.members = e4.content.members, this.amount = e4.content.amount, this.queried = true;
    }).catch((e4) => {
      throw e4;
    });
  }
  update(e3) {
    if (["join", "back"].includes(e3.action))
      this.members.unshift(e3.member);
    else if (["leave", "timeout"].includes(e3.action)) {
      let t2 = this.members.findIndex((t3) => t3.id === e3.member.id);
      t2 > -1 && this.members.splice(t2, 1);
    }
    this.amount = e3.amount;
  }
  expire() {
    this.queried = false, this.queryPromise = null;
  }
  subscribed() {
    return void 0 !== this.on;
  }
};
function be$1(e3, t2) {
  return t2 || (t2 = 10), new Promise((s3, i3) => {
    let n2 = { channel: e3, limit: t2 }, o2 = new re$1({ name: y$1.PUBSUB_PRESENCE_HERENOW, permission: ne$1.READ, params: n2, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, success: (e4) => {
      s3(e4);
    }, fail: (e4) => {
      i3(e4);
    } });
    te$1.Socket.e(o2);
  });
}
let Ce$1 = class Ce {
  constructor() {
    this.publisher = new he$1(), this.subscriber = new ye$1(), this.presence2 = new Ee$1(), this.histories = new Se$1();
  }
  static init() {
    this.instance = new Ce();
  }
  publish(e3) {
    this.publisher.publish(e3);
  }
  subscribe(e3) {
    this.subscriber.subscribe(e3);
  }
  unsubscribe(e3) {
    this.subscriber.unsubscribe(e3);
  }
  subscribePresence(e3) {
    this.presence2.subscribe(e3);
  }
  unsubscribePresence(e3) {
    this.presence2.unsubscribe(e3);
  }
  history(e3) {
    this.histories.get(e3);
  }
  hereNow(e3) {
    this.presence2.hereNow(e3);
  }
};
let we$1 = class we extends X$1 {
  static init() {
    return this.module = new we(), this.module.name = this.GWS_MODULE_NAME, this.initGN(), this.module;
  }
  static initGN() {
    ce$1.addAssembler(new class {
      assemble(e3) {
        return { channel: e3.ch, content: e3.ctt };
      }
      support(e3) {
        return !!e3.ch;
      }
    }());
  }
  postConnect() {
    Ce$1.init();
  }
  static check() {
    if (!this.module)
      throw { code: 400, content: "PubSub not initialized. Please include 'PUBSUB' in the 'modules' during GoEasy initialization." };
  }
};
we$1.GWS_MODULE_NAME = "GWS";
let Me$1 = class Me {
  constructor() {
  }
};
!function(e3) {
  e3.aliYun = "ALI", e3.qiNiu = "QN", e3.tencent = "TX", e3.s3 = "S3";
}(ge$1 || (ge$1 = {}));
let Ie$1 = new class extends Me$1 {
  constructor() {
    super();
  }
  upload(e3, t2) {
    try {
      return e3.storageLocation === ge$1.s3 ? this.uploadToS3(e3, t2) : (delete e3.parameters.fileRes, new Promise((s3, i3) => {
        index.uploadFile({ url: e3.host, filePath: this.getTempFilePath(e3), name: "file", formData: e3.parameters, success(e4) {
          200 === e4.statusCode ? s3() : i3({ code: e4.statusCode, content: e4.errMsg });
        }, fail(e4) {
          i3({ code: 500, content: e4.errMsg });
        } }).onProgressUpdate((e4) => {
          t2 && t2(e4);
        });
      }));
    } catch (e4) {
      return new Promise((t3, s3) => {
        s3({ code: 500, content: e4 });
      });
    }
  }
  getTempFilePath(e3) {
    let t2 = e3.file;
    return t2.tempFilePath || t2.fullPath || t2.path;
  }
  uploadToS3(e3, t2) {
    return new Promise((t3, s3) => b$1(this, void 0, void 0, function* () {
      const i3 = yield this.fileToArrayBuffer(e3);
      index.request({ url: e3.url, method: "PUT", header: e3.headers, data: i3, success(i4) {
        200 === i4.statusCode ? (e3.storageLocation === ge$1.s3 && (e3.url = e3.url.split("?")[0]), t3()) : s3({ code: i4.statusCode, content: i4.errMsg });
      }, fail(e4) {
        s3({ code: 500, content: e4.errMsg });
      } });
    }));
  }
  fileToArrayBuffer(e3) {
    return new Promise((t2, s3) => {
      const i3 = this.getTempFilePath(e3);
      if ("undefined" != typeof plus)
        plus.io.resolveLocalFileSystemURL(i3, (e4) => {
          e4.file((e5) => {
            let i4 = new plus.io.FileReader();
            i4.onloadend = (e6) => {
              const s4 = index.base64ToArrayBuffer(e6.target.result.split(",")[1]);
              t2(s4);
            }, i4.onerror = function(e6) {
              s3(e6);
            }, i4.readAsDataURL(e5);
          });
        }, (e4) => {
          s3("Resolve file URL failed: " + e4.message);
        });
      else if ("undefined" != typeof FileReader) {
        const i4 = new FileReader();
        i4.onload = () => {
          t2(i4.result);
        }, i4.onerror = (e4) => {
          s3(e4);
        }, i4.readAsArrayBuffer(e3.file);
      } else if ("object" == typeof wx$1 && wx$1.canIUse("getFileSystemManager"))
        try {
          const e4 = wx$1.getFileSystemManager().readFileSync(i3);
          t2(e4);
        } catch (e4) {
          s3(e4);
        }
    });
  }
}();
const Ne$1 = new class extends Me$1 {
  upload(e3, t2) {
    try {
      return e3.storageLocation === ge$1.s3 ? this.uploadToS3(e3, t2) : new Promise((s3, i3) => {
        wx$1.uploadFile({ url: e3.host, filePath: this.getTempFilePath(e3), name: "file", formData: e3.parameters, success(e4) {
          200 === e4.statusCode ? s3() : i3({ code: e4.statusCode, content: e4.errMsg });
        }, fail(e4) {
          i3({ code: 500, content: e4.errMsg });
        } }).onProgressUpdate((e4) => {
          t2 && t2(e4);
        });
      });
    } catch (e4) {
      return new Promise((t3, s3) => {
        s3({ code: 500, content: e4 });
      });
    }
  }
  getTempFilePath(e3) {
    let t2 = e3.file || e3.fileRes;
    return t2.path || t2.tempFilePath;
  }
  uploadToS3(e3, t2) {
    return new Promise((t3, s3) => b$1(this, void 0, void 0, function* () {
      const i3 = yield this.fileToArrayBuffer(this.getTempFilePath(e3));
      wx$1.request({ url: e3.url, method: "PUT", header: e3.headers, data: i3, success(i4) {
        200 === i4.statusCode ? (e3.storageLocation === ge$1.s3 && (e3.url = e3.url.split("?")[0]), t3()) : s3({ code: i4.statusCode, content: i4.errMsg });
      }, fail(e4) {
        s3({ code: 500, content: e4.errMsg });
      } });
    }));
  }
  fileToArrayBuffer(e3) {
    return new Promise((t2, s3) => {
      try {
        const s4 = wx$1.getFileSystemManager();
        t2(s4.readFileSync(e3));
      } catch (e4) {
        s3(e4);
      }
    });
  }
}();
const Te$1 = new class extends Me$1 {
  constructor() {
    super();
  }
  upload(e3, t2) {
    return new Promise((s3, i3) => {
      try {
        const n2 = new XMLHttpRequest(), o2 = e3.storageLocation === ge$1.s3, r2 = o2 ? "PUT" : "POST", a3 = o2 ? e3.url : e3.host;
        n2.open(r2, a3, true);
        for (let t3 in e3.headers)
          n2.setRequestHeader(t3, e3.headers[t3]);
        n2.upload.onprogress = function(e4) {
          t2 && t2(e4);
        }, n2.upload.onloadstart = function(e4) {
          t2 && t2(e4);
        }, n2.upload.onloadend = function(e4) {
          t2 && t2(e4);
        };
        let c3 = new FormData();
        for (let t3 in e3.parameters)
          "fileRes" == t3 ? c3.append("file", e3.parameters[t3]) : c3.append(t3, e3.parameters[t3]);
        const u2 = o2 ? e3.file : c3;
        n2.send(u2), n2.onreadystatechange = function() {
          4 == n2.readyState && (n2.status >= 200 && n2.status < 300 || 304 == n2.status ? (o2 && (e3.url = e3.url.split("?")[0]), s3()) : i3({ code: n2.status, content: n2.responseText }));
        };
      } catch (e4) {
        i3({ code: 500, content: e4 });
      }
    });
  }
  fileToArrayBuffer(e3) {
    return new Promise((t2, s3) => {
      const i3 = new FileReader();
      i3.onload = () => {
        t2(i3.result);
      }, i3.onerror = (e4) => {
        s3(e4);
      }, i3.readAsArrayBuffer(e3);
    });
  }
}();
const Oe$1 = new class extends Me$1 {
  upload(e3, t2) {
    try {
      return e3.storageLocation === ge$1.s3 ? this.uploadToS3(e3, t2) : (delete e3.parameters.fileRes, new Promise((s3, i3) => {
        my.uploadFile({ url: e3.host, filePath: this.getTempFilePath(e3), fileType: "image", name: "file", formData: e3.parameters, success(e4) {
          200 === e4.statusCode ? s3() : i3({ code: e4.statusCode, content: e4.errMsg });
        }, fail(e4) {
          i3({ code: 500, content: e4.errMsg });
        } }).onProgressUpdate((e4) => {
          t2 && t2(e4);
        });
      }));
    } catch (e4) {
      return new Promise((t3, s3) => {
        s3({ code: 500, content: e4 });
      });
    }
  }
  getTempFilePath(e3) {
    let t2 = e3.file;
    return t2.path || t2.tempFilePath;
  }
  uploadToS3(e3, t2) {
    return new Promise((t3, s3) => b$1(this, void 0, void 0, function* () {
      const i3 = yield this.fileToArrayBuffer(this.getTempFilePath(e3));
      my.request({ url: e3.url, method: "PUT", header: e3.headers, data: i3, success(i4) {
        200 === i4.statusCode ? (e3.storageLocation === ge$1.s3 && (e3.url = e3.url.split("?")[0]), t3()) : s3({ code: i4.statusCode, content: i4.errMsg });
      }, fail(e4) {
        s3({ code: 500, content: e4.errMsg });
      } });
    }));
  }
  fileToArrayBuffer(e3) {
    return new Promise((t2, s3) => {
      my.getFileSystemManager().readFile({ filePath: e3, success: (e4) => {
        t2(e4.data);
      }, fail(e4) {
        s3(e4);
      } });
    });
  }
}();
const Re$1 = new class extends Me$1 {
  upload(e3, t2) {
    try {
      return e3.storageLocation === ge$1.s3 ? this.uploadToS3(e3, t2) : (delete e3.parameters.fileRes, new Promise((s3, i3) => {
        swan.uploadFile({ url: e3.host, filePath: this.getTempFilePath(e3), name: "file", formData: e3.parameters, success(e4) {
          200 === e4.statusCode ? s3() : i3({ code: e4.statusCode, content: e4.errMsg });
        }, fail(e4) {
          i3({ code: 500, content: e4.errMsg });
        } }).onProgressUpdate((e4) => {
          t2 && t2(e4);
        });
      }));
    } catch (e4) {
      return new Promise((t3, s3) => {
        s3({ code: 500, content: e4 });
      });
    }
  }
  getTempFilePath(e3) {
    let t2 = e3.file;
    return t2.path || t2.tempFilePath;
  }
  uploadToS3(e3, t2) {
    return new Promise((t3, s3) => b$1(this, void 0, void 0, function* () {
      const i3 = yield this.fileToArrayBuffer(this.getTempFilePath(e3));
      swan.request({ url: e3.url, method: "PUT", header: e3.headers, data: i3, success(i4) {
        200 === i4.statusCode ? (e3.storageLocation === ge$1.s3 && (e3.url = e3.url.split("?")[0]), t3()) : s3({ code: i4.statusCode, content: i4.errMsg });
      }, fail(e4) {
        s3({ code: 500, content: e4.errMsg });
      } });
    }));
  }
  fileToArrayBuffer(e3) {
    return new Promise((t2, s3) => {
      swan.getFileSystemManager().readFile({ filePath: e3, success: (e4) => {
        t2(e4.data);
      }, fail: (e4) => {
        s3(e4);
      } });
    });
  }
}();
let Ae$1 = class Ae {
  constructor(e3, t2, s3) {
    this.storageLocation = e3, this.url = t2, this.name = s3;
  }
};
const Pe$1 = new class {
  constructor() {
    this.uploader = { [e$1.UNIAPP]: Ie$1, [l$1.MP_WX]: Ne$1, [l$1.BROWSER]: Te$1, [l$1.MP_ALI]: Oe$1, [l$1.MP_BAIDU]: Re$1, [e$1.REACT_NATIVE]: Te$1, [l$1.MP_BYTE]: Ne$1 };
  }
  upload(t2, i3) {
    return b$1(this, void 0, void 0, function* () {
      const n2 = s$1.currentFramework(), o2 = d$1.currentPlatform(), r2 = n2 === e$1.UNKNOWN ? o2 : n2;
      let a3 = this.uploader[r2];
      return yield a3.upload(t2, i3), new Ae$1(t2.storageLocation, t2.url, t2.newFileName);
    });
  }
}();
let ke$1 = class ke {
  resolve(e3) {
    return new Promise((t2, s3) => {
      let i3 = new re$1({ name: "uploadToken", params: { filename: e3 }, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail(e4) {
        s3(e4.content);
      }, success(e4) {
        200 === e4.code ? t2(e4.content) : s3(e4.content);
      } });
      te$1.Socket.e(i3);
    });
  }
};
let _e$1 = class _e {
  constructor(e3, t2, s3, i3, n2, o2, r2) {
    this.storageLocation = e3, this.host = t2, this.headers = s3, this.parameters = i3, this.file = n2, this.newFileName = o2, this.url = r2;
  }
};
let De$1 = class De {
  constructor() {
  }
  newFileName(e3) {
    return e3 && e3.newFilename || "";
  }
};
let xe$1 = new class extends De$1 {
  constructor() {
    super();
  }
  url(e3) {
    return e3.host + "/" + e3.dir + "/" + this.newFileName(e3);
  }
  build(e3, t2, s3) {
    let i3, n2 = this.newFileName(e3);
    return i3 = { key: e3.dir + "/" + n2, OSSAccessKeyId: e3.accessKeyId, policy: e3.policy, signature: e3.signature, success_action_status: "200", fileRes: t2 }, s3 && (i3 = { key: e3.dir + "/" + n2, OSSAccessKeyId: e3.accessKeyId, policy: e3.policy, signature: e3.signature, success_action_status: "200", "Content-Disposition": "attachment;filename=" + t2.name, fileRes: t2 }), new _e$1(ge$1.aliYun, e3.host, null, i3, t2, n2, this.url(e3));
  }
}();
let Ue$1 = new class extends De$1 {
  constructor() {
    super();
  }
  url(e3) {
    return e3.host + "/" + e3.key;
  }
  build(e3, t2, s3) {
    let i3 = { "q-sign-algorithm": e3.qSignAlgorithm, "q-ak": e3.qAk, "q-key-time": e3.qKeyTime, "q-signature": e3.qSignature, policy: e3.policy, "x-cos-security-token": e3.xCosSecurityToken, success_action_status: "200", key: e3.key, fileRes: t2 };
    return s3 && (i3 = { "q-sign-algorithm": e3.qSignAlgorithm, "q-ak": e3.qAk, "q-key-time": e3.qKeyTime, "q-signature": e3.qSignature, policy: e3.policy, "x-cos-security-token": e3.xCosSecurityToken, success_action_status: "200", key: e3.key, "Content-Disposition": `attachment;filename=${t2.name}`, fileRes: t2 }), new _e$1(ge$1.tencent, e3.host, null, i3, t2, e3.key, this.url(e3));
  }
}();
let Fe$1 = new class extends De$1 {
  constructor() {
    super();
  }
  url(e3) {
    return e3.uploadUrl;
  }
  build(e3, t2, s3) {
    const i3 = { file: t2 };
    return new _e$1(ge$1.s3, null, { "Content-Type": "application/octet-stream" }, i3, t2, t2.name, this.url(e3));
  }
}();
let Ge$1 = class Ge {
  constructor() {
    this.uploadTokenResolver = new ke$1();
  }
  builder(e3) {
    if (e3 === ge$1.aliYun)
      return xe$1;
    if (e3 === ge$1.tencent)
      return Ue$1;
    if (e3 === ge$1.s3)
      return Fe$1;
    throw new Error("Only Ali OSS and Tencent COS are supported, unknown storage location:" + e3);
  }
  build(e3, t2, s3) {
    return b$1(this, void 0, void 0, function* () {
      try {
        let i3 = yield this.uploadTokenResolver.resolve(t2), n2 = this.builder(i3.vendor).build(i3, e3, s3);
        return Promise.resolve(n2);
      } catch (e4) {
        return Promise.reject(e4);
      }
    });
  }
};
let Le$1 = class Le {
  constructor() {
    this.requestBuilder = new Ge$1(), this.fileUploader = Pe$1;
  }
  upload(e3, t2, s3, i3) {
    return b$1(this, void 0, void 0, function* () {
      try {
        let n2 = yield this.requestBuilder.build(e3, t2, i3);
        return this.fileUploader.upload(n2, s3);
      } catch (e4) {
        return Promise.reject(e4);
      }
    });
  }
};
var Be$1, qe$1, je$1, He$1;
!function(e3) {
  e3.MESSAGE_SENDING = "IM_INTERNAL_MESSAGE_SENDING", e3.MESSAGE_SEND_SUCCESS = "IM_INTERNAL_MESSAGE_SEND_SUCCESS", e3.MESSAGE_SEND_FAILED = "IM_INTERNAL_MESSAGE_SEND_FAILED", e3.MESSAGE_RECEIVED = "IM_INTERNAL_MESSAGE_RECEIVED", e3.MESSAGE_RECALLED = "IM_INTERNAL_MESSAGE_RECALLED", e3.MAX_MESSAGE_CHANGED = "IM_INTERNAL_MAX_MESSAGE_CHANGED", e3.MAX_MESSAGE_DELETED = "IM_INTERNAL_MAX_MESSAGE_DELETED", e3.UNREAD_AMOUNT_CHANGED = "IM_INTERNAL_UNREAD_MESSAGE_CHANGED", e3.CS_ONLINE_SUCCESS = "CS_ONLINE_SUCCESS", e3.CS_OFFLINE_SUCCESS = "CS_OFFLINE_SUCCESS", e3.CS_ACCEPTED = "CS_ACCEPTED", e3.CS_ENDED = "CS_ENDED", e3.CS_TRANSFER = "CS_TRANSFER", e3.CS_AGENT_MESSAGE_RECEIVED = "CS_AGENT_MESSAGE_RECEIVED";
}(Be$1 || (Be$1 = {}));
let Ve$1 = class Ve {
  clearUseLessAttribute() {
    delete this.buildOptions;
  }
  isOtherSent() {
    return this.senderId !== te$1.Socket.user().id;
  }
  getToData() {
    return this.buildOptions.createOptions.to.data;
  }
};
let ze$1 = class ze {
};
!function(e3) {
  e3.TEXT = "text", e3.IMAGE = "image", e3.FILE = "file", e3.VIDEO = "video", e3.AUDIO = "audio";
}(qe$1 || (qe$1 = {}));
let We$1 = class We extends ze$1 {
  constructor() {
    super(...arguments), this.goEasyUploader = new Le$1();
  }
  improve(e3) {
    let t2 = e3.message;
    return new Promise((e4, s3) => {
      let i3, n2, o2 = t2.buildOptions.createOptions;
      t2.type === qe$1.VIDEO ? (n2 = t2.payload, i3 = n2.video.name) : (n2 = t2.payload, i3 = n2.name), this.goEasyUploader.upload(o2.file, i3, o2.onProgress, t2.type === qe$1.FILE).then((s4) => {
        s4.storageLocation !== ge$1.s3 && (s4.url = encodeURI(s4.url)), this.setPayload(s4, t2), e4();
      }).catch((e5) => {
        s3(e5);
      });
    });
  }
  setPayload(e3, t2) {
    t2.payload.url = e3.url;
  }
};
let Xe$1 = class Xe extends We$1 {
  setPayload(e3, t2) {
    let s3, i3 = t2.payload;
    switch (i3.video.url = e3.url, i3.video.name = e3.name, i3.thumbnail.height > 200 && (i3.thumbnail.height = 200, i3.thumbnail.width = 200 * i3.video.width / i3.video.height), e3.storageLocation) {
      case ge$1.aliYun:
        s3 = "?x-oss-process=video/snapshot,t_0000,f_jpg,h_" + i3.thumbnail.height + ",m_fast,ar_auto";
        break;
      case ge$1.tencent:
        s3 = "?ci-process=snapshot&time=1&format=jpg&height=" + i3.thumbnail.height;
        break;
      case ge$1.s3:
        s3 = "?process=video&height=" + i3.thumbnail.height;
        break;
      default:
        throw new Error("Only Ali OSS and Tencent COS are supported, unknown storage location:" + e3.storageLocation);
    }
    i3.thumbnail.url = e3.url + s3;
  }
};
let Je$1 = class Je extends We$1 {
  setPayload(e3, t2) {
    let s3, i3 = t2.payload;
    i3.url = e3.url;
    const n2 = i3.height > 200 ? 200 : i3.height;
    switch (e3.storageLocation) {
      case ge$1.aliYun:
        s3 = "?x-oss-process=image/resize,m_lfit,h_" + n2;
        break;
      case ge$1.tencent:
        s3 = `?imageMogr2/thumbnail/x${n2}`;
        break;
      case ge$1.s3:
        s3 = `?process=image&height=${n2}`;
        break;
      default:
        throw new Error("Only Ali OSS and Tencent COS are supported, unknown storage location:" + e3.storageLocation);
    }
    i3.thumbnail = e3.url + s3;
  }
};
let Ye$1 = class Ye {
  constructor() {
    this.improvers = { [qe$1.FILE]: new We$1(), [qe$1.AUDIO]: new We$1(), [qe$1.IMAGE]: new Je$1(), [qe$1.VIDEO]: new Xe$1() };
  }
  improve(e3) {
    let t2 = this.improvers[e3.message.type];
    if (t2)
      try {
        return t2.improve(e3);
      } catch (e4) {
        return Promise.reject(e4);
      }
    return Promise.resolve();
  }
};
let $e$1 = class $e extends Q$1 {
  static init() {
    this.i = new $e();
  }
};
let Qe$1 = class Qe {
  constructor(e3, t2, s3, i3, n2) {
    this.validate(e3), this.mt = e3.type, this.to = t2.id.toString(), this.d = JSON.stringify(t2.data), this.p = JSON.stringify(e3.payload), s3 && (this.nt = s3), n2 && (this.at = n2), i3 && (this.wxmpTemplateMsg = de$1(i3), this.wxmpTemplateMsg.data = JSON.stringify(this.wxmpTemplateMsg.data));
    let r2 = t2.type;
    if (this.t = r2, r2 === o$1.CS) {
      let t3 = e3;
      this.tid = t3.teamId;
    }
    this.guid = e3.messageId;
  }
  validate(e3) {
    if (e3.type === qe$1.TEXT) {
      if (JSON.stringify(e3.payload).length > 3072)
        throw Error("message-length limit 3kb");
    }
  }
};
let Ke$1 = class Ke {
  constructor() {
    this.payloadImprover = new Ye$1();
  }
  send(e3) {
    this.validate(e3);
    let t2 = e3.message, s3 = e3.accessToken, i3 = t2.buildOptions, n2 = i3.createOptions, o2 = n2.notification, a3 = n2.wxmpTemplateMsg, c3 = n2.to;
    c3.data || (c3.data = {}), t2.status = r$1.SENDING;
    let u2 = i3.complete, l2 = this.payloadImprover.improve(e3);
    Promise.all([u2, l2]).then(() => b$1(this, void 0, void 0, function* () {
      if (n2.beforeSend) {
        const e4 = JSON.parse(JSON.stringify(t2));
        yield n2.beforeSend(e4);
      }
      this.doSend(t2, c3, o2, a3, s3, e3);
    })).catch((s4) => {
      t2.status = r$1.FAIL, v$1.onFailed(e3, { code: s4 && s4.code || 400, content: s4 && s4.content || s4 });
    });
  }
  doSend(e3, t2, s3, i3, n2, a3) {
    let c3 = new Qe$1(e3, t2, s3, i3, n2);
    $e$1.i.fire(Be$1.MESSAGE_SENDING, e3);
    let u2 = new re$1({ name: y$1.publishIM, params: c3, unique: true, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (t3) => {
      e3.status = r$1.FAIL, $e$1.i.fire(Be$1.MESSAGE_SEND_FAILED, e3), v$1.onFailed(a3, { code: t3.resultCode, content: t3.content });
    }, success: (t3) => {
      if (e3.status = r$1.SUCCESS, e3.timestamp = t3.content.timestamp, e3.messageId = JSON.stringify(t3.content.id), e3.scene() === o$1.CS) {
        let s4 = e3;
        s4.customerId() !== te$1.Socket.user().id && (s4.sessionId = t3.content.sessionId);
      }
      e3.clearUseLessAttribute(), $e$1.i.fire(Be$1.MESSAGE_SEND_SUCCESS, e3), v$1.onSuccess(a3, e3);
    } });
    te$1.Socket.e(u2);
  }
  validate(e3) {
    let t2 = e3.message;
    if (!(t2 instanceof Ve$1))
      throw new Error("it is invalid message");
    if (t2.status !== r$1.NEW)
      throw new Error("Please create a new message, a message can only be sent once");
  }
};
let Ze$1 = class Ze {
  insert(e3, t2) {
    let s3 = this.binarySearch(e3, t2);
    if (s3 >= 0)
      e3.splice(s3, 1, t2);
    else {
      let i3 = -s3 - 1;
      e3.splice(i3, 0, t2);
    }
  }
  binarySearch(e3, t2) {
    let s3 = 0, i3 = e3.length - 1;
    for (; s3 <= i3; ) {
      let n2 = i3 + s3 >> 1, o2 = this.compare(t2, e3[n2]);
      if (o2 > 0)
        s3 = n2 + 1;
      else {
        if (!(o2 < 0))
          return n2;
        i3 = n2 - 1;
      }
    }
    return -s3 - 1;
  }
};
let et$1 = class et {
  constructor(e3) {
    this.messages = new Array(), this.allLoaded = false, this.target = e3;
  }
  all() {
    return this.messages;
  }
  sliceOverLengthMessages() {
    this.messages.length > et.CACHE_MAX_LENGTH && (this.messages = this.messages.slice(-et.CACHE_MAX_LENGTH), true === this.allLoaded && (this.allLoaded = false));
  }
  getMaxMessage() {
    return this.messages[this.messages.length - 1];
  }
  loadLocalMessages(e3, t2) {
    let s3 = [], i3 = this.messages.length;
    if (t2) {
      if (i3 > 0) {
        let n2 = this.messages[0].timestamp, o2 = this.messages[i3 - 1].timestamp;
        if (t2 >= n2 && t2 <= o2)
          for (let n3 = i3 - 1; n3 >= 0; n3--) {
            let i4 = this.messages[n3];
            if (i4.timestamp < t2) {
              if (!(s3.length < e3))
                break;
              s3.unshift(i4);
            }
          }
      }
    } else
      s3 = this.messages.slice(-e3);
    return s3;
  }
  cacheServerMessages(e3, t2) {
    let s3 = this.messages[0];
    this.messages.length < et.CACHE_MAX_LENGTH && (!e3.lastTimestamp || this.messages.length > 0 && s3.timestamp === e3.lastTimestamp) && (t2.forEach((e4) => {
      et.sortedInserter.insert(this.messages, e4);
    }), t2.length < e3.limit && (this.allLoaded = true));
  }
  findMessageByTime(e3) {
    return this.messages.find((t2) => e3 === t2.timestamp);
  }
  findMessagesByTimes(e3) {
    let t2 = [];
    return e3.forEach((e4) => {
      let s3 = this.findMessageByTime(e4);
      u$1.isDef(s3) && t2.push(s3);
    }), t2;
  }
  existsMessage(e3) {
    return this.findMessageIndexById(e3) > -1;
  }
  findMessageIndexById(e3) {
    return this.messages.findIndex((t2) => e3 === t2.messageId);
  }
  deleteMessage(e3) {
    let t2 = this.findMessageIndexById(e3);
    t2 >= 0 && this.messages.splice(t2, 1);
  }
  recallMessage(e3) {
    return e3.times.map((e4) => this.findMessageByTime(e4)).filter((e4) => u$1.isDef(e4)).map((t2) => (t2.recalled = true, t2.recaller = e3.recaller, t2));
  }
  isEmpty() {
    return 0 === this.messages.length;
  }
  deleteMessages(e3) {
    e3.forEach((e4) => {
      this.deleteMessage(e4.messageId);
    });
  }
  saveMessage(e3) {
    et.sortedInserter.insert(this.messages, e3), this.deleteGroupConversationMessage(), this.sliceOverLengthMessages();
  }
  deleteGroupConversationMessage() {
    this.target.scene === o$1.GROUP && this.messages.length >= 2 && 1 === this.messages[0].x && this.messages.shift();
  }
  maxSuccessMessageTime() {
    for (let e3 = this.messages.length - 1; e3 >= 0; e3--)
      if (this.messages[e3].status === r$1.SUCCESS)
        return this.messages[e3].timestamp;
    return 0;
  }
  minTime() {
    return this.isEmpty() ? 0 : this.messages[0].timestamp;
  }
  correctPosition(e3) {
    this.deleteMessage(e3.messageId), this.saveMessage(e3);
  }
};
et$1.CACHE_MAX_LENGTH = 200, et$1.sortedInserter = new class extends Ze$1 {
  compare(e3, t2) {
    let s3 = e3.timestamp - t2.timestamp;
    return s3 > 0 ? 1 : 0 === s3 ? 0 : -1;
  }
}();
let st$1 = class st {
  constructor(e3, t2, s3) {
    this.scene = e3, this.id = t2, u$1.isDef(s3) && (this.teamId = s3);
  }
  toString() {
    return o$1.PRIVATE === this.scene || o$1.GROUP === this.scene ? this.scene + "#" + this.id : this.scene + "#" + this.id + "#" + this.teamId;
  }
  customerId() {
    if (o$1.CS === this.scene)
      return this.id === this.teamId ? te$1.Socket.user().id : this.id;
  }
  static byScene(e3, t2, s3) {
    return new st(e3, t2, s3);
  }
  static byIMMessage(e3) {
    let t2, s3, i3 = e3.scene();
    if (i3 === o$1.PRIVATE) {
      let t3 = e3.senderId, i4 = e3.targetId();
      s3 = te$1.Socket.user().id === t3 ? i4 : t3;
    } else if (i3 === o$1.GROUP)
      s3 = e3.targetId();
    else {
      if (i3 !== o$1.CS)
        throw { code: 400, content: `scene ${i3} not exists` };
      s3 = e3.targetId(), t2 = e3.teamId;
    }
    return new st(i3, s3, t2);
  }
  static byMessageReadRemoteEvent(e3) {
    let t2, s3 = e3.scene, i3 = e3.targetId, n2 = e3.markerId, r2 = e3.teamId;
    return s3 === o$1.PRIVATE ? t2 = te$1.Socket.user().id === n2 ? i3 : n2 : s3 === o$1.GROUP ? t2 = i3 : s3 === o$1.CS && (t2 = i3 === r2 ? n2 === te$1.Socket.user().id ? r2 : n2 : n2 === te$1.Socket.user().id ? i3 : r2), new st(s3, t2, r2);
  }
  static byIMMessageDeletedEvent(e3) {
    let t2 = e3.scene, s3 = e3.deleterId;
    if (t2 === o$1.PRIVATE) {
      let i3 = te$1.Socket.user().id === s3 ? e3.targetId : s3;
      return new st(t2, i3);
    }
    if (t2 === o$1.GROUP)
      return new st(t2, e3.targetId);
  }
  static byConversationDTO(e3) {
    let t2 = e3.lastMessage;
    return this.byIMMessage(t2);
  }
  static byConversationId(e3, t2) {
    let s3;
    if (e3 === o$1.PRIVATE) {
      let e4 = t2.split(":", 2);
      s3 = e4[0] === te$1.Socket.user().id ? e4[1] : e4[0];
    } else
      s3 = t2;
    return new st(e3, s3);
  }
};
let it$1 = class it {
  constructor(e3) {
    this.times = new Array();
    let t2 = e3[0], s3 = st$1.byIMMessage(t2);
    this.scene = s3.scene, this.targetId = s3.id, e3.forEach((e4) => {
      e4.status === r$1.SUCCESS && this.times.push(e4.timestamp);
    }), this.times.sort((e4, t3) => e4 < t3 ? -1 : e4 == t3 ? 0 : 1);
  }
};
let nt$1 = class nt {
  static deleteServerMessages(e3) {
    let t2 = new it$1(e3);
    return t2.times.length < 0 ? Promise.resolve() : new Promise((e4, s3) => {
      let i3 = new re$1({ name: y$1.IM_DELETE_MESSAGE, params: t2, permission: ne$1.WRITE, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, success: (t3) => {
        200 === t3.code ? e4(t3) : s3(t3);
      }, fail: (e5) => {
        s3(e5);
      } });
      te$1.Socket.e(i3);
    });
  }
  static validate(e3) {
    let t2 = e3.messages;
    for (let e4 = 0; e4 < t2.length; e4++) {
      let s3 = t2[e4];
      if (s3.status === r$1.SENDING)
        throw { code: 400, content: "message[" + e4 + "] is '" + s3.status + "' and cannot be deleted" };
    }
  }
};
let ot$1 = class ot {
  constructor(e3, t2, s3, i3, n2) {
    this.scene = e3, this.id = t2, this.after = s3, this.min = i3, this.teamId = n2;
  }
};
let rt$1 = class rt {
  constructor(e3, t2, s3, i3) {
    this.id = e3, this.scene = t2, this.lastTimestamp = s3, this.teamId = i3;
  }
};
let at$1 = class at extends Ve$1 {
  constructor() {
    super(...arguments), this.read = false;
  }
  scene() {
    return o$1.PRIVATE;
  }
  targetId() {
    return this.receiverId;
  }
};
let ct$1 = class ct extends Ve$1 {
  scene() {
    return o$1.GROUP;
  }
  targetId() {
    return this.groupId;
  }
};
let ut$1 = class ut extends Ve$1 {
  constructor() {
    super(...arguments), this.accepted = false;
  }
  scene() {
    return o$1.CS;
  }
  targetId() {
    return te$1.Socket.user().id === this.customerId() ? this.teamId : this.customerId();
  }
  sendByCustomer() {
    return this.to === this.teamId;
  }
  customerId() {
    return this.sendByCustomer() ? this.senderId : this.to;
  }
  isOtherSent() {
    return te$1.Socket.user().id === this.customerId() ? this.senderId !== te$1.Socket.user().id : this.senderId === this.customerId();
  }
};
!function(e3) {
  e3.ACCEPT = "CS_ACCEPT", e3.END = "CS_END", e3.TRANSFER = "CS_TRANSFER";
}(je$1 || (je$1 = {}));
let lt$1 = class lt {
  build(e3) {
    let t2, s3 = e3.t;
    s3 === o$1.PRIVATE ? (t2 = new at$1(), t2.read = false, t2.receiverId = e3.r) : s3 === o$1.GROUP ? (t2 = new ct$1(), t2.groupId = e3.r, t2.senderData = e3.d ? JSON.parse(e3.d) : {}) : s3 === o$1.CS && (t2 = new ut$1(), t2.to = e3.r, t2.teamId = e3.tid, t2.senderData = e3.d ? JSON.parse(e3.d) : {}, t2.accepted = e3.accepted, t2.customerId() !== te$1.Socket.user().id && (t2.sessionId = e3.sessionId)), t2.senderId = e3.s, t2.messageId = e3.i, t2.timestamp = e3.ts, t2.type = e3.mt;
    let i3 = e3.p;
    if (u$1.isDef(i3))
      if (s3 === o$1.CS && t2.type === je$1.TRANSFER) {
        let e4 = JSON.parse(i3);
        e4.transferTo.data = JSON.parse(e4.transferTo.data), t2.payload = e4;
      } else
        t2.payload = JSON.parse(i3);
    let n2 = e3.rc;
    return u$1.isDef(n2) && true === n2 ? (t2.recalled = n2, t2.recaller = e3.recaller) : t2.recalled = false, t2.status = r$1.SUCCESS, t2;
  }
};
let dt$1 = class dt {
  constructor() {
    this.builder = new lt$1();
  }
  sync(e3, t2, s3, i3, n2) {
    let o2 = new ot$1(e3, t2, s3, i3, n2);
    return new Promise((e4, t3) => {
      let s4 = new re$1({ name: y$1.IM_HISTORY_CHANGE, params: o2, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e5) => {
        t3(e5);
      }, success: (t4) => {
        let s5 = t4.content;
        e4(s5);
      } });
      te$1.Socket.e(s4);
    });
  }
  loadServerMessages(e3, t2) {
    return new Promise((s3, i3) => {
      let n2 = new re$1({ name: y$1.IM_HISTORY, params: t2, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e4) => {
        i3(e4);
      }, success: (t3) => {
        let i4 = t3.content;
        i4.messages = this.convertServerMessages(e3, i4.messages), s3(i4);
      } });
      te$1.Socket.e(n2);
    });
  }
  convertServerMessages(e3, t2) {
    let s3 = [], i3 = e3.scene, n2 = e3.id;
    return t2.forEach((t3) => {
      if (t3.t = i3, o$1.PRIVATE === i3)
        t3.r = t3.s === te$1.Socket.user().id ? n2 : te$1.Socket.user().id;
      else if (o$1.GROUP === i3)
        t3.r = n2;
      else if (o$1.CS === i3) {
        let s4 = e3.customerId(), i4 = e3.teamId;
        s4 === te$1.Socket.user().id ? t3.r = i4 : t3.r = s4;
      }
      let r2 = this.builder.build(t3);
      s3.push(r2);
    }), s3;
  }
  updateServerOffsets(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = new rt$1(t2.id, t2.scene, e3, t2.teamId);
      return new Promise((e4, t3) => {
        let i3 = new re$1({ name: y$1.IM_MARK_AS_READ, params: s3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: (t4) => {
          e4(t4);
        }, fail: (e5) => {
          t3(e5);
        } });
        te$1.Socket.e(i3);
      });
    });
  }
};
dt$1.instance = new dt$1();
let ht$1 = class ht {
  constructor() {
    this.offsetMap = /* @__PURE__ */ new Map(), this.markingTime = 0, this.userId = te$1.Socket.user().id;
  }
  updateOffset(e3, t2) {
    let s3 = this.offsetMap.get(e3);
    return u$1.isDef(s3) ? t2 > s3 && (this.offsetMap.set(e3, t2), true) : (this.offsetMap.set(e3, t2), true);
  }
  updateUserOffsets(e3) {
    e3.forEach((e4) => {
      let t2 = e4.userId, s3 = e4.offset;
      this.updateOffset(t2, s3);
    });
  }
  updateMyOffset(e3) {
    return this.updateOffset(this.userId, e3);
  }
  myOffset() {
    return this.getOffset(this.userId);
  }
  getOffset(e3) {
    let t2 = this.offsetMap.get(e3);
    return t2 || 0;
  }
};
let pt$1 = class pt {
  constructor(e3, t2, s3, i3, n2) {
    this.id = e3, this.scene = t2, this.lastTimestamp = s3, this.limit = i3, this.teamId = n2;
  }
};
let mt$1 = class mt {
  constructor(e3) {
    this.history = e3;
  }
  pre() {
    this.oldLastMessage = this.history.getMaxMessage(), this.oldUnreadAmount = this.history.unreadAmount(), this.oldLastMessage && (this.oldLastMessageRecalled = this.oldLastMessage.recalled, this.oldLastMessageRead = this.oldLastMessage.read, this.oldLastMessageStatus = this.oldLastMessage.status);
  }
  post() {
    let e3, t2, s3, i3 = this.history.unreadAmount(), n2 = this.history.getMaxMessage();
    n2 && (s3 = n2.status, e3 = n2.read, t2 = n2.recalled);
    let o2 = this.history.target;
    this.oldLastMessage !== n2 || this.oldLastMessageRead !== e3 || this.oldLastMessageRecalled !== t2 || this.oldLastMessageStatus !== s3 ? n2 ? $e$1.i.fire(Be$1.MAX_MESSAGE_CHANGED, n2) : $e$1.i.fire(Be$1.MAX_MESSAGE_DELETED, o2) : this.oldUnreadAmount !== i3 && $e$1.i.fire(Be$1.UNREAD_AMOUNT_CHANGED, o2);
  }
};
let ft$1 = class ft {
  constructor(e3, t2, s3, i3) {
    this.scene = e3, this.conversationId = t2, this.recaller = s3, this.times = i3;
  }
};
let gt$1 = class gt {
  static init() {
    this.eventCenter = new ee$1();
  }
  static on(e3, t2) {
    this.eventCenter.on(e3, t2);
  }
  static fire(e3, t2) {
    this.eventCenter.fire(e3, t2);
  }
  static off(e3, t2) {
    this.eventCenter.off(e3, t2);
  }
};
!function(e3) {
  e3.PRIVATE_MESSAGE_RECEIVED = "PRIVATE_MESSAGE_RECEIVED", e3.GROUP_MESSAGE_RECEIVED = "GROUP_MESSAGE_RECEIVED", e3.SYSTEM_MESSAGE_RECEIVED = "SYSTEM_MESSAGE_RECEIVED", e3.CONVERSATIONS_UPDATED = "CONVERSATIONS_UPDATED", e3.HISTORY_EXPIRED = "HISTORY_EXPIRED", e3.USER_PRESENCE = "USER_PRESENCE", e3.GROUP_PRESENCE = "GROUP_PRESENCE", e3.MESSAGE_DELETED = "MESSAGE_DELETED", e3.MESSAGE_READ = "MESSAGE_READ", e3.MESSAGE_RECALLED = "MESSAGE_RECALLED", e3.CS_MESSAGE_RECEIVED = "CS_MESSAGE_RECEIVED", e3.PENDING_CONVERSATIONS_UPDATED = "PENDING_CONVERSATIONS_UPDATED";
}(He$1 || (He$1 = {}));
let yt$1 = class yt {
  constructor(e3) {
    this.expiredTime = 0, this.remoteHistory = dt$1.instance, this.target = e3, this.userOffsets = new ht$1(), this.messageCache = new et$1(e3);
  }
  initMaxMessageAndOffsets(e3, t2) {
    this.existsMessage(e3) || (this.messageCache.saveMessage(e3), t2.forEach((e4) => {
      this.markLocalMessagesRead(this.messageCache.all(), e4.userId, e4.offset, false);
    }));
  }
  existsMessage(e3) {
    return this.messageCache.existsMessage(e3.messageId);
  }
  loadHistory(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      return this.expiredTime > 0 && !this.messageCache.isEmpty() && (yield this.updateByServerChange()), u$1.isUndef(t2) ? t2 = 10 : t2 > 30 && (t2 = 30), yield this.loadServerMessages(e3, t2);
    });
  }
  loadServerMessages(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = this.messageCache.loadLocalMessages(t2, e3);
      if (false === this.messageCache.allLoaded && s3.length !== t2) {
        let i3 = t2 - s3.length, n2 = s3[0] ? s3[0].timestamp : e3, o2 = new pt$1(this.target.id.toString(), this.target.scene, n2, i3, this.target.teamId), r2 = yield this.remoteHistory.loadServerMessages(this.target, o2), a3 = r2.messages;
        s3 = a3.concat(s3), this.messageCache.cacheServerMessages(o2, a3), r2.userOffsets.forEach((e4) => {
          this.userOffsets.updateOffset(e4.userId, e4.offset);
        }), this.userOffsets.offsetMap.forEach((e4, t3) => {
          this.markLocalMessagesRead(a3, t3, e4, false);
        });
      }
      return s3;
    });
  }
  deleteMessages(e3) {
    return b$1(this, void 0, void 0, function* () {
      yield this.aopUnreadAmountMaxMessage(() => b$1(this, void 0, void 0, function* () {
        let t2 = e3.messages;
        yield nt$1.deleteServerMessages(t2), this.messageCache.deleteMessages(t2), v$1.onSuccess(e3);
      }));
    });
  }
  syncDeletedMessage(e3, t2) {
    this.aopUnreadAmountMaxMessage(() => {
      this.doSyncDeletedMessage(e3, t2);
    });
  }
  doSyncDeletedMessage(e3, t2) {
    if (e3 === te$1.Socket.user().id) {
      let e4 = this.messageCache.findMessagesByTimes(t2);
      this.messageCache.deleteMessages(e4), e4.length > 0 && gt$1.fire(He$1.MESSAGE_DELETED, e4);
    }
  }
  recallMessages(e3) {
    return b$1(this, void 0, void 0, function* () {
      yield this.aopUnreadAmountMaxMessage(() => b$1(this, void 0, void 0, function* () {
        this.doRecall(e3);
      }));
    });
  }
  doRecall(e3) {
    let t2 = this.messageCache.recallMessage(e3);
    t2.length > 0 && gt$1.fire(He$1.MESSAGE_RECALLED, t2);
  }
  expire() {
    this.messageCache.isEmpty() || (this.expiredTime = this.messageCache.maxSuccessMessageTime());
  }
  updateByServerChange() {
    return b$1(this, void 0, void 0, function* () {
      yield this.aopUnreadAmountMaxMessage(() => b$1(this, void 0, void 0, function* () {
        let e3 = yield this.remoteHistory.sync(this.target.scene, this.target.id, this.expiredTime, this.messageCache.minTime(), this.target.teamId);
        e3.userOffsets.forEach((e4) => {
          this.markLocalMessagesRead(this.messageCache.all(), e4.userId, e4.offset, true);
        });
        let t2 = e3.deletedMessageTimes;
        t2.length > 0 && this.doSyncDeletedMessage(te$1.Socket.user().id, t2);
        let s3 = e3.recalledMessages;
        s3.length > 0 && s3.forEach((e4) => {
          let t3 = new ft$1(this.target.scene, this.target.id, e4.recaller, e4.times);
          this.doRecall(t3);
        }), this.expiredTime = 0;
      }));
    });
  }
  markRead() {
    return b$1(this, void 0, void 0, function* () {
      yield this.aopUnreadAmountMaxMessage(() => b$1(this, void 0, void 0, function* () {
        let e3 = this.messageCache.maxSuccessMessageTime();
        e3 > this.userOffsets.myOffset() && (this.userOffsets.markingTime = e3, yield this.remoteHistory.updateServerOffsets(e3, this.target), e3 === this.userOffsets.markingTime && this.markLocalMessagesRead(this.messageCache.all(), te$1.Socket.user().id, e3, true));
      }));
    });
  }
  syncMarkedMessage(e3) {
    this.aopUnreadAmountMaxMessage(() => {
      this.markLocalMessagesRead(this.messageCache.all(), e3.markerId, e3.time, true);
    });
  }
  onMessageSending(e3) {
    this.aopUnreadAmountMaxMessage(() => {
      this.messageCache.saveMessage(e3);
    });
  }
  onMessageSendSuccess(e3) {
    this.aopUnreadAmountMaxMessage(() => {
      this.messageCache.correctPosition(e3), this.markLocalMessagesRead(this.messageCache.all(), te$1.Socket.user().id, e3.timestamp, true);
    });
  }
  onMessageSendFailed(e3) {
    this.getMaxMessage() === e3 && $e$1.i.fire(Be$1.MAX_MESSAGE_CHANGED, e3);
  }
  onMessageReceived(e3) {
    this.aopUnreadAmountMaxMessage(() => {
      this.messageCache.saveMessage(e3), this.markLocalMessagesRead(this.messageCache.all(), e3.senderId, e3.timestamp, true);
    });
  }
  aopUnreadAmountMaxMessage(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      try {
        let t3 = new mt$1(this);
        t3.pre(), yield e3(), t3.post();
      } catch (e4) {
        v$1.onFailed(t2, e4);
      }
    });
  }
  markLocalMessagesRead(e3, t2, s3, i3) {
    if (this.userOffsets.updateOffset(t2, s3), this.isOtherUserId(t2)) {
      let t3 = this.markMySentRead(e3, s3);
      i3 && t3.length > 0 && gt$1.fire(He$1.MESSAGE_READ, t3);
    } else
      t2 === te$1.Socket.user().id && this.markOthersSentRead(e3, s3);
  }
  markOthersSentRead(e3, t2) {
    if (this.target.scene === o$1.PRIVATE)
      for (let s3 = e3.length - 1; s3 >= 0; s3--) {
        let i3 = e3[s3];
        if (i3.isOtherSent() && i3.timestamp <= t2) {
          if (i3.read)
            break;
          i3.read = true;
        }
      }
  }
  markMySentRead(e3, t2) {
    let s3 = new Array();
    if (this.target.scene === o$1.PRIVATE)
      for (let i3 = e3.length - 1; i3 >= 0; i3--) {
        let n2 = e3[i3];
        if (!n2.isOtherSent() && n2.timestamp <= t2 && n2.status === r$1.SUCCESS) {
          if (n2.read)
            break;
          n2.read = true, s3.push(n2);
        }
      }
    return s3;
  }
  isOtherUserId(e3) {
    if (this.target.scene === o$1.CS) {
      let t2 = this.target.customerId();
      return te$1.Socket.user().id === t2 ? e3 !== te$1.Socket.user().id : e3 === t2;
    }
    return e3 !== te$1.Socket.user().id;
  }
  unreadAmount(e3) {
    let t2 = 0, s3 = this.userOffsets.myOffset(), i3 = this.messageCache.all();
    for (const e4 of i3)
      e4.isOtherSent() && false === e4.recalled && e4.timestamp > s3 && (t2 += 1);
    return t2;
  }
  getMaxMessage(e3) {
    return this.messageCache.getMaxMessage();
  }
  maxTime(e3) {
    let t2 = this.getMaxMessage();
    return u$1.isDef(t2) ? t2.timestamp : 0;
  }
};
let St$1 = class St {
  constructor(e3, t2) {
    this.teamId = e3, this.customerId = t2;
  }
};
let Et$1 = class Et {
};
let vt$1 = class vt {
  constructor(e3, t2, s3) {
    this.teamId = e3, this.teamData = JSON.stringify(t2), this.agentData = JSON.stringify(s3);
  }
};
let bt$1 = class bt {
  constructor(e3) {
    this.teamId = e3;
  }
};
let Ct$1 = class Ct {
  constructor(e3) {
    this.teamId = e3;
  }
};
var wt$1 = { exports: {} }, Mt$1 = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, It$1 = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"], Nt$1 = function(e3) {
  var t2 = e3, s3 = e3.indexOf("["), i3 = e3.indexOf("]");
  -1 != s3 && -1 != i3 && (e3 = e3.substring(0, s3) + e3.substring(s3, i3).replace(/:/g, ";") + e3.substring(i3, e3.length));
  for (var n2 = Mt$1.exec(e3 || ""), o2 = {}, r2 = 14; r2--; )
    o2[It$1[r2]] = n2[r2] || "";
  return -1 != s3 && -1 != i3 && (o2.source = t2, o2.host = o2.host.substring(1, o2.host.length - 1).replace(/;/g, ":"), o2.authority = o2.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), o2.ipv6uri = true), o2;
}, Tt$1 = { exports: {} }, Ot$1 = { exports: {} }, Rt$1 = 1e3, At$1 = 60 * Rt$1, Pt$1 = 60 * At$1, kt$1 = 24 * Pt$1, _t$1 = 365.25 * kt$1, Dt$1 = function(e3, t2) {
  t2 = t2 || {};
  var s3 = typeof e3;
  if ("string" === s3 && e3.length > 0)
    return function(e4) {
      if (e4 = String(e4), e4.length > 100)
        return;
      var t3 = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e4);
      if (!t3)
        return;
      var s4 = parseFloat(t3[1]);
      switch ((t3[2] || "ms").toLowerCase()) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return s4 * _t$1;
        case "days":
        case "day":
        case "d":
          return s4 * kt$1;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return s4 * Pt$1;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return s4 * At$1;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return s4 * Rt$1;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return s4;
        default:
          return;
      }
    }(e3);
  if ("number" === s3 && false === isNaN(e3))
    return t2.long ? function(e4) {
      return xt$1(e4, kt$1, "day") || xt$1(e4, Pt$1, "hour") || xt$1(e4, At$1, "minute") || xt$1(e4, Rt$1, "second") || e4 + " ms";
    }(e3) : function(e4) {
      if (e4 >= kt$1)
        return Math.round(e4 / kt$1) + "d";
      if (e4 >= Pt$1)
        return Math.round(e4 / Pt$1) + "h";
      if (e4 >= At$1)
        return Math.round(e4 / At$1) + "m";
      if (e4 >= Rt$1)
        return Math.round(e4 / Rt$1) + "s";
      return e4 + "ms";
    }(e3);
  throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e3));
};
function xt$1(e3, t2, s3) {
  if (!(e3 < t2))
    return e3 < 1.5 * t2 ? Math.floor(e3 / t2) + " " + s3 : Math.ceil(e3 / t2) + " " + s3 + "s";
}
!function(e3, t2) {
  function s3(e4) {
    var s4;
    function n2() {
      if (n2.enabled) {
        var e5 = n2, i4 = +/* @__PURE__ */ new Date(), o2 = i4 - (s4 || i4);
        e5.diff = o2, e5.prev = s4, e5.curr = i4, s4 = i4;
        for (var r2 = new Array(arguments.length), a3 = 0; a3 < r2.length; a3++)
          r2[a3] = arguments[a3];
        r2[0] = t2.coerce(r2[0]), "string" != typeof r2[0] && r2.unshift("%O");
        var c3 = 0;
        r2[0] = r2[0].replace(/%([a-zA-Z%])/g, function(s5, i5) {
          if ("%%" === s5)
            return s5;
          c3++;
          var n3 = t2.formatters[i5];
          if ("function" == typeof n3) {
            var o3 = r2[c3];
            s5 = n3.call(e5, o3), r2.splice(c3, 1), c3--;
          }
          return s5;
        }), t2.formatArgs.call(e5, r2), (n2.log || t2.log || console.log.bind(console)).apply(e5, r2);
      }
    }
    return n2.namespace = e4, n2.enabled = t2.enabled(e4), n2.useColors = t2.useColors(), n2.color = function(e5) {
      var s5, i4 = 0;
      for (s5 in e5)
        i4 = (i4 << 5) - i4 + e5.charCodeAt(s5), i4 |= 0;
      return t2.colors[Math.abs(i4) % t2.colors.length];
    }(e4), n2.destroy = i3, "function" == typeof t2.init && t2.init(n2), t2.instances.push(n2), n2;
  }
  function i3() {
    var e4 = t2.instances.indexOf(this);
    return -1 !== e4 && (t2.instances.splice(e4, 1), true);
  }
  (t2 = Ot$1.exports = s3.debug = s3.default = s3).coerce = function(e4) {
    return e4 instanceof Error ? e4.stack || e4.message : e4;
  }, t2.disable = function() {
    t2.enable("");
  }, t2.enable = function(e4) {
    var s4;
    t2.save(e4), t2.names = [], t2.skips = [];
    var i4 = ("string" == typeof e4 ? e4 : "").split(/[\s,]+/), n2 = i4.length;
    for (s4 = 0; s4 < n2; s4++)
      i4[s4] && ("-" === (e4 = i4[s4].replace(/\*/g, ".*?"))[0] ? t2.skips.push(new RegExp("^" + e4.substr(1) + "$")) : t2.names.push(new RegExp("^" + e4 + "$")));
    for (s4 = 0; s4 < t2.instances.length; s4++) {
      var o2 = t2.instances[s4];
      o2.enabled = t2.enabled(o2.namespace);
    }
  }, t2.enabled = function(e4) {
    if ("*" === e4[e4.length - 1])
      return true;
    var s4, i4;
    for (s4 = 0, i4 = t2.skips.length; s4 < i4; s4++)
      if (t2.skips[s4].test(e4))
        return false;
    for (s4 = 0, i4 = t2.names.length; s4 < i4; s4++)
      if (t2.names[s4].test(e4))
        return true;
    return false;
  }, t2.humanize = Dt$1, t2.instances = [], t2.names = [], t2.skips = [], t2.formatters = {};
}(0, Ot$1.exports), function(e3, t2) {
  function s3() {
    var e4;
    try {
      e4 = t2.storage.debug;
    } catch (e5) {
    }
    return !e4 && "undefined" != typeof process && "env" in process && (e4 = process.env.DEBUG), e4;
  }
  (t2 = e3.exports = Ot$1.exports).log = function() {
    return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);
  }, t2.formatArgs = function(e4) {
    var s4 = this.useColors;
    if (e4[0] = (s4 ? "%c" : "") + this.namespace + (s4 ? " %c" : " ") + e4[0] + (s4 ? "%c " : " ") + "+" + t2.humanize(this.diff), !s4)
      return;
    var i3 = "color: " + this.color;
    e4.splice(1, 0, i3, "color: inherit");
    var n2 = 0, o2 = 0;
    e4[0].replace(/%[a-zA-Z%]/g, function(e5) {
      "%%" !== e5 && (n2++, "%c" === e5 && (o2 = n2));
    }), e4.splice(o2, 0, i3);
  }, t2.save = function(e4) {
    try {
      null == e4 ? t2.storage.removeItem("debug") : t2.storage.debug = e4;
    } catch (e5) {
    }
  }, t2.load = s3, t2.useColors = function() {
    if ("undefined" != typeof window && window.process && "renderer" === window.process.type)
      return true;
    if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
      return false;
    return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  }, t2.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function() {
    try {
      return window.localStorage;
    } catch (e4) {
    }
  }(), t2.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t2.formatters.j = function(e4) {
    try {
      return JSON.stringify(e4);
    } catch (e5) {
      return "[UnexpectedJSONParseError]: " + e5.message;
    }
  }, t2.enable(s3());
}(Tt$1, Tt$1.exports);
var Ut$1 = Nt$1, Ft$1 = Tt$1.exports("socket.io-client:url"), Gt$1 = function(e3, t2) {
  var s3 = e3;
  t2 = t2 || "undefined" != typeof location && location, null == e3 && (e3 = t2.protocol + "//" + t2.host);
  "string" == typeof e3 && ("/" === e3.charAt(0) && (e3 = "/" === e3.charAt(1) ? t2.protocol + e3 : t2.host + e3), /^(https?|wss?):\/\//.test(e3) || (Ft$1("protocol-less url %s", e3), e3 = void 0 !== t2 ? t2.protocol + "//" + e3 : "https://" + e3), Ft$1("parse %s", e3), s3 = Ut$1(e3));
  s3.port || (/^(http|ws)$/.test(s3.protocol) ? s3.port = "80" : /^(http|ws)s$/.test(s3.protocol) && (s3.port = "443"));
  s3.path = s3.path || "/";
  var i3 = -1 !== s3.host.indexOf(":") ? "[" + s3.host + "]" : s3.host;
  return s3.id = s3.protocol + "://" + i3 + ":" + s3.port, s3.href = s3.protocol + "://" + i3 + (t2 && t2.port === s3.port ? "" : ":" + s3.port), s3;
};
var Lt$1 = {}, Bt$1 = {}.toString, qt$1 = Array.isArray || function(e3) {
  return "[object Array]" == Bt$1.call(e3);
};
!function(e3) {
  Tt$1.exports("socket.io-parser");
  var t2 = M$1.exports, s3 = qt$1;
  function i3() {
  }
  e3.protocol = 4, e3.types = ["CONNECT", "DISCONNECT", "EVENT", "ACK", "ERROR", "BINARY_EVENT", "BINARY_ACK"], e3.CONNECT = 0, e3.DISCONNECT = 1, e3.EVENT = 2, e3.ACK = 3, e3.ERROR = 4, e3.BINARY_EVENT = 5, e3.BINARY_ACK = 6, e3.Encoder = i3, e3.Decoder = o2;
  var n2 = e3.ERROR + '"encode error"';
  function o2() {
    this.reconstructor = null;
  }
  function r2(t3) {
    return { type: e3.ERROR, data: "parser error: " + t3 };
  }
  i3.prototype.encode = function(t3, s4) {
    var i4 = function(t4) {
      var s5 = "" + t4.type;
      e3.BINARY_EVENT !== t4.type && e3.BINARY_ACK !== t4.type || (s5 += t4.attachments + "-");
      t4.nsp && "/" !== t4.nsp && (s5 += t4.nsp + ",");
      null != t4.id && (s5 += t4.id);
      if (null != t4.data) {
        var i5 = function(e4) {
          try {
            return JSON.stringify(e4);
          } catch (e5) {
            return false;
          }
        }(t4.data);
        if (false === i5)
          return n2;
        s5 += i5;
      }
      return s5;
    }(t3);
    s4([i4]);
  }, t2(o2.prototype), o2.prototype.add = function(t3) {
    var i4;
    if ("string" != typeof t3)
      throw new Error("Unknown type: " + t3);
    i4 = function(t4) {
      var i5 = 0, n3 = { type: Number(t4.charAt(0)) };
      if (null == e3.types[n3.type])
        return r2("unknown packet type " + n3.type);
      if (e3.BINARY_EVENT === n3.type || e3.BINARY_ACK === n3.type) {
        for (var o3 = ""; "-" !== t4.charAt(++i5) && (o3 += t4.charAt(i5), i5 != t4.length); )
          ;
        if (o3 != Number(o3) || "-" !== t4.charAt(i5))
          throw new Error("Illegal attachments");
        n3.attachments = Number(o3);
      }
      if ("/" === t4.charAt(i5 + 1))
        for (n3.nsp = ""; ++i5; ) {
          if ("," === (c3 = t4.charAt(i5)))
            break;
          if (n3.nsp += c3, i5 === t4.length)
            break;
        }
      else
        n3.nsp = "/";
      var a3 = t4.charAt(i5 + 1);
      if ("" !== a3 && Number(a3) == a3) {
        for (n3.id = ""; ++i5; ) {
          var c3;
          if (null == (c3 = t4.charAt(i5)) || Number(c3) != c3) {
            --i5;
            break;
          }
          if (n3.id += t4.charAt(i5), i5 === t4.length)
            break;
        }
        n3.id = Number(n3.id);
      }
      if (t4.charAt(++i5)) {
        var u2 = function(e4) {
          try {
            return JSON.parse(e4);
          } catch (e5) {
            return false;
          }
        }(t4.substr(i5));
        if (!(false !== u2 && (n3.type === e3.ERROR || s3(u2))))
          return r2("invalid payload");
        n3.data = u2;
      }
      return n3;
    }(t3), this.emit("decoded", i4);
  }, o2.prototype.destroy = function() {
    this.reconstructor && this.reconstructor.finishedReconstruction();
  };
}(Lt$1);
var jt$1 = { exports: {} }, Ht$1 = {}, Vt$1 = {}, zt = Object.keys || function(e3) {
  var t2 = [], s3 = Object.prototype.hasOwnProperty;
  for (var i3 in e3)
    s3.call(e3, i3) && t2.push(i3);
  return t2;
}, Wt$1 = qt$1, Xt$1 = Object.prototype.toString, Jt$1 = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === Xt$1.call(Blob), Yt$1 = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === Xt$1.call(File), $t$1 = function e(t2) {
  if (!t2 || "object" != typeof t2)
    return false;
  if (Wt$1(t2)) {
    for (var s3 = 0, i3 = t2.length; s3 < i3; s3++)
      if (e(t2[s3]))
        return true;
    return false;
  }
  if ("function" == typeof Buffer && Buffer.isBuffer && Buffer.isBuffer(t2) || "function" == typeof ArrayBuffer && t2 instanceof ArrayBuffer || Jt$1 && t2 instanceof Blob || Yt$1 && t2 instanceof File)
    return true;
  if (t2.toJSON && "function" == typeof t2.toJSON && 1 === arguments.length)
    return e(t2.toJSON(), true);
  for (var n2 in t2)
    if (Object.prototype.hasOwnProperty.call(t2, n2) && e(t2[n2]))
      return true;
  return false;
};
var Qt$1 = function(e3, t2, s3) {
  var i3 = false;
  return s3 = s3 || Kt$1, n2.count = e3, 0 === e3 ? t2() : n2;
  function n2(e4, o2) {
    if (n2.count <= 0)
      throw new Error("after called too many times");
    --n2.count, e4 ? (i3 = true, t2(e4), t2 = s3) : 0 !== n2.count || i3 || t2(null, o2);
  }
};
function Kt$1() {
}
var Zt$1, es$1, ts$1, ss$1 = String.fromCharCode;
function is(e3) {
  for (var t2, s3, i3 = [], n2 = 0, o2 = e3.length; n2 < o2; )
    (t2 = e3.charCodeAt(n2++)) >= 55296 && t2 <= 56319 && n2 < o2 ? 56320 == (64512 & (s3 = e3.charCodeAt(n2++))) ? i3.push(((1023 & t2) << 10) + (1023 & s3) + 65536) : (i3.push(t2), n2--) : i3.push(t2);
  return i3;
}
function ns(e3, t2) {
  if (e3 >= 55296 && e3 <= 57343) {
    if (t2)
      throw Error("Lone surrogate U+" + e3.toString(16).toUpperCase() + " is not a scalar value");
    return false;
  }
  return true;
}
function os(e3, t2) {
  return ss$1(e3 >> t2 & 63 | 128);
}
function rs(e3, t2) {
  if (0 == (4294967168 & e3))
    return ss$1(e3);
  var s3 = "";
  return 0 == (4294965248 & e3) ? s3 = ss$1(e3 >> 6 & 31 | 192) : 0 == (4294901760 & e3) ? (ns(e3, t2) || (e3 = 65533), s3 = ss$1(e3 >> 12 & 15 | 224), s3 += os(e3, 6)) : 0 == (4292870144 & e3) && (s3 = ss$1(e3 >> 18 & 7 | 240), s3 += os(e3, 12), s3 += os(e3, 6)), s3 += ss$1(63 & e3 | 128);
}
function as() {
  if (ts$1 >= es$1)
    throw Error("Invalid byte index");
  var e3 = 255 & Zt$1[ts$1];
  if (ts$1++, 128 == (192 & e3))
    return 63 & e3;
  throw Error("Invalid continuation byte");
}
function cs(e3) {
  var t2, s3;
  if (ts$1 > es$1)
    throw Error("Invalid byte index");
  if (ts$1 == es$1)
    return false;
  if (t2 = 255 & Zt$1[ts$1], ts$1++, 0 == (128 & t2))
    return t2;
  if (192 == (224 & t2)) {
    if ((s3 = (31 & t2) << 6 | as()) >= 128)
      return s3;
    throw Error("Invalid continuation byte");
  }
  if (224 == (240 & t2)) {
    if ((s3 = (15 & t2) << 12 | as() << 6 | as()) >= 2048)
      return ns(s3, e3) ? s3 : 65533;
    throw Error("Invalid continuation byte");
  }
  if (240 == (248 & t2) && (s3 = (7 & t2) << 18 | as() << 12 | as() << 6 | as()) >= 65536 && s3 <= 1114111)
    return s3;
  throw Error("Invalid UTF-8 detected");
}
var us = { version: "2.1.2", encode: function(e3, t2) {
  for (var s3 = false !== (t2 = t2 || {}).strict, i3 = is(e3), n2 = i3.length, o2 = -1, r2 = ""; ++o2 < n2; )
    r2 += rs(i3[o2], s3);
  return r2;
}, decode: function(e3, t2) {
  var s3 = false !== (t2 = t2 || {}).strict;
  Zt$1 = is(e3), es$1 = Zt$1.length, ts$1 = 0;
  for (var i3, n2 = []; false !== (i3 = cs(s3)); )
    n2.push(i3);
  return function(e4) {
    for (var t3, s4 = e4.length, i4 = -1, n3 = ""; ++i4 < s4; )
      (t3 = e4[i4]) > 65535 && (n3 += ss$1((t3 -= 65536) >>> 10 & 1023 | 55296), t3 = 56320 | 1023 & t3), n3 += ss$1(t3);
    return n3;
  }(n2);
} }, ls = void 0 !== ls ? ls : "undefined" != typeof WebKitBlobBuilder ? WebKitBlobBuilder : "undefined" != typeof MSBlobBuilder ? MSBlobBuilder : "undefined" != typeof MozBlobBuilder && MozBlobBuilder, ds = function() {
  try {
    return 2 === new Blob(["hi"]).size;
  } catch (e3) {
    return false;
  }
}(), hs = ds && function() {
  try {
    return 2 === new Blob([new Uint8Array([1, 2])]).size;
  } catch (e3) {
    return false;
  }
}(), ps = ls && ls.prototype.append && ls.prototype.getBlob;
function ms(e3) {
  return e3.map(function(e4) {
    if (e4.buffer instanceof ArrayBuffer) {
      var t2 = e4.buffer;
      if (e4.byteLength !== t2.byteLength) {
        var s3 = new Uint8Array(e4.byteLength);
        s3.set(new Uint8Array(t2, e4.byteOffset, e4.byteLength)), t2 = s3.buffer;
      }
      return t2;
    }
    return e4;
  });
}
function fs(e3, t2) {
  t2 = t2 || {};
  var s3 = new ls();
  return ms(e3).forEach(function(e4) {
    s3.append(e4);
  }), t2.type ? s3.getBlob(t2.type) : s3.getBlob();
}
function gs(e3, t2) {
  return new Blob(ms(e3), t2 || {});
}
"undefined" != typeof Blob && (fs.prototype = Blob.prototype, gs.prototype = Blob.prototype);
var ys = ds ? hs ? Blob : gs : ps ? fs : void 0;
!function(e3) {
  var t2 = zt, s3 = $t$1, i3 = Qt$1, n2 = us;
  e3.protocol = 3;
  var o2 = e3.packets = { open: 0, close: 1, ping: 2, pong: 3, message: 4, upgrade: 5, noop: 6 }, r2 = t2(o2), a3 = { type: "error", data: "parser error" }, c3 = ys;
  e3.encodePacket = function(e4, t3, s4, i4) {
    "function" == typeof t3 && (i4 = t3, t3 = false), "function" == typeof s4 && (i4 = s4, s4 = null), void 0 === e4.data || e4.data.buffer || e4.data;
    var r3 = o2[e4.type];
    return void 0 !== e4.data && (r3 += s4 ? n2.encode(String(e4.data), { strict: false }) : String(e4.data)), i4("" + r3);
  }, e3.decodePacket = function(e4, t3, s4) {
    if (void 0 === e4)
      return a3;
    if ("string" == typeof e4) {
      if (s4 && false === (e4 = function(e5) {
        try {
          e5 = n2.decode(e5, { strict: false });
        } catch (e6) {
          return false;
        }
        return e5;
      }(e4)))
        return a3;
      var i4 = e4.charAt(0);
      return Number(i4) == i4 && r2[i4] ? e4.length > 1 ? { type: r2[i4], data: e4.substring(1) } : { type: r2[i4] } : a3;
    }
    i4 = new Uint8Array(e4)[0];
    var o3 = sliceBuffer(e4, 1);
    return c3 && "blob" === t3 && (o3 = new c3([o3])), { type: r2[i4], data: o3 };
  }, e3.encodePayload = function(t3, n3, o3) {
    "function" == typeof n3 && (o3 = n3, n3 = null);
    var r3 = s3(t3);
    if (!t3.length)
      return o3("0:");
    !function(e4, t4, s4) {
      for (var n4 = new Array(e4.length), o4 = i3(e4.length, s4), r4 = function(e5, s5, i4) {
        t4(s5, function(t5, s6) {
          n4[e5] = s6, i4(t5, n4);
        });
      }, a4 = 0; a4 < e4.length; a4++)
        r4(a4, e4[a4], o4);
    }(t3, function(t4, s4) {
      e3.encodePacket(t4, !!r3 && n3, true, function(e4) {
        s4(null, function(e5) {
          return e5.length + ":" + e5;
        }(e4));
      });
    }, function(e4, t4) {
      return o3(t4.join(""));
    });
  }, e3.decodePayload = function(t3, s4, i4) {
    var n3;
    if ("function" == typeof s4 && (i4 = s4, s4 = null), "" === t3)
      return i4(a3, 0, 1);
    for (var o3, r3, c4 = "", u2 = 0, l2 = t3.length; u2 < l2; u2++) {
      var d3 = t3.charAt(u2);
      if (":" === d3) {
        if ("" === c4 || c4 != (o3 = Number(c4)))
          return i4(a3, 0, 1);
        if (c4 != (r3 = t3.substr(u2 + 1, o3)).length)
          return i4(a3, 0, 1);
        if (r3.length) {
          if (n3 = e3.decodePacket(r3, s4, true), a3.type === n3.type && a3.data === n3.data)
            return i4(a3, 0, 1);
          if (false === i4(n3, u2 + o3, l2))
            return;
        }
        u2 += o3, c4 = "";
      } else
        c4 += d3;
    }
    return "" !== c4 ? i4(a3, 0, 1) : void 0;
  };
}(Vt$1);
var Ss = Vt$1, Es = vs;
function vs(e3) {
  this.path = e3.path, this.hostname = e3.hostname, this.port = e3.port, this.secure = e3.secure, this.query = e3.query, this.timestampParam = e3.timestampParam, this.timestampRequests = e3.timestampRequests, this.readyState = "", this.agent = e3.agent || false, this.socket = e3.socket, this.enablesXDR = e3.enablesXDR, this.pfx = e3.pfx, this.key = e3.key, this.passphrase = e3.passphrase, this.cert = e3.cert, this.ca = e3.ca, this.ciphers = e3.ciphers, this.rejectUnauthorized = e3.rejectUnauthorized, this.forceNode = e3.forceNode, this.isReactNative = e3.isReactNative, this.extraHeaders = e3.extraHeaders, this.localAddress = e3.localAddress;
}
(0, M$1.exports)(vs.prototype), vs.prototype.onError = function(e3, t2) {
  var s3 = new Error(e3);
  return s3.type = "TransportError", s3.description = t2, this.emit("error", s3), this;
}, vs.prototype.open = function() {
  return "closed" !== this.readyState && "" !== this.readyState || (this.readyState = "opening", this.doOpen()), this;
}, vs.prototype.close = function() {
  return "opening" !== this.readyState && "open" !== this.readyState || (this.doClose(), this.onClose()), this;
}, vs.prototype.send = function(e3) {
  if ("open" !== this.readyState)
    throw new Error("Transport not open");
  this.write(e3);
}, vs.prototype.onOpen = function() {
  this.readyState = "open", this.writable = true, this.emit("open");
}, vs.prototype.onData = function(e3) {
  var t2 = Ss.decodePacket(e3, this.socket.binaryType);
  this.onPacket(t2);
}, vs.prototype.onPacket = function(e3) {
  this.emit("packet", e3);
}, vs.prototype.onClose = function() {
  this.readyState = "closed", this.emit("close");
};
var bs, Cs = { encode: function(e3) {
  var t2 = "";
  for (var s3 in e3)
    e3.hasOwnProperty(s3) && (t2.length && (t2 += "&"), t2 += encodeURIComponent(s3) + "=" + encodeURIComponent(e3[s3]));
  return t2;
}, decode: function(e3) {
  for (var t2 = {}, s3 = e3.split("&"), i3 = 0, n2 = s3.length; i3 < n2; i3++) {
    var o2 = s3[i3].split("=");
    t2[decodeURIComponent(o2[0])] = decodeURIComponent(o2[1]);
  }
  return t2;
} }, ws = function(e3, t2) {
  var s3 = function() {
  };
  s3.prototype = t2.prototype, e3.prototype = new s3(), e3.prototype.constructor = e3;
}, Ms = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), Is = 64, Ns = {}, Ts = 0, Os = 0;
function Rs(e3) {
  var t2 = "";
  do {
    t2 = Ms[e3 % Is] + t2, e3 = Math.floor(e3 / Is);
  } while (e3 > 0);
  return t2;
}
function As() {
  var e3 = Rs(+/* @__PURE__ */ new Date());
  return e3 !== bs ? (Ts = 0, bs = e3) : e3 + "." + Rs(Ts++);
}
for (; Os < Is; Os++)
  Ns[Ms[Os]] = Os;
As.encode = Rs, As.decode = function(e3) {
  var t2 = 0;
  for (Os = 0; Os < e3.length; Os++)
    t2 = t2 * Is + Ns[e3.charAt(Os)];
  return t2;
};
var Ps = As, ks$1 = { exports: {} };
try {
  ks$1.exports = "undefined" != typeof XMLHttpRequest && "withCredentials" in new XMLHttpRequest();
} catch (e3) {
  ks$1.exports = false;
}
var _s = ks$1.exports, Ds = function(e3) {
  var t2 = e3.xdomain, s3 = e3.xscheme, i3 = e3.enablesXDR;
  try {
    if ("undefined" != typeof XMLHttpRequest && (!t2 || _s))
      return new XMLHttpRequest();
  } catch (e4) {
  }
  try {
    if ("undefined" != typeof XDomainRequest && !s3 && i3)
      return new XDomainRequest();
  } catch (e4) {
  }
  if (!t2)
    try {
      return new self[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
    } catch (e4) {
    }
}, xs = Es, Us = Cs, Fs = Vt$1, Gs = ws, Ls = Ps, Bs = Tt$1.exports("engine.io-client:polling"), qs = Hs, js = null != new Ds({ xdomain: false }).responseType;
function Hs(e3) {
  var t2 = e3 && e3.forceBase64;
  js && !t2 || (this.supportsBinary = false), xs.call(this, e3);
}
Gs(Hs, xs), Hs.prototype.name = "polling", Hs.prototype.doOpen = function() {
  this.poll();
}, Hs.prototype.pause = function(e3) {
  var t2 = this;
  function s3() {
    Bs("paused"), t2.readyState = "paused", e3();
  }
  if (this.readyState = "pausing", this.polling || !this.writable) {
    var i3 = 0;
    this.polling && (Bs("we are currently polling - waiting to pause"), i3++, this.once("pollComplete", function() {
      Bs("pre-pause polling complete"), --i3 || s3();
    })), this.writable || (Bs("we are currently writing - waiting to pause"), i3++, this.once("drain", function() {
      Bs("pre-pause writing complete"), --i3 || s3();
    }));
  } else
    s3();
}, Hs.prototype.poll = function() {
  Bs("polling"), this.polling = true, this.doPoll(), this.emit("poll");
}, Hs.prototype.onData = function(e3) {
  var t2 = this;
  Bs("polling got data %s", e3);
  Fs.decodePayload(e3, this.socket.binaryType, function(e4, s3, i3) {
    if ("opening" === t2.readyState && t2.onOpen(), "close" === e4.type)
      return t2.onClose(), false;
    t2.onPacket(e4);
  }), "closed" !== this.readyState && (this.polling = false, this.emit("pollComplete"), "open" === this.readyState ? this.poll() : Bs('ignoring poll - transport state "%s"', this.readyState));
}, Hs.prototype.doClose = function() {
  var e3 = this;
  function t2() {
    Bs("writing close packet"), e3.write([{ type: "close" }]);
  }
  "open" === this.readyState ? (Bs("transport open - closing"), t2()) : (Bs("transport not open - deferring close"), this.once("open", t2));
}, Hs.prototype.write = function(e3) {
  var t2 = this;
  this.writable = false;
  var s3 = function() {
    t2.writable = true, t2.emit("drain");
  };
  Fs.encodePayload(e3, this.supportsBinary, function(e4) {
    t2.doWrite(e4, s3);
  });
}, Hs.prototype.uri = function() {
  var e3 = this.query || {}, t2 = this.secure ? "https" : "http", s3 = "";
  return false !== this.timestampRequests && (e3[this.timestampParam] = Ls()), this.supportsBinary || e3.sid || (e3.b64 = 1), e3 = Us.encode(e3), this.port && ("https" === t2 && 443 !== Number(this.port) || "http" === t2 && 80 !== Number(this.port)) && (s3 = ":" + this.port), e3.length && (e3 = "?" + e3), t2 + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + s3 + this.path + e3;
};
var Vs, zs = qs, Ws = Qs, Xs = /\n/g, Js = /\\n/g;
function Ys() {
}
function $s() {
  return "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== C$1 ? C$1 : {};
}
function Qs(e3) {
  if (zs.call(this, e3), this.query = this.query || {}, !Vs) {
    var t2 = $s();
    Vs = t2.___eio = t2.___eio || [];
  }
  this.index = Vs.length;
  var s3 = this;
  Vs.push(function(e4) {
    s3.onData(e4);
  }), this.query.j = this.index, "function" == typeof addEventListener && addEventListener("beforeunload", function() {
    s3.script && (s3.script.onerror = Ys);
  }, false);
}
ws(Qs, zs), Qs.prototype.supportsBinary = false, Qs.prototype.doClose = function() {
  this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), zs.prototype.doClose.call(this);
}, Qs.prototype.doPoll = function() {
  var e3 = this, t2 = document.createElement("script");
  this.script && (this.script.parentNode.removeChild(this.script), this.script = null), t2.async = true, t2.src = this.uri(), t2.onerror = function(t3) {
    e3.onError("jsonp poll error", t3);
  };
  var s3 = document.getElementsByTagName("script")[0];
  s3 ? s3.parentNode.insertBefore(t2, s3) : (document.head || document.body).appendChild(t2), this.script = t2, "undefined" != typeof navigator && /gecko/i.test(navigator.userAgent) && setTimeout(function() {
    var e4 = document.createElement("iframe");
    document.body.appendChild(e4), document.body.removeChild(e4);
  }, 100);
}, Qs.prototype.doWrite = function(e3, t2) {
  var s3 = this;
  if (!this.form) {
    var i3, n2 = document.createElement("form"), o2 = document.createElement("textarea"), r2 = this.iframeId = "eio_iframe_" + this.index;
    n2.className = "socketio", n2.style.position = "absolute", n2.style.top = "-1000px", n2.style.left = "-1000px", n2.target = r2, n2.method = "POST", n2.setAttribute("accept-charset", "utf-8"), o2.name = "d", n2.appendChild(o2), document.body.appendChild(n2), this.form = n2, this.area = o2;
  }
  function a3() {
    c3(), t2();
  }
  function c3() {
    if (s3.iframe)
      try {
        s3.form.removeChild(s3.iframe);
      } catch (e5) {
        s3.onError("jsonp polling iframe removal error", e5);
      }
    try {
      var e4 = '<iframe src="javascript:0" name="' + s3.iframeId + '">';
      i3 = document.createElement(e4);
    } catch (e5) {
      (i3 = document.createElement("iframe")).name = s3.iframeId, i3.src = "javascript:0";
    }
    i3.id = s3.iframeId, s3.form.appendChild(i3), s3.iframe = i3;
  }
  this.form.action = this.uri(), c3(), e3 = e3.replace(Js, "\\\n"), this.area.value = e3.replace(Xs, "\\n");
  try {
    this.form.submit();
  } catch (e4) {
  }
  this.iframe.attachEvent ? this.iframe.onreadystatechange = function() {
    "complete" === s3.iframe.readyState && a3();
  } : this.iframe.onload = a3;
};
var Ks, Zs, ei = Es, ti = Vt$1, si = Cs, ii = ws, ni = Ps, oi = Tt$1.exports("engine.io-client:websocket");
("undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket) && ("undefined" != typeof WebSocket ? Ks = WebSocket : "undefined" != typeof self && (Ks = self.WebSocket || self.MozWebSocket));
var ri = Ks || Zs;
("undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket) && "undefined" == typeof GameGlobal || (ri = function(e3) {
  var t2 = this;
  if (t2.onopen = function() {
  }, t2.onclose = function() {
  }, t2.onmessage = function(e4) {
  }, t2.onerror = function(e4) {
  }, "object" == typeof tt && tt.getSystemInfo) {
    let s4 = tt.connectSocket({ url: e3 });
    t2.send = function(e4) {
      s4.send({ data: e4 });
    }, t2.close = function() {
      s4.close();
    }, s4.onOpen(function() {
      t2.onopen();
    }), s4.onError(function(e4) {
      t2.onerror(e4);
    }), s4.onMessage(function(e4) {
      t2.onmessage(e4);
    }), s4.onClose(function() {
      t2.onclose();
    });
  } else if ("undefined" != typeof my)
    my.connectSocket({ url: e3 }), t2.send = function(e4) {
      my.sendSocketMessage({ data: e4 });
    }, t2.close = function(e4) {
      my.closeSocket();
    }, my.onSocketOpen(function(e4) {
      t2.onopen();
    }), my.onSocketError(function(e4) {
      t2.onerror(e4);
    }), my.onSocketMessage(function(e4) {
      t2.onmessage(e4);
    }), my.onSocketClose((e4) => {
      t2.onclose(e4);
    });
  else if ("undefined" != typeof swan)
    swan.connectSocket({ url: e3 }), t2.send = function(e4) {
      swan.sendSocketMessage({ data: e4 });
    }, t2.close = function(e4) {
      swan.closeSocket();
    }, swan.onSocketOpen(function(e4) {
      t2.onopen();
    }), swan.onSocketError(function(e4) {
      t2.onerror(e4);
    }), swan.onSocketMessage(function(e4) {
      t2.onmessage(e4);
    }), swan.onSocketClose((e4) => {
      t2.onclose(e4);
    });
  else if ("undefined" != typeof index) {
    var s3 = index.connectSocket({ url: e3, complete: () => {
    } });
    t2.send = function(e4) {
      s3.send({ data: e4 });
    }, t2.close = function() {
      s3.close();
    }, s3.onOpen(function(e4) {
      t2.onopen();
    }), s3.onError(function(e4) {
      t2.onerror(e4);
    }), s3.onMessage(function(e4) {
      t2.onmessage(e4);
    }), s3.onClose(function(e4) {
      t2.onclose();
    });
  } else {
    var i3 = wx$1.connectSocket({ url: e3 });
    t2.send = function(e4) {
      i3.send({ data: e4 });
    }, t2.close = function(e4) {
      i3.close({ code: 1e3 });
    }, i3.onOpen(function() {
      t2.onopen();
    }), i3.onError(function(e4) {
      t2.onerror(e4);
    }), i3.onMessage(function(e4) {
      t2.onmessage(e4);
    }), i3.onClose(function(e4) {
      t2.onclose(e4);
    });
  }
});
var ai = ci;
function ci(e3) {
  e3 && e3.forceBase64 && (this.supportsBinary = false), ("undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket) && (this.perMessageDeflate = e3.perMessageDeflate, this.usingBrowserWebSocket = Ks && !e3.forceNode, this.protocols = e3.protocols, this.usingBrowserWebSocket || (ri = Zs)), ei.call(this, e3);
}
ii(ci, ei), ci.prototype.name = "websocket", ci.prototype.supportsBinary = false, ci.prototype.doOpen = function() {
  if (this.check()) {
    var e3, t2, s3 = this.uri();
    if (("undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket) && (e3 = this.protocols), (t2 = "undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket ? { agent: this.agent, perMessageDeflate: this.perMessageDeflate } : { agent: this.agent }).pfx = this.pfx, t2.key = this.key, t2.passphrase = this.passphrase, t2.cert = this.cert, t2.ca = this.ca, t2.ciphers = this.ciphers, t2.rejectUnauthorized = this.rejectUnauthorized, "object" == typeof navigator && "ReactNative" === navigator.product && (t2 = {}), this.extraHeaders && (t2.headers = this.extraHeaders), this.localAddress && (t2.localAddress = this.localAddress), "undefined" != typeof cc && "Windows" === cc.sys.os)
      cc.resources.load("cacert", (e4, t3) => {
        const i3 = t3.nativeUrl;
        this.ws = new ri(s3, [], i3), this.ws.binaryType = "arraybuffer", this.addEventListeners();
      });
    else {
      try {
        "undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket ? this.ws = this.usingBrowserWebSocket && !this.isReactNative ? e3 ? new ri(s3, e3) : new ri(s3) : new ri(s3, e3, t2) : this.ws = new ri(s3);
      } catch (e4) {
        return this.emit("error", e4);
      }
      void 0 === this.ws.binaryType && (this.supportsBinary = false), this.ws.supports && this.ws.supports.binary ? (this.supportsBinary = true, this.ws.binaryType = "nodebuffer") : this.ws.binaryType = "arraybuffer", this.addEventListeners();
    }
  }
}, ci.prototype.addEventListeners = function() {
  var e3 = this;
  this.ws.onopen = function() {
    e3.onOpen();
  }, this.ws.onclose = function() {
    e3.onClose();
  }, this.ws.onmessage = function(t2) {
    e3.onData(t2.data);
  }, this.ws.onerror = function(t2) {
    e3.onError("websocket error", t2);
  };
}, ci.prototype.write = function(e3) {
  var t2 = this;
  this.writable = false;
  for (var s3 = e3.length, i3 = 0, n2 = s3; i3 < n2; i3++)
    !function(e4) {
      ti.encodePacket(e4, t2.supportsBinary, function(i4) {
        if ("undefined" == typeof index && "undefined" == typeof wx$1 && "undefined" == typeof my && "undefined" == typeof swan || "undefined" != typeof WebSocket) {
          if (!t2.usingBrowserWebSocket) {
            var n3 = {};
            if (e4.options && (n3.compress = e4.options.compress), t2.perMessageDeflate)
              ("string" == typeof i4 ? Buffer.byteLength(i4) : i4.length) < t2.perMessageDeflate.threshold && (n3.compress = false);
          }
          try {
            t2.usingBrowserWebSocket ? t2.ws.send(i4) : t2.ws.send(i4, n3);
          } catch (e5) {
            oi("websocket closed before onclose event");
          }
        } else
          try {
            t2.ws.send(i4);
          } catch (e5) {
            oi("websocket closed before onclose event");
          }
        --s3 || o2();
      });
    }(e3[i3]);
  function o2() {
    t2.emit("flush"), setTimeout(function() {
      t2.writable = true, t2.emit("drain");
    }, 0);
  }
}, ci.prototype.onClose = function() {
  ei.prototype.onClose.call(this);
}, ci.prototype.doClose = function() {
  void 0 !== this.ws && this.ws.close();
}, ci.prototype.uri = function() {
  var e3 = this.query || {}, t2 = this.secure ? "wss" : "ws", s3 = "";
  return this.port && ("wss" === t2 && 443 !== Number(this.port) || "ws" === t2 && 80 !== Number(this.port)) && (s3 = ":" + this.port), this.timestampRequests && (e3[this.timestampParam] = ni()), this.supportsBinary || (e3.b64 = 1), (e3 = si.encode(e3)).length && (e3 = "?" + e3), t2 + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + s3 + this.path + e3;
}, ci.prototype.check = function() {
  return !(!ri || "__initialize" in ri && this.name === ci.prototype.name);
};
var ui = Ws, li = ai;
Ht$1.polling = function(e3) {
  var t2 = false, s3 = false;
  if (e3.jsonp, "undefined" != typeof location) {
    var i3 = "https:" === location.protocol, n2 = location.port;
    n2 || (n2 = i3 ? 443 : 80), t2 = e3.hostname !== location.hostname || n2 !== e3.port, s3 = e3.secure !== i3;
  }
  return e3.xdomain = t2, e3.xscheme = s3, new ui(e3);
}, Ht$1.websocket = li;
var di = [].indexOf, hi = function(e3, t2) {
  if (di)
    return e3.indexOf(t2);
  for (var s3 = 0; s3 < e3.length; ++s3)
    if (e3[s3] === t2)
      return s3;
  return -1;
}, pi = Ht$1, mi = M$1.exports, fi = Tt$1.exports("engine.io-client:socket"), gi = hi, yi = Vt$1, Si = Nt$1, Ei = Cs, vi = bi;
function bi(e3, t2) {
  if (!(this instanceof bi))
    return new bi(e3, t2);
  t2 = t2 || {}, e3 && "object" == typeof e3 && (t2 = e3, e3 = null), e3 ? (e3 = Si(e3), t2.hostname = e3.host, t2.secure = "https" === e3.protocol || "wss" === e3.protocol, t2.port = e3.port, e3.query && (t2.query = e3.query)) : t2.host && (t2.hostname = Si(t2.host).host), this.secure = null != t2.secure ? t2.secure : "undefined" != typeof location && "https:" === location.protocol, t2.hostname && !t2.port && (t2.port = this.secure ? "443" : "80"), this.agent = t2.agent || false, this.hostname = t2.hostname || ("undefined" != typeof location ? location.hostname : "localhost"), this.port = t2.port || ("undefined" != typeof location && location.port ? location.port : this.secure ? 443 : 80), this.query = t2.query || {}, "string" == typeof this.query && (this.query = Ei.decode(this.query)), this.upgrade = false !== t2.upgrade, this.path = (t2.path || "/engine.io").replace(/\/$/, "") + "/", this.forceJSONP = !!t2.forceJSONP, this.jsonp = false !== t2.jsonp, this.forceBase64 = !!t2.forceBase64, this.enablesXDR = !!t2.enablesXDR, this.timestampParam = t2.timestampParam || "t", this.timestampRequests = t2.timestampRequests, this.transports = t2.transports || ["polling", "websocket"], this.transportOptions = t2.transportOptions || {}, this.readyState = "", this.writeBuffer = [], this.prevBufferLen = 0, this.policyPort = t2.policyPort || 843, this.rememberUpgrade = t2.rememberUpgrade || false, this.binaryType = null, this.onlyBinaryUpgrades = t2.onlyBinaryUpgrades, this.perMessageDeflate = false !== t2.perMessageDeflate && (t2.perMessageDeflate || {}), true === this.perMessageDeflate && (this.perMessageDeflate = {}), this.perMessageDeflate && null == this.perMessageDeflate.threshold && (this.perMessageDeflate.threshold = 1024), this.pfx = t2.pfx || null, this.key = t2.key || null, this.passphrase = t2.passphrase || null, this.cert = t2.cert || null, this.ca = t2.ca || null, this.ciphers = t2.ciphers || null, this.rejectUnauthorized = void 0 === t2.rejectUnauthorized || t2.rejectUnauthorized, this.forceNode = !!t2.forceNode, this.isReactNative = "undefined" != typeof navigator && "string" == typeof navigator.product && "reactnative" === navigator.product.toLowerCase(), ("undefined" == typeof self || this.isReactNative) && (t2.extraHeaders && Object.keys(t2.extraHeaders).length > 0 && (this.extraHeaders = t2.extraHeaders), t2.localAddress && (this.localAddress = t2.localAddress)), this.id = null, this.upgrades = null, this.pingInterval = null, this.pingTimeout = null, this.pingIntervalTimer = null, this.pingTimeoutTimer = null, this.open();
}
bi.priorWebsocketSuccess = false, mi(bi.prototype), bi.protocol = yi.protocol, bi.Socket = bi, bi.Transport = Es, bi.transports = Ht$1, bi.parser = Vt$1, bi.prototype.createTransport = function(e3) {
  fi('creating transport "%s"', e3);
  var t2 = function(e4) {
    var t3 = {};
    for (var s4 in e4)
      e4.hasOwnProperty(s4) && (t3[s4] = e4[s4]);
    return t3;
  }(this.query);
  t2.EIO = yi.protocol, t2.transport = e3;
  var s3 = this.transportOptions[e3] || {};
  return this.id && (t2.sid = this.id), new pi[e3]({ query: t2, socket: this, agent: s3.agent || this.agent, hostname: s3.hostname || this.hostname, port: s3.port || this.port, secure: s3.secure || this.secure, path: s3.path || this.path, forceJSONP: s3.forceJSONP || this.forceJSONP, jsonp: s3.jsonp || this.jsonp, forceBase64: s3.forceBase64 || this.forceBase64, enablesXDR: s3.enablesXDR || this.enablesXDR, timestampRequests: s3.timestampRequests || this.timestampRequests, timestampParam: s3.timestampParam || this.timestampParam, policyPort: s3.policyPort || this.policyPort, pfx: s3.pfx || this.pfx, key: s3.key || this.key, passphrase: s3.passphrase || this.passphrase, cert: s3.cert || this.cert, ca: s3.ca || this.ca, ciphers: s3.ciphers || this.ciphers, rejectUnauthorized: s3.rejectUnauthorized || this.rejectUnauthorized, perMessageDeflate: s3.perMessageDeflate || this.perMessageDeflate, extraHeaders: s3.extraHeaders || this.extraHeaders, forceNode: s3.forceNode || this.forceNode, localAddress: s3.localAddress || this.localAddress, requestTimeout: s3.requestTimeout || this.requestTimeout, protocols: s3.protocols || void 0, isReactNative: this.isReactNative });
}, bi.prototype.open = function() {
  var e3;
  if (this.rememberUpgrade && bi.priorWebsocketSuccess && -1 !== this.transports.indexOf("websocket"))
    e3 = "websocket";
  else {
    if (0 === this.transports.length) {
      var t2 = this;
      return void setTimeout(function() {
        t2.emit("error", "No transports available");
      }, 0);
    }
    e3 = this.transports[0];
  }
  this.readyState = "opening";
  try {
    e3 = this.createTransport(e3);
  } catch (e4) {
    return this.transports.shift(), void this.open();
  }
  e3.open(), this.setTransport(e3);
}, bi.prototype.setTransport = function(e3) {
  fi("setting transport %s", e3.name);
  var t2 = this;
  this.transport && (fi("clearing existing transport %s", this.transport.name), this.transport.removeAllListeners()), this.transport = e3, e3.on("drain", function() {
    t2.onDrain();
  }).on("packet", function(e4) {
    t2.onPacket(e4);
  }).on("error", function(e4) {
    t2.onError(e4);
  }).on("close", function() {
    t2.onClose("transport close");
  });
}, bi.prototype.probe = function(e3) {
  fi('probing transport "%s"', e3);
  var t2 = this.createTransport(e3, { probe: 1 }), s3 = false, i3 = this;
  function n2() {
    if (i3.onlyBinaryUpgrades) {
      var n3 = !this.supportsBinary && i3.transport.supportsBinary;
      s3 = s3 || n3;
    }
    s3 || (fi('probe transport "%s" opened', e3), t2.send([{ type: "ping", data: "probe" }]), t2.once("packet", function(n4) {
      if (!s3)
        if ("pong" === n4.type && "probe" === n4.data) {
          if (fi('probe transport "%s" pong', e3), i3.upgrading = true, i3.emit("upgrading", t2), !t2)
            return;
          bi.priorWebsocketSuccess = "websocket" === t2.name, fi('pausing current transport "%s"', i3.transport.name), i3.transport.pause(function() {
            s3 || "closed" !== i3.readyState && (fi("changing transport and sending upgrade packet"), l2(), i3.setTransport(t2), t2.send([{ type: "upgrade" }]), i3.emit("upgrade", t2), t2 = null, i3.upgrading = false, i3.flush());
          });
        } else {
          fi('probe transport "%s" failed', e3);
          var o3 = new Error("probe error");
          o3.transport = t2.name, i3.emit("upgradeError", o3);
        }
    }));
  }
  function o2() {
    s3 || (s3 = true, l2(), t2.close(), t2 = null);
  }
  function r2(s4) {
    var n3 = new Error("probe error: " + s4);
    n3.transport = t2.name, o2(), fi('probe transport "%s" failed because of error: %s', e3, s4), i3.emit("upgradeError", n3);
  }
  function a3() {
    r2("transport closed");
  }
  function c3() {
    r2("socket closed");
  }
  function u2(e4) {
    t2 && e4.name !== t2.name && (fi('"%s" works - aborting "%s"', e4.name, t2.name), o2());
  }
  function l2() {
    t2.removeListener("open", n2), t2.removeListener("error", r2), t2.removeListener("close", a3), i3.removeListener("close", c3), i3.removeListener("upgrading", u2);
  }
  bi.priorWebsocketSuccess = false, t2.once("open", n2), t2.once("error", r2), t2.once("close", a3), this.once("close", c3), this.once("upgrading", u2), t2.open();
}, bi.prototype.onOpen = function() {
  if (fi("socket open"), this.readyState = "open", bi.priorWebsocketSuccess = "websocket" === this.transport.name, this.emit("open"), this.flush(), "open" === this.readyState && this.upgrade && this.transport.pause) {
    fi("starting upgrade probes");
    for (var e3 = 0, t2 = this.upgrades.length; e3 < t2; e3++)
      this.probe(this.upgrades[e3]);
  }
}, bi.prototype.onPacket = function(e3) {
  if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState)
    switch (fi('socket receive: type "%s", data "%s"', e3.type, e3.data), this.emit("packet", e3), this.emit("heartbeat"), e3.type) {
      case "open":
        this.onHandshake(JSON.parse(e3.data));
        break;
      case "pong":
        this.setPing(), this.emit("pong");
        break;
      case "error":
        var t2 = new Error("server error");
        t2.code = e3.data, this.onError(t2);
        break;
      case "message":
        this.emit("data", e3.data), this.emit("message", e3.data);
    }
  else
    fi('packet received with socket readyState "%s"', this.readyState);
}, bi.prototype.onHandshake = function(e3) {
  this.emit("handshake", e3), this.id = e3.sid, this.transport.query.sid = e3.sid, this.upgrades = this.filterUpgrades(e3.upgrades), this.pingInterval = e3.pingInterval, this.pingTimeout = e3.pingTimeout, this.onOpen(), "closed" !== this.readyState && (this.setPing(), this.removeListener("heartbeat", this.onHeartbeat), this.on("heartbeat", this.onHeartbeat));
}, bi.prototype.onHeartbeat = function(e3) {
  clearTimeout(this.pingTimeoutTimer);
  var t2 = this;
  t2.pingTimeoutTimer = setTimeout(function() {
    "closed" !== t2.readyState && t2.onClose("ping timeout");
  }, e3 || t2.pingInterval + t2.pingTimeout);
}, bi.prototype.setPing = function() {
  var e3 = this;
  clearTimeout(e3.pingIntervalTimer), e3.pingIntervalTimer = setTimeout(function() {
    fi("writing ping packet - expecting pong within %sms", e3.pingTimeout), e3.ping(), e3.onHeartbeat(e3.pingTimeout);
  }, e3.pingInterval);
}, bi.prototype.ping = function() {
  var e3 = this;
  this.sendPacket("ping", function() {
    e3.emit("ping");
  });
}, bi.prototype.onDrain = function() {
  this.writeBuffer.splice(0, this.prevBufferLen), this.prevBufferLen = 0, 0 === this.writeBuffer.length ? this.emit("drain") : this.flush();
}, bi.prototype.flush = function() {
  "closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length && (fi("flushing %d packets in socket", this.writeBuffer.length), this.transport.send(this.writeBuffer), this.prevBufferLen = this.writeBuffer.length, this.emit("flush"));
}, bi.prototype.write = bi.prototype.send = function(e3, t2, s3) {
  return this.sendPacket("message", e3, t2, s3), this;
}, bi.prototype.sendPacket = function(e3, t2, s3, i3) {
  if ("function" == typeof t2 && (i3 = t2, t2 = void 0), "function" == typeof s3 && (i3 = s3, s3 = null), "closing" !== this.readyState && "closed" !== this.readyState) {
    (s3 = s3 || {}).compress = false !== s3.compress;
    var n2 = { type: e3, data: t2, options: s3 };
    this.emit("packetCreate", n2), this.writeBuffer.push(n2), i3 && this.once("flush", i3), this.flush();
  }
}, bi.prototype.close = function() {
  if ("opening" === this.readyState || "open" === this.readyState) {
    this.readyState = "closing";
    var e3 = this;
    this.writeBuffer.length ? this.once("drain", function() {
      this.upgrading ? i3() : t2();
    }) : this.upgrading ? i3() : t2();
  }
  function t2() {
    e3.onClose("forced close"), fi("socket closing - telling transport to close"), e3.transport.close();
  }
  function s3() {
    e3.removeListener("upgrade", s3), e3.removeListener("upgradeError", s3), t2();
  }
  function i3() {
    e3.once("upgrade", s3), e3.once("upgradeError", s3);
  }
  return this;
}, bi.prototype.onError = function(e3) {
  fi("socket error %j", e3), bi.priorWebsocketSuccess = false, this.emit("error", e3), this.onClose("transport error", e3);
}, bi.prototype.onClose = function(e3, t2) {
  if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
    fi('socket close with reason: "%s"', e3);
    clearTimeout(this.pingIntervalTimer), clearTimeout(this.pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), this.readyState = "closed", this.id = null, this.emit("close", e3, t2), this.writeBuffer = [], this.prevBufferLen = 0;
  }
}, bi.prototype.filterUpgrades = function(e3) {
  for (var t2 = [], s3 = 0, i3 = e3.length; s3 < i3; s3++)
    ~gi(this.transports, e3[s3]) && t2.push(e3[s3]);
  return t2;
}, jt$1.exports = vi, jt$1.exports.parser = Vt$1;
var Ci = { exports: {} }, wi = function(e3, t2) {
  for (var s3 = [], i3 = (t2 = t2 || 0) || 0; i3 < e3.length; i3++)
    s3[i3 - t2] = e3[i3];
  return s3;
};
var Mi = function(e3, t2, s3) {
  return e3.on(t2, s3), { destroy: function() {
    e3.removeListener(t2, s3);
  } };
};
var Ii = [].slice, Ni = function(e3, t2) {
  if ("string" == typeof t2 && (t2 = e3[t2]), "function" != typeof t2)
    throw new Error("bind() requires a function");
  var s3 = Ii.call(arguments, 2);
  return function() {
    return t2.apply(e3, s3.concat(Ii.call(arguments)));
  };
};
!function(e3, t2) {
  var s3 = Lt$1, i3 = M$1.exports, n2 = wi, o2 = Mi, r2 = Ni, a3 = (Tt$1.exports("socket.io-client:socket"), Cs), c3 = $t$1;
  e3.exports = d3;
  var u2 = { connect: 1, connect_error: 1, connect_timeout: 1, connecting: 1, disconnect: 1, error: 1, reconnect: 1, reconnect_attempt: 1, reconnect_failed: 1, reconnect_error: 1, reconnecting: 1, ping: 1, pong: 1 }, l2 = i3.prototype.emit;
  function d3(e4, t3, s4) {
    this.io = e4, this.nsp = t3, this.json = this, this.ids = 0, this.acks = {}, this.receiveBuffer = [], this.sendBuffer = [], this.connected = false, this.disconnected = true, this.flags = {}, s4 && s4.query && (this.query = s4.query), this.io.autoConnect && this.open();
  }
  i3(d3.prototype), d3.prototype.subEvents = function() {
    if (!this.subs) {
      var e4 = this.io;
      this.subs = [o2(e4, "open", r2(this, "onopen")), o2(e4, "packet", r2(this, "onpacket")), o2(e4, "close", r2(this, "onclose"))];
    }
  }, d3.prototype.open = d3.prototype.connect = function() {
    return this.connected || (this.subEvents(), this.io.open(), "open" === this.io.readyState && this.onopen(), this.emit("connecting")), this;
  }, d3.prototype.send = function() {
    var e4 = n2(arguments);
    return e4.unshift("message"), this.emit.apply(this, e4), this;
  }, d3.prototype.emit = function(e4) {
    if (u2.hasOwnProperty(e4))
      return l2.apply(this, arguments), this;
    var t3 = n2(arguments), i4 = { type: (void 0 !== this.flags.binary ? this.flags.binary : c3(t3)) ? s3.BINARY_EVENT : s3.EVENT, data: t3, options: {} };
    return i4.options.compress = !this.flags || false !== this.flags.compress, "function" == typeof t3[t3.length - 1] && (this.ids, this.acks[this.ids] = t3.pop(), i4.id = this.ids++), this.connected ? this.packet(i4) : this.sendBuffer.push(i4), this.flags = {}, this;
  }, d3.prototype.packet = function(e4) {
    e4.nsp = this.nsp, this.io.packet(e4);
  }, d3.prototype.onopen = function() {
    if ("/" !== this.nsp)
      if (this.query) {
        var e4 = "object" == typeof this.query ? a3.encode(this.query) : this.query;
        this.packet({ type: s3.CONNECT, query: e4 });
      } else
        this.packet({ type: s3.CONNECT });
  }, d3.prototype.onclose = function(e4) {
    this.connected = false, this.disconnected = true, delete this.id, this.emit("disconnect", e4);
  }, d3.prototype.onpacket = function(e4) {
    var t3 = e4.nsp === this.nsp, i4 = e4.type === s3.ERROR && "/" === e4.nsp;
    if (t3 || i4)
      switch (e4.type) {
        case s3.CONNECT:
          this.onconnect();
          break;
        case s3.EVENT:
        case s3.BINARY_EVENT:
          this.onevent(e4);
          break;
        case s3.ACK:
        case s3.BINARY_ACK:
          this.onack(e4);
          break;
        case s3.DISCONNECT:
          this.ondisconnect();
          break;
        case s3.ERROR:
          this.emit("error", e4.data);
      }
  }, d3.prototype.onevent = function(e4) {
    var t3 = e4.data || [];
    null != e4.id && t3.push(this.ack(e4.id)), this.connected ? l2.apply(this, t3) : this.receiveBuffer.push(t3);
  }, d3.prototype.ack = function(e4) {
    var t3 = this, i4 = false;
    return function() {
      if (!i4) {
        i4 = true;
        var o3 = n2(arguments);
        t3.packet({ type: c3(o3) ? s3.BINARY_ACK : s3.ACK, id: e4, data: o3 });
      }
    };
  }, d3.prototype.onack = function(e4) {
    var t3 = this.acks[e4.id];
    "function" == typeof t3 ? (e4.id, e4.data, t3.apply(this, e4.data), delete this.acks[e4.id]) : e4.id;
  }, d3.prototype.onconnect = function() {
    this.connected = true, this.disconnected = false, this.emit("connect"), this.emitBuffered();
  }, d3.prototype.emitBuffered = function() {
    var e4;
    for (e4 = 0; e4 < this.receiveBuffer.length; e4++)
      l2.apply(this, this.receiveBuffer[e4]);
    for (this.receiveBuffer = [], e4 = 0; e4 < this.sendBuffer.length; e4++)
      this.packet(this.sendBuffer[e4]);
    this.sendBuffer = [];
  }, d3.prototype.ondisconnect = function() {
    this.nsp, this.destroy(), this.onclose("io server disconnect");
  }, d3.prototype.destroy = function() {
    if (this.subs) {
      for (var e4 = 0; e4 < this.subs.length; e4++)
        this.subs[e4].destroy();
      this.subs = null;
    }
    this.io.destroy(this);
  }, d3.prototype.close = d3.prototype.disconnect = function() {
    return this.connected && (this.nsp, this.packet({ type: s3.DISCONNECT })), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
  }, d3.prototype.compress = function(e4) {
    return this.flags.compress = e4, this;
  }, d3.prototype.binary = function(e4) {
    return this.flags.binary = e4, this;
  };
}(Ci);
var Ti = Oi;
function Oi(e3) {
  e3 = e3 || {}, this.ms = e3.min || 100, this.max = e3.max || 1e4, this.factor = e3.factor || 2, this.jitter = e3.jitter > 0 && e3.jitter <= 1 ? e3.jitter : 0, this.attempts = 0;
}
Oi.prototype.duration = function() {
  var e3 = this.ms * Math.pow(this.factor, this.attempts++);
  if (this.jitter) {
    var t2 = Math.random(), s3 = Math.floor(t2 * this.jitter * e3);
    e3 = 0 == (1 & Math.floor(10 * t2)) ? e3 - s3 : e3 + s3;
  }
  return 0 | Math.min(e3, this.max);
}, Oi.prototype.reset = function() {
  this.attempts = 0;
}, Oi.prototype.setMin = function(e3) {
  this.ms = e3;
}, Oi.prototype.setMax = function(e3) {
  this.max = e3;
}, Oi.prototype.setJitter = function(e3) {
  this.jitter = e3;
};
class Ri {
  static init(e3, t2, s3) {
    this.host = e3, (void 0 !== t2 && false === t2 || true === s3) && (this.https = false);
  }
  static isMP() {
    return [l$1.MP_WX, l$1.MP_ALI, l$1.MP_BYTE, l$1.MP_WGAME, l$1.MP_BAIDU].includes(d$1.currentPlatform());
  }
  static uri() {
    let e3 = "http";
    return this.https && (e3 += "s"), e3 + "://" + this.index() + this.host;
  }
  static index() {
    return 0 == this.i ? this.i = Math.floor(Math.random() * this.max) + 1 : this.i = this.i % this.max + 1, this.i;
  }
}
Ri.i = 0, Ri.max = 5, Ri.https = true;
var Ai = w$1(Object.freeze({ __proto__: null, URIResolver: Ri })), Pi = w$1(E$1), ki = jt$1.exports, _i = Ci.exports, Di = M$1.exports, xi = Lt$1, Ui = Mi, Fi = Ni, Gi = (Tt$1.exports("socket.io-client:manager"), hi), Li = Ti;
const { URIResolver: Bi } = Ai;
var qi = Pi.runStatus, ji = Object.prototype.hasOwnProperty, Hi = Vi;
function Vi(e3, t2) {
  if (!(this instanceof Vi))
    return new Vi(e3, t2);
  e3 && "object" == typeof e3 && (t2 = e3, e3 = void 0), (t2 = t2 || {}).path = t2.path || "/socket.io", this.nsps = {}, this.subs = [], this.opts = t2, this.reconnection(false !== t2.reconnection), this.reconnectionAttempts(t2.reconnectionAttempts || 1 / 0), this.reconnectionDelay(t2.reconnectionDelay || 1e3), this.reconnectionDelayMax(t2.reconnectionDelayMax || 5e3), this.randomizationFactor(t2.randomizationFactor || 0.5), this.backoff = new Li({ min: this.reconnectionDelay(), max: this.reconnectionDelayMax(), jitter: this.randomizationFactor() }), this.timeout(null == t2.timeout ? 2e4 : t2.timeout), this.readyState = "closed", this.uri = e3, this.connecting = [], this.lastPing = null, this.encoding = false, this.packetBuffer = [];
  var s3 = t2.parser || xi;
  this.encoder = new s3.Encoder(), this.decoder = new s3.Decoder(), this.autoConnect = false !== t2.autoConnect, this.autoConnect && this.open();
}
Vi.prototype.emitAll = function() {
  for (var e3 in this.emit.apply(this, arguments), this.nsps)
    ji.call(this.nsps, e3) && this.nsps[e3].emit.apply(this.nsps[e3], arguments);
}, Vi.prototype.updateSocketIds = function() {
  for (var e3 in this.nsps)
    ji.call(this.nsps, e3) && (this.nsps[e3].id = this.generateId(e3));
}, Vi.prototype.generateId = function(e3) {
  return ("/" === e3 ? "" : e3 + "#") + this.engine.id;
}, Di(Vi.prototype), Vi.prototype.reconnection = function(e3) {
  return arguments.length ? (this._reconnection = !!e3, this) : this._reconnection;
}, Vi.prototype.reconnectionAttempts = function(e3) {
  return arguments.length ? (this._reconnectionAttempts = e3, this) : this._reconnectionAttempts;
}, Vi.prototype.reconnectionDelay = function(e3) {
  return arguments.length ? (this._reconnectionDelay = e3, this.backoff && this.backoff.setMin(e3), this) : this._reconnectionDelay;
}, Vi.prototype.randomizationFactor = function(e3) {
  return arguments.length ? (this._randomizationFactor = e3, this.backoff && this.backoff.setJitter(e3), this) : this._randomizationFactor;
}, Vi.prototype.reconnectionDelayMax = function(e3) {
  return arguments.length ? (this._reconnectionDelayMax = e3, this.backoff && this.backoff.setMax(e3), this) : this._reconnectionDelayMax;
}, Vi.prototype.timeout = function(e3) {
  return arguments.length ? (this._timeout = e3, this) : this._timeout;
}, Vi.prototype.maybeReconnectOnOpen = function() {
  !this.reconnecting && this._reconnection && 0 === this.backoff.attempts && this.reconnect();
}, Vi.prototype.open = Vi.prototype.connect = function(e3, t2) {
  if (this.readyState, ~this.readyState.indexOf("open"))
    return this;
  this.uri, this.engine = ki(this.uri, this.opts);
  var s3 = this.engine, i3 = this;
  this.readyState = "opening", this.skipReconnect = false;
  var n2 = Ui(s3, "open", function() {
    i3.onopen(), e3 && e3();
  }), o2 = Ui(s3, "error", async function(t3) {
    if (i3.uri = Bi.uri(), i3.cleanup(), i3.readyState = "closed", i3.emitAll("connect_error", t3), e3) {
      var s4 = new Error("Connection error");
      s4.data = t3, e3(s4);
    } else
      i3.maybeReconnectOnOpen();
  });
  if (false !== this._timeout) {
    var r2 = this._timeout, a3 = setTimeout(function() {
      n2.destroy(), s3.close(), s3.emit("error", "timeout"), i3.emitAll("connect_timeout", r2);
    }, r2);
    this.subs.push({ destroy: function() {
      clearTimeout(a3);
    } });
  }
  return this.subs.push(n2), this.subs.push(o2), this;
}, Vi.prototype.onopen = function() {
  this.cleanup(), this.readyState = "open", this.emit("open");
  var e3 = this.engine;
  this.subs.push(Ui(e3, "data", Fi(this, "ondata"))), this.subs.push(Ui(e3, "ping", Fi(this, "onping"))), this.subs.push(Ui(e3, "pong", Fi(this, "onpong"))), this.subs.push(Ui(e3, "error", Fi(this, "onerror"))), this.subs.push(Ui(e3, "close", Fi(this, "onclose"))), this.subs.push(Ui(this.decoder, "decoded", Fi(this, "ondecoded")));
}, Vi.prototype.onping = function() {
  this.lastPing = /* @__PURE__ */ new Date(), this.emitAll("ping");
}, Vi.prototype.onpong = function() {
  this.emitAll("pong", /* @__PURE__ */ new Date() - this.lastPing);
}, Vi.prototype.ondata = function(e3) {
  this.decoder.add(e3);
}, Vi.prototype.ondecoded = function(e3) {
  this.emit("packet", e3);
}, Vi.prototype.onerror = function(e3) {
  this.emitAll("error", e3);
}, Vi.prototype.socket = function(e3, t2) {
  var s3 = this.nsps[e3];
  if (!s3) {
    s3 = new _i(this, e3, t2), this.nsps[e3] = s3;
    var i3 = this;
    s3.on("connecting", n2), s3.on("connect", function() {
      s3.id = i3.generateId(e3);
    }), this.autoConnect && n2();
  }
  function n2() {
    ~Gi(i3.connecting, s3) || i3.connecting.push(s3);
  }
  return s3;
}, Vi.prototype.destroy = function(e3) {
  var t2 = Gi(this.connecting, e3);
  ~t2 && this.connecting.splice(t2, 1), this.connecting.length || this.close();
}, Vi.prototype.packet = function(e3) {
  var t2 = this;
  e3.query && 0 === e3.type && (e3.nsp += "?" + e3.query), t2.encoding ? t2.packetBuffer.push(e3) : (t2.encoding = true, this.encoder.encode(e3, function(s3) {
    for (var i3 = 0; i3 < s3.length; i3++)
      t2.engine.write(s3[i3], e3.options);
    t2.encoding = false, t2.processPacketQueue();
  }));
}, Vi.prototype.processPacketQueue = function() {
  if (this.packetBuffer.length > 0 && !this.encoding) {
    var e3 = this.packetBuffer.shift();
    this.packet(e3);
  }
}, Vi.prototype.cleanup = function() {
  for (var e3 = this.subs.length, t2 = 0; t2 < e3; t2++) {
    this.subs.shift().destroy();
  }
  this.packetBuffer = [], this.encoding = false, this.lastPing = null, this.decoder.destroy();
}, Vi.prototype.close = Vi.prototype.disconnect = function() {
  this.skipReconnect = true, this.reconnecting = false, "opening" === this.readyState && this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.engine && this.engine.close();
}, Vi.prototype.onclose = function(e3) {
  this.cleanup(), this.backoff.reset(), this.readyState = "closed", this.emit("close", e3), this._reconnection && !this.skipReconnect && this.reconnect();
}, Vi.prototype.reconnect = function() {
  if (qi.isBackend(), this.reconnecting || this.skipReconnect)
    return this;
  var e3 = this;
  if (this.backoff.attempts >= this._reconnectionAttempts)
    this.backoff.reset(), this.emitAll("reconnect_failed"), this.reconnecting = false;
  else {
    var t2 = this.backoff.duration();
    this.reconnecting = true;
    var s3 = setTimeout(function() {
      if (qi.isBackend())
        return e3.reconnecting = false, e3.reconnect(), void e3.emitAll("reconnect_error", "Uniapp running backend, skipped reconnect...");
      e3.skipReconnect || (e3.emitAll("reconnect_attempt", e3.backoff.attempts), e3.emitAll("reconnecting", e3.backoff.attempts), e3.skipReconnect || e3.open(function(t3) {
        t3 ? (e3.reconnecting = false, e3.reconnect(), e3.emitAll("reconnect_error", t3.data)) : e3.onreconnect();
      }));
    }, t2);
    this.subs.push({ destroy: function() {
      clearTimeout(s3);
    } });
  }
}, Vi.prototype.onreconnect = function() {
  var e3 = this.backoff.attempts;
  this.reconnecting = false, this.backoff.reset(), this.updateSocketIds(), this.emitAll("reconnect", e3);
}, function(e3, t2) {
  var s3 = Gt$1, i3 = Lt$1, n2 = Hi;
  Tt$1.exports("socket.io-client");
  e3.exports = t2 = r2;
  var o2 = t2.managers = {};
  function r2(e4, t3) {
    "object" == typeof e4 && (t3 = e4, e4 = void 0), t3 = t3 || {};
    var i4, r3 = s3(e4), a3 = r3.source, c3 = r3.id, u2 = r3.path, l2 = o2[c3] && u2 in o2[c3].nsps;
    return t3.forceNew || t3["force new connection"] || false === t3.multiplex || l2 ? i4 = n2(a3, t3) : (o2[c3] || (o2[c3] = n2(a3, t3)), i4 = o2[c3]), r3.query && !t3.query && (t3.query = r3.query), i4.socket(r3.path, t3);
  }
  t2.protocol = i3.protocol, t2.connect = r2, t2.Manager = Hi, t2.Socket = Ci.exports;
}(wt$1, wt$1.exports);
const zi = wt$1.exports;
class Wi {
  constructor() {
    this.io = zi, this.status = t$1.DISCONNECTED, this.permissions = [ne$1.NONE], this.connectedObservers = [], this.disconnectedObservers = [];
  }
  connect() {
    this.status = t$1.CONNECTING;
  }
  socketio() {
    return this.io;
  }
  on(e3, t2) {
    this.io.on(e3, t2);
  }
  disconnect() {
    this.io.disconnect();
  }
  getStatus() {
    return this.status;
  }
  addConnectedObserver(e3) {
    u$1.isFunction(e3) && this.connectedObservers.push(e3);
  }
  addDisconnectedObserver(e3) {
    u$1.isFunction(e3) && this.disconnectedObservers.push(e3);
  }
  notify(e3, t2) {
    for (let s3 = 0; s3 < e3.length; s3++)
      e3[s3](t2);
  }
}
class Xi extends Wi {
  constructor(e3) {
    super(), this.reconnectingObservers = [], this.addReconnectingObserver(e3.onReconnecting), this.addDisconnectedObserver(e3.onDisconnected);
  }
  connect(e3) {
    super.connect(), this.io = this.io.connect(e3.uri, e3.opts), this.initListener();
  }
  initListener() {
    this.io.on("connect", () => {
      this.status = t$1.CONNECTED, this.notify(this.connectedObservers);
    }), this.io.on("reconnecting", (e3) => {
      this.status = t$1.CONNECTING, this.notify(this.reconnectingObservers, e3);
    }), this.io.on("disconnect", () => {
      this.status = t$1.DISCONNECTED, this.notify(this.disconnectedObservers);
    }), this.io.on("connect_error", function(e3) {
    });
  }
  addReconnectingObserver(e3) {
    this.reconnectingObservers.push(e3);
  }
}
class Ji {
  static get(e3) {
    const t2 = encodeURIComponent(e3) + "=", s3 = document.cookie.split("; ");
    for (const e4 of s3)
      if (e4.startsWith(t2))
        return decodeURIComponent(e4.substring(t2.length));
    return null;
  }
  static set(e3, t2, s3, i3, n2 = "/", o2 = false) {
    let r2 = encodeURIComponent(e3) + "=" + encodeURIComponent(t2);
    s3 instanceof Date && (r2 += "; expires=" + s3.toGMTString()), n2 && (r2 += "; path=" + n2), i3 && (r2 += "; domain=" + i3), o2 && (r2 += "; secure"), document.cookie = r2;
  }
  static remove(e3, t2, s3 = "/", i3 = false) {
    Ji.set(e3, "", /* @__PURE__ */ new Date(0), t2, s3, i3);
  }
}
class Yi {
  asyncGet(e3) {
    let t2 = this.get(e3);
    return Promise.resolve(t2);
  }
  asyncPut(e3, t2) {
    return this.put(e3, t2), Promise.resolve();
  }
  get(e3) {
    let t2 = this.doGet(e3);
    return t2 = JSON.parse(t2), t2;
  }
  put(e3, t2) {
    this.doPut(e3, JSON.stringify(t2));
  }
}
class $i extends Yi {
  constructor() {
    super(), this.domain = null;
    this.domain = "undefined" != typeof location && /^(?:[A-za-z0-9-]+\.)+[A-za-z]{2,4}(?:[\/\?#][\/=\?%\-&~`@[\]\':+!\.#\w]*)?$/.test(location.host) ? location.host.split(".").slice(-2).join(".") : null;
  }
  doGet(e3) {
    return Ji.get(e3) || null;
  }
  doPut(e3, t2) {
    const s3 = new Date(2030, 12, 31, 0, 0, 0, 0), i3 = this.domain;
    Ji.set(e3, t2, s3, i3);
  }
  remove(e3) {
    const t2 = this.domain;
    Ji.remove(e3, t2);
  }
  support() {
    return "undefined" != typeof navigator && true === navigator.cookieEnabled;
  }
}
class Qi extends Yi {
  doGet(e3) {
    return localStorage.getItem(e3) || null;
  }
  doPut(e3, t2) {
    localStorage.setItem(e3, t2);
  }
  remove(e3) {
    localStorage.removeItem(e3);
  }
  support() {
    return !("undefined" != typeof GameGlobal || "undefined" == typeof localStorage || !localStorage.setItem);
  }
}
class Ki extends Yi {
  doGet(e3) {
    return index.getStorageSync(e3) || null;
  }
  doPut(e3, t2) {
    index.setStorageSync(e3, t2);
  }
  remove(e3) {
    index.removeStorageSync(e3);
  }
  support() {
    return !("object" != typeof index || !index.getStorageSync);
  }
}
class Zi extends Yi {
  doGet(e3) {
    return cc.sys.localStorage.getItem(e3) || null;
  }
  doPut(e3, t2) {
    cc.sys.localStorage.setItem(e3, t2);
  }
  remove(e3) {
    cc.sys.localStorage.removeItem(e3);
  }
  support() {
    return "undefined" != typeof cc && void 0 !== cc.sys.localStorage;
  }
}
class en extends Yi {
  doGet(e3) {
    return wx$1.getStorageSync(e3) || null;
  }
  doPut(e3, t2) {
    wx$1.setStorageSync(e3, t2);
  }
  remove(e3) {
    wx$1.removeStorageSync(e3);
  }
  support() {
    return !("object" != typeof wx$1 || !wx$1.getStorageSync || "undefined" != typeof tt);
  }
}
class tn extends Yi {
  asyncGet(e3) {
    return b$1(this, void 0, void 0, function* () {
      const t2 = yield i$1.asyncStorage.getItem(e3);
      return JSON.parse(t2);
    });
  }
  asyncPut(e3, t2) {
    return i$1.asyncStorage.setItem(e3, JSON.stringify(t2));
  }
  doPut(e3, t2) {
    throw new Error("Method not implemented.");
  }
  remove(e3) {
    i$1.asyncStorage.removeItem(e3);
  }
  support() {
    return s$1.currentFramework() === e$1.REACT_NATIVE;
  }
  doGet(e3) {
    throw new Error("Method not implemented.");
  }
}
class sn extends Yi {
  doGet(e3) {
    const t2 = my.getStorageSync({ key: e3 }).data || null;
    return "string" == typeof JSON.parse(t2) ? JSON.parse(t2) : t2;
  }
  doPut(e3, t2) {
    my.setStorageSync({ key: e3, data: JSON.stringify(t2) });
  }
  remove(e3) {
    my.removeStorageSync({ key: e3 });
  }
  support() {
    return !("undefined" == typeof my || !my.getStorageSync);
  }
}
class nn extends Yi {
  doGet(e3) {
    return tt.getStorageSync(e3) || null;
  }
  doPut(e3, t2) {
    tt.setStorageSync(e3, t2);
  }
  remove(e3) {
    tt.removeStorageSync(e3);
  }
  support() {
    return !("object" != typeof tt || !tt.getStorageSync);
  }
}
class on extends Yi {
  doGet(e3) {
    return swan.getStorageSync(e3) || null;
  }
  doPut(e3, t2) {
    swan.setStorageSync(e3, t2);
  }
  remove(e3) {
    swan.removeStorageSync(e3);
  }
  support() {
    return !("undefined" == typeof swan || !swan.getStorageSync);
  }
}
class rn {
  constructor() {
    this.supportedStorage = null;
    const e3 = rn.storages;
    e3.push(new Ki()), e3.push(new Zi()), e3.push(new Qi()), e3.push(new en()), e3.push(new tn()), e3.push(new sn()), e3.push(new on()), e3.push(new nn()), e3.push(new $i()), this.dispatch(), this.supportedStorage;
  }
  static localStorage() {
    return this.instance.supportedStorage;
  }
  dispatch() {
    for (let e3 of rn.storages)
      if (e3.support()) {
        this.supportedStorage = e3;
        break;
      }
  }
}
rn.storages = new Array(), rn.instance = new rn();
class an {
  static get() {
    return b$1(this, void 0, void 0, function* () {
      let e3, t2 = rn.localStorage();
      return null !== t2 && (e3 = yield t2.asyncGet(an.SM_KEY)), e3;
    });
  }
  static put(e3) {
    return b$1(this, void 0, void 0, function* () {
      var t2 = rn.localStorage();
      let s3 = e3.sm;
      null !== t2 && s3 && t2.asyncPut(an.SM_KEY, s3);
    });
  }
}
an.SM_KEY = "GE-SM";
class cn {
  static e(e3, t2) {
    function s3(e4) {
      return function(e5) {
        return e5 >= 32 && e5 <= 126;
      }(e4) ? String.fromCharCode(function(e5) {
        let s4 = e5 + t2;
        return s4 > 126 ? s4 - 126 + 32 : s4;
      }(e4)) : String.fromCharCode(e4);
    }
    let i3 = "";
    for (let t3 = 0; t3 < e3.length; t3++) {
      i3 += s3(e3.charCodeAt(t3));
    }
    return i3;
  }
}
class un {
  static initRNUniqueId() {
    if (s$1.currentFramework() === e$1.REACT_NATIVE) {
      let e3 = i$1.platform, t2 = e3.constants, s3 = { os: e3.OS };
      return "android" === s3.os ? s3.f = t2.Fingerprint : s3.v = e3.Version, JSON.stringify(s3);
    }
    return null;
  }
  static initPlusDeviceId() {
    return new Promise((e3, t2) => {
      "undefined" != typeof plus ? plus.device.getInfo({ success: (t3) => {
        e3(t3.uuid);
      }, fail: (e4) => {
        t2(e4);
      } }) : e3(null);
    });
  }
  static getVideoCard() {
    var e3;
    if (d$1.currentPlatform() === l$1.BROWSER && "undefined" != typeof document) {
      const t2 = document.createElement("canvas"), s3 = null !== (e3 = t2.getContext("webgl")) && void 0 !== e3 ? e3 : t2.getContext("experimental-webgl");
      if (s3 && "getExtension" in s3) {
        let e4 = 0, t3 = 0;
        if (navigator.userAgent.indexOf("Firefox") > -1)
          t3 = s3.VENDOR, e4 = s3.RENDERER;
        else {
          let i4 = s3.getExtension("WEBGL_debug_renderer_info");
          if (!i4)
            return null;
          t3 = i4.UNMASKED_VENDOR_WEBGL, e4 = i4.UNMASKED_RENDERER_WEBGL;
        }
        const i3 = { vendor: (s3.getParameter(t3) || "").toString(), renderer: (s3.getParameter(e4) || "").toString() };
        return JSON.stringify(i3);
      }
    }
    return null;
  }
  static z() {
    return b$1(this, void 0, void 0, function* () {
      const e3 = { p: d$1.currentPlatform(), f: s$1.currentFramework(), vc: this.getVideoCard(), rfp: this.initRNUniqueId() };
      return cn.e(JSON.stringify(e3), 5);
    });
  }
}
class ln {
  constructor(e3) {
    this.rocketsBuffer = /* @__PURE__ */ new Set(), this.socket = e3, this.socket.addConnectedObserver(this.onSocketConnected.bind(this));
  }
  emit(e3) {
    this.socket.status !== t$1.DISCONNECTED ? (e3.start(), this.doEmit(e3)) : e3.fail({ resultCode: "409", content: "Please connect first" });
  }
  doEmit(e3) {
    if (!e3.complete)
      if (this.socket.status !== t$1.CONNECT_FAILED)
        if (this.isConnected())
          if (this.hasPermission(e3)) {
            let t2 = setTimeout(() => {
              this.doEmit(e3);
            }, e3.singleTimeout);
            e3.unique && (e3.params.retried = e3.retried), this.socket.socketio().emit(e3.name, e3.params, (s3) => {
              clearTimeout(t2), 200 === s3.resultCode || 200 == s3.code ? e3.success(s3) : e3.fail(s3);
            }), e3.retried++;
          } else
            e3.fail({ resultCode: 401, content: "No permission" });
        else
          this.isConnecting() && this.rocketsBuffer.add(e3);
      else
        e3.fail({ resultCode: 408, content: "Failed to connect GoEasy." });
  }
  hasPermission(e3) {
    return !!this.socket.permissions.find((t2) => t2 === e3.permission);
  }
  isConnected() {
    return [t$1.CONNECTED, t$1.RECONNECTED, t$1.EXPIRED_RECONNECTED, t$1.DISCONNECTING].includes(this.socket.status);
  }
  isConnecting() {
    return [t$1.CONNECTING, t$1.RECONNECTING].includes(this.socket.status);
  }
  onSocketConnected() {
    this.emitBuffer();
  }
  emitBuffer() {
    Array.from(this.rocketsBuffer).forEach((e3) => {
      this.rocketsBuffer.delete(e3), this.doEmit(e3);
    });
  }
}
class dn extends Q$1 {
  static init() {
    dn.i = new dn();
  }
  static fire(e3, t2) {
    this.i.fire(e3, t2);
  }
  static on(e3, t2) {
    this.i.on(e3, t2);
  }
  static off(e3, t2) {
    this.i.off(e3, t2);
  }
}
class hn extends Wi {
  constructor(e3, t2) {
    super(), this.ioSocket = null, this.sid = null, this.anonymous = false, this.userId = null, this.artifactVersion = n$1, this.vname = null, this.uri = null, this.ioOpts = null, this.reconnectingTimes = 0, this.messageObservers = /* @__PURE__ */ new Map(), this.connectFailedObservers = [], this.connectingObservers = [], this.expiredReconnectedObservers = [], this.options = e3, this.ioSocket = new Xi({ onDisconnected: this.onIoDisconnected.bind(this), onReconnecting: this.onIoReconnecting.bind(this) }), this.ioSocketEmitter = new ln(this.ioSocket), this.ioSocket.addConnectedObserver(this.onIoReconnected.bind(this)), this.initOptions(t2), this.connect();
  }
  initUserId() {
    let e3 = this.connectOptions.id;
    u$1.isEmpty(e3) ? this.anonymous = true : this.userId = e3.toString();
  }
  socketio() {
    return this.ioSocket.socketio();
  }
  extendOptions() {
    let e3 = this.connectOptions;
    if (u$1.isNull(e3.data) || u$1.isDef(e3.data) && !u$1.isObject(e3.data))
      throw { code: 400, content: "TypeError: data requires an object." };
    if ((u$1.isDef(e3.data) ? String(e3.data).length : 0) > 300 && u$1.isObject(e3) && u$1.isFunction(e3.onFailed))
      throw { code: 400, content: "user.data-length limit 300 byte." };
    if (u$1.isObject(e3.wxmpId)) {
      if (u$1.isEmpty(e3.wxmpId.appid))
        throw { code: 400, content: "wxmpId.appid is required." };
      if (u$1.isEmpty(e3.wxmpId.openid))
        throw { code: 400, content: "wxmpId.openid is required. requires string." };
    } else if (u$1.isPrimitive(e3.wxmpId))
      throw { code: 400, content: "TypeError: wxmpId requires an object." };
  }
  initUriAndOpts() {
    let e3 = this.options;
    Ri.init(e3.host, e3.forceTLS, e3.supportOldBrowser), this.uri = Ri.uri();
    let t2 = ["websocket"];
    true === e3.supportOldBrowser && t2.push("polling"), this.ioOpts = { transports: t2, timeout: S$1.connect, reconnectionDelayMax: S$1.reconnectionDelayMax };
  }
  onIoReconnected() {
    this.status === t$1.RECONNECTING && this.authorize();
  }
  sendAck(e3, t2) {
    this.ioSocket.io.emit(e3, t2);
  }
  initOptions(e3) {
    this.connectOptions = e3, this.addConnectedObserver(e3.onSuccess), this.addConnectFailedObserver(e3.onFailed), this.addConnectingObserver(e3.onProgress), this.initUserId();
  }
  connect() {
    this.initUriAndOpts(), this.extendOptions(), super.connect(), this.onConnecting(), this.ioSocket.connect({ uri: this.uri, opts: this.ioOpts }), this.authorize();
  }
  disconnect() {
    return new Promise((e3, s3) => {
      this.status = t$1.DISCONNECTING;
      let i3 = () => {
        this.ioSocket.disconnect(), this.status = t$1.DISCONNECTED, dn.fire(fe$1.DISCONNECTED), e3();
      };
      const n2 = J$1.modules.get("GN");
      if (n2 && (n2.params.regId || this.connectOptions.wxmpId)) {
        let e4 = (e5) => {
          s3(e5);
        }, t2 = new re$1({ name: y$1.manualDisconnect, params: {}, permission: ne$1.READ, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: e4, success: i3 });
        te$1.Socket.e(t2);
      } else
        i3();
    });
  }
  authorize() {
    return b$1(this, void 0, void 0, function* () {
      let e3 = this.connectOptions, t2 = { appkey: this.options.appkey, userId: this.userId, userData: JSON.stringify(e3.data), otp: e3.otp, artifactVersion: this.artifactVersion, sid: this.sid, mP: yield J$1.getParams(), a: this.anonymous, z: yield un.z(), sm: yield an.get(), c: { n: this.vname, v: this.artifactVersion } };
      JSON.stringify(t2);
      let s3 = new re$1({ name: y$1.authorize, params: t2, permission: ne$1.NONE, singleTimeout: S$1.commonInfiniteSingle, totalTimeout: S$1.commonInfiniteTotal, success: (e4) => {
        this.onAuthorizeSuccess(e4);
      }, fail: (e4) => {
        this.onAuthorizeFailed(e4);
      } });
      this.ioSocketEmitter.emit(s3);
    });
  }
  onConnecting() {
    dn.fire(fe$1.CONNECTING, this.reconnectingTimes), this.notify(this.connectingObservers, this.reconnectingTimes);
  }
  onIoReconnecting() {
    this.reconnectingTimes++, this.status == t$1.CONNECTED || this.status == t$1.EXPIRED_RECONNECTED || this.status == t$1.RECONNECTING ? this.status = t$1.RECONNECTING : this.status = t$1.CONNECTING, this.onConnecting();
  }
  onIoDisconnected() {
    this.status !== t$1.DISCONNECTING && (this.status = t$1.RECONNECTING, dn.fire(fe$1.LOST), this.notify(this.disconnectedObservers));
  }
  onAuthorizeSuccess(e3) {
    if (an.put(e3), J$1.setDatas(e3.mD), this.status === t$1.RECONNECTING) {
      this.sid !== e3.sid ? (this.status = t$1.EXPIRED_RECONNECTED, this.sid = e3.sid, dn.fire(fe$1.EXPIRED_RECONNECTED), this.notify(this.expiredReconnectedObservers)) : (this.status = t$1.RECONNECTED, dn.fire(fe$1.RECONNECTED));
    } else
      this.status = t$1.CONNECTED, this.sid = e3.sid;
    e3.enablePublish && (this.permissions.find((e4) => e4 == ne$1.WRITE) || this.permissions.push(ne$1.WRITE)), e3.enableSubscribe && (this.permissions.find((e4) => e4 == ne$1.READ) || this.permissions.push(ne$1.READ)), this.reconnectingTimes = 0, dn.fire(fe$1.CONNECTED), this.notify(this.connectedObservers);
  }
  onAuthorizeFailed(e3) {
    this.ioSocket.disconnect(), this.status = t$1.CONNECT_FAILED;
    let s3 = { code: e3.resultCode || 408, content: e3.content || "Host unreachable or timeout" };
    this.notify(this.connectFailedObservers, s3);
  }
  addConnectingObserver(e3) {
    u$1.isFunction(e3) && this.connectingObservers.push(e3);
  }
  addConnectFailedObserver(e3) {
    u$1.isFunction(e3) && this.connectFailedObservers.push(e3);
  }
  addExpiredReconnectedObserver(e3) {
    u$1.isFunction(e3) && this.expiredReconnectedObservers.push(e3);
  }
  onMessage(e3, t2) {
    this.ioSocket.io._callbacks.hasOwnProperty("$" + e3) || this.ioSocket.io.on(e3, t2);
  }
  user() {
    let e3 = this.connectOptions;
    return e3 ? { id: e3.id, data: e3.data } : null;
  }
}
class pn {
  constructor(e3) {
    this.guidList = [], this.socket = e3;
  }
  offMessage(e3, t2) {
    dn.off(fe$1.NEW_MESSAGE + "_" + e3, t2);
  }
  onMessage(e3, t2) {
    dn.on(fe$1.NEW_MESSAGE + "_" + e3, t2), this.socket.onMessage(e3, (t3) => {
      this.fire(e3, t3);
    });
  }
  fire(e3, t2) {
    let s3 = this.filter(t2);
    s3 && dn.fire(fe$1.NEW_MESSAGE + "_" + e3, s3);
  }
  filter(e3) {
    if ("string" == typeof e3 && (e3 = JSON.parse(e3)), e3.i) {
      if (this.guidList.findIndex((t2) => t2 === e3.i) > -1)
        return;
      this.guidList.unshift(e3.i), this.guidList.length > 300 && this.guidList.pop();
    }
    return e3;
  }
}
class mn {
  static init(e3) {
    this.i = new mn(e3);
  }
  constructor(e3) {
    this.goeasyOptions = e3;
  }
  static connect(e3, s3) {
    if (this.status() !== t$1.DISCONNECTED && u$1.isObject(e3) && u$1.isFunction(e3.onFailed))
      return void e3.onFailed({ code: 408, content: "It is already connected, don't try again until disconnect() is called. " });
    this.confirmUserIdAndData(e3), dn.init();
    let i3 = this.i;
    J$1.preConnect(e3), i3.socket = new hn(i3.goeasyOptions, e3), i3.socket.vname = s3, i3.emitter = new ln(i3.socket), i3.messageListener = new pn(i3.socket), J$1.postConnect();
  }
  static confirmUserIdAndData(e3) {
    if (J$1.modules.get("GIM"))
      le$1.validateId(e3.id, "id"), le$1.validateObject(e3.data, "data");
    else if ("string" == typeof e3.id && e3.id.length > 60)
      throw { code: 400, content: "id over max length 60" };
  }
  static e(e3) {
    this.i.emitter.emit(e3);
  }
  static sendAck(e3, t2) {
    this.i.socket.sendAck(e3, t2);
  }
  static status() {
    return this.i && this.i.socket ? this.i.socket.getStatus() : t$1.DISCONNECTED;
  }
  static on(e3, t2) {
    dn.on(e3, t2);
  }
  static off(e3, t2) {
    dn.off(e3, t2);
  }
  static offMessage(e3, t2) {
    this.i.messageListener.offMessage(e3, t2);
  }
  static onMessage(e3, t2) {
    this.i.messageListener.onMessage(e3, t2);
  }
  static disconnect(e3) {
    this.status() === t$1.CONNECTED || this.status() === t$1.RECONNECTED ? this.i.socket.disconnect().then(() => {
      v$1.onSuccess(e3);
    }).catch((t2) => {
      v$1.onFailed(e3, t2);
    }) : v$1.onFailed(e3, { code: 408, content: "Host unreachable or timeout" });
  }
  static user() {
    return this.i.socket.user();
  }
}
mn.EVENT = fe$1;
class fn {
  static getInstance() {
    return fn.instance || (fn.instance = new fn()), fn.instance;
  }
  constructor() {
    this.synchronized = true, this.onlineChanged = (e3) => {
      e3.online ? this.teamIds.add(e3.teamId) : this.teamIds.delete(e3.teamId);
    }, this.onDisconnected = () => {
      this.queryMyTeamPromise = null, this.teamIds = null;
    }, this.onConnected = () => {
      this.synchronized && (this.queryMyTeamPromise = this.queryTeams());
    }, mn.on(mn.EVENT.LOST, this.onDisconnected), mn.on(mn.EVENT.RECONNECTED, this.onConnected), mn.onMessage(me$1.CS_ONLINE_CHANGED, this.onlineChanged);
  }
  queryTeams() {
    return this.queryMyTeamPromise || (this.queryMyTeamPromise = new Promise((e3, t2) => {
      let s3 = new re$1({ name: y$1.CS_MY_TEAMS, params: {}, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e4) => {
        t2(e4);
      }, success: (t3) => {
        this.teamIds = new Set(t3.content), this.synchronized = true, e3(this.teamIds);
      } });
      te$1.Socket.e(s3);
    })), this.queryMyTeamPromise;
  }
  myTeams() {
    if (this.synchronized && this.queryMyTeamPromise)
      return this.teamIds;
    throw "please query team first.";
  }
  isOnline(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      yield this.queryTeams(), v$1.onSuccess(t2, this.teamIds.has(e3));
    });
  }
  online(e3, t2) {
    if (!u$1.isObject(t2.agentData) || !u$1.isObject(t2.teamData))
      throw { code: 400, content: "agentData and teamData require an object" };
    let s3 = new vt$1(e3, t2.teamData, t2.agentData), i3 = new re$1({ name: y$1.CS_ONLINE, params: s3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e4) => {
      v$1.onFailed(t2, e4);
    }, success: (s4) => {
      this.teamIds.add(e3), v$1.onSuccess(t2), $e$1.i.fire(Be$1.CS_ONLINE_SUCCESS);
    } });
    te$1.Socket.e(i3);
  }
  offline(e3, t2) {
    let s3 = new bt$1(e3), i3 = new re$1({ name: y$1.CS_OFFLINE, params: s3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e4) => {
      v$1.onFailed(t2, e4);
    }, success: (s4) => {
      this.teamIds.delete(e3), v$1.onSuccess(t2), $e$1.i.fire(Be$1.CS_OFFLINE_SUCCESS);
    } });
    te$1.Socket.e(i3);
  }
  agents(e3, t2) {
    let s3 = new Ct$1(e3), i3 = new re$1({ name: y$1.CS_AGENTS, params: s3, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e4) => {
      v$1.onFailed(t2, e4);
    }, success: (e4) => {
      e4.content.forEach((e5) => {
        e5.data = JSON.parse(e5.data);
      }), v$1.onSuccess(t2, e4);
    } });
    te$1.Socket.e(i3);
  }
}
class gn {
  constructor(e3) {
    this.onMessageReceived = (e4) => {
      let t2 = gn.session;
      if (e4.scene() === o$1.CS && t2.liveOptions) {
        let s3 = e4, i3 = t2.liveOptions.customerId;
        t2.teamId === s3.teamId && s3.customerId() === i3 && (t2.tryUpdateStatus(s3), t2.liveOptions.onNewMessage(s3));
      }
    }, this.teamId = e3, $e$1.i.on(Be$1.CS_AGENT_MESSAGE_RECEIVED, this.onMessageReceived), $e$1.i.on(Be$1.CS_ACCEPTED, this.onMessageReceived), $e$1.i.on(Be$1.CS_ENDED, this.onMessageReceived), $e$1.i.on(Be$1.CS_TRANSFER, this.onMessageReceived), mn.on(fe$1.DISCONNECTED, gn.destroy);
  }
  static live(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = t2.customerId;
      le$1.validateId(s3, "customerId");
      let i3 = new St$1(e3, s3);
      yield fn.getInstance().queryTeams();
      let n2 = new re$1({ name: y$1.CS_LIVE_SESSION, params: i3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e4) => {
        v$1.onFailed(t2, e4);
      }, success: (s4) => {
        gn.destroy(), this.session = new gn(e3), this.session.liveOptions = t2;
        let i4 = s4.content.customerStatus;
        "ACCEPTED" === i4.status && (i4.agent.data = JSON.parse(i4.agent.data)), this.session.status = i4, this.session.liveOptions.onStatusUpdated(this.session.status), v$1.onSuccess(t2);
      } });
      te$1.Socket.e(n2);
    });
  }
  customerId() {
    return this.liveOptions.customerId;
  }
  static isMyCustomer(e3) {
    let t2 = gn.session;
    if (t2 && t2.teamId === e3.teamId && t2.customerId() === e3.customerId()) {
      let s3 = fn.getInstance().myTeams(), i3 = t2.status.agent;
      return s3.has(e3.teamId) && (!i3 || i3.id === te$1.Socket.user().id);
    }
    return true;
  }
  static isMyMessage(e3) {
    let t2 = st$1.byIMMessage(e3);
    return e3.type === je$1.TRANSFER && e3.payload.transferTo.id === te$1.Socket.user().id || this.isMyCustomer(t2);
  }
  static quit(e3) {
    let t2 = gn.session;
    if (t2) {
      let s3 = t2.liveOptions.customerId;
      le$1.validateId(s3, "customerId");
      let i3 = new St$1(t2.teamId, s3), n2 = new re$1({ name: y$1.CS_QUIT_LIVE, params: i3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (t3) => {
        v$1.onFailed(e3, t3);
      }, success: (t3) => {
        gn.destroy(), v$1.onSuccess(e3);
      } });
      te$1.Socket.e(n2);
    }
  }
  tryUpdateStatus(e3) {
    if ("FREE" !== this.status.status && this.status.sessionId > e3.sessionId)
      return;
    let t2;
    switch (e3.type) {
      case je$1.ACCEPT:
        t2 = new Et$1(), t2.status = "ACCEPTED", t2.start = e3.payload.sessionStart, t2.sessionId = e3.sessionId, t2.agent = new c$1(e3.senderId, e3.senderData);
        break;
      case je$1.END:
        t2 = new Et$1(), t2.status = "FREE";
        break;
      case je$1.TRANSFER:
        t2 = new Et$1(), t2.status = "ACCEPTED", t2.start = e3.payload.sessionStart, t2.sessionId = e3.sessionId, t2.agent = e3.payload.transferTo;
        break;
      default:
        "FREE" === this.status.status && (t2 = new Et$1(), t2.status = "PENDING", t2.start = e3.timestamp, t2.sessionId = e3.sessionId);
    }
    t2 && (this.status = t2, this.liveOptions.onStatusUpdated(t2));
  }
}
gn.destroy = () => {
  let e3 = gn.session;
  e3 && ($e$1.i.off(Be$1.CS_AGENT_MESSAGE_RECEIVED, e3.onMessageReceived), $e$1.i.off(Be$1.CS_ACCEPTED, e3.onMessageReceived), $e$1.i.off(Be$1.CS_ENDED, e3.onMessageReceived), $e$1.i.off(Be$1.CS_TRANSFER, e3.onMessageReceived), mn.off(fe$1.DISCONNECTED, gn.destroy), gn.session = null);
};
class yn extends yt$1 {
  constructor(e3) {
    super(e3), this.unread = 0, this.markingAmount = 0;
  }
  loadHistory(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      return u$1.isUndef(t2) ? t2 = 10 : t2 > 30 && (t2 = 30), yield this.loadServerMessages(e3, t2);
    });
  }
  loadServerMessages(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = new pt$1(this.target.id.toString(), this.target.scene, e3, t2, this.target.teamId), i3 = yield this.remoteHistory.loadServerMessages(this.target, s3);
      return i3.userOffsets.forEach((e4) => {
        this.userOffsets.updateOffset(e4.userId, e4.offset);
      }), i3.messages;
    });
  }
  deleteMessages(e3) {
    return b$1(this, void 0, void 0, function* () {
      v$1.onFailed(e3, "Delete CS message is not supported yet");
    });
  }
  initMaxMessageAndOffsets(e3, t2) {
    t2.forEach((e4) => {
      this.userOffsets.updateOffset(e4.userId, e4.offset);
    }), (u$1.isUndef(this.acceptedMaxMessage) || this.acceptedMaxMessage.timestamp < e3.timestamp) && this.increaseUnreadAmount(e3), this.saveAcceptedMessage(e3);
  }
  initPendingMaxMessageAndOffsets(e3, t2) {
    t2.forEach((e4) => {
      this.userOffsets.updateOffset(e4.userId, e4.offset);
    }), this.savePendingMessage(e3);
  }
  savePendingMessage(e3) {
    this.pendingMaxMessage ? this.pendingMaxMessage.timestamp < e3.timestamp && (this.pendingMaxMessage = e3) : this.pendingMaxMessage = e3;
  }
  saveAcceptedMessage(e3) {
    this.acceptedMaxMessage ? this.acceptedMaxMessage.timestamp < e3.timestamp && (this.acceptedMaxMessage = e3) : this.acceptedMaxMessage = e3;
  }
  onMessageSending(e3) {
    this.saveAcceptedMessage(e3), $e$1.i.fire(Be$1.MAX_MESSAGE_CHANGED, e3);
  }
  onMessageSendSuccess(e3) {
    this.saveAcceptedMessage(e3), this.userOffsets.updateOffset(e3.senderId, e3.timestamp), this.acceptedMaxMessage === e3 && $e$1.i.fire(Be$1.MAX_MESSAGE_CHANGED, e3);
  }
  onMessageSendFailed(e3) {
    this.acceptedMaxMessage === e3 && $e$1.i.fire(Be$1.MAX_MESSAGE_CHANGED, e3);
  }
  onMessageReceived(e3) {
    gn.isMyMessage(e3) && (!e3.accepted || e3.senderId !== te$1.Socket.user().id && e3.type === je$1.ACCEPT ? this.savePendingMessage(e3) : this.saveAcceptedMessage(e3), this.userOffsets.updateOffset(e3.senderId, e3.timestamp), this.increaseUnreadAmount(e3), $e$1.i.fire(Be$1.MAX_MESSAGE_CHANGED, e3));
  }
  increaseUnreadAmount(e3) {
    if (e3.sendByCustomer() || e3.type === je$1.TRANSFER && e3.senderId !== te$1.Socket.user().id) {
      this.userOffsets.myOffset() < e3.timestamp && e3.accepted && (this.unread += 1);
    }
  }
  markRead() {
    return b$1(this, void 0, void 0, function* () {
      let e3 = this.maxAcceptedMessageTime();
      gn.isMyCustomer(this.target) && this.preMark(e3) && (yield this.remoteHistory.updateServerOffsets(e3, this.target), this.postMark(e3));
    });
  }
  preMark(e3) {
    let t2 = this.userOffsets.myOffset();
    return e3 > this.userOffsets.markingTime && e3 > t2 && (this.userOffsets.markingTime = e3, this.markingAmount = this.unread, true);
  }
  postMark(e3) {
    e3 === this.userOffsets.markingTime && (this.unread -= this.markingAmount, this.markingAmount = 0, this.userOffsets.updateOffset(te$1.Socket.user().id, e3), $e$1.i.fire(Be$1.UNREAD_AMOUNT_CHANGED, this.target));
  }
  syncMarkedMessage(e3) {
  }
  getMaxMessage(e3) {
    return e3 ? this.acceptedMaxMessage : this.pendingMaxMessage;
  }
  unreadAmount(e3) {
    return e3 ? this.unread : 0;
  }
  existsMessage(e3) {
    return this.acceptedMaxMessage && this.acceptedMaxMessage.messageId === e3.messageId || this.pendingMaxMessage && this.pendingMaxMessage.messageId === e3.messageId;
  }
  maxAcceptedMessageTime() {
    return this.acceptedMaxMessage ? this.acceptedMaxMessage.timestamp : 0;
  }
  maxTime(e3) {
    let t2 = this.getMaxMessage(e3);
    return t2 ? t2.timestamp : 0;
  }
}
class Sn extends yt$1 {
  constructor(e3) {
    super(e3);
  }
  deleteMessages(e3) {
    return b$1(this, void 0, void 0, function* () {
      v$1.onFailed(e3, "Delete CS message is not supported yet");
    });
  }
}
class En {
  static validateMessageArray(e3) {
    if (!u$1.isArray(e3) || u$1.isEmpty(e3))
      throw { code: 400, content: "messages requires non empty array" };
    if (e3.length > 20)
      throw { code: 400, content: "The maximum number of messages is 20" };
    let t2 = st$1.byIMMessage(e3[0]);
    for (let s3 = 0; s3 < e3.length; s3++) {
      let i3 = e3[s3];
      if (!(i3 instanceof Ve$1))
        throw { code: 400, content: "message[" + s3 + "] is not a correct message" };
      if (s3 > 0) {
        let e4 = st$1.byIMMessage(i3);
        if (e4.scene !== t2.scene || e4.id !== t2.id)
          throw { code: 400, content: "each message must be from the same friend or group" };
      }
    }
  }
}
class vn {
  static init() {
    return vn.instance = new vn(), vn.instance;
  }
  constructor() {
    this.map = /* @__PURE__ */ new Map(), this.onMessageSending = (e3) => {
      let t2 = st$1.byIMMessage(e3);
      this.findOrCreateHistory(t2).onMessageSending(e3);
    }, this.onMessageSendSuccess = (e3) => {
      let t2 = st$1.byIMMessage(e3);
      this.findHistory(t2).onMessageSendSuccess(e3);
    }, this.onMessageSendFailed = (e3) => {
      let t2 = st$1.byIMMessage(e3);
      this.findHistory(t2).onMessageSendFailed(e3);
    }, this.onMessageReceived = (e3) => {
      let t2 = st$1.byIMMessage(e3), s3 = this.findOrCreateHistory(t2);
      s3.expiredTime > 0 && (this.map.delete(t2.toString()), s3 = this.findOrCreateHistory(t2)), s3.onMessageReceived(e3);
    }, this.onRemoteMarkRead = (e3) => {
      let t2 = st$1.byMessageReadRemoteEvent(e3), s3 = this.findHistory(t2);
      s3 && s3.syncMarkedMessage(e3);
    }, this.onRemoteMessageDeleted = (e3) => {
      let t2 = st$1.byIMMessageDeletedEvent(e3), s3 = this.findHistory(t2);
      s3 && s3.syncDeletedMessage(e3.deleterId, e3.times);
    }, this.onMessageRecalled = (e3) => {
      let t2 = st$1.byConversationId(e3.scene, e3.conversationId), s3 = this.findHistory(t2);
      s3 && s3.recallMessages(e3);
    }, this.onDisconnected = () => {
      this.map.forEach((e3, t2) => {
        e3.expire();
      });
    }, this.onReconnected = () => {
      gt$1.fire(He$1.HISTORY_EXPIRED);
    }, this.destroy = () => {
    }, this.initialListeners();
  }
  initialListeners() {
    $e$1.i.on(Be$1.MESSAGE_SENDING, this.onMessageSending), $e$1.i.on(Be$1.MESSAGE_SEND_SUCCESS, this.onMessageSendSuccess), $e$1.i.on(Be$1.MESSAGE_SEND_FAILED, this.onMessageSendFailed), $e$1.i.on(Be$1.MESSAGE_RECEIVED, this.onMessageReceived), $e$1.i.on(Be$1.CS_AGENT_MESSAGE_RECEIVED, this.onMessageReceived), $e$1.i.on(Be$1.CS_ACCEPTED, this.onMessageReceived), $e$1.i.on(Be$1.CS_ENDED, this.onMessageReceived), $e$1.i.on(Be$1.CS_TRANSFER, this.onMessageReceived), $e$1.i.on(Be$1.MESSAGE_RECALLED, this.onMessageRecalled), mn.onMessage(me$1.IM_MSG_READ, this.onRemoteMarkRead), mn.onMessage(me$1.IM_MSG_DELETED, this.onRemoteMessageDeleted), mn.on(mn.EVENT.LOST, this.onDisconnected), mn.on(mn.EVENT.RECONNECTED, this.onReconnected);
  }
  loadHistory(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = this.queryToTarget(e3, t2), i3 = this.findOrCreateHistory(s3);
      i3.expiredTime > 0 && (this.map.delete(s3.toString()), i3 = this.findOrCreateHistory(s3));
      let n2 = yield i3.loadHistory(e3.lastTimestamp, e3.limit);
      v$1.onSuccess(e3, { code: 200, content: n2 });
    });
  }
  queryToTarget(e3, t2) {
    if (u$1.isDef(e3.userId))
      return new st$1(o$1.PRIVATE, e3.userId);
    if (u$1.isDef(e3.groupId))
      return new st$1(o$1.GROUP, e3.groupId);
    if (u$1.isDef(e3.type)) {
      if (!Object.values(o$1).includes(e3.type))
        throw new Error("incorrect type, must be: " + Object.values(o$1));
      if (u$1.isUndef(e3.id))
        throw new Error("If type is not empty, id is required.");
      return o$1.CS == e3.type && u$1.isUndef(t2) && (t2 = e3.id), new st$1(e3.type, e3.id, t2);
    }
    throw new Error("incorrect query options.");
  }
  privateMarkAsRead(e3) {
    return b$1(this, void 0, void 0, function* () {
      if (u$1.isUndef(e3.userId))
        throw new Error("userId could not be empty.");
      let t2 = st$1.byScene(o$1.PRIVATE, e3.userId);
      yield this.markAsRead(t2, e3);
    });
  }
  groupMarkAsRead(e3) {
    return b$1(this, void 0, void 0, function* () {
      if (u$1.isUndef(e3.groupId))
        throw new Error("groupId could not be empty.");
      let t2 = st$1.byScene(o$1.GROUP, e3.groupId);
      yield this.markAsRead(t2, e3);
    });
  }
  markMessageAsRead(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      if (u$1.isUndef(e3.id))
        throw new Error("id could not be empty.");
      if (!Object.values(o$1).includes(e3.type))
        throw new Error("incorrect type, must be: " + Object.values(o$1));
      o$1.CS == e3.type && u$1.isUndef(t2) && (t2 = e3.id);
      let s3 = st$1.byScene(e3.type, e3.id, t2);
      yield this.markAsRead(s3, e3);
    });
  }
  markAsRead(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = this.findHistory(e3);
      s3 && (yield s3.markRead()), v$1.onSuccess(t2);
    });
  }
  deleteMessage(e3) {
    return b$1(this, void 0, void 0, function* () {
      this.validateMessageArray(e3.messages), nt$1.validate(e3);
      let t2 = e3.messages[0], s3 = st$1.byIMMessage(t2), i3 = this.findHistory(s3);
      if (!i3)
        throw { code: 400, content: "No message that could be deleted" };
      yield i3.deleteMessages(e3);
    });
  }
  findOrCreateHistory(e3) {
    let t2 = this.findHistory(e3);
    return t2 || (t2 = e3.scene === o$1.CS ? te$1.Socket.user().id === e3.customerId() ? new Sn(e3) : new yn(e3) : new yt$1(e3), this.map.set(e3.toString(), t2), t2);
  }
  static get(e3) {
    return vn.instance.findOrCreateHistory(e3);
  }
  findHistory(e3) {
    return this.map.get(e3.toString());
  }
  validateMessageArray(e3) {
    En.validateMessageArray(e3);
  }
}
class bn {
  constructor(e3) {
    this.top = false, this.data = null, this.dataLoaded = false, this.target = e3;
  }
  toDto() {
    let e3 = this.target.scene, t2 = this.target.id, s3 = new a$1();
    return e3 === o$1.PRIVATE ? s3.userId = t2 : e3 === o$1.GROUP ? s3.groupId = t2 : e3 === o$1.CS && (s3.id = this.target.teamId), s3.type = e3, s3.lastMessage = this.getMaxMessage(), s3.unread = this.getUnreadAmount(), s3.top = this.top, s3.data = this.data, s3;
  }
  getMaxMessage() {
    return vn.get(this.target).getMaxMessage();
  }
  getUnreadAmount() {
    return vn.get(this.target).unreadAmount();
  }
  maxMessageTime() {
    return vn.get(this.target).maxTime();
  }
}
class Cn extends bn {
  constructor(e3) {
    super(e3), this.accepted = false;
  }
  toDto() {
    let e3 = new a$1(), t2 = this.target.scene, s3 = this.target.id, i3 = this.target.teamId;
    return e3.id = s3, e3.teamId = i3, e3.type = t2, e3.lastMessage = this.getMaxMessage(), e3.unread = this.getUnreadAmount(), e3.top = this.top, e3.data = this.data, e3.ended = this.isEnded(), e3;
  }
  isEnded() {
    let e3 = this.getMaxMessage(), t2 = e3.type, s3 = e3.payload;
    return t2 === je$1.END || t2 === je$1.TRANSFER && s3.transferTo.id !== te$1.Socket.user().id;
  }
  getMaxMessage() {
    return vn.get(this.target).getMaxMessage(this.accepted);
  }
  getUnreadAmount() {
    return vn.get(this.target).unreadAmount(this.accepted);
  }
  maxMessageTime() {
    return vn.get(this.target).maxTime(this.accepted);
  }
}
class wn {
  constructor(e3, t2, s3, i3) {
    this.type = e3, this.top = t2, this.targetId = s3, this.teamId = i3;
  }
}
class Mn {
  constructor(e3, t2, s3) {
    this.type = e3, this.targetId = t2, this.teamId = s3;
  }
}
class In {
  constructor(e3, t2, s3) {
    this.type = e3, this.targetId = t2, this.teamId = s3;
  }
}
class Nn {
  top(e3, t2) {
    let s3 = new wn(e3.scene, t2, e3.id, e3.teamId);
    return new Promise((e4, t3) => {
      let i3 = new re$1({ name: y$1.topConversation, params: s3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: (s4) => {
        200 === s4.code ? e4(s4) : t3(s4);
      }, fail: (e5) => {
        t3(e5);
      } });
      te$1.Socket.e(i3);
    });
  }
  remove(e3) {
    let t2 = new Mn(e3.scene, e3.id, e3.teamId);
    return new Promise((e4, s3) => {
      let i3 = new re$1({ name: y$1.removeConversation, params: t2, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: (t3) => {
        200 == t3.code ? e4(t3) : s3(t3);
      }, fail: (e5) => {
        s3(e5);
      } });
      te$1.Socket.e(i3);
    });
  }
  query(e3) {
    return new Promise((t2, s3) => {
      let i3 = new re$1({ name: e3, params: {}, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e4) => {
        s3(e4);
      }, success: (e4) => b$1(this, void 0, void 0, function* () {
        t2(e4);
      }) });
      te$1.Socket.e(i3);
    });
  }
  loadData(e3) {
    let t2 = new In(e3.scene, e3.id, e3.teamId);
    return new Promise((e4, s3) => {
      let i3 = new re$1({ name: y$1.imData, params: t2, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, success: (t3) => {
        let s4 = JSON.parse(t3.content);
        e4(s4);
      }, fail: (e5) => {
        s3(e5);
      } });
      te$1.Socket.e(i3);
    });
  }
}
Nn.instance = new Nn();
class Tn {
  constructor() {
    this.list = new Array(), this.builder = new lt$1(), this.remoteConversations = Nn.instance, this.synchronized = false, $e$1.i.on(Be$1.MAX_MESSAGE_CHANGED, this.onMaxMessageChanged.bind(this)), $e$1.i.on(Be$1.UNREAD_AMOUNT_CHANGED, this.onUnreadMessageChanged.bind(this)), $e$1.i.on(Be$1.MAX_MESSAGE_DELETED, this.onMaxMessageDeleted.bind(this));
  }
  onUnreadMessageChanged(e3) {
    this.findConversation(e3) && this.fireUpdated();
  }
  fireUpdated() {
    this.debounce(this.triggerUpdate.bind(this));
  }
  triggerUpdate() {
    let e3 = this.loadLocalConversations(), t2 = this.getUpdatedEventName();
    gt$1.fire(t2, { unreadTotal: e3.content.unreadTotal, conversations: e3.content.conversations });
  }
  getUpdatedEventName() {
    return He$1.CONVERSATIONS_UPDATED;
  }
  latestConversations(e3) {
    return b$1(this, void 0, void 0, function* () {
      this.synchronized || (yield this.loadServerConversations());
      let t2 = this.loadLocalConversations();
      v$1.onSuccess(e3, t2);
    });
  }
  loadServerConversations() {
    return b$1(this, void 0, void 0, function* () {
      let e3 = this.rocketName(), t2 = yield this.remoteConversations.query(e3);
      this.convertAbbrConversation(t2.content), this.synchronized = true;
    });
  }
  rocketName() {
    return y$1.imLastConversations;
  }
  convertAbbrConversation(e3) {
    let t2 = e3;
    for (const e4 of t2) {
      let t3 = e4.t, s3 = e4.top, i3 = e4.d ? JSON.parse(e4.d) : {}, n2 = e4.userOffsets;
      e4.lmsg.t = t3;
      let r2 = e4.lmsg, a3 = this.builder.build(r2), c3 = st$1.byIMMessage(a3), l2 = this.findConversation(c3);
      u$1.isUndef(l2) ? (l2 = this.buildByAbbr(e4, a3), this.insertOne(l2)) : (l2.top = s3, l2.data = i3), c3.scene === o$1.GROUP && (a3.x = 1), vn.get(c3).initMaxMessageAndOffsets(a3, n2), this.correctPosition(l2);
    }
  }
  onMaxMessageDeleted(e3) {
    this.removeConversation(e3);
  }
  onMaxMessageChanged(e3) {
    return b$1(this, void 0, void 0, function* () {
      if (e3.scene() === o$1.CS) {
        let t2 = e3;
        if (te$1.Socket.user().id != t2.customerId() && (false === t2.accepted || t2.type === je$1.ACCEPT && t2.senderId != te$1.Socket.user().id))
          return;
      }
      yield this.saveOrUpdateConversation(e3);
    });
  }
  saveOrUpdateConversation(e3) {
    return b$1(this, void 0, void 0, function* () {
      let t2 = e3.status, s3 = st$1.byIMMessage(e3), i3 = this.findConversation(s3);
      u$1.isUndef(i3) && t2 !== r$1.FAIL && (i3 = this.buildByMessage(e3), this.insertOne(i3), t2 === r$1.SUCCESS && (i3.data = yield this.remoteConversations.loadData(s3), i3.dataLoaded = true)), t2 === r$1.SENDING && (i3.data = e3.getToData(), i3.dataLoaded = true), i3 && i3.dataLoaded && (this.correctPosition(i3), this.fireUpdated());
    });
  }
  debounce(e3) {
    clearTimeout(this.timer), this.timer = setTimeout(() => {
      e3();
    }, 500);
  }
  loadLocalConversations() {
    let e3 = 0, t2 = new Array();
    for (const s3 of this.list)
      if (s3.dataLoaded && s3.getMaxMessage()) {
        e3 += s3.getUnreadAmount();
        let i3 = s3.toDto();
        t2.push(i3);
      }
    return { code: 200, content: { unreadTotal: e3, conversations: t2 } };
  }
  findConversationIndex(e3) {
    return this.list.findIndex((t2) => e3.toString() === t2.target.toString());
  }
  findConversation(e3) {
    let t2 = this.findConversationIndex(e3);
    return this.list[t2];
  }
  removeLocalConversation(e3) {
    let t2 = this.findConversationIndex(e3.target);
    this.list.splice(t2, 1);
  }
  insertOne(e3) {
    Tn.sortedInserter.insert(this.list, e3), this.list.length > Tn.CONVERSATIONS_MAX_LENGTH && 0 === this.list[this.list.length - 1].getUnreadAmount() && this.list.pop();
  }
  correctPosition(e3) {
    this.removeLocalConversation(e3), this.insertOne(e3);
  }
  removeConversation(e3) {
    let t2 = this.findConversation(e3);
    t2 && (this.removeLocalConversation(t2), this.fireUpdated());
  }
  top(e3, t2, s3) {
    return b$1(this, void 0, void 0, function* () {
      if (!u$1.isBoolean(t2))
        throw new Error("top must be boolean.");
      let i3 = this.findConversation(e3);
      if (!i3)
        throw new Error("conversation does not exist.");
      i3.top != t2 && (yield this.remoteConversations.top(e3, t2), i3.top = t2, this.correctPosition(i3)), this.fireUpdated(), v$1.onSuccess(s3);
    });
  }
  remove(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      let s3 = this.findConversation(e3);
      if (!s3)
        throw new Error("conversation does not exist.");
      if (s3 instanceof Cn && !s3.isEnded())
        throw new Error("CS conversation can only be deleted after it ends");
      yield this.remoteConversations.remove(e3), this.removeLocalConversation(s3), this.fireUpdated(), v$1.onSuccess(t2);
    });
  }
  buildByAbbr(e3, t2) {
    let s3, i3 = st$1.byIMMessage(t2);
    if (e3.t === o$1.CS) {
      let e4 = t2;
      te$1.Socket.user().id === e4.customerId() ? s3 = new bn(i3) : (s3 = new Cn(i3), s3.accepted = e4.accepted);
    } else
      s3 = new bn(i3);
    return s3.dataLoaded = true, s3.top = e3.top, s3.data = e3.d ? JSON.parse(e3.d) : {}, s3;
  }
  buildByMessage(e3) {
    let t2, s3 = st$1.byIMMessage(e3);
    if (e3.scene() === o$1.CS) {
      let i3 = e3;
      te$1.Socket.user().id === i3.customerId() ? t2 = new bn(s3) : (t2 = new Cn(s3), t2.accepted = i3.accepted);
    } else
      t2 = new bn(s3);
    return t2;
  }
}
Tn.CONVERSATIONS_MAX_LENGTH = 200, Tn.sortedInserter = new class extends Ze$1 {
  compare(e3, t2) {
    let s3;
    if (e3.top == t2.top) {
      let i3 = e3.maxMessageTime();
      s3 = t2.maxMessageTime() - i3;
    } else
      s3 = e3.top ? -1 : 1;
    return 0 === s3 ? 0 : s3 > 0 ? 1 : -1;
  }
}();
class On extends X$1 {
  static init() {
    return this.module = new On(), this.module.name = this.GIM_MODULE_NAME, this.initGN(), this.module;
  }
  static initGN() {
    ce$1.addAssembler(new class {
      assemble(e3) {
        let t2 = { messageId: e3.id, timestamp: e3.tm, type: e3.t, senderId: e3.sid, toType: e3.tt };
        return e3.tt === o$1.GROUP && (t2.groupId = e3.gid), t2;
      }
      support(e3) {
        return !!e3.sid;
      }
    }());
  }
  postConnect() {
    ko.init();
  }
  static check() {
    if (!this.module)
      throw { code: 400, content: "IM not initialized. Please include 'IM' in the 'modules' during GoEasy initialization." };
  }
}
On.GIM_MODULE_NAME = "GIM";
class Rn extends Tn {
  constructor() {
    super(), this.expired = false, $e$1.i.on(Be$1.CS_ONLINE_SUCCESS, this.onCSOnlineSuccess.bind(this)), $e$1.i.on(Be$1.CS_OFFLINE_SUCCESS, this.onCSOfflineSuccess.bind(this)), mn.on(mn.EVENT.LOST, this.onDisconnected.bind(this)), mn.on(mn.EVENT.RECONNECTED, this.onConnected.bind(this));
  }
  onMaxMessageChanged(e3) {
    return b$1(this, void 0, void 0, function* () {
      if (e3.scene() === o$1.CS) {
        let t2 = e3;
        if (t2.customerId() != te$1.Socket.user().id && (false === t2.accepted || t2.type === je$1.ACCEPT))
          if (je$1.ACCEPT === e3.type) {
            let t3 = st$1.byIMMessage(e3);
            this.removeConversation(t3);
          } else
            yield this.saveOrUpdateConversation(e3);
      }
    });
  }
  latestConversations(e3) {
    const t2 = Object.create(null, { latestConversations: { get: () => super.latestConversations } });
    return b$1(this, void 0, void 0, function* () {
      let s3 = this.synchronized;
      yield t2.latestConversations.call(this, e3), this.list.length > 0 && !s3 && this.fireUpdated();
    });
  }
  onUnreadMessageChanged(e3) {
  }
  onCSOnlineSuccess() {
    return b$1(this, void 0, void 0, function* () {
      yield this.loadServerConversations(), this.fireUpdated();
    });
  }
  onCSOfflineSuccess() {
    this.list = [], this.fireUpdated();
  }
  getUpdatedEventName() {
    return He$1.PENDING_CONVERSATIONS_UPDATED;
  }
  rocketName() {
    return y$1.CS_PENDING_CONVERSATION;
  }
  convertAbbrConversation(e3) {
    return b$1(this, void 0, void 0, function* () {
      let t2 = e3;
      for (const e4 of t2) {
        e4.lastMessage.t = o$1.CS;
        let t3 = e4.customerData, s3 = e4.lastMessage, i3 = e4.userOffsets, n2 = t3 ? JSON.parse(t3) : {}, r2 = this.builder.build(s3), a3 = st$1.byIMMessage(r2), c3 = this.findConversation(a3);
        u$1.isUndef(c3) && (c3 = new Cn(a3), c3.accepted = r2.accepted, c3.dataLoaded = true, this.insertOne(c3)), c3.top = false, c3.data = n2, vn.get(a3).initPendingMaxMessageAndOffsets(r2, i3), this.correctPosition(c3);
      }
    });
  }
  onDisconnected() {
    this.expired = true;
  }
  onConnected() {
    return b$1(this, void 0, void 0, function* () {
      this.expired && On.module && On.module.active && (this.expired = false, this.list = [], yield this.loadServerConversations(), this.fireUpdated());
    });
  }
}
class An {
  constructor() {
    this.conversations = new Tn(), this.pendingConversations = new Rn();
  }
  latestConversations(e3) {
    this.conversations.latestConversations(e3);
  }
  latestPendingConversations(e3) {
    this.pendingConversations.latestConversations(e3);
  }
  topPrivateConversation(e3) {
    let t2 = st$1.byScene(o$1.PRIVATE, e3.userId);
    this.conversations.top(t2, e3.top, e3);
  }
  topGroupConversation(e3) {
    let t2 = st$1.byScene(o$1.GROUP, e3.groupId);
    this.conversations.top(t2, e3.top, e3);
  }
  topConversation(e3) {
    let t2 = e3.conversation;
    this.validateConversationDTO(t2);
    let s3 = st$1.byConversationDTO(t2);
    this.conversations.top(s3, e3.top, e3);
  }
  removePrivateConversation(e3) {
    let t2 = st$1.byScene(o$1.PRIVATE, e3.userId);
    this.conversations.remove(t2, e3);
  }
  removeGroupConversation(e3) {
    let t2 = st$1.byScene(o$1.GROUP, e3.groupId);
    this.conversations.remove(t2, e3);
  }
  removeConversation(e3) {
    let t2 = e3.conversation;
    this.validateConversationDTO(t2);
    let s3 = st$1.byConversationDTO(t2);
    this.conversations.remove(s3, e3);
  }
  validateConversationDTO(e3) {
    if (!(e3 instanceof a$1))
      throw new Error("Incorrect conversation object.");
    {
      let t2 = e3.lastMessage;
      if (t2 instanceof ut$1 && t2.customerId() !== te$1.Socket.user().id && false === t2.accepted)
        throw new Error("pending conversation cannot be topped or removed.");
    }
  }
}
class Pn {
  constructor() {
    this.builder = new lt$1(), te$1.Socket.onMessage(me$1.imMessage, this.onMessageReceived.bind(this));
  }
  onMessageReceived(e3) {
    if (e3.t !== o$1.CS) {
      let t2 = this.builder.build(e3);
      this.sendAck(t2);
      let s3 = st$1.byIMMessage(t2), i3 = s3.scene;
      vn.get(s3).existsMessage(t2) || (this.createNotification(e3), $e$1.i.fire(Be$1.MESSAGE_RECEIVED, t2), i3 === o$1.PRIVATE ? gt$1.fire(He$1.PRIVATE_MESSAGE_RECEIVED, t2) : i3 === o$1.GROUP && gt$1.fire(He$1.GROUP_MESSAGE_RECEIVED, t2));
    }
  }
  sendAck(e3) {
    te$1.Socket.sendAck("imAck", { publishGuid: e3.messageId });
  }
  createNotification(e3) {
    const t2 = te$1.N.supportAppNotification();
    if (!u$1.isObject(e3.nt) || e3.s === te$1.Socket.user().id || !t2)
      return;
    let s3 = { id: e3.i, tm: e3.ts, t: e3.mt, sid: e3.s, tt: e3.t };
    s3.tt === o$1.GROUP && (s3.gid = e3.r), te$1.N.createLocalNotification(e3.nt.t, e3.nt.c, s3, e3.nt.sound, e3.nt.badge);
  }
}
class kn {
  constructor() {
    this.subscribedGroups = [], te$1.Socket.on(fe$1.EXPIRED_RECONNECTED, this.expiredResubscribeGroups.bind(this));
  }
  expiredResubscribeGroups() {
    this.subscribedGroups.forEach((e3) => b$1(this, void 0, void 0, function* () {
      yield this.doSubscribeGroup(e3);
    }));
  }
  subscribe(e3) {
    let t2 = e3.groupIds;
    le$1.validateIdArray(t2, "groupIds");
    let s3 = new _n(t2, e3.accessToken);
    this.doSubscribeGroup(s3).then(() => {
      this.subscribedGroups.push(s3), v$1.onSuccess(e3, { code: 200, content: "ok" });
    }).catch((t3) => {
      v$1.onFailed(e3, { code: t3.resultCode || 408, content: t3.content || "Failed to subscribe group message" });
    });
  }
  doSubscribeGroup(e3) {
    return new Promise((t2, s3) => {
      let i3 = e3.groupIds.toString().split(","), n2 = new re$1({ name: y$1.subscribeGroups, params: { groupIds: i3, at: e3.accessToken }, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: () => {
        t2();
      }, fail: (e4) => {
        s3(e4);
      } });
      te$1.Socket.e(n2);
    });
  }
  unsubscribe(e3) {
    le$1.validateId(e3.groupId, "groupId"), e3.groupId = e3.groupId.toString();
    let t2 = new re$1({ name: y$1.unsubscribeGroup, params: { groupId: e3.groupId }, permission: ne$1.READ, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, success: () => {
      this.deleteSubscriptionByGroupId(e3.groupId), v$1.onSuccess(e3, { code: 200, content: "ok" });
    }, fail: (t3) => {
      v$1.onFailed(e3, { code: t3.resultCode || 408, content: t3.content || "Failed to unsubscribe group message" });
    } });
    te$1.Socket.e(t2);
  }
  deleteSubscriptionByGroupId(e3) {
    this.subscribedGroups = this.subscribedGroups.filter((t2) => {
      const s3 = t2.groupIds.findIndex((t3) => t3 == e3);
      return s3 > -1 && t2.groupIds.splice(s3, 1), t2.groupIds.length > 0;
    });
  }
}
class _n {
  constructor(e3, t2) {
    this.groupIds = e3, this.accessToken = t2;
  }
}
class Dn {
  constructor() {
    this.newMessageReceived = (e3) => {
      let t2 = null;
      e3.c && (t2 = JSON.parse(e3.c)), t2 && t2.events && t2.events.map((e4) => {
        let s3 = e4.userData ? JSON.parse(e4.userData) : {}, i3 = { time: e4.time, action: e4.action, groupOnlineCount: t2.userAmount, groupId: t2.groupId, id: e4.userId, data: s3 };
        gt$1.fire(He$1.GROUP_PRESENCE, i3);
      });
    }, mn.onMessage(me$1.groupPresence, this.newMessageReceived);
  }
  presence(e3) {
    le$1.validateIdArray(e3.groupIds, "groupIds"), e3.groupIds.toString().split(",");
    let t2 = { groupIds: e3.groupIds };
    this.emitRocket(y$1.subscribeGroupPresence, t2, () => {
      v$1.onSuccess(e3, { code: 200, content: "ok" });
    }, (t3) => {
      v$1.onFailed(e3, { code: t3.code || 408, content: t3.content || "Failed to subscribe group message" });
    }, S$1.commonRequestSingle, S$1.commonRequestTotal);
  }
  unPresence(e3) {
    le$1.validateId(e3.groupId, "groupId"), e3.groupId = e3.groupId.toString();
    let t2 = { groupId: e3.groupId };
    this.emitRocket(y$1.unsubscribeGroupPresence, t2, () => {
      v$1.onSuccess(e3, { code: 200, content: "ok" });
    }, (t3) => {
      v$1.onFailed(e3, { code: t3.code || 408, content: t3.content || "Failed to unsubscribe presence" });
    }, S$1.commonRequestSingle, S$1.commonRequestTotal);
  }
  emitRocket(e3, t2, s3, i3, n2, o2) {
    let r2 = new re$1({ name: e3, params: t2, singleTimeout: n2, totalTimeout: o2, permission: ne$1.WRITE, success: s3, fail: i3 });
    te$1.Socket.e(r2);
  }
}
class xn {
  get(e3) {
    le$1.validateId(e3.groupId, "groupId"), e3.groupId = e3.groupId.toString();
    let t2 = new re$1({ name: y$1.imGroupOnlineCount, params: { groupId: e3.groupId }, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: function(t3) {
      v$1.onFailed(e3, t3 || { code: 408, content: "Failed to query online group users" });
    }, success: function(t3) {
      200 == t3.code ? v$1.onSuccess(e3, t3) : v$1.onFailed(e3, t3);
    } });
    te$1.Socket.e(t2);
  }
}
class Un {
  doHereNow(e3, t2, s3) {
    let i3 = new re$1({ name: e3, params: t2, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e4) => {
      v$1.onFailed(s3, e4);
    }, success: (e4) => {
      let t3 = e4.content;
      e4.content = t3.map((e5) => {
        let t4 = e5.userData ? JSON.parse(e5.userData) : {};
        return { id: e5.userId, data: t4 };
      }), v$1.onSuccess(s3, e4);
    } });
    te$1.Socket.e(i3);
  }
}
class Fn extends Un {
  hereNow(e3) {
    le$1.validateId(e3.groupId, "groupId"), e3.groupId = e3.groupId.toString();
    let t2 = { groupId: e3.groupId };
    this.doHereNow(y$1.imGroupHereNow, t2, e3);
  }
}
class Gn {
  constructor() {
    this.newMessageReceived = (e3) => {
      let t2 = [];
      e3.c && (t2 = JSON.parse(e3.c).events || []), t2.map((e4) => {
        let t3 = e4.userData ? JSON.parse(e4.userData) : {}, s3 = { time: e4.time, action: e4.action, id: e4.userId, data: t3 };
        gt$1.fire(He$1.USER_PRESENCE, s3);
      });
    }, mn.onMessage(me$1.userPresence, this.newMessageReceived);
  }
  presence(e3) {
    le$1.validateIdArray(e3.userIds, "userIds"), e3.userIds.toString().split(",");
    let t2 = { userIds: e3.userIds };
    this.emitRocket(y$1.subscribeUserPresence, t2, () => {
      v$1.onSuccess(e3, { code: 200, content: "ok" });
    }, (t3) => {
      v$1.onFailed(e3, { code: t3.code || 408, content: t3.content || "Failed to subscribe group message" });
    }, S$1.commonRequestSingle, S$1.commonRequestTotal);
  }
  unPresence(e3) {
    le$1.validateId(e3.userId, "userId"), e3.userId = e3.userId.toString();
    let t2 = { userId: e3.userId };
    this.emitRocket(y$1.unsubscribeUserPresence, t2, () => {
      v$1.onSuccess(e3, { code: 200, content: "ok" });
    }, (t3) => {
      v$1.onFailed(e3, { code: t3.code || 408, content: t3.content || "Failed to unsubscribe presence" });
    }, S$1.commonRequestSingle, S$1.commonRequestTotal);
  }
  emitRocket(e3, t2, s3, i3, n2, o2) {
    let r2 = new re$1({ name: e3, params: t2, singleTimeout: n2, totalTimeout: o2, permission: ne$1.WRITE, success: s3, fail: i3 });
    te$1.Socket.e(r2);
  }
}
class Ln extends Un {
  hereNow(e3) {
    let t2 = e3.userIds;
    le$1.validateIdArray(t2, "userIds"), t2.toString().split(","), this.doHereNow(y$1.imHereNow, e3, e3);
  }
}
const Bn = new class {
  fileExtension(e3, t2) {
    if (u$1.isString(e3))
      try {
        let s3 = e3.split(t2);
        return s3[s3.length - 1];
      } catch (e4) {
        throw Error(e4);
      }
  }
}();
class qn {
}
class jn extends qn {
  constructor() {
    super(...arguments), this.contentType = "", this.name = "", this.size = 0, this.url = "";
  }
}
class Hn extends jn {
  constructor() {
    super(...arguments), this.width = 0, this.height = 0;
  }
}
class Vn {
  build(e3) {
    this.validate(e3.createOptions);
    let t2 = this.create();
    return this.setPayload(e3, t2), t2;
  }
}
class zn extends Vn {
  create() {
    return new jn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    s3.url = i3.path, s3.name = i3.name, s3.size = i3.size, s3.contentType = i3.type, e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class Wn extends zn {
  create() {
    return new Hn();
  }
  setPayload(e3, t2) {
    super.setPayload(e3, t2);
    let s3 = e3.createOptions.file, i3 = t2, n2 = s3.path || s3.tempFilePath, o2 = u$1.isEmpty(s3.name) || void 0 === s3.name ? n2 : s3.name;
    i3.name = "wx-image." + Bn.fileExtension(o2, "."), i3.contentType = "image/" + Bn.fileExtension(o2, "."), i3.url = n2, i3.size = s3.size, e3.complete = new Promise((e4, t3) => {
      wx$1.getImageInfo({ src: i3.url, success(t4) {
        i3.width = t4.width, i3.height = t4.height, e4();
      }, fail(e5) {
        t3(e5);
      } });
    });
  }
  validate(e3) {
    super.validate(e3);
  }
}
class Xn extends jn {
  constructor() {
    super(...arguments), this.duration = 0;
  }
}
class Jn extends zn {
  create() {
    return new Xn();
  }
  setPayload(e3, t2) {
    super.setPayload(e3, t2);
    let s3 = e3.createOptions.file, i3 = t2, n2 = s3.tempFilePath, o2 = u$1.isEmpty(s3.name) || null == s3.name ? n2 : s3.name, r2 = s3.duration, a3 = s3.fileSize;
    i3.url = n2, i3.size = a3, i3.duration = r2 / 1e3, i3.name = "wx-audio." + Bn.fileExtension(o2, "."), i3.contentType = "audio/" + Bn.fileExtension(o2, "."), e3.complete = Promise.resolve();
  }
  validate(e3) {
    super.validate(e3);
  }
}
class Yn extends qn {
  constructor() {
    super(...arguments), this.text = "";
  }
}
class $n extends Vn {
  create() {
    return new Yn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions;
    s3.text = i3.text, e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (u$1.isEmpty(e3.text))
      throw { code: 400, content: "text is empty" };
    if (!u$1.isString(e3.text))
      throw { code: 400, content: "TypeError: text requires string." };
    if ("" === e3.text.trim())
      throw { code: 400, content: "text is empty" };
    if (e3.text.length > 2500)
      throw { code: 400, content: "Message text over max length 2500" };
  }
}
class Qn extends qn {
  constructor() {
    super(...arguments), this.video = new Zn(), this.thumbnail = new Kn();
  }
}
class Kn {
  constructor() {
    this.name = "", this.url = "", this.width = 0, this.height = 0, this.contentType = "";
  }
  initURL(e3) {
    d$1.currentPlatform() === l$1.BROWSER && this.htmlUrl(e3);
  }
  htmlUrl(e3) {
    let t2 = document.createElement("canvas");
    t2.width = e3.videoWidth, t2.height = e3.videoHeight, t2.getContext("2d").drawImage(e3, 0, 0, t2.width, t2.height), this.url = t2.toDataURL("image/png");
  }
}
class Zn {
  constructor() {
    this.name = "", this.url = "", this.width = 0, this.height = 0, this.contentType = "", this.size = 0, this.duration = 0;
  }
}
class eo extends Vn {
  create() {
    return new Qn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions.file, i3 = t2, n2 = i3.video, o2 = i3.thumbnail, { duration: r2, height: a3, size: c3, tempFilePath: l2, thumbTempFilePath: d3, width: h3, name: p3 = "" } = s3, m3 = u$1.isEmpty(p3) ? l2 : p3;
    n2.contentType = "video/" + Bn.fileExtension(m3, "."), n2.name = "wx-video." + Bn.fileExtension(m3, "."), n2.url = l2, n2.width = o2.width = h3, n2.height = o2.height = a3, n2.size = c3, n2.duration = r2, o2.url = d3, o2.contentType = "image/jpg", o2.name = "wx-thumbnail.jpg", e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class to extends Vn {
  create() {
    return new jn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    s3.url = i3.fullPath || i3.path, s3.name = i3.name, s3.size = i3.size, s3.contentType = i3.type, i3.type, e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class so extends to {
  create() {
    return new Hn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    s3.url = i3.path, s3.size = i3.size;
    let n2 = u$1.isEmpty(i3.name) || void 0 === i3.name ? i3.path : i3.name;
    s3.contentType = "image/" + Bn.fileExtension(n2, "."), s3.name = "uni-image." + Bn.fileExtension(n2, "."), e3.complete = new Promise((e4, t3) => {
      index.getImageInfo({ src: i3.path, success(t4) {
        s3.width = t4.width, s3.height = t4.height, e4();
      }, fail(e5) {
        t3(e5);
      } });
    });
  }
  validate(e3) {
    super.validate(e3);
  }
}
class io extends to {
  create() {
    return new Xn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions, i3 = t2, n2 = s3.file, o2 = n2.tempFilePath, r2 = u$1.isEmpty(n2.name) || null == n2.name ? o2 : n2.name;
    i3.url = o2, i3.name = "uni-audio." + Bn.fileExtension(r2, "."), i3.contentType = "audio/" + Bn.fileExtension(r2, "."), e3.complete = new Promise((e4, t3) => {
      index.getFileInfo({ filePath: o2, success: (n3) => {
        let r3 = n3.size;
        if (i3.size = r3, 0 === r3)
          e4();
        else if (u$1.isDef(s3.file.duration))
          i3.duration = s3.file.duration / 1e3, e4();
        else {
          const s4 = index.createInnerAudioContext();
          s4.src = o2, s4.onCanplay(function(n4) {
            n4.errCode ? (s4.destroy(), t3(n4)) : (i3.duration = s4.duration, s4.destroy(), e4());
          }), s4.onError((i4) => {
            s4.destroy(), -99 === i4.errCode ? e4() : t3(i4);
          });
        }
      }, fail(e5) {
        t3(e5);
      } });
    });
  }
  validate(e3) {
    super.validate(e3);
  }
}
class no extends Vn {
  create() {
    return new Qn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions.file, i3 = t2, n2 = i3.video, o2 = i3.thumbnail, { duration: r2, height: a3, size: c3, tempFilePath: l2, width: d3, name: h3 = "" } = s3, p3 = u$1.isEmpty(h3) ? l2 : h3;
    n2.size = c3, n2.width = d3, n2.height = a3, n2.url = l2, n2.duration = r2, n2.contentType = "video/" + Bn.fileExtension(p3, "."), n2.name = "uni-video." + Bn.fileExtension(p3, "."), o2.url = l2, o2.height = 200, o2.width = Number((n2.width * o2.height / n2.height).toFixed(0)), o2.contentType = "image/jpg", o2.name = "uni-thumbnail.jpg", e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class oo extends Vn {
  create() {
    return new jn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file, n2 = window.URL || window.webkitURL;
    s3.url = n2.createObjectURL(i3), s3.name = i3.name, s3.size = i3.size, s3.contentType = i3.type, e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!(e3.file instanceof File))
      throw Error("wrong file type.");
    if (0 == e3.file.size)
      throw Error("File size is 0.");
    if (e3.file.size > 524288e3)
      throw Error("message-length limit 30mib");
  }
}
class ro extends oo {
  create() {
    return new Hn();
  }
  setPayload(e3, t2) {
    super.setPayload(e3, t2);
    let s3 = e3.createOptions.file, i3 = t2, n2 = window.URL || window.webkitURL, o2 = new Image();
    o2.src = n2.createObjectURL(s3), e3.complete = new Promise((e4, t3) => {
      o2.onload = function() {
        i3.width = o2.width, i3.height = o2.height, n2.revokeObjectURL(o2.src), e4();
      }, o2.onerror = function(e5) {
        n2.revokeObjectURL(o2.src), t3(e5);
      };
    });
  }
  validate(e3) {
    super.validate(e3);
    let t2 = ["gif", "jpg", "png", "jpeg"];
    if (!t2.find((t3) => t3 === e3.file.type.split("/")[1].toLowerCase()))
      throw Error("Only " + t2.join(",") + " is supported image.");
  }
}
class ao extends oo {
  create() {
    return new Xn();
  }
  setPayload(e3, t2) {
    super.setPayload(e3, t2);
    let s3 = e3.createOptions.file, i3 = t2, n2 = window.URL || window.webkitURL, o2 = document.createElement("audio");
    o2.src = n2.createObjectURL(s3), e3.complete = new Promise((e4, t3) => {
      o2.onloadedmetadata = () => {
        i3.duration = o2.duration, n2.revokeObjectURL(o2.src), e4();
      }, o2.onerror = (e5) => {
        n2.revokeObjectURL(o2.src), t3(e5);
      };
    });
  }
  validate(e3) {
    super.validate(e3);
    let t2 = ["mp3", "ogg", "wav", "wma", "ape", "acc", "mpeg"];
    if (!t2.find((t3) => t3 === e3.file.type.split("/")[1].toLowerCase()))
      throw Error("Only " + t2.join(",") + " is supported audio.");
  }
}
class co extends Vn {
  create() {
    return new Qn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions.file, i3 = t2, n2 = i3.video, o2 = i3.thumbnail, r2 = window.URL || window.webkitURL, a3 = document.createElement("video");
    a3.src = r2.createObjectURL(s3), n2.size = s3.size, n2.name = s3.name, n2.contentType = s3.type, n2.url = a3.src, o2.name = s3.name, o2.contentType = "image/jpg", e3.complete = new Promise((e4, t3) => {
      a3.onloadedmetadata = () => {
        n2.duration = a3.duration, n2.width = a3.videoWidth, n2.height = a3.videoHeight, o2.width = a3.videoWidth, o2.height = a3.videoHeight, o2.url = this.getThumbnailUrl(a3), r2.revokeObjectURL(a3.src), e4();
      }, a3.onerror = function(e5) {
        r2.revokeObjectURL(a3.src), t3(e5);
      };
    });
  }
  getThumbnailUrl(e3) {
    let t2 = document.createElement("canvas");
    return t2.width = e3.videoWidth, t2.height = e3.videoHeight, t2.getContext("2d").drawImage(e3, 0, 0, t2.width, t2.height), t2.toDataURL("image/png");
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!(e3.file instanceof File))
      throw Error("wrong file type.");
    if (0 == e3.file.size)
      throw Error("File size is 0.");
    if (e3.file.size > 31457280)
      throw Error("message-length limit 30mib");
    let t2 = ["avi", "mov", "rmvb", "rm", "flv", "mp4", "3gp", "quicktime"];
    if (!t2.find((t3) => t3 === e3.file.type.split("/")[1].toLowerCase()))
      throw Error("Only " + t2.join(",") + " is supported video.");
  }
}
class uo extends Vn {
  create() {
    return new Qn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions.file, i3 = t2, n2 = i3.video, o2 = i3.thumbnail, { duration: r2, height: a3, size: c3, tempFilePath: u2, tempVideoThumbPath: l2, width: d3 } = s3;
    n2.size = c3, n2.width = d3, n2.height = a3, n2.url = u2, n2.duration = r2, n2.contentType = "video/mp4", n2.name = "ali-video.mp4", o2.url = l2, o2.height = 200, o2.width = Number((n2.width * o2.height / n2.height).toFixed(0)), o2.contentType = "image/jpg", o2.name = "ali-thumbnail.jpg", e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class lo extends Vn {
  create() {
    return new jn();
  }
  setPayload(e3, t2) {
    e3.complete = Promise.reject("Alipay not support file message.");
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class ho extends lo {
  create() {
    return new Hn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    s3.url = i3.path, s3.size = i3.size, e3.complete = new Promise((e4, t3) => {
      my.getImageInfo({ src: i3.path, success(t4) {
        s3.width = t4.width, s3.height = t4.height, s3.contentType = "image/" + t4.type, s3.name = "ali-image." + t4.type, e4();
      }, fail(e5) {
        t3(e5);
      } });
    });
  }
  validate(e3) {
    super.validate(e3);
  }
}
class po extends lo {
  create() {
    return new Xn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file, n2 = i3.tempFilePath;
    s3.url = n2, s3.name = "ali-audio." + Bn.fileExtension(n2, "."), s3.contentType = "audio/" + Bn.fileExtension(n2, "."), s3.duration = i3.duration, s3.size = i3.fileSize, e3.complete = Promise.resolve();
  }
  validate(e3) {
    super.validate(e3);
  }
}
class mo extends Vn {
  create() {
    return new Qn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions.file, i3 = t2, n2 = i3.video, o2 = i3.thumbnail, { duration: r2, height: a3, size: c3, tempFilePath: u2, thumbTempFilePath: l2, width: d3 } = s3;
    n2.size = c3, n2.width = d3, n2.height = a3, n2.url = u2, n2.duration = r2, n2.contentType = "video/" + Bn.fileExtension(u2, "."), n2.name = "baidu-video." + Bn.fileExtension(u2, "."), o2.url = l2, o2.height = 200, o2.width = Number((n2.width * o2.height / n2.height).toFixed(0)), o2.contentType = "image/" + Bn.fileExtension(l2, "."), o2.name = "baidu-thumbnail." + Bn.fileExtension(u2, "."), e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class fo extends Vn {
  create() {
    return new jn();
  }
  setPayload(e3, t2) {
    e3.complete = Promise.reject("Baidu app not support file message.");
  }
  validate(e3) {
  }
}
class go extends fo {
  create() {
    return new Xn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file, n2 = i3.tempFilePath;
    s3.url = n2, s3.name = "baidu-audio." + Bn.fileExtension(n2, "."), s3.contentType = "audio/" + Bn.fileExtension(n2, "."), s3.duration = i3.duration / 1e3, s3.size = i3.fileSize, e3.complete = Promise.resolve();
  }
  validate(e3) {
    super.validate(e3);
  }
}
class yo extends fo {
  create() {
    return new Hn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    s3.url = i3.path, s3.size = i3.size, e3.complete = new Promise((e4, t3) => {
      swan.getImageInfo({ src: i3.path, success(t4) {
        s3.width = t4.width, s3.height = t4.height, s3.contentType = "image/" + t4.type, s3.name = "baidu-image." + t4.type, e4();
      }, fail(e5) {
        t3(e5);
      } });
    });
  }
  validate(e3) {
    super.validate(e3);
  }
}
class So extends Vn {
  create() {
    return new jn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    const { uri: n2, type: o2, size: r2, name: a3 } = i3;
    s3.url = decodeURIComponent(n2), s3.name = a3, s3.size = r2, s3.contentType = o2, e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class Eo extends So {
  create() {
    return new Hn();
  }
  setPayload(e3, t2) {
    let s3 = t2, i3 = e3.createOptions.file;
    const { uri: n2, fileSize: o2, type: r2, fileName: a3, width: c3, height: u2 } = i3;
    s3.url = n2, s3.size = o2, s3.contentType = r2, s3.name = a3, s3.width = c3, s3.height = u2, e3.complete = Promise.resolve();
  }
  validate(e3) {
    super.validate(e3);
  }
}
class vo extends Vn {
  create() {
    return new Qn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions.file;
    const i3 = t2, { video: n2, thumbnail: o2 } = i3, { uri: r2, type: a3, fileSize: c3, fileName: u2, duration: l2, height: d3, width: h3 } = s3;
    n2.size = c3, n2.width = h3, n2.height = d3, n2.url = r2, n2.duration = l2, n2.contentType = a3, n2.name = u2, o2.url = r2, o2.name = "rn-thumbnail.jpg", o2.height = 200, o2.width = Number((n2.width * o2.height / n2.height).toFixed(0)), o2.contentType = "image/jpg", e3.complete = Promise.resolve();
  }
  validate(e3) {
    if (!u$1.isObject(e3))
      throw Error("it is an empty message.");
    if (!u$1.isDef(e3.file))
      throw Error("file is empty.");
  }
}
class bo extends So {
  create() {
    return new Xn();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions, i3 = t2, n2 = s3.file;
    const { uri: o2, name: r2, duration: a3, size: c3 } = n2;
    i3.url = o2, i3.duration = Number((a3 / 1e3).toFixed(2)), i3.size = c3, i3.name = r2 || "rn-audio." + Bn.fileExtension(o2, "."), i3.contentType = "audio/" + Bn.fileExtension(o2, "."), s3.file = { uri: o2, type: i3.contentType, name: i3.name }, e3.complete = Promise.resolve();
  }
  validate(e3) {
    super.validate(e3);
  }
}
class Co extends qn {
}
class wo extends Vn {
  create() {
    return new Co();
  }
  setPayload(e3, t2) {
    let s3 = e3.createOptions;
    t2.payload = s3.payload, e3.complete = Promise.resolve();
  }
  validate(e3) {
    let t2 = e3.type, s3 = e3.payload;
    if (u$1.isEmpty(t2))
      throw Error("type is empty.");
    if (!u$1.isString(t2))
      throw Error("type require a string");
    if (u$1.isEmpty(s3))
      throw Error("payload is empty.");
    if (!u$1.isPlainObject(s3) && !u$1.isStringOrNumber(s3))
      throw Error("payload require object | string | number.");
  }
}
class Mo {
  constructor(e3, t2) {
    this.type = e3, this.createOptions = t2;
  }
}
class Io {
  constructor() {
    this.framework = s$1.currentFramework(), this.platform = d$1.currentPlatform(), this.payloadBuilders = { [e$1.UNIAPP]: { image: new so(), file: new to(), audio: new io(), video: new no(), text: new $n() }, [l$1.MP_WX]: { image: new Wn(), file: new zn(), audio: new Jn(), video: new eo(), text: new $n() }, [l$1.BROWSER]: { image: new ro(), file: new oo(), audio: new ao(), video: new co(), text: new $n() }, [l$1.MP_ALI]: { image: new ho(), file: new lo(), audio: new po(), video: new uo(), text: new $n() }, [l$1.MP_BAIDU]: { image: new yo(), file: new fo(), audio: new go(), video: new mo(), text: new $n() }, [e$1.REACT_NATIVE]: { image: new Eo(), file: new So(), audio: new bo(), video: new vo(), text: new $n() }, [l$1.MP_BYTE]: { image: new Wn(), file: new zn(), audio: new Jn(), video: new eo(), text: new $n() } };
  }
  buildMessage(t2, s3) {
    const i3 = this.framework === e$1.UNKNOWN ? this.platform : this.framework;
    let n2 = this.payloadBuilders[i3][t2], o2 = new Mo(t2, s3);
    if (n2) {
      let e3 = n2.build(o2);
      o2.payload = e3;
    } else {
      let e3 = new wo().build(o2);
      o2.payload = e3.payload;
    }
    let r2 = this.build(o2);
    return o2.complete.then(() => {
      v$1.onSuccess(s3, r2);
    }).catch((e3) => {
      v$1.onFailed(s3, e3);
    }), r2;
  }
  build(e3) {
    let t2, s3 = e3.type, i3 = e3.payload, n2 = e3.createOptions, a3 = n2.to, c3 = a3.type;
    return this.validate(n2), c3 === o$1.GROUP ? (t2 = new ct$1(), t2.groupId = a3.id.toString(), t2.senderData = te$1.Socket.user().data) : c3 === o$1.PRIVATE ? (t2 = new at$1(), t2.read = false, t2.receiverId = a3.id.toString()) : c3 === o$1.CS && (t2 = new ut$1(), t2.to = a3.id.toString(), t2.teamId = a3.id.toString(), t2.senderData = te$1.Socket.user().data), t2.senderId = te$1.Socket.user().id, t2.messageId = ie$1.get(), t2.payload = i3, t2.timestamp = Date.now(), t2.type = s3, t2.recalled = false, t2.status = r$1.NEW, t2.buildOptions = e3, t2;
  }
  validate(e3) {
    const t2 = e3.to;
    if (!t2)
      throw new Error("message require property to.");
    if (!u$1.isObject(t2))
      throw new Error("TypeError: to requires an object.");
    if (!u$1.isObject(t2.data))
      throw new Error("TypeError: to.data requires an object.");
    if (!t2.type || t2.type !== o$1.GROUP && t2.type !== o$1.PRIVATE && t2.type !== o$1.CS)
      throw new Error("message require property to.type");
    if (le$1.validateId(t2.id, "to.id"), te$1.Socket.user().id === t2.id)
      throw new Error("to.id can not be the same as your id.");
    u$1.isDef(e3.notification) && le$1.validateNotification(e3.notification), e3.wxmpTemplateMsg && le$1.validateWXMPTemplateMsg(e3.wxmpTemplateMsg);
  }
}
class No extends Pn {
  onMessageReceived(e3) {
    if (e3.t === o$1.CS) {
      let t2 = this.builder.build(e3);
      this.sendAck(t2);
      let s3 = st$1.byIMMessage(t2);
      if (!vn.get(s3).existsMessage(t2)) {
        if (t2.customerId() === te$1.Socket.user().id)
          this.createNotification(e3), $e$1.i.fire(Be$1.MESSAGE_RECEIVED, t2), gt$1.fire(He$1.CS_MESSAGE_RECEIVED, t2);
        else {
          fn.getInstance().queryTeams().then(() => {
            gn.isMyMessage(t2) && this.createNotification(e3), $e$1.i.fire(Be$1.CS_AGENT_MESSAGE_RECEIVED, t2);
          });
        }
      }
    }
  }
}
class To {
  constructor(e3) {
    this.times = new Array();
    let t2 = e3[0], s3 = st$1.byIMMessage(t2);
    this.scene = s3.scene, this.targetId = s3.id, e3.forEach((e4) => {
      this.times.push(e4.timestamp);
    }), this.times.sort((e4, t3) => e4 < t3 ? -1 : e4 == t3 ? 0 : 1);
  }
}
class Oo {
  constructor() {
    this.onRemoteRecalled = (e3) => {
      $e$1.i.fire(Be$1.MESSAGE_RECALLED, e3);
    }, mn.onMessage(me$1.IM_MSG_RECALLED, this.onRemoteRecalled);
  }
  recallMessage(e3) {
    return b$1(this, void 0, void 0, function* () {
      En.validateMessageArray(e3.messages), this.validate(e3);
      let t2 = e3.messages;
      yield this.recallServerMessages(t2);
      let s3 = t2[0], i3 = s3.scene(), n2 = this.toConversationId(i3, s3.senderId, s3.targetId()), o2 = { id: te$1.Socket.user().id, data: te$1.Socket.user().data }, r2 = t2.map((e4) => e4.timestamp), a3 = new ft$1(i3, n2, o2, r2);
      $e$1.i.fire(Be$1.MESSAGE_RECALLED, a3), v$1.onSuccess(e3);
    });
  }
  toConversationId(e3, t2, s3) {
    if (o$1.PRIVATE === e3)
      return function(e4, t3) {
        return e4.localeCompare(t3) > 0 ? `${e4}:${t3}` : `${t3}:${e4}`;
      }(t2, s3);
    if (o$1.GROUP === e3)
      return s3;
    throw { code: 400, content: `scene: ${e3} not support` };
  }
  recallServerMessages(e3) {
    let t2 = new To(e3);
    return 0 === t2.times.length ? Promise.resolve() : new Promise((e4, s3) => {
      let i3 = new re$1({ name: y$1.IM_RECALL_MESSAGE, params: t2, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e5) => {
        s3(e5);
      }, success: (t3) => {
        200 === t3.code ? e4(t3) : s3(t3);
      } });
      te$1.Socket.e(i3);
    });
  }
  validate(e3) {
    let t2 = e3.messages;
    for (let e4 = 0; e4 < t2.length; e4++) {
      let s3 = t2[e4];
      if (s3.scene() === o$1.CS)
        throw { code: 400, content: "Recall CS message is not supported yet." };
      if (s3.status !== r$1.SUCCESS)
        throw { code: 400, content: "message[" + e4 + "] is '" + s3.status + "' and cannot be recalled" };
      if (s3.recalled)
        throw { code: 400, content: "message[" + e4 + "] has been recalled" };
      if (s3.senderId !== te$1.Socket.user().id)
        throw { code: 400, content: "it is not allowed to recall messages sent by others" };
    }
  }
}
class Ro {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  getData(e3) {
    return this.map.get(e3);
  }
  setData(e3, t2) {
    this.map.set(e3, t2);
  }
}
class Ao {
  constructor() {
    this.dataCache = new Ro();
  }
  static init() {
    this.i = new Ao();
  }
  getData(...e3) {
    return b$1(this, void 0, void 0, function* () {
      let t2 = [], s3 = /* @__PURE__ */ new Map();
      return e3.forEach((e4) => {
        let i3 = this.dataCache.getData(e4);
        i3 ? s3.set(e4, i3) : t2.push(e4);
      }), 0 === t2.length || (yield this.fetchData(...t2)).forEach((e4, t3) => {
        this.dataCache.setData(t3, e4), s3.set(t3, e4);
      }), Promise.resolve(s3);
    });
  }
  fetchData(...e3) {
    return new Promise((t2, s3) => {
      let i3 = new re$1({ name: y$1.MD_CMD, permission: ne$1.READ, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, params: { name: "GET", data: { ids: e3 } }, success: (e4) => {
        if (200 === e4.code) {
          const s4 = /* @__PURE__ */ new Map();
          e4.content.forEach((e5) => {
            s4.set(e5.id, e5.data);
          }), t2(s4);
        } else
          s3(e4);
      }, fail: (e4) => {
        s3(e4);
      } });
      te$1.Socket.e(i3);
    });
  }
  setData(e3, t2) {
    this.dataCache.setData(e3, t2);
  }
}
class Po {
  constructor() {
    $e$1.i.on(Be$1.MESSAGE_RECEIVED, this.onMessageReceived), $e$1.i.on(Be$1.MESSAGE_SENDING, this.onMessageSending);
  }
  onMessageSending(e3) {
    let t2 = st$1.byIMMessage(e3);
    t2.scene === o$1.PRIVATE && Ao.i.setData(t2.id, e3.getToData());
  }
  onMessageReceived(e3) {
    if (st$1.byIMMessage(e3).scene === o$1.GROUP) {
      let t2 = e3;
      Ao.i.setData(t2.senderId, t2.senderData);
    }
  }
}
class ko {
  constructor() {
    this._iMReceiver = new Pn(), this.csMessageReceiver = new No(), this.memberDataUpdator = new Po(), this._userHereNow = new Ln(), this.goEasyUploader = new Le$1(), this._groupHereNow = new Fn(), this._groupOnlineCount = new xn(), this.groupMessageSubscriber = new kn(), this.messageBuilder = new Io(), this.messageSender = new Ke$1(), this.recaller = new Oo(), this._groupPresenceSubscriber = new Dn(), this._userPresenceSubscriber = new Gn(), this.conversations = new An(), this.histories = vn.init();
  }
  static init() {
    $e$1.init(), gt$1.init(), ko.instance = new ko();
  }
  static i() {
    if (ko.instance)
      return ko.instance;
    throw Error("Please connect first.");
  }
  validateModules() {
    if (mn.status() === t$1.DISCONNECTED)
      throw Error("Please call connect() first.");
    On.check();
  }
  catch(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      try {
        this.validateModules(), le$1.validateCallbackOptions(t2), yield e3();
      } catch (e4) {
        v$1.onFailed(t2, e4);
      }
    });
  }
  on(e3, t2) {
    gt$1.on(e3, t2);
  }
  off(e3, t2) {
    gt$1.off(e3, t2);
  }
  createTextMessage(e3) {
    return this.validateModules(), this.messageBuilder.buildMessage(qe$1.TEXT, e3);
  }
  createImageMessage(e3) {
    return this.validateModules(), this.messageBuilder.buildMessage(qe$1.IMAGE, e3);
  }
  createFileMessage(e3) {
    return this.validateModules(), this.messageBuilder.buildMessage(qe$1.FILE, e3);
  }
  createAudioMessage(e3) {
    return this.validateModules(), this.messageBuilder.buildMessage(qe$1.AUDIO, e3);
  }
  createVideoMessage(e3) {
    return this.validateModules(), this.messageBuilder.buildMessage(qe$1.VIDEO, e3);
  }
  createCustomMessage(e3) {
    return this.validateModules(), this.messageBuilder.buildMessage(e3.type, e3);
  }
  sendMessage(e3) {
    this.catch(() => {
      this.messageSender.send(e3);
    }, e3);
  }
  recallMessage(e3) {
    this.catch(() => {
      this.recaller.recallMessage(e3);
    }, e3);
  }
  deleteMessage(e3) {
    this.catch(() => {
      this.histories.deleteMessage(e3);
    }, e3);
  }
  markGroupMessageAsRead(e3) {
    this.catch(() => b$1(this, void 0, void 0, function* () {
      yield this.histories.groupMarkAsRead(e3);
    }), e3);
  }
  markPrivateMessageAsRead(e3) {
    this.catch(() => b$1(this, void 0, void 0, function* () {
      yield this.histories.privateMarkAsRead(e3);
    }), e3);
  }
  markMessageAsRead(e3, t2) {
    this.catch(() => b$1(this, void 0, void 0, function* () {
      yield this.histories.markMessageAsRead(e3, t2);
    }), e3);
  }
  latestConversations(e3) {
    this.validateModules(), this.conversations.latestConversations(e3);
  }
  removePrivateConversation(e3) {
    this.catch(() => this.conversations.removePrivateConversation(e3), e3);
  }
  removeGroupConversation(e3) {
    this.catch(() => this.conversations.removeGroupConversation(e3), e3);
  }
  topPrivateConversation(e3) {
    this.catch(() => this.conversations.topPrivateConversation(e3), e3);
  }
  topGroupConversation(e3) {
    this.catch(() => this.conversations.topGroupConversation(e3), e3);
  }
  history(e3, t2) {
    this.catch(() => {
      this.histories.loadHistory(e3, t2);
    }, e3);
  }
  subscribeUserPresence(e3) {
    this.catch(() => this._userPresenceSubscriber.presence(e3), e3);
  }
  unsubscribeUserPresence(e3) {
    this.catch(() => this._userPresenceSubscriber.unPresence(e3), e3);
  }
  hereNow(e3) {
    this.catch(() => this._userHereNow.hereNow(e3), e3);
  }
  subscribeGroup(e3) {
    this.catch(() => this.groupMessageSubscriber.subscribe(e3), e3);
  }
  unsubscribeGroup(e3) {
    this.catch(() => this.groupMessageSubscriber.unsubscribe(e3), e3);
  }
  subscribeGroupPresence(e3) {
    this.catch(() => this._groupPresenceSubscriber.presence(e3), e3);
  }
  unsubscribeGroupPresence(e3) {
    this.catch(() => this._groupPresenceSubscriber.unPresence(e3), e3);
  }
  groupHereNow(e3) {
    this.catch(() => this._groupHereNow.hereNow(e3), e3);
  }
  groupOnlineCount(e3) {
    this.catch(() => this._groupOnlineCount.get(e3), e3);
  }
  latestPendingConversations(e3) {
    this.validateModules(), this.conversations.latestPendingConversations(e3);
  }
  topConversation(e3) {
    this.validateModules(), this.conversations.topConversation(e3);
  }
  removeConversation(e3) {
    this.validateModules(), this.conversations.removeConversation(e3);
  }
}
class _o {
  constructor(e3, t2) {
    this.customerId = e3, this.teamId = t2;
  }
}
class Do {
  constructor(e3, t2) {
    this.teamId = e3;
    let s3 = new c$1(t2.id.toString(), JSON.stringify(t2.data));
    this.customer = s3;
  }
}
class xo {
  constructor(e3, t2, s3) {
    this.customerId = e3, this.teamId = t2, this.agentId = s3;
  }
}
class Uo {
  constructor(e3, t2) {
    this.customerId = e3, this.teamId = t2;
  }
}
class Fo {
  constructor(e3) {
    this.builder = new lt$1(), this.teamId = e3;
  }
  accept(e3, t2) {
    let s3 = t2.customer;
    if (u$1.isUndef(s3))
      throw { code: 400, content: "customer is required." };
    le$1.validateId(s3.id, "customer.id");
    let i3 = s3.data;
    if (u$1.isUndef(i3) || !u$1.isObject(i3))
      throw { code: 400, content: "customer data must be non-empty object." };
    let n2 = new Do(e3, s3), o2 = new re$1({ name: y$1.CS_ACCEPT, params: n2, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e4) => {
      v$1.onFailed(t2, e4);
    }, success: (e4) => {
      let s4 = this.builder.build(e4.content.message);
      $e$1.i.fire(Be$1.CS_ACCEPTED, s4), v$1.onSuccess(t2);
    } });
    te$1.Socket.e(o2);
  }
  end(e3, t2) {
    le$1.validateId(t2.id, "id");
    let s3 = t2.id.toString(), i3 = new Uo(s3, e3), n2 = new re$1({ name: y$1.CS_END, params: i3, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e4) => {
      v$1.onFailed(t2, e4);
    }, success: (e4) => {
      let s4 = this.builder.build(e4.content.message);
      $e$1.i.fire(Be$1.CS_ENDED, s4), v$1.onSuccess(t2);
    } });
    te$1.Socket.e(n2);
  }
  queryCustomerStatus(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      le$1.validateId(t2.id, "id");
      let s3 = yield this.doCustomerStatus(e3, t2.id);
      this.activeCustomerStatus = s3, this.activeCustomerStatusOptions = t2, v$1.onSuccess(t2, s3);
    });
  }
  doCustomerStatus(e3, t2) {
    let s3 = t2.toString(), i3 = new _o(s3, e3);
    return new Promise((e4, t3) => {
      let s4 = new re$1({ name: y$1.CS_CUSTOMER_STATUS, params: i3, permission: ne$1.READ, singleTimeout: S$1.commonQuerySingle, totalTimeout: S$1.commonQueryTotal, fail: (e5) => {
        t3(e5);
      }, success: (t4) => {
        let s5 = t4.content;
        s5.agent && (s5.agent.data = JSON.parse(s5.agent.data)), e4(s5);
      } });
      te$1.Socket.e(s4);
    });
  }
  transfer(e3, t2) {
    le$1.validateId(t2.customerId, "customerId"), le$1.validateId(t2.agentId, "agentId");
    let s3 = t2.customerId.toString(), i3 = t2.agentId.toString(), n2 = new xo(s3, e3, i3), o2 = new re$1({ name: y$1.CS_TRANSFER, params: n2, permission: ne$1.WRITE, singleTimeout: S$1.commonRequestSingle, totalTimeout: S$1.commonRequestTotal, fail: (e4) => {
      v$1.onFailed(t2, e4);
    }, success: (e4) => {
      let s4 = this.builder.build(e4.content.message);
      $e$1.i.fire(Be$1.CS_TRANSFER, s4), v$1.onSuccess(t2);
    } });
    te$1.Socket.e(o2);
  }
}
class Go {
  createTextMessage(e3, t2) {
    let s3 = ko.i().createTextMessage(t2);
    this.extendProps(e3, s3);
  }
  createImageMessage(e3, t2) {
    let s3 = ko.i().createImageMessage(t2);
    this.extendProps(e3, s3);
  }
  createFileMessage(e3, t2) {
    let s3 = ko.i().createFileMessage(t2);
    this.extendProps(e3, s3);
  }
  createAudioMessage(e3, t2) {
    let s3 = ko.i().createAudioMessage(t2);
    this.extendProps(e3, s3);
  }
  createVideoMessage(e3, t2) {
    let s3 = ko.i().createVideoMessage(t2);
    this.extendProps(e3, s3);
  }
  createCustomMessage(e3, t2) {
    let s3 = ko.i().createCustomMessage(t2);
    this.extendProps(e3, s3);
  }
  extendProps(e3, t2) {
    if (t2.scene() === o$1.CS) {
      let s3 = t2;
      s3.teamId = e3, s3.accepted = true;
    }
  }
}
class Lo {
  constructor(e3) {
    this.teamId = e3, this.agentStatus = fn.getInstance(), this.conversationHandler = new Fo(e3), this.messageCreator = new Go();
  }
  catch(e3, t2) {
    return b$1(this, void 0, void 0, function* () {
      try {
        le$1.validateCallbackOptions(t2), yield e3();
      } catch (e4) {
        v$1.onFailed(t2, e4);
      }
    });
  }
  isOnline(e3) {
    this.catch(() => {
      this.agentStatus.isOnline(this.teamId, e3);
    }, e3);
  }
  online(e3) {
    this.catch(() => {
      this.agentStatus.online(this.teamId, e3);
    }, e3);
  }
  offline(e3) {
    this.catch(() => {
      this.agentStatus.offline(this.teamId, e3);
    }, e3);
  }
  customerStatus(e3) {
    this.catch(() => {
      this.conversationHandler.queryCustomerStatus(this.teamId, e3);
    }, e3);
  }
  accept(e3) {
    this.catch(() => {
      this.conversationHandler.accept(this.teamId, e3);
    }, e3);
  }
  end(e3) {
    this.catch(() => {
      this.conversationHandler.end(this.teamId, e3);
    }, e3);
  }
  history(e3) {
    ko.i().history(e3, this.teamId);
  }
  markMessageAsRead(e3) {
    ko.i().markMessageAsRead(e3, this.teamId);
  }
  createTextMessage(e3) {
    this.messageCreator.createTextMessage(this.teamId, e3);
  }
  createImageMessage(e3) {
    this.messageCreator.createImageMessage(this.teamId, e3);
  }
  createFileMessage(e3) {
    this.messageCreator.createFileMessage(this.teamId, e3);
  }
  createAudioMessage(e3) {
    this.messageCreator.createAudioMessage(this.teamId, e3);
  }
  createVideoMessage(e3) {
    this.messageCreator.createVideoMessage(this.teamId, e3);
  }
  createCustomMessage(e3) {
    this.messageCreator.createCustomMessage(this.teamId, e3);
  }
  transfer(e3) {
    this.catch(() => {
      this.conversationHandler.transfer(this.teamId, e3);
    }, e3);
  }
  agents(e3) {
    this.catch(() => {
      this.agentStatus.agents(this.teamId, e3);
    }, e3);
  }
  liveSession(e3) {
    this.catch(() => {
      gn.live(this.teamId, e3);
    }, e3);
  }
  quitLiveSession(e3) {
    this.catch(() => {
      gn.quit(e3);
    }, e3);
  }
  listenCustomer(e3) {
    let t2 = { customerId: e3.id, onNewMessage: e3.onNewMessage, onStatusUpdated: e3.onStatusUpdated, onFailed: e3.onFailed, onSuccess: e3.onSuccess };
    this.catch(() => {
      gn.live(this.teamId, t2);
    }, e3);
  }
  cancelListenCustomer(e3) {
    this.catch(() => {
      gn.quit(e3);
    }, e3);
  }
}
class Bo {
  static team(e3) {
    le$1.validateId(e3, "teamId");
    let t2 = this.teams.get(e3);
    return t2 || (t2 = new Lo(e3.toString()), this.teams.set(e3.toString(), t2)), t2;
  }
}
Bo.teams = /* @__PURE__ */ new Map();
class qo {
  constructor(e3) {
    this.id = e3;
  }
  isOnline(e3) {
    Bo.team(this.id).isOnline(e3);
  }
  online(e3) {
    Bo.team(this.id).online(e3);
  }
  offline(e3) {
    Bo.team(this.id).offline(e3);
  }
  customerStatus(e3) {
    Bo.team(this.id).customerStatus(e3);
  }
  accept(e3) {
    Bo.team(this.id).accept(e3);
  }
  end(e3) {
    Bo.team(this.id).end(e3);
  }
  history(e3) {
    Bo.team(this.id).history(e3);
  }
  markMessageAsRead(e3) {
    Bo.team(this.id).markMessageAsRead(e3);
  }
  createTextMessage(e3) {
    Bo.team(this.id).createTextMessage(e3);
  }
  createImageMessage(e3) {
    Bo.team(this.id).createImageMessage(e3);
  }
  createFileMessage(e3) {
    Bo.team(this.id).createFileMessage(e3);
  }
  createAudioMessage(e3) {
    Bo.team(this.id).createAudioMessage(e3);
  }
  createVideoMessage(e3) {
    Bo.team(this.id).createVideoMessage(e3);
  }
  createCustomMessage(e3) {
    Bo.team(this.id).createCustomMessage(e3);
  }
  transfer(e3) {
    Bo.team(this.id).transfer(e3);
  }
  agents(e3) {
    Bo.team(this.id).agents(e3);
  }
  liveSession(e3) {
    Bo.team(this.id).liveSession(e3);
  }
  quitLiveSession(e3) {
    Bo.team(this.id).quitLiveSession(e3);
  }
  listenCustomer(e3) {
    Bo.team(this.id).listenCustomer(e3);
  }
  cancelListenCustomer(e3) {
    Bo.team(this.id).cancelListenCustomer(e3);
  }
}
class jo {
  static getInstance(e3) {
    return this.init(e3), jo;
  }
  static init(e3) {
    if (this.getConnectionStatus() !== t$1.DISCONNECTED)
      throw new Error("Initialization failed. Please disconnect and try again.");
    this.validateOptions(e3), i$1.init(e3.reactNativeOptions), this.options = e3, mn.init(e3), e3.allowNotification && ce$1.init(e3.allowNotification), e3.modules && (e3.modules.includes("PUBSUB") && J$1.initModule(we$1.init()), e3.modules.includes("IM") && J$1.initModule(On.init())), Ao.init(), te$1.init(mn, ce$1, Ao, n$1, h$1, J$1);
  }
  static setBadge(e3) {
    ce$1.setBadge(e3);
  }
  static connect(e3) {
    mn.connect(e3, "JS");
  }
  static disconnect(e3) {
    mn.disconnect(e3);
  }
  static getConnectionStatus() {
    return mn.status();
  }
  static validateOptions(e3) {
    let t2 = "";
    if (!u$1.isObject(e3))
      throw t2 = "options is require an object.", Error(t2);
    if (!u$1.isPrimitive(e3.appkey) || 0 == e3.appkey.length)
      throw t2 = "Invalid options:'appkey' is empty.", Error(t2);
    if (!u$1.isPrimitive(e3.host) || 0 == e3.host.length)
      throw t2 = "Invalid options:'host' is empty.", Error(t2);
    if (!u$1.isArray(e3.modules))
      throw t2 = "Invalid options: 'modules' must be nonempty array", Error(t2);
    if (!e3.modules.includes("im") && !e3.modules.includes("pubsub"))
      throw t2 = "Invalid options: 'modules' must include at least one of 'im' or 'pubsub'.", Error(t2);
    e3.modules = e3.modules.map((e4) => e4.toUpperCase());
  }
  static onClickNotification(e3) {
    ce$1.onClickNotification(e3);
  }
  static c(e3) {
    e3.init(te$1.Socket, te$1.N, te$1.Member, te$1.v, te$1.Platform, J$1);
  }
}
jo.version = n$1, jo.IM_EVENT = He$1, jo.IM_SCENE = o$1, jo.im = class {
  static on(e3, t2) {
    ko.i().on(e3, t2);
  }
  static off(e3, t2) {
    ko.i().off(e3, t2);
  }
  static createTextMessage(e3) {
    return ko.i().createTextMessage(e3);
  }
  static createImageMessage(e3) {
    return ko.i().createImageMessage(e3);
  }
  static createFileMessage(e3) {
    return ko.i().createFileMessage(e3);
  }
  static createAudioMessage(e3) {
    return ko.i().createAudioMessage(e3);
  }
  static createVideoMessage(e3) {
    return ko.i().createVideoMessage(e3);
  }
  static createCustomMessage(e3) {
    return ko.i().createCustomMessage(e3);
  }
  static sendMessage(e3) {
    ko.i().sendMessage(e3);
  }
  static recallMessage(e3) {
    ko.i().recallMessage(e3);
  }
  static deleteMessage(e3) {
    ko.i().deleteMessage(e3);
  }
  static markGroupMessageAsRead(e3) {
    ko.i().markGroupMessageAsRead(e3);
  }
  static markPrivateMessageAsRead(e3) {
    ko.i().markPrivateMessageAsRead(e3);
  }
  static latestConversations(e3) {
    ko.i().latestConversations(e3);
  }
  static removePrivateConversation(e3) {
    ko.i().removePrivateConversation(e3);
  }
  static removeGroupConversation(e3) {
    ko.i().removeGroupConversation(e3);
  }
  static topPrivateConversation(e3) {
    ko.i().topPrivateConversation(e3);
  }
  static topGroupConversation(e3) {
    ko.i().topGroupConversation(e3);
  }
  static history(e3) {
    ko.i().history(e3);
  }
  static subscribeUserPresence(e3) {
    ko.i().subscribeUserPresence(e3);
  }
  static unsubscribeUserPresence(e3) {
    ko.i().unsubscribeUserPresence(e3);
  }
  static hereNow(e3) {
    ko.i().hereNow(e3);
  }
  static subscribeGroup(e3) {
    ko.i().subscribeGroup(e3);
  }
  static unsubscribeGroup(e3) {
    ko.i().unsubscribeGroup(e3);
  }
  static subscribeGroupPresence(e3) {
    ko.i().subscribeGroupPresence(e3);
  }
  static unsubscribeGroupPresence(e3) {
    ko.i().unsubscribeGroupPresence(e3);
  }
  static groupHereNow(e3) {
    ko.i().groupHereNow(e3);
  }
  static groupOnlineCount(e3) {
    ko.i().groupOnlineCount(e3);
  }
  static markMessageAsRead(e3) {
    ko.i().markMessageAsRead(e3);
  }
  static csteam(e3) {
    return new qo(e3);
  }
  static pendingConversations(e3) {
    ko.i().latestPendingConversations(e3);
  }
  static topConversation(e3) {
    ko.i().topConversation(e3);
  }
  static removeConversation(e3) {
    ko.i().removeConversation(e3);
  }
}, jo.pubsub = class {
  static publish(e3) {
    this.catch(() => {
      Ce$1.instance.publish(e3);
    }, e3);
  }
  static subscribe(e3) {
    this.catch(() => {
      Ce$1.instance.subscribe(e3);
    }, e3);
  }
  static unsubscribe(e3) {
    this.catch(() => {
      Ce$1.instance.unsubscribe(e3);
    }, e3);
  }
  static subscribePresence(e3) {
    this.catch(() => {
      Ce$1.instance.subscribePresence(e3);
    }, e3);
  }
  static unsubscribePresence(e3) {
    this.catch(() => {
      Ce$1.instance.unsubscribePresence(e3);
    }, e3);
  }
  static history(e3) {
    this.catch(() => {
      Ce$1.instance.history(e3);
    }, e3);
  }
  static hereNow(e3) {
    this.catch(() => {
      Ce$1.instance.hereNow(e3);
    }, e3);
  }
  static catch(e3, s3) {
    try {
      if (we$1.check(), [t$1.DISCONNECTED, t$1.DISCONNECTING, t$1.CONNECT_FAILED].includes(te$1.Socket.status()))
        throw new Error("Please call connect() first.");
      e3();
    } catch (e4) {
      v$1.onFailed(s3, e4);
    }
  }
};
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x2) {
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
}
var cosWxSdkV5_min = { exports: {} };
(function(module2, exports2) {
  !function(e3, t2) {
    module2.exports = t2();
  }(window, function() {
    return function(e3) {
      var t2 = {};
      function n2(i3) {
        if (t2[i3])
          return t2[i3].exports;
        var o2 = t2[i3] = { i: i3, l: false, exports: {} };
        return e3[i3].call(o2.exports, o2, o2.exports, n2), o2.l = true, o2.exports;
      }
      return n2.m = e3, n2.c = t2, n2.d = function(e4, t3, i3) {
        n2.o(e4, t3) || Object.defineProperty(e4, t3, { enumerable: true, get: i3 });
      }, n2.r = function(e4) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e4, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e4, "__esModule", { value: true });
      }, n2.t = function(e4, t3) {
        if (1 & t3 && (e4 = n2(e4)), 8 & t3)
          return e4;
        if (4 & t3 && "object" == typeof e4 && e4 && e4.__esModule)
          return e4;
        var i3 = /* @__PURE__ */ Object.create(null);
        if (n2.r(i3), Object.defineProperty(i3, "default", { enumerable: true, value: e4 }), 2 & t3 && "string" != typeof e4)
          for (var o2 in e4)
            n2.d(i3, o2, (function(t4) {
              return e4[t4];
            }).bind(null, o2));
        return i3;
      }, n2.n = function(e4) {
        var t3 = e4 && e4.__esModule ? function() {
          return e4.default;
        } : function() {
          return e4;
        };
        return n2.d(t3, "a", t3), t3;
      }, n2.o = function(e4, t3) {
        return Object.prototype.hasOwnProperty.call(e4, t3);
      }, n2.p = "/Users/chrisftian/Documents/projects/cos-sdk/cos-wx-sdk-v5/dist", n2(n2.s = 8);
    }([function(e3, t2, n2) {
      function i3(e4, t3) {
        var n3 = "undefined" != typeof Symbol && e4[Symbol.iterator] || e4["@@iterator"];
        if (!n3) {
          if (Array.isArray(e4) || (n3 = function(e5, t4) {
            if (!e5)
              return;
            if ("string" == typeof e5)
              return o2(e5, t4);
            var n4 = Object.prototype.toString.call(e5).slice(8, -1);
            "Object" === n4 && e5.constructor && (n4 = e5.constructor.name);
            if ("Map" === n4 || "Set" === n4)
              return Array.from(e5);
            if ("Arguments" === n4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
              return o2(e5, t4);
          }(e4)) || t3 && e4 && "number" == typeof e4.length) {
            n3 && (e4 = n3);
            var i4 = 0, a4 = function() {
            };
            return { s: a4, n: function() {
              return i4 >= e4.length ? { done: true } : { done: false, value: e4[i4++] };
            }, e: function(e5) {
              throw e5;
            }, f: a4 };
          }
          throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }
        var r3, s4 = true, c4 = false;
        return { s: function() {
          n3 = n3.call(e4);
        }, n: function() {
          var e5 = n3.next();
          return s4 = e5.done, e5;
        }, e: function(e5) {
          c4 = true, r3 = e5;
        }, f: function() {
          try {
            s4 || null == n3.return || n3.return();
          } finally {
            if (c4)
              throw r3;
          }
        } };
      }
      function o2(e4, t3) {
        (null == t3 || t3 > e4.length) && (t3 = e4.length);
        for (var n3 = 0, i4 = new Array(t3); n3 < t3; n3++)
          i4[n3] = e4[n3];
        return i4;
      }
      function a3() {
        /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        a3 = function() {
          return t3;
        };
        var e4, t3 = {}, n3 = Object.prototype, i4 = n3.hasOwnProperty, o3 = Object.defineProperty || function(e5, t4, n4) {
          e5[t4] = n4.value;
        }, r3 = "function" == typeof Symbol ? Symbol : {}, c4 = r3.iterator || "@@iterator", l3 = r3.asyncIterator || "@@asyncIterator", p4 = r3.toStringTag || "@@toStringTag";
        function u3(e5, t4, n4) {
          return Object.defineProperty(e5, t4, { value: n4, enumerable: true, configurable: true, writable: true }), e5[t4];
        }
        try {
          u3({}, "");
        } catch (e5) {
          u3 = function(e6, t4, n4) {
            return e6[t4] = n4;
          };
        }
        function d4(e5, t4, n4, i5) {
          var a4 = t4 && t4.prototype instanceof x3 ? t4 : x3, r4 = Object.create(a4.prototype), s4 = new j3(i5 || []);
          return o3(r4, "_invoke", { value: A3(e5, n4, s4) }), r4;
        }
        function f4(e5, t4, n4) {
          try {
            return { type: "normal", arg: e5.call(t4, n4) };
          } catch (e6) {
            return { type: "throw", arg: e6 };
          }
        }
        t3.wrap = d4;
        var m4 = "suspendedStart", h4 = "suspendedYield", g3 = "executing", v4 = "completed", y3 = {};
        function x3() {
        }
        function k3() {
        }
        function b3() {
        }
        var C3 = {};
        u3(C3, c4, function() {
          return this;
        });
        var S3 = Object.getPrototypeOf, w3 = S3 && S3(S3(I3([])));
        w3 && w3 !== n3 && i4.call(w3, c4) && (C3 = w3);
        var T3 = b3.prototype = x3.prototype = Object.create(C3);
        function R3(e5) {
          ["next", "throw", "return"].forEach(function(t4) {
            u3(e5, t4, function(e6) {
              return this._invoke(t4, e6);
            });
          });
        }
        function B3(e5, t4) {
          function n4(o4, a5, r4, c5) {
            var l4 = f4(e5[o4], e5, a5);
            if ("throw" !== l4.type) {
              var p5 = l4.arg, u4 = p5.value;
              return u4 && "object" == s3(u4) && i4.call(u4, "__await") ? t4.resolve(u4.__await).then(function(e6) {
                n4("next", e6, r4, c5);
              }, function(e6) {
                n4("throw", e6, r4, c5);
              }) : t4.resolve(u4).then(function(e6) {
                p5.value = e6, r4(p5);
              }, function(e6) {
                return n4("throw", e6, r4, c5);
              });
            }
            c5(l4.arg);
          }
          var a4;
          o3(this, "_invoke", { value: function(e6, i5) {
            function o4() {
              return new t4(function(t5, o5) {
                n4(e6, i5, t5, o5);
              });
            }
            return a4 = a4 ? a4.then(o4, o4) : o4();
          } });
        }
        function A3(t4, n4, i5) {
          var o4 = m4;
          return function(a4, r4) {
            if (o4 === g3)
              throw Error("Generator is already running");
            if (o4 === v4) {
              if ("throw" === a4)
                throw r4;
              return { value: e4, done: true };
            }
            for (i5.method = a4, i5.arg = r4; ; ) {
              var s4 = i5.delegate;
              if (s4) {
                var c5 = P3(s4, i5);
                if (c5) {
                  if (c5 === y3)
                    continue;
                  return c5;
                }
              }
              if ("next" === i5.method)
                i5.sent = i5._sent = i5.arg;
              else if ("throw" === i5.method) {
                if (o4 === m4)
                  throw o4 = v4, i5.arg;
                i5.dispatchException(i5.arg);
              } else
                "return" === i5.method && i5.abrupt("return", i5.arg);
              o4 = g3;
              var l4 = f4(t4, n4, i5);
              if ("normal" === l4.type) {
                if (o4 = i5.done ? v4 : h4, l4.arg === y3)
                  continue;
                return { value: l4.arg, done: i5.done };
              }
              "throw" === l4.type && (o4 = v4, i5.method = "throw", i5.arg = l4.arg);
            }
          };
        }
        function P3(t4, n4) {
          var i5 = n4.method, o4 = t4.iterator[i5];
          if (o4 === e4)
            return n4.delegate = null, "throw" === i5 && t4.iterator.return && (n4.method = "return", n4.arg = e4, P3(t4, n4), "throw" === n4.method) || "return" !== i5 && (n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a '" + i5 + "' method")), y3;
          var a4 = f4(o4, t4.iterator, n4.arg);
          if ("throw" === a4.type)
            return n4.method = "throw", n4.arg = a4.arg, n4.delegate = null, y3;
          var r4 = a4.arg;
          return r4 ? r4.done ? (n4[t4.resultName] = r4.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e4), n4.delegate = null, y3) : r4 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, y3);
        }
        function E3(e5) {
          var t4 = { tryLoc: e5[0] };
          1 in e5 && (t4.catchLoc = e5[1]), 2 in e5 && (t4.finallyLoc = e5[2], t4.afterLoc = e5[3]), this.tryEntries.push(t4);
        }
        function O3(e5) {
          var t4 = e5.completion || {};
          t4.type = "normal", delete t4.arg, e5.completion = t4;
        }
        function j3(e5) {
          this.tryEntries = [{ tryLoc: "root" }], e5.forEach(E3, this), this.reset(true);
        }
        function I3(t4) {
          if (t4 || "" === t4) {
            var n4 = t4[c4];
            if (n4)
              return n4.call(t4);
            if ("function" == typeof t4.next)
              return t4;
            if (!isNaN(t4.length)) {
              var o4 = -1, a4 = function n5() {
                for (; ++o4 < t4.length; )
                  if (i4.call(t4, o4))
                    return n5.value = t4[o4], n5.done = false, n5;
                return n5.value = e4, n5.done = true, n5;
              };
              return a4.next = a4;
            }
          }
          throw new TypeError(s3(t4) + " is not iterable");
        }
        return k3.prototype = b3, o3(T3, "constructor", { value: b3, configurable: true }), o3(b3, "constructor", { value: k3, configurable: true }), k3.displayName = u3(b3, p4, "GeneratorFunction"), t3.isGeneratorFunction = function(e5) {
          var t4 = "function" == typeof e5 && e5.constructor;
          return !!t4 && (t4 === k3 || "GeneratorFunction" === (t4.displayName || t4.name));
        }, t3.mark = function(e5) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(e5, b3) : (e5.__proto__ = b3, u3(e5, p4, "GeneratorFunction")), e5.prototype = Object.create(T3), e5;
        }, t3.awrap = function(e5) {
          return { __await: e5 };
        }, R3(B3.prototype), u3(B3.prototype, l3, function() {
          return this;
        }), t3.AsyncIterator = B3, t3.async = function(e5, n4, i5, o4, a4) {
          void 0 === a4 && (a4 = Promise);
          var r4 = new B3(d4(e5, n4, i5, o4), a4);
          return t3.isGeneratorFunction(n4) ? r4 : r4.next().then(function(e6) {
            return e6.done ? e6.value : r4.next();
          });
        }, R3(T3), u3(T3, p4, "Generator"), u3(T3, c4, function() {
          return this;
        }), u3(T3, "toString", function() {
          return "[object Generator]";
        }), t3.keys = function(e5) {
          var t4 = Object(e5), n4 = [];
          for (var i5 in t4)
            n4.push(i5);
          return n4.reverse(), function e6() {
            for (; n4.length; ) {
              var i6 = n4.pop();
              if (i6 in t4)
                return e6.value = i6, e6.done = false, e6;
            }
            return e6.done = true, e6;
          };
        }, t3.values = I3, j3.prototype = { constructor: j3, reset: function(t4) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = e4, this.done = false, this.delegate = null, this.method = "next", this.arg = e4, this.tryEntries.forEach(O3), !t4)
            for (var n4 in this)
              "t" === n4.charAt(0) && i4.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e4);
        }, stop: function() {
          this.done = true;
          var e5 = this.tryEntries[0].completion;
          if ("throw" === e5.type)
            throw e5.arg;
          return this.rval;
        }, dispatchException: function(t4) {
          if (this.done)
            throw t4;
          var n4 = this;
          function o4(i5, o5) {
            return s4.type = "throw", s4.arg = t4, n4.next = i5, o5 && (n4.method = "next", n4.arg = e4), !!o5;
          }
          for (var a4 = this.tryEntries.length - 1; a4 >= 0; --a4) {
            var r4 = this.tryEntries[a4], s4 = r4.completion;
            if ("root" === r4.tryLoc)
              return o4("end");
            if (r4.tryLoc <= this.prev) {
              var c5 = i4.call(r4, "catchLoc"), l4 = i4.call(r4, "finallyLoc");
              if (c5 && l4) {
                if (this.prev < r4.catchLoc)
                  return o4(r4.catchLoc, true);
                if (this.prev < r4.finallyLoc)
                  return o4(r4.finallyLoc);
              } else if (c5) {
                if (this.prev < r4.catchLoc)
                  return o4(r4.catchLoc, true);
              } else {
                if (!l4)
                  throw Error("try statement without catch or finally");
                if (this.prev < r4.finallyLoc)
                  return o4(r4.finallyLoc);
              }
            }
          }
        }, abrupt: function(e5, t4) {
          for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
            var o4 = this.tryEntries[n4];
            if (o4.tryLoc <= this.prev && i4.call(o4, "finallyLoc") && this.prev < o4.finallyLoc) {
              var a4 = o4;
              break;
            }
          }
          a4 && ("break" === e5 || "continue" === e5) && a4.tryLoc <= t4 && t4 <= a4.finallyLoc && (a4 = null);
          var r4 = a4 ? a4.completion : {};
          return r4.type = e5, r4.arg = t4, a4 ? (this.method = "next", this.next = a4.finallyLoc, y3) : this.complete(r4);
        }, complete: function(e5, t4) {
          if ("throw" === e5.type)
            throw e5.arg;
          return "break" === e5.type || "continue" === e5.type ? this.next = e5.arg : "return" === e5.type ? (this.rval = this.arg = e5.arg, this.method = "return", this.next = "end") : "normal" === e5.type && t4 && (this.next = t4), y3;
        }, finish: function(e5) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.finallyLoc === e5)
              return this.complete(n4.completion, n4.afterLoc), O3(n4), y3;
          }
        }, catch: function(e5) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.tryLoc === e5) {
              var i5 = n4.completion;
              if ("throw" === i5.type) {
                var o4 = i5.arg;
                O3(n4);
              }
              return o4;
            }
          }
          throw Error("illegal catch attempt");
        }, delegateYield: function(t4, n4, i5) {
          return this.delegate = { iterator: I3(t4), resultName: n4, nextLoc: i5 }, "next" === this.method && (this.arg = e4), y3;
        } }, t3;
      }
      function r2(e4, t3, n3, i4, o3, a4, r3) {
        try {
          var s4 = e4[a4](r3), c4 = s4.value;
        } catch (e5) {
          return void n3(e5);
        }
        s4.done ? t3(c4) : Promise.resolve(c4).then(i4, o3);
      }
      function s3(e4) {
        return s3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e5) {
          return typeof e5;
        } : function(e5) {
          return e5 && "function" == typeof Symbol && e5.constructor === Symbol && e5 !== Symbol.prototype ? "symbol" : typeof e5;
        }, s3(e4);
      }
      var c3 = n2(10), l2 = n2(13), p3 = n2(14), u2 = p3.btoa, d3 = wx$1.getFileSystemManager(), f3 = n2(2), m3 = n2(15), h3 = m3.XMLParser, g2 = m3.XMLBuilder, v3 = new h3({ ignoreDeclaration: true, ignoreAttributes: true, parseTagValue: false, trimValues: false }), y2 = new g2(), x2 = function e4(t3) {
        if (A2(t3))
          for (var n3 in t3) {
            var i4 = t3[n3];
            "string" == typeof i4 ? "#text" === n3 && delete t3[n3] : Array.isArray(i4) ? i4.forEach(function(t4) {
              e4(t4);
            }) : A2(i4) && e4(i4);
          }
      };
      function k2(e4) {
        return encodeURIComponent(e4).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
      }
      function b2(e4, t3) {
        var n3 = [];
        for (var i4 in e4)
          e4.hasOwnProperty(i4) && n3.push(t3 ? k2(i4).toLowerCase() : i4);
        return n3.sort(function(e5, t4) {
          return (e5 = e5.toLowerCase()) === (t4 = t4.toLowerCase()) ? 0 : e5 > t4 ? 1 : -1;
        });
      }
      var C2 = ["cache-control", "content-disposition", "content-encoding", "content-length", "content-md5", "content-type", "expect", "expires", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "origin", "range", "transfer-encoding", "pic-operations"], S2 = function() {
      }, w2 = function(e4) {
        var t3 = {};
        for (var n3 in e4)
          e4.hasOwnProperty(n3) && void 0 !== e4[n3] && null !== e4[n3] && (t3[n3] = e4[n3]);
        return t3;
      };
      function T2(e4) {
        return E2(e4, function(e5) {
          return "object" === s3(e5) && null !== e5 ? T2(e5) : e5;
        });
      }
      function R2(e4, t3) {
        return P2(t3, function(n3, i4) {
          e4[i4] = t3[i4];
        }), e4;
      }
      function B2(e4) {
        return e4 instanceof Array;
      }
      function A2(e4) {
        return "[object Object]" === Object.prototype.toString.call(e4);
      }
      function P2(e4, t3) {
        for (var n3 in e4)
          e4.hasOwnProperty(n3) && t3(e4[n3], n3);
      }
      function E2(e4, t3) {
        var n3 = B2(e4) ? [] : {};
        for (var i4 in e4)
          e4.hasOwnProperty(i4) && (n3[i4] = t3(e4[i4], i4));
        return n3;
      }
      var O2 = function(e4, t3) {
        if (t3 = R2({}, t3), "getAuth" !== e4 && "getV4Auth" !== e4 && "getObjectUrl" !== e4) {
          var n3 = t3.Headers || {};
          if (t3 && "object" === s3(t3)) {
            !function() {
              for (var e5 in t3)
                t3.hasOwnProperty(e5) && e5.indexOf("x-cos-") > -1 && (n3[e5] = t3[e5]);
            }();
            U2.each({ "x-cos-mfa": "MFA", "Content-MD5": "ContentMD5", "Content-Length": "ContentLength", "Content-Type": "ContentType", Expect: "Expect", Expires: "Expires", "Cache-Control": "CacheControl", "Content-Disposition": "ContentDisposition", "Content-Encoding": "ContentEncoding", Range: "Range", "If-Modified-Since": "IfModifiedSince", "If-Unmodified-Since": "IfUnmodifiedSince", "If-Match": "IfMatch", "If-None-Match": "IfNoneMatch", "x-cos-copy-source": "CopySource", "x-cos-copy-source-Range": "CopySourceRange", "x-cos-metadata-directive": "MetadataDirective", "x-cos-copy-source-If-Modified-Since": "CopySourceIfModifiedSince", "x-cos-copy-source-If-Unmodified-Since": "CopySourceIfUnmodifiedSince", "x-cos-copy-source-If-Match": "CopySourceIfMatch", "x-cos-copy-source-If-None-Match": "CopySourceIfNoneMatch", "x-cos-acl": "ACL", "x-cos-grant-read": "GrantRead", "x-cos-grant-write": "GrantWrite", "x-cos-grant-full-control": "GrantFullControl", "x-cos-grant-read-acp": "GrantReadAcp", "x-cos-grant-write-acp": "GrantWriteAcp", "x-cos-storage-class": "StorageClass", "x-cos-traffic-limit": "TrafficLimit", "x-cos-mime-limit": "MimeLimit", "x-cos-forbid-overwrite": "ForbidOverwrite", "x-cos-server-side-encryption-customer-algorithm": "SSECustomerAlgorithm", "x-cos-server-side-encryption-customer-key": "SSECustomerKey", "x-cos-server-side-encryption-customer-key-MD5": "SSECustomerKeyMD5", "x-cos-server-side-encryption": "ServerSideEncryption", "x-cos-server-side-encryption-cos-kms-key-id": "SSEKMSKeyId", "x-cos-server-side-encryption-context": "SSEContext", "Pic-Operations": "PicOperations" }, function(e5, i4) {
              void 0 !== t3[e5] && (n3[i4] = t3[e5]);
            }), t3.Headers = w2(n3);
          }
        }
        return t3;
      }, j2 = function(e4) {
        return new Promise(function(t3, n3) {
          d3.readFile({ filePath: e4, success: function(e5) {
            t3(e5.data);
          }, fail: function(e5) {
            n3((null == e5 ? void 0 : e5.errMsg) || "");
          } });
        });
      }, I2 = function() {
        var e4, t3 = (e4 = a3().mark(function e5(t4, n3, i4) {
          return a3().wrap(function(e6) {
            for (; ; )
              switch (e6.prev = e6.next) {
                case 0:
                  if ("postObject" !== t4) {
                    e6.next = 4;
                    break;
                  }
                  i4(), e6.next = 21;
                  break;
                case 4:
                  if ("putObject" !== t4) {
                    e6.next = 20;
                    break;
                  }
                  if (void 0 !== n3.Body || !n3.FilePath) {
                    e6.next = 17;
                    break;
                  }
                  return e6.prev = 6, e6.next = 9, j2(n3.FilePath);
                case 9:
                  n3.Body = e6.sent, e6.next = 17;
                  break;
                case 12:
                  return e6.prev = 12, e6.t0 = e6.catch(6), n3.Body = void 0, i4({ error: "readFile error, ".concat(e6.t0) }), e6.abrupt("return");
                case 17:
                  void 0 !== n3.Body ? (n3.ContentLength = n3.Body.byteLength, i4(null, n3.ContentLength)) : i4({ error: "missing param Body" }), e6.next = 21;
                  break;
                case 20:
                  n3.FilePath ? d3.stat({ path: n3.FilePath, success: function(e7) {
                    var t5 = e7.stats;
                    n3.FileStat = t5, n3.FileStat.FilePath = n3.FilePath;
                    var o3 = t5.isDirectory() ? 0 : t5.size;
                    n3.ContentLength = o3 = o3 || 0, i4(null, o3);
                  }, fail: function(e7) {
                    i4(e7);
                  } }) : i4({ error: "missing param FilePath" });
                case 21:
                case "end":
                  return e6.stop();
              }
          }, e5, null, [[6, 12]]);
        }), function() {
          var t4 = this, n3 = arguments;
          return new Promise(function(i4, o3) {
            var a4 = e4.apply(t4, n3);
            function s4(e5) {
              r2(a4, i4, o3, s4, c4, "next", e5);
            }
            function c4(e5) {
              r2(a4, i4, o3, s4, c4, "throw", e5);
            }
            s4(void 0);
          });
        });
        return function(e5, n3, i4) {
          return t3.apply(this, arguments);
        };
      }(), _2 = function(e4) {
        return Date.now() + (e4 || 0);
      }, N2 = function(e4, t3) {
        if (!e4 || !t3)
          return -1;
        e4 = e4.split("."), t3 = t3.split(".");
        for (var n3 = Math.max(e4.length, t3.length); e4.length < n3; )
          e4.push("0");
        for (; t3.length < n3; )
          t3.push("0");
        for (var i4 = 0; i4 < n3; i4++) {
          var o3 = parseInt(e4[i4]), a4 = parseInt(t3[i4]);
          if (o3 > a4)
            return 1;
          if (o3 < a4)
            return -1;
        }
        return 0;
      }, L2 = function() {
        var e4 = {}, t3 = {};
        wx$1.canIUse("getAppBaseInfo") && (e4 = wx$1.getAppBaseInfo() || {}), wx$1.canIUse("getDeviceInfo") && (t3 = wx$1.getDeviceInfo() || {});
        var n3 = e4.SDKVersion, i4 = (t3.platform, N2(n3, "2.10.0") >= 0);
        return function() {
          return i4;
        };
      }(), U2 = { noop: S2, formatParams: O2, apiWrapper: function(e4, t3) {
        return function(n3, i4) {
          var o3, a4 = this;
          if ("function" == typeof n3 && (i4 = n3, n3 = {}), n3 = O2(e4, n3), a4.options.EnableReporter)
            if ("sliceUploadFile" === n3.calledBySdk || "sliceCopyFile" === n3.calledBySdk)
              o3 = n3.tracker && n3.tracker.generateSubTracker({ apiName: e4 });
            else if (["uploadFile", "uploadFiles"].includes(e4))
              o3 = null;
            else {
              var r3 = 0;
              n3.Body && (r3 = "string" == typeof n3.Body ? n3.Body.length : n3.Body.size || n3.Body.byteLength || 0);
              var s4 = a4.options.UseAccelerate || "string" == typeof a4.options.Domain && a4.options.Domain.includes("accelerate.");
              o3 = new f3({ Beacon: a4.options.BeaconReporter, clsReporter: a4.options.ClsReporter, bucket: n3.Bucket, region: n3.Region, apiName: e4, realApi: e4, accelerate: s4, fileKey: n3.Key, fileSize: r3, deepTracker: a4.options.DeepTracker, customId: a4.options.CustomId, delay: a4.options.TrackerDelay });
            }
          n3.tracker = o3;
          var c4 = function(e5) {
            return e5 && e5.headers && (e5.headers["x-ci-request-id"] && (e5.RequestId = e5.headers["x-ci-request-id"]), e5.headers["x-cos-request-id"] && (e5.RequestId = e5.headers["x-cos-request-id"]), e5.headers["x-cos-version-id"] && (e5.VersionId = e5.headers["x-cos-version-id"]), e5.headers["x-cos-delete-marker"] && (e5.DeleteMarker = e5.headers["x-cos-delete-marker"])), e5;
          }, l3 = function(e5, t4) {
            o3 && o3.report(e5, t4), i4 && i4(c4(e5), c4(t4));
          }, p4 = function() {
            if ("getService" !== e4 && "abortUploadTask" !== e4) {
              var t4 = function(e5, t5) {
                var n4 = t5.Bucket, i5 = t5.Region, o4 = t5.Key;
                if (e5.indexOf("Bucket") > -1 || "deleteMultipleObject" === e5 || "multipartList" === e5 || "listObjectVersions" === e5) {
                  if (!n4)
                    return "Bucket";
                  if (!i5)
                    return "Region";
                } else if (e5.indexOf("Object") > -1 || e5.indexOf("multipart") > -1 || "sliceUploadFile" === e5 || "abortUploadTask" === e5 || "uploadFile" === e5) {
                  if (!n4)
                    return "Bucket";
                  if (!i5)
                    return "Region";
                  if (!o4)
                    return "Key";
                }
                return false;
              }(e4, n3);
              if (t4)
                return "missing param " + t4;
              if (n3.Region) {
                if (n3.Region.indexOf("cos.") > -1)
                  return 'param Region should not be start with "cos."';
                if (!/^([a-z\d-]+)$/.test(n3.Region))
                  return "Region format error.";
                !a4.options.CompatibilityMode && -1 === n3.Region.indexOf("-") && "yfb" !== n3.Region && "default" !== n3.Region && n3.Region;
              }
              if (n3.Bucket) {
                if (!/^([a-z\d-]+)-(\d+)$/.test(n3.Bucket))
                  if (n3.AppId)
                    n3.Bucket = n3.Bucket + "-" + n3.AppId;
                  else {
                    if (!a4.options.AppId)
                      return 'Bucket should format as "test-1250000000".';
                    n3.Bucket = n3.Bucket + "-" + a4.options.AppId;
                  }
                n3.AppId && delete n3.AppId;
              }
              n3.Key && "/" === n3.Key.substr(0, 1) && (n3.Key = n3.Key.substr(1));
            }
          }(), u3 = ["getAuth", "getObjectUrl"].includes(e4);
          if (!u3 && !i4)
            return new Promise(function(e5, o4) {
              if (i4 = function(t4, n4) {
                t4 ? o4(t4) : e5(n4);
              }, p4)
                return l3({ error: p4 });
              t3.call(a4, n3, l3);
            });
          if (p4)
            return l3({ error: p4 });
          var d4 = t3.call(a4, n3, l3);
          return u3 ? d4 : void 0;
        };
      }, xml2json: function(e4) {
        var t3 = v3.parse(e4);
        return x2(t3), t3;
      }, json2xml: function(e4) {
        return y2.build(e4);
      }, md5: c3, clearKey: w2, fileSlice: function(e4, t3, n3, i4) {
        e4 ? d3.readFile({ filePath: e4, position: t3, length: n3 - t3, success: function(e5) {
          i4(e5.data);
        }, fail: function() {
          i4(null);
        } }) : i4(null);
      }, getBodyMd5: function(e4, t3, n3) {
        n3 = n3 || S2, e4 && t3 && t3 instanceof ArrayBuffer ? U2.getFileMd5(t3, function(e5, t4) {
          n3(t4);
        }) : n3();
      }, getFileMd5: function(e4, t3) {
        var n3 = c3(e4);
        return t3 && t3(n3), n3;
      }, binaryBase64: function(e4) {
        var t3, n3, i4, o3 = "";
        for (t3 = 0, n3 = e4.length / 2; t3 < n3; t3++)
          i4 = parseInt(e4[2 * t3] + e4[2 * t3 + 1], 16), o3 += String.fromCharCode(i4);
        return u2(o3);
      }, extend: R2, isArray: B2, isInArray: function(e4, t3) {
        for (var n3 = false, i4 = 0; i4 < e4.length; i4++)
          if (t3 === e4[i4]) {
            n3 = true;
            break;
          }
        return n3;
      }, makeArray: function(e4) {
        return B2(e4) ? e4 : [e4];
      }, each: P2, map: E2, filter: function(e4, t3) {
        var n3 = B2(e4), i4 = n3 ? [] : {};
        for (var o3 in e4)
          e4.hasOwnProperty(o3) && t3(e4[o3], o3) && (n3 ? i4.push(e4[o3]) : i4[o3] = e4[o3]);
        return i4;
      }, clone: T2, attr: function(e4, t3, n3) {
        return e4 && t3 in e4 ? e4[t3] : n3;
      }, uuid: function() {
        var e4 = function() {
          return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
        };
        return e4() + e4() + "-" + e4() + "-" + e4() + "-" + e4() + "-" + e4() + e4() + e4();
      }, camSafeUrlEncode: k2, throttleOnProgress: function(e4, t3) {
        var n3, i4, o3 = this, a4 = 0, r3 = 0, s4 = Date.now();
        function c4() {
          if (i4 = 0, t3 && "function" == typeof t3) {
            n3 = Date.now();
            var o4, c5 = Math.max(0, Math.round((r3 - a4) / ((n3 - s4) / 1e3) * 100) / 100) || 0;
            o4 = 0 === r3 && 0 === e4 ? 1 : Math.floor(r3 / e4 * 100) / 100 || 0, s4 = n3, a4 = r3;
            try {
              t3({ loaded: r3, total: e4, speed: c5, percent: o4 });
            } catch (e5) {
            }
          }
        }
        return function(t4, n4) {
          if (t4 && (r3 = t4.loaded, e4 = t4.total), n4)
            clearTimeout(i4), c4();
          else {
            if (i4)
              return;
            i4 = setTimeout(c4, o3.options.ProgressInterval);
          }
        };
      }, getFileSize: I2, getFileSizeByPath: function(e4) {
        return new Promise(function(t3, n3) {
          d3.stat({ path: e4, success: function(e5) {
            var n4 = e5.stats, i4 = n4.isDirectory() ? 0 : n4.size;
            t3(i4);
          }, fail: function(e5) {
            n3((null == e5 ? void 0 : e5.errMsg) || "");
          } });
        });
      }, getSkewTime: _2, obj2str: function(e4, t3) {
        var n3, i4, o3, a4 = [], r3 = b2(e4);
        for (n3 = 0; n3 < r3.length; n3++)
          o3 = void 0 === e4[i4 = r3[n3]] || null === e4[i4] ? "" : "" + e4[i4], i4 = t3 ? k2(i4).toLowerCase() : k2(i4), o3 = k2(o3) || "", a4.push(i4 + "=" + o3);
        return a4.join("&");
      }, getAuth: function(e4) {
        var t3, n3 = (e4 = e4 || {}).SecretId, i4 = e4.SecretKey, o3 = e4.KeyTime, a4 = (e4.method || e4.Method || "get").toLowerCase(), r3 = T2(e4.Query || e4.params || {}), s4 = function(e5) {
          var t4 = {};
          for (var n4 in e5) {
            var i5 = n4.toLowerCase();
            (i5.indexOf("x-cos-") > -1 || i5.indexOf("x-ci-") > -1 || C2.indexOf(i5) > -1) && (t4[n4] = e5[n4]);
          }
          return t4;
        }(T2(e4.Headers || e4.headers || {})), c4 = e4.Key || "";
        e4.UseRawKey ? t3 = e4.Pathname || e4.pathname || "/" + c4 : 0 !== (t3 = e4.Pathname || e4.pathname || c4).indexOf("/") && (t3 = "/" + t3);
        var p4 = false !== e4.ForceSignHost;
        if (!s4.Host && !s4.host && e4.Bucket && e4.Region && p4 && (s4.Host = e4.Bucket + ".cos." + e4.Region + ".myqcloud.com"), n3 && i4) {
          var u3 = Math.round(_2(e4.SystemClockOffset) / 1e3) - 1, d4 = u3, f4 = e4.Expires || e4.expires;
          d4 += void 0 === f4 ? 900 : 1 * f4 || 0;
          var m4 = n3, h4 = o3 || u3 + ";" + d4, g3 = o3 || u3 + ";" + d4, v4 = b2(s4, true).join(";").toLowerCase(), y3 = b2(r3, true).join(";").toLowerCase(), x3 = l2.HmacSHA1(g3, i4).toString(), k3 = [a4, t3, U2.obj2str(r3, true), U2.obj2str(s4, true), ""].join("\n"), S3 = ["sha1", h4, l2.SHA1(k3).toString(), ""].join("\n");
          return ["q-sign-algorithm=sha1", "q-ak=" + m4, "q-sign-time=" + h4, "q-key-time=" + g3, "q-header-list=" + v4, "q-url-param-list=" + y3, "q-signature=" + l2.HmacSHA1(S3, x3).toString()].join("&");
        }
      }, compareVersion: N2, canFileSlice: L2, isCIHost: function(e4) {
        return /^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e4);
      }, error: function(e4, t3) {
        var n3 = e4;
        return e4.message = e4.message || null, "string" == typeof t3 ? (e4.error = t3, e4.message = t3) : "object" === s3(t3) && null !== t3 && (R2(e4, t3), (t3.code || t3.name) && (e4.code = t3.code || t3.name), t3.message && (e4.message = t3.message), t3.stack && (e4.stack = t3.stack)), "function" == typeof Object.defineProperty && (Object.defineProperty(e4, "name", { writable: true, enumerable: false }), Object.defineProperty(e4, "message", { enumerable: true })), e4.name = t3 && t3.name || e4.name || e4.code || "Error", e4.code || (e4.code = e4.name), e4.error || (e4.error = T2(n3)), e4;
      }, getSourceParams: function(e4) {
        var t3 = this.options.CopySourceParser;
        if (t3)
          return t3(e4);
        var n3 = e4.match(/^([^.]+-\d+)\.cos(v6|-cdc|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);
        return n3 ? { Bucket: n3[1], Region: n3[3], Key: n3[7] } : null;
      }, encodeBase64: function(e4, t3) {
        var n3 = p3.encode(e4);
        return t3 && (n3 = n3.replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "")), n3;
      }, simplifyPath: function(e4) {
        var t3, n3 = [], o3 = i3(e4.split("/"));
        try {
          for (o3.s(); !(t3 = o3.n()).done; ) {
            var a4 = t3.value;
            ".." === a4 ? n3.length && n3.pop() : a4.length && "." !== a4 && n3.push(a4);
          }
        } catch (e5) {
          o3.e(e5);
        } finally {
          o3.f();
        }
        return "/" + n3.join("/");
      }, arrayBufferToString: function(e4) {
        return new TextDecoder("utf-8").decode(e4);
      }, parseResBody: function(e4) {
        var t3;
        if (e4 && "string" == typeof e4) {
          var n3 = e4.trim(), i4 = 0 === n3.indexOf("<"), o3 = 0 === n3.indexOf("{");
          if (i4)
            t3 = U2.xml2json(e4) || {};
          else if (o3)
            try {
              var a4 = e4.replace(/\n/g, " "), r3 = JSON.parse(a4);
              t3 = "[object Object]" === Object.prototype.toString.call(r3) ? r3 : e4;
            } catch (n4) {
              t3 = e4;
            }
          else
            t3 = e4;
        } else
          t3 = e4 || {};
        return t3;
      } };
      e3.exports = U2;
    }, function(e3, t2, n2) {
      const i3 = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", o2 = "[" + i3 + "][" + (i3 + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040") + "]*", a3 = new RegExp("^" + o2 + "$");
      t2.isExist = function(e4) {
        return void 0 !== e4;
      }, t2.isEmptyObject = function(e4) {
        return 0 === Object.keys(e4).length;
      }, t2.merge = function(e4, t3, n3) {
        if (t3) {
          const i4 = Object.keys(t3), o3 = i4.length;
          for (let a4 = 0; a4 < o3; a4++)
            e4[i4[a4]] = "strict" === n3 ? [t3[i4[a4]]] : t3[i4[a4]];
        }
      }, t2.getValue = function(e4) {
        return t2.isExist(e4) ? e4 : "";
      }, t2.isName = function(e4) {
        const t3 = a3.exec(e4);
        return !(null == t3);
      }, t2.getAllMatches = function(e4, t3) {
        const n3 = [];
        let i4 = t3.exec(e4);
        for (; i4; ) {
          const o3 = [];
          o3.startIndex = t3.lastIndex - i4[0].length;
          const a4 = i4.length;
          for (let e5 = 0; e5 < a4; e5++)
            o3.push(i4[e5]);
          n3.push(o3), i4 = t3.exec(e4);
        }
        return n3;
      }, t2.nameRegexp = o2;
    }, function(e3, t2, n2) {
      function i3(e4) {
        return i3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e5) {
          return typeof e5;
        } : function(e5) {
          return e5 && "function" == typeof Symbol && e5.constructor === Symbol && e5 !== Symbol.prototype ? "symbol" : typeof e5;
        }, i3(e4);
      }
      function o2() {
        /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        o2 = function() {
          return t3;
        };
        var e4, t3 = {}, n3 = Object.prototype, a4 = n3.hasOwnProperty, r3 = Object.defineProperty || function(e5, t4, n4) {
          e5[t4] = n4.value;
        }, s4 = "function" == typeof Symbol ? Symbol : {}, c4 = s4.iterator || "@@iterator", l3 = s4.asyncIterator || "@@asyncIterator", p4 = s4.toStringTag || "@@toStringTag";
        function u3(e5, t4, n4) {
          return Object.defineProperty(e5, t4, { value: n4, enumerable: true, configurable: true, writable: true }), e5[t4];
        }
        try {
          u3({}, "");
        } catch (e5) {
          u3 = function(e6, t4, n4) {
            return e6[t4] = n4;
          };
        }
        function d4(e5, t4, n4, i4) {
          var o3 = t4 && t4.prototype instanceof x3 ? t4 : x3, a5 = Object.create(o3.prototype), s5 = new j2(i4 || []);
          return r3(a5, "_invoke", { value: A2(e5, n4, s5) }), a5;
        }
        function f4(e5, t4, n4) {
          try {
            return { type: "normal", arg: e5.call(t4, n4) };
          } catch (e6) {
            return { type: "throw", arg: e6 };
          }
        }
        t3.wrap = d4;
        var m4 = "suspendedStart", h4 = "suspendedYield", g3 = "executing", v4 = "completed", y3 = {};
        function x3() {
        }
        function k2() {
        }
        function b2() {
        }
        var C2 = {};
        u3(C2, c4, function() {
          return this;
        });
        var S2 = Object.getPrototypeOf, w2 = S2 && S2(S2(I2([])));
        w2 && w2 !== n3 && a4.call(w2, c4) && (C2 = w2);
        var T2 = b2.prototype = x3.prototype = Object.create(C2);
        function R2(e5) {
          ["next", "throw", "return"].forEach(function(t4) {
            u3(e5, t4, function(e6) {
              return this._invoke(t4, e6);
            });
          });
        }
        function B2(e5, t4) {
          function n4(o4, r4, s5, c5) {
            var l4 = f4(e5[o4], e5, r4);
            if ("throw" !== l4.type) {
              var p5 = l4.arg, u4 = p5.value;
              return u4 && "object" == i3(u4) && a4.call(u4, "__await") ? t4.resolve(u4.__await).then(function(e6) {
                n4("next", e6, s5, c5);
              }, function(e6) {
                n4("throw", e6, s5, c5);
              }) : t4.resolve(u4).then(function(e6) {
                p5.value = e6, s5(p5);
              }, function(e6) {
                return n4("throw", e6, s5, c5);
              });
            }
            c5(l4.arg);
          }
          var o3;
          r3(this, "_invoke", { value: function(e6, i4) {
            function a5() {
              return new t4(function(t5, o4) {
                n4(e6, i4, t5, o4);
              });
            }
            return o3 = o3 ? o3.then(a5, a5) : a5();
          } });
        }
        function A2(t4, n4, i4) {
          var o3 = m4;
          return function(a5, r4) {
            if (o3 === g3)
              throw Error("Generator is already running");
            if (o3 === v4) {
              if ("throw" === a5)
                throw r4;
              return { value: e4, done: true };
            }
            for (i4.method = a5, i4.arg = r4; ; ) {
              var s5 = i4.delegate;
              if (s5) {
                var c5 = P2(s5, i4);
                if (c5) {
                  if (c5 === y3)
                    continue;
                  return c5;
                }
              }
              if ("next" === i4.method)
                i4.sent = i4._sent = i4.arg;
              else if ("throw" === i4.method) {
                if (o3 === m4)
                  throw o3 = v4, i4.arg;
                i4.dispatchException(i4.arg);
              } else
                "return" === i4.method && i4.abrupt("return", i4.arg);
              o3 = g3;
              var l4 = f4(t4, n4, i4);
              if ("normal" === l4.type) {
                if (o3 = i4.done ? v4 : h4, l4.arg === y3)
                  continue;
                return { value: l4.arg, done: i4.done };
              }
              "throw" === l4.type && (o3 = v4, i4.method = "throw", i4.arg = l4.arg);
            }
          };
        }
        function P2(t4, n4) {
          var i4 = n4.method, o3 = t4.iterator[i4];
          if (o3 === e4)
            return n4.delegate = null, "throw" === i4 && t4.iterator.return && (n4.method = "return", n4.arg = e4, P2(t4, n4), "throw" === n4.method) || "return" !== i4 && (n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a '" + i4 + "' method")), y3;
          var a5 = f4(o3, t4.iterator, n4.arg);
          if ("throw" === a5.type)
            return n4.method = "throw", n4.arg = a5.arg, n4.delegate = null, y3;
          var r4 = a5.arg;
          return r4 ? r4.done ? (n4[t4.resultName] = r4.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e4), n4.delegate = null, y3) : r4 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, y3);
        }
        function E2(e5) {
          var t4 = { tryLoc: e5[0] };
          1 in e5 && (t4.catchLoc = e5[1]), 2 in e5 && (t4.finallyLoc = e5[2], t4.afterLoc = e5[3]), this.tryEntries.push(t4);
        }
        function O2(e5) {
          var t4 = e5.completion || {};
          t4.type = "normal", delete t4.arg, e5.completion = t4;
        }
        function j2(e5) {
          this.tryEntries = [{ tryLoc: "root" }], e5.forEach(E2, this), this.reset(true);
        }
        function I2(t4) {
          if (t4 || "" === t4) {
            var n4 = t4[c4];
            if (n4)
              return n4.call(t4);
            if ("function" == typeof t4.next)
              return t4;
            if (!isNaN(t4.length)) {
              var o3 = -1, r4 = function n5() {
                for (; ++o3 < t4.length; )
                  if (a4.call(t4, o3))
                    return n5.value = t4[o3], n5.done = false, n5;
                return n5.value = e4, n5.done = true, n5;
              };
              return r4.next = r4;
            }
          }
          throw new TypeError(i3(t4) + " is not iterable");
        }
        return k2.prototype = b2, r3(T2, "constructor", { value: b2, configurable: true }), r3(b2, "constructor", { value: k2, configurable: true }), k2.displayName = u3(b2, p4, "GeneratorFunction"), t3.isGeneratorFunction = function(e5) {
          var t4 = "function" == typeof e5 && e5.constructor;
          return !!t4 && (t4 === k2 || "GeneratorFunction" === (t4.displayName || t4.name));
        }, t3.mark = function(e5) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(e5, b2) : (e5.__proto__ = b2, u3(e5, p4, "GeneratorFunction")), e5.prototype = Object.create(T2), e5;
        }, t3.awrap = function(e5) {
          return { __await: e5 };
        }, R2(B2.prototype), u3(B2.prototype, l3, function() {
          return this;
        }), t3.AsyncIterator = B2, t3.async = function(e5, n4, i4, o3, a5) {
          void 0 === a5 && (a5 = Promise);
          var r4 = new B2(d4(e5, n4, i4, o3), a5);
          return t3.isGeneratorFunction(n4) ? r4 : r4.next().then(function(e6) {
            return e6.done ? e6.value : r4.next();
          });
        }, R2(T2), u3(T2, p4, "Generator"), u3(T2, c4, function() {
          return this;
        }), u3(T2, "toString", function() {
          return "[object Generator]";
        }), t3.keys = function(e5) {
          var t4 = Object(e5), n4 = [];
          for (var i4 in t4)
            n4.push(i4);
          return n4.reverse(), function e6() {
            for (; n4.length; ) {
              var i5 = n4.pop();
              if (i5 in t4)
                return e6.value = i5, e6.done = false, e6;
            }
            return e6.done = true, e6;
          };
        }, t3.values = I2, j2.prototype = { constructor: j2, reset: function(t4) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = e4, this.done = false, this.delegate = null, this.method = "next", this.arg = e4, this.tryEntries.forEach(O2), !t4)
            for (var n4 in this)
              "t" === n4.charAt(0) && a4.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e4);
        }, stop: function() {
          this.done = true;
          var e5 = this.tryEntries[0].completion;
          if ("throw" === e5.type)
            throw e5.arg;
          return this.rval;
        }, dispatchException: function(t4) {
          if (this.done)
            throw t4;
          var n4 = this;
          function i4(i5, o4) {
            return s5.type = "throw", s5.arg = t4, n4.next = i5, o4 && (n4.method = "next", n4.arg = e4), !!o4;
          }
          for (var o3 = this.tryEntries.length - 1; o3 >= 0; --o3) {
            var r4 = this.tryEntries[o3], s5 = r4.completion;
            if ("root" === r4.tryLoc)
              return i4("end");
            if (r4.tryLoc <= this.prev) {
              var c5 = a4.call(r4, "catchLoc"), l4 = a4.call(r4, "finallyLoc");
              if (c5 && l4) {
                if (this.prev < r4.catchLoc)
                  return i4(r4.catchLoc, true);
                if (this.prev < r4.finallyLoc)
                  return i4(r4.finallyLoc);
              } else if (c5) {
                if (this.prev < r4.catchLoc)
                  return i4(r4.catchLoc, true);
              } else {
                if (!l4)
                  throw Error("try statement without catch or finally");
                if (this.prev < r4.finallyLoc)
                  return i4(r4.finallyLoc);
              }
            }
          }
        }, abrupt: function(e5, t4) {
          for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
            var i4 = this.tryEntries[n4];
            if (i4.tryLoc <= this.prev && a4.call(i4, "finallyLoc") && this.prev < i4.finallyLoc) {
              var o3 = i4;
              break;
            }
          }
          o3 && ("break" === e5 || "continue" === e5) && o3.tryLoc <= t4 && t4 <= o3.finallyLoc && (o3 = null);
          var r4 = o3 ? o3.completion : {};
          return r4.type = e5, r4.arg = t4, o3 ? (this.method = "next", this.next = o3.finallyLoc, y3) : this.complete(r4);
        }, complete: function(e5, t4) {
          if ("throw" === e5.type)
            throw e5.arg;
          return "break" === e5.type || "continue" === e5.type ? this.next = e5.arg : "return" === e5.type ? (this.rval = this.arg = e5.arg, this.method = "return", this.next = "end") : "normal" === e5.type && t4 && (this.next = t4), y3;
        }, finish: function(e5) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.finallyLoc === e5)
              return this.complete(n4.completion, n4.afterLoc), O2(n4), y3;
          }
        }, catch: function(e5) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.tryLoc === e5) {
              var i4 = n4.completion;
              if ("throw" === i4.type) {
                var o3 = i4.arg;
                O2(n4);
              }
              return o3;
            }
          }
          throw Error("illegal catch attempt");
        }, delegateYield: function(t4, n4, i4) {
          return this.delegate = { iterator: I2(t4), resultName: n4, nextLoc: i4 }, "next" === this.method && (this.arg = e4), y3;
        } }, t3;
      }
      function a3(e4, t3, n3, i4, o3, a4, r3) {
        try {
          var s4 = e4[a4](r3), c4 = s4.value;
        } catch (e5) {
          return void n3(e5);
        }
        s4.done ? t3(c4) : Promise.resolve(c4).then(i4, o3);
      }
      function r2(e4) {
        return function() {
          var t3 = this, n3 = arguments;
          return new Promise(function(i4, o3) {
            var r3 = e4.apply(t3, n3);
            function s4(e5) {
              a3(r3, i4, o3, s4, c4, "next", e5);
            }
            function c4(e5) {
              a3(r3, i4, o3, s4, c4, "throw", e5);
            }
            s4(void 0);
          });
        };
      }
      function s3(e4, t3, n3) {
        return (t3 = l2(t3)) in e4 ? Object.defineProperty(e4, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e4[t3] = n3, e4;
      }
      function c3(e4, t3) {
        for (var n3 = 0; n3 < t3.length; n3++) {
          var i4 = t3[n3];
          i4.enumerable = i4.enumerable || false, i4.configurable = true, "value" in i4 && (i4.writable = true), Object.defineProperty(e4, l2(i4.key), i4);
        }
      }
      function l2(e4) {
        var t3 = function(e5, t4) {
          if ("object" != i3(e5) || !e5)
            return e5;
          var n3 = e5[Symbol.toPrimitive];
          if (void 0 !== n3) {
            var o3 = n3.call(e5, t4 || "default");
            if ("object" != i3(o3))
              return o3;
            throw new TypeError("@@toPrimitive must return a primitive value.");
          }
          return ("string" === t4 ? String : Number)(e5);
        }(e4, "string");
        return "symbol" == i3(t3) ? t3 : t3 + "";
      }
      var p3 = n2(3), u2 = null, d3 = function(e4) {
        return !e4 || e4 < 0 ? 0 : (e4 / 1e3).toFixed(3);
      }, f3 = function() {
        var e4 = function() {
          return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
        };
        return e4() + e4() + "-" + e4() + "-" + e4() + "-" + e4() + "-" + e4() + e4() + e4();
      }, m3 = function() {
        return new Promise(function(e4) {
          if (wx$1.canIUse("getNetworkType"))
            try {
              wx$1.getNetworkType({ success: function(t3) {
                e4(t3.networkType);
              } });
            } catch (t3) {
              e4("can_not_get_network_type");
            }
          else
            e4("can_not_get_network_type");
        });
      }, h3 = function() {
        var e4 = { devicePlatform: "can_not_get_system_info", wxVersion: "can_not_get_system_info", wxSystem: "can_not_get_system_info", wxSdkVersion: "can_not_get_system_info" }, t3 = {}, n3 = {};
        wx$1.canIUse("getAppBaseInfo") && (t3 = wx$1.getAppBaseInfo() || {}), wx$1.canIUse("getDeviceInfo") && (n3 = wx$1.getDeviceInfo() || {});
        var i4 = t3.SDKVersion || "can_not_get_system_info", o3 = t3.version || "can_not_get_system_info", a4 = n3.platform || "can_not_get_system_info", r3 = n3.system || "can_not_get_system_info";
        return Object.assign(e4, { devicePlatform: a4, wxVersion: o3, wxSystem: r3, wxSdkVersion: i4 }), e4;
      }, g2 = h3();
      function v3(e4) {
        return e4.replace(/([A-Z])/g, "_$1").toLowerCase();
      }
      function y2(e4) {
        var t3, n3 = {}, i4 = ["sdkVersionName", "sdkVersionCode", "osName", "networkType", "requestName", "requestResult", "bucket", "region", "appid", "accelerate", "url", "host", "requestPath", "userAgent", "httpMethod", "httpSize", "httpSpeed", "httpTookTime", "httpMd5", "httpSign", "httpFullTime", "httpDomain", "partNumber", "httpRetryTimes", "customId", "traceId", "realApi"], o3 = [].concat(i4, ["errorNode", "errorCode", "errorName", "errorMessage", "errorRequestId", "errorHttpCode", "errorServiceName", "errorType", "fullError"]), a4 = "Success" === e4.requestResult ? i4 : o3;
        for (var r3 in e4) {
          if (a4.includes(r3))
            n3[v3(r3)] = e4[r3];
        }
        return n3.request_name = e4.realApi ? (t3 = e4.realApi, ["putObject", "sliceUploadFile", "uploadFile", "uploadFiles"].includes(t3) ? "UploadTask" : "getObject" === t3 ? "DownloadTask" : ["putObjectCopy", "sliceCopyFile"].includes(t3) ? "CopyTask" : t3) : e4.requestName, n3;
      }
      var x2 = function() {
        function e4(t4) {
          var n4;
          !function(e5, t5) {
            if (!(e5 instanceof t5))
              throw new TypeError("Cannot call a class as a function");
          }(this, e4);
          var i4 = t4.parent, o3 = t4.traceId, a5 = t4.bucket, r3 = t4.region, c4 = t4.apiName, l4 = t4.realApi, d4 = t4.httpMethod, m4 = t4.fileKey, h4 = t4.fileSize, v4 = t4.accelerate, y3 = t4.customId, x3 = t4.delay, k2 = t4.deepTracker, b2 = t4.Beacon, C2 = t4.clsReporter, S2 = a5 && a5.substr(a5.lastIndexOf("-") + 1) || "";
          this.parent = i4, this.deepTracker = k2, this.delay = x3, C2 && !this.clsReporter && (this.clsReporter = C2), this.params = (s3(n4 = { sdkVersionName: "cos-wx-sdk-v5", sdkVersionCode: p3.version, osName: g2.devicePlatform, networkType: "", requestName: c4 || "", requestResult: "", realApi: l4, bucket: a5, region: r3, accelerate: v4, httpMethod: d4, url: "", host: "", httpDomain: "", requestPath: m4 || "", errorType: "", errorCode: "", errorName: "", errorMessage: "", errorRequestId: "", errorHttpCode: 0, errorServiceName: "", errorNode: "", httpTookTime: 0, httpSize: h4 || 0, httpMd5: 0, httpSign: 0, httpFullTime: 0, httpSpeed: 0, size: h4 || 0 }, "httpMd5", 0), s3(n4, "httpSign", 0), s3(n4, "httpFull", 0), s3(n4, "name", c4 || ""), s3(n4, "tookTime", 0), s3(n4, "md5StartTime", 0), s3(n4, "md5EndTime", 0), s3(n4, "signStartTime", 0), s3(n4, "signEndTime", 0), s3(n4, "httpStartTime", 0), s3(n4, "httpEndTime", 0), s3(n4, "startTime", (/* @__PURE__ */ new Date()).getTime()), s3(n4, "endTime", 0), s3(n4, "traceId", o3 || f3()), s3(n4, "appid", S2), s3(n4, "partNumber", 0), s3(n4, "httpRetryTimes", 0), s3(n4, "customId", y3 || ""), s3(n4, "partTime", 0), n4), b2 && (this.beacon = function(e5, t5) {
            if (!u2) {
              if ("function" != typeof e5)
                throw new Error("Beacon not found");
              u2 = new e5({ appkey: "0WEB05PY6MHRGK0U", versionCode: p3.version, channelID: "mp_sdk", openid: "openid", unionid: "unid", strictMode: false, delay: t5, sessionDuration: 6e4 });
            }
            return u2;
          }(b2, x3));
        }
        var t3, n3, a4, l3;
        return t3 = e4, n3 = [{ key: "formatResult", value: (l3 = r2(o2().mark(function e5(t4, n4) {
          var i4, a5, r3, s4, c4, l4, p4, u3, f4, h4, g3, v4, y3, x3, k2, b2, C2, S2, w2, T2, R2, B2, A2, P2, E2, O2, j2;
          return o2().wrap(function(e6) {
            for (; ; )
              switch (e6.prev = e6.next) {
                case 0:
                  return h4 = (/* @__PURE__ */ new Date()).getTime(), e6.next = 3, m3();
                case 3:
                  if (g3 = e6.sent, v4 = t4 ? (null == t4 || null === (i4 = t4.error) || void 0 === i4 || null === (a5 = i4.error) || void 0 === a5 ? void 0 : a5.Code) || "Error" : "", y3 = t4 && ((null == t4 || null === (r3 = t4.error) || void 0 === r3 || null === (s4 = r3.error) || void 0 === s4 ? void 0 : s4.Message) || (null == t4 || null === (c4 = t4.error) || void 0 === c4 ? void 0 : c4.error) || (null == t4 ? void 0 : t4.error)) || "", x3 = y3, k2 = t4 ? null == t4 || null === (l4 = t4.error) || void 0 === l4 ? void 0 : l4.statusCode : n4.statusCode, b2 = t4 ? null == t4 || null === (p4 = t4.error) || void 0 === p4 || null === (u3 = p4.error) || void 0 === u3 ? void 0 : u3.Resource : "", C2 = t4 ? (null == t4 || null === (f4 = t4.error) || void 0 === f4 ? void 0 : f4.RequestId) || "" : (null == n4 ? void 0 : n4.RequestId) || "", S2 = t4 ? C2 ? "Server" : "Client" : "", "getObject" === this.params.requestName && (this.params.httpSize = n4 ? n4.headers && n4.headers["content-length"] : 0), w2 = "sliceUploadFile" === this.params.realApi, T2 = "sliceCopyFile" === this.params.realApi, w2 || T2 ? (R2 = this.params.httpSize / 1024 / this.params.partTime, Object.assign(this.params, { httpSpeed: R2 < 0 ? 0 : R2.toFixed(3) })) : (B2 = h4 - this.params.startTime, A2 = this.params.httpEndTime - this.params.httpStartTime, P2 = this.params.httpSize / 1024 / (A2 / 1e3), E2 = this.params.md5EndTime - this.params.md5StartTime, O2 = this.params.signEndTime - this.params.signStartTime, this.parent && (this.parent.addParamValue("httpTookTime", d3(A2)), this.parent.addParamValue("httpFullTime", d3(B2)), this.parent.addParamValue("httpMd5", d3(E2)), this.parent.addParamValue("httpSign", d3(O2)), ["multipartUpload", "uploadPartCopy", "putObjectCopy"].includes(this.params.requestName) && this.parent.addParamValue("partTime", d3(A2))), Object.assign(this.params, { httpFullTime: d3(B2), httpMd5: d3(E2), httpSign: d3(O2), httpTookTime: d3(A2), httpSpeed: P2 < 0 ? 0 : P2.toFixed(3) })), Object.assign(this.params, { networkType: g3, requestResult: t4 ? "Failure" : "Success", errorType: S2, errorCode: v4, errorHttpCode: k2, errorName: x3, errorMessage: y3, errorServiceName: b2, errorRequestId: C2 }), !t4 || v4 && y3 || (this.params.fullError = t4 ? JSON.stringify(t4) : ""), "getObject" === this.params.name && (this.params.size = n4 ? n4.headers && n4.headers["content-length"] : -1), this.params.url) {
                    try {
                      j2 = /^http(s)?:\/\/(.*?)\//.exec(this.params.url), this.params.host = j2[2];
                    } catch (e7) {
                      this.params.host = this.params.url;
                    }
                    this.params.httpDomain = this.params.host;
                  }
                case 19:
                case "end":
                  return e6.stop();
              }
          }, e5, this);
        })), function(e5, t4) {
          return l3.apply(this, arguments);
        }) }, { key: "report", value: (a4 = r2(o2().mark(function e5(t4, n4) {
          var i4;
          return o2().wrap(function(e6) {
            for (; ; )
              switch (e6.prev = e6.next) {
                case 0:
                  if (this.beacon || this.clsReporter) {
                    e6.next = 2;
                    break;
                  }
                  return e6.abrupt("return");
                case 2:
                  return e6.next = 4, this.formatResult(t4, n4);
                case 4:
                  i4 = y2(this.params), this.beacon && this.sendEventsToBeacon(i4), this.clsReporter && this.sendEventsToCLS(i4);
                case 7:
                case "end":
                  return e6.stop();
              }
          }, e5, this);
        })), function(e5, t4) {
          return a4.apply(this, arguments);
        }) }, { key: "setParams", value: function(e5) {
          Object.assign(this.params, e5);
        } }, { key: "addParamValue", value: function(e5, t4) {
          this.params[e5] = (+this.params[e5] + +t4).toFixed(3);
        } }, { key: "sendEventsToBeacon", value: function(e5) {
          if ("sliceUploadFile" !== this.params.requestName && "sliceUploadFile" !== this.params.realApi || this.deepTracker) {
            var t4 = "qcloud_track_cos_sdk";
            0 === this.delay ? this.beacon && this.beacon.onDirectUserAction(t4, e5) : this.beacon && this.beacon.onUserAction(t4, e5);
          }
        } }, { key: "sendEventsToCLS", value: function(e5) {
          var t4 = !(0 !== this.delay);
          this.clsReporter.log(e5, t4);
        } }, { key: "generateSubTracker", value: function(t4) {
          return Object.assign(t4, { parent: this, deepTracker: this.deepTracker, traceId: this.params.traceId, bucket: this.params.bucket, region: this.params.region, accelerate: this.params.accelerate, fileKey: this.params.requestPath, customId: this.params.customId, delay: this.params.delay, clsReporter: this.clsReporter }), new e4(t4);
        } }], n3 && c3(t3.prototype, n3), Object.defineProperty(t3, "prototype", { writable: false }), e4;
      }();
      e3.exports = x2;
    }, function(e3) {
      e3.exports = JSON.parse('{"name":"cos-wx-sdk-v5","version":"1.8.0","description":"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)","main":"dist/cos-wx-sdk-v5.min.js","scripts":{"prettier":"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo","dev":"cross-env NODE_ENV=development node build.js --mode=development","build":"cross-env NODE_ENV=production node build.js --mode=production","sts.js":"node server/sts.js","postinstall":"patch-package"},"repository":{"type":"git","url":"http://github.com/tencentyun/cos-wx-sdk-v5.git"},"author":"carsonxu","license":"ISC","dependencies":{"fast-xml-parser":"4.5.0","mime":"^2.4.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^7.0.3","express":"^4.17.1","patch-package":"^8.0.0","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","terser-webpack-plugin":"4.2.3","webpack":"4.46.0","webpack-cli":"4.10.0"}}');
    }, function(e3, t2, n2) {
      const i3 = n2(1), o2 = { allowBooleanAttributes: false, unpairedTags: [] };
      function a3(e4) {
        return " " === e4 || "	" === e4 || "\n" === e4 || "\r" === e4;
      }
      function r2(e4, t3) {
        const n3 = t3;
        for (; t3 < e4.length; t3++)
          if ("?" != e4[t3] && " " != e4[t3])
            ;
          else {
            const i4 = e4.substr(n3, t3 - n3);
            if (t3 > 5 && "xml" === i4)
              return m3("InvalidXml", "XML declaration allowed only at the start of the document.", g2(e4, t3));
            if ("?" == e4[t3] && ">" == e4[t3 + 1]) {
              t3++;
              break;
            }
          }
        return t3;
      }
      function s3(e4, t3) {
        if (e4.length > t3 + 5 && "-" === e4[t3 + 1] && "-" === e4[t3 + 2]) {
          for (t3 += 3; t3 < e4.length; t3++)
            if ("-" === e4[t3] && "-" === e4[t3 + 1] && ">" === e4[t3 + 2]) {
              t3 += 2;
              break;
            }
        } else if (e4.length > t3 + 8 && "D" === e4[t3 + 1] && "O" === e4[t3 + 2] && "C" === e4[t3 + 3] && "T" === e4[t3 + 4] && "Y" === e4[t3 + 5] && "P" === e4[t3 + 6] && "E" === e4[t3 + 7]) {
          let n3 = 1;
          for (t3 += 8; t3 < e4.length; t3++)
            if ("<" === e4[t3])
              n3++;
            else if (">" === e4[t3] && (n3--, 0 === n3))
              break;
        } else if (e4.length > t3 + 9 && "[" === e4[t3 + 1] && "C" === e4[t3 + 2] && "D" === e4[t3 + 3] && "A" === e4[t3 + 4] && "T" === e4[t3 + 5] && "A" === e4[t3 + 6] && "[" === e4[t3 + 7]) {
          for (t3 += 8; t3 < e4.length; t3++)
            if ("]" === e4[t3] && "]" === e4[t3 + 1] && ">" === e4[t3 + 2]) {
              t3 += 2;
              break;
            }
        }
        return t3;
      }
      t2.validate = function(e4, t3) {
        t3 = Object.assign({}, o2, t3);
        const n3 = [];
        let c4 = false, l3 = false;
        "\uFEFF" === e4[0] && (e4 = e4.substr(1));
        for (let o3 = 0; o3 < e4.length; o3++)
          if ("<" === e4[o3] && "?" === e4[o3 + 1]) {
            if (o3 += 2, o3 = r2(e4, o3), o3.err)
              return o3;
          } else {
            if ("<" !== e4[o3]) {
              if (a3(e4[o3]))
                continue;
              return m3("InvalidChar", "char '" + e4[o3] + "' is not expected.", g2(e4, o3));
            }
            {
              let h4 = o3;
              if (o3++, "!" === e4[o3]) {
                o3 = s3(e4, o3);
                continue;
              }
              {
                let v4 = false;
                "/" === e4[o3] && (v4 = true, o3++);
                let y2 = "";
                for (; o3 < e4.length && ">" !== e4[o3] && " " !== e4[o3] && "	" !== e4[o3] && "\n" !== e4[o3] && "\r" !== e4[o3]; o3++)
                  y2 += e4[o3];
                if (y2 = y2.trim(), "/" === y2[y2.length - 1] && (y2 = y2.substring(0, y2.length - 1), o3--), u3 = y2, !i3.isName(u3)) {
                  let t4;
                  return t4 = 0 === y2.trim().length ? "Invalid space after '<'." : "Tag '" + y2 + "' is an invalid name.", m3("InvalidTag", t4, g2(e4, o3));
                }
                const x2 = p3(e4, o3);
                if (false === x2)
                  return m3("InvalidAttr", "Attributes for '" + y2 + "' have open quote.", g2(e4, o3));
                let k2 = x2.value;
                if (o3 = x2.index, "/" === k2[k2.length - 1]) {
                  const n4 = o3 - k2.length;
                  k2 = k2.substring(0, k2.length - 1);
                  const i4 = d3(k2, t3);
                  if (true !== i4)
                    return m3(i4.err.code, i4.err.msg, g2(e4, n4 + i4.err.line));
                  c4 = true;
                } else if (v4) {
                  if (!x2.tagClosed)
                    return m3("InvalidTag", "Closing tag '" + y2 + "' doesn't have proper closing.", g2(e4, o3));
                  if (k2.trim().length > 0)
                    return m3("InvalidTag", "Closing tag '" + y2 + "' can't have attributes or invalid starting.", g2(e4, h4));
                  if (0 === n3.length)
                    return m3("InvalidTag", "Closing tag '" + y2 + "' has not been opened.", g2(e4, h4));
                  {
                    const t4 = n3.pop();
                    if (y2 !== t4.tagName) {
                      let n4 = g2(e4, t4.tagStartPos);
                      return m3("InvalidTag", "Expected closing tag '" + t4.tagName + "' (opened in line " + n4.line + ", col " + n4.col + ") instead of closing tag '" + y2 + "'.", g2(e4, h4));
                    }
                    0 == n3.length && (l3 = true);
                  }
                } else {
                  const i4 = d3(k2, t3);
                  if (true !== i4)
                    return m3(i4.err.code, i4.err.msg, g2(e4, o3 - k2.length + i4.err.line));
                  if (true === l3)
                    return m3("InvalidXml", "Multiple possible root nodes found.", g2(e4, o3));
                  -1 !== t3.unpairedTags.indexOf(y2) || n3.push({ tagName: y2, tagStartPos: h4 }), c4 = true;
                }
                for (o3++; o3 < e4.length; o3++)
                  if ("<" === e4[o3]) {
                    if ("!" === e4[o3 + 1]) {
                      o3++, o3 = s3(e4, o3);
                      continue;
                    }
                    if ("?" !== e4[o3 + 1])
                      break;
                    if (o3 = r2(e4, ++o3), o3.err)
                      return o3;
                  } else if ("&" === e4[o3]) {
                    const t4 = f3(e4, o3);
                    if (-1 == t4)
                      return m3("InvalidChar", "char '&' is not expected.", g2(e4, o3));
                    o3 = t4;
                  } else if (true === l3 && !a3(e4[o3]))
                    return m3("InvalidXml", "Extra text at the end", g2(e4, o3));
                "<" === e4[o3] && o3--;
              }
            }
          }
        var u3;
        return c4 ? 1 == n3.length ? m3("InvalidTag", "Unclosed tag '" + n3[0].tagName + "'.", g2(e4, n3[0].tagStartPos)) : !(n3.length > 0) || m3("InvalidXml", "Invalid '" + JSON.stringify(n3.map((e5) => e5.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : m3("InvalidXml", "Start tag expected.", 1);
      };
      const c3 = '"', l2 = "'";
      function p3(e4, t3) {
        let n3 = "", i4 = "", o3 = false;
        for (; t3 < e4.length; t3++) {
          if (e4[t3] === c3 || e4[t3] === l2)
            "" === i4 ? i4 = e4[t3] : i4 !== e4[t3] || (i4 = "");
          else if (">" === e4[t3] && "" === i4) {
            o3 = true;
            break;
          }
          n3 += e4[t3];
        }
        return "" === i4 && { value: n3, index: t3, tagClosed: o3 };
      }
      const u2 = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
      function d3(e4, t3) {
        const n3 = i3.getAllMatches(e4, u2), o3 = {};
        for (let e5 = 0; e5 < n3.length; e5++) {
          if (0 === n3[e5][1].length)
            return m3("InvalidAttr", "Attribute '" + n3[e5][2] + "' has no space in starting.", v3(n3[e5]));
          if (void 0 !== n3[e5][3] && void 0 === n3[e5][4])
            return m3("InvalidAttr", "Attribute '" + n3[e5][2] + "' is without value.", v3(n3[e5]));
          if (void 0 === n3[e5][3] && !t3.allowBooleanAttributes)
            return m3("InvalidAttr", "boolean attribute '" + n3[e5][2] + "' is not allowed.", v3(n3[e5]));
          const i4 = n3[e5][2];
          if (!h3(i4))
            return m3("InvalidAttr", "Attribute '" + i4 + "' is an invalid name.", v3(n3[e5]));
          if (o3.hasOwnProperty(i4))
            return m3("InvalidAttr", "Attribute '" + i4 + "' is repeated.", v3(n3[e5]));
          o3[i4] = 1;
        }
        return true;
      }
      function f3(e4, t3) {
        if (";" === e4[++t3])
          return -1;
        if ("#" === e4[t3])
          return function(e5, t4) {
            let n4 = /\d/;
            for ("x" === e5[t4] && (t4++, n4 = /[\da-fA-F]/); t4 < e5.length; t4++) {
              if (";" === e5[t4])
                return t4;
              if (!e5[t4].match(n4))
                break;
            }
            return -1;
          }(e4, ++t3);
        let n3 = 0;
        for (; t3 < e4.length; t3++, n3++)
          if (!(e4[t3].match(/\w/) && n3 < 20)) {
            if (";" === e4[t3])
              break;
            return -1;
          }
        return t3;
      }
      function m3(e4, t3, n3) {
        return { err: { code: e4, msg: t3, line: n3.line || n3, col: n3.col } };
      }
      function h3(e4) {
        return i3.isName(e4);
      }
      function g2(e4, t3) {
        const n3 = e4.substring(0, t3).split(/\r?\n/);
        return { line: n3.length, col: n3[n3.length - 1].length + 1 };
      }
      function v3(e4) {
        return e4.startIndex + e4[1].length;
      }
    }, function(e3, t2) {
      e3.exports = function(e4) {
        return "function" == typeof e4 ? e4 : Array.isArray(e4) ? (t3) => {
          for (const n2 of e4) {
            if ("string" == typeof n2 && t3 === n2)
              return true;
            if (n2 instanceof RegExp && n2.test(t3))
              return true;
          }
        } : () => false;
      };
    }, function(e3, t2) {
      var n2 = function(e4) {
        var t3 = {}, n3 = function(e5) {
          return !t3[e5] && (t3[e5] = []), t3[e5];
        };
        e4.on = function(e5, t4) {
          n3(e5).push(t4);
        }, e4.off = function(e5, t4) {
          for (var i3 = n3(e5), o2 = i3.length - 1; o2 >= 0; o2--)
            t4 === i3[o2] && i3.splice(o2, 1);
        }, e4.emit = function(e5, t4) {
          for (var i3 = n3(e5).map(function(e6) {
            return e6;
          }), o2 = 0; o2 < i3.length; o2++)
            i3[o2](t4);
        };
      };
      e3.exports.init = n2, e3.exports.EventProxy = function() {
        n2(this);
      };
    }, function(e3, t2, n2) {
      var i3, o2, a3 = n2(0), r2 = "cos_sdk_upload_cache", s3 = function() {
        try {
          i3.length ? wx$1.setStorageSync(r2, JSON.stringify(i3)) : wx$1.removeStorageSync(r2);
        } catch (e4) {
        }
      }, c3 = function() {
        if (!i3) {
          i3 = function() {
            try {
              var e5 = JSON.parse(wx$1.getStorageSync(r2));
            } catch (e6) {
            }
            return e5 || (e5 = []), e5;
          }();
          for (var e4 = false, t3 = Math.round(Date.now() / 1e3), n3 = i3.length - 1; n3 >= 0; n3--) {
            var o3 = i3[n3][2];
            (!o3 || o3 + 2592e3 < t3) && (i3.splice(n3, 1), e4 = true);
          }
          e4 && s3();
        }
      }, l2 = function() {
        o2 || (o2 = setTimeout(function() {
          s3(), o2 = null;
        }, 400));
      }, p3 = { using: {}, setUsing: function(e4) {
        p3.using[e4] = true;
      }, removeUsing: function(e4) {
        delete p3.using[e4];
      }, getFileId: function(e4, t3, n3, i4) {
        return e4.FilePath && e4.size && e4.lastModifiedTime && t3 ? a3.md5([e4.FilePath].join("::")) + "-" + a3.md5([e4.size, e4.mode, e4.lastAccessedTime, e4.lastModifiedTime, t3, n3, i4].join("::")) : null;
      }, getCopyFileId: function(e4, t3, n3, i4, o3) {
        var r3 = t3["content-length"], s4 = t3.etag || "", c4 = t3["last-modified"];
        return e4 && n3 ? a3.md5([e4, r3, s4, c4, n3, i4, o3].join("::")) : null;
      }, getUploadIdList: function(e4) {
        if (!e4)
          return null;
        c3();
        for (var t3 = [], n3 = 0; n3 < i3.length; n3++)
          i3[n3][0] === e4 && t3.push(i3[n3][1]);
        return t3.length ? t3 : null;
      }, saveUploadId: function(e4, t3, n3) {
        if (c3(), e4) {
          for (var o3 = e4.substr(0, e4.indexOf("-") + 1), a4 = i3.length - 1; a4 >= 0; a4--) {
            var r3 = i3[a4];
            (r3[0] === e4 && r3[1] === t3 || e4 !== r3[0] && 0 === r3[0].indexOf(o3)) && i3.splice(a4, 1);
          }
          i3.unshift([e4, t3, Math.round(Date.now() / 1e3)]), i3.length > n3 && i3.splice(n3), l2();
        }
      }, removeUploadId: function(e4) {
        c3(), delete p3.using[e4];
        for (var t3 = i3.length - 1; t3 >= 0; t3--)
          i3[t3][1] === e4 && i3.splice(t3, 1);
        l2();
      } };
      e3.exports = p3;
    }, function(e3, t2, n2) {
      var i3 = n2(9);
      e3.exports = i3;
    }, function(e3, t2, n2) {
      var i3 = n2(0), o2 = n2(6), a3 = n2(25), r2 = n2(26), s3 = n2(32), c3 = n2(3), l2 = { SecretId: "", SecretKey: "", SecurityToken: "", StartTime: 0, ExpiredTime: 0, ChunkRetryTimes: 2, FileParallelLimit: 3, ChunkParallelLimit: 3, ChunkSize: 1048576, SliceSize: 1048576, CopyChunkParallelLimit: 20, CopyChunkSize: 10485760, CopySliceSize: 10485760, MaxPartNumber: 1e4, ProgressInterval: 1e3, UploadQueueSize: 1e4, Domain: "", ServiceDomain: "", Protocol: "", CompatibilityMode: false, ForcePathStyle: false, Timeout: 0, CorrectClockSkew: true, SystemClockOffset: 0, UploadCheckContentMd5: false, UploadAddMetaMd5: false, UploadIdCacheLimit: 50, UseAccelerate: false, ForceSignHost: true, HttpDNSServiceId: "", SimpleUploadMethod: "postObject", AutoSwitchHost: false, CopySourceParser: null, ObjectKeySimplifyCheck: true, DeepTracker: false, TrackerDelay: 5e3, CustomId: "", BeaconReporter: null, ClsReporter: null }, p3 = function(e4) {
        if (this.options = i3.extend(i3.clone(l2), e4 || {}), this.options.FileParallelLimit = Math.max(1, this.options.FileParallelLimit), this.options.ChunkParallelLimit = Math.max(1, this.options.ChunkParallelLimit), this.options.ChunkRetryTimes = Math.max(0, this.options.ChunkRetryTimes), this.options.ChunkSize = Math.max(1048576, this.options.ChunkSize), this.options.CopyChunkParallelLimit = Math.max(1, this.options.CopyChunkParallelLimit), this.options.CopyChunkSize = Math.max(1048576, this.options.CopyChunkSize), this.options.CopySliceSize = Math.max(0, this.options.CopySliceSize), this.options.MaxPartNumber = Math.max(1024, Math.min(1e4, this.options.MaxPartNumber)), this.options.Timeout = Math.max(0, this.options.Timeout), this.options.EnableReporter = this.options.BeaconReporter || this.options.ClsReporter, this.options.AppId, this.options.SecretId && this.options.SecretId.indexOf(" "), this.options.SecretKey && this.options.SecretKey.indexOf(" "), this.options.ForcePathStyle)
          throw new Error("ForcePathStyle is not supported");
        o2.init(this), a3.init(this);
      };
      r2.init(p3, a3), s3.init(p3, a3), p3.util = { md5: i3.md5, xml2json: i3.xml2json, json2xml: i3.json2xml, encodeBase64: i3.encodeBase64 }, p3.getAuthorization = i3.getAuth, p3.version = c3.version, e3.exports = p3;
    }, function(e3, t2, n2) {
      (function(e4) {
        var t3;
        function i3(e5) {
          return i3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e6) {
            return typeof e6;
          } : function(e6) {
            return e6 && "function" == typeof Symbol && e6.constructor === Symbol && e6 !== Symbol.prototype ? "symbol" : typeof e6;
          }, i3(e5);
        }
        !function() {
          var o2 = "input is invalid type", a3 = "object" === ("undefined" == typeof window ? "undefined" : i3(window)), r2 = a3 ? window : {};
          r2.JS_MD5_NO_WINDOW && (a3 = false), !a3 && "object" === ("undefined" == typeof self ? "undefined" : i3(self)) && (r2 = self);
          var s3, c3 = !r2.JS_MD5_NO_COMMON_JS && "object" === i3(e4) && e4.exports, l2 = n2(12), p3 = !r2.JS_MD5_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer, u2 = "0123456789abcdef".split(""), d3 = [128, 32768, 8388608, -2147483648], f3 = [0, 8, 16, 24], m3 = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"], h3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), g2 = [];
          if (p3) {
            var v3 = new ArrayBuffer(68);
            s3 = new Uint8Array(v3), g2 = new Uint32Array(v3);
          }
          !r2.JS_MD5_NO_NODE_JS && Array.isArray || (Array.isArray = function(e5) {
            return "[object Array]" === Object.prototype.toString.call(e5);
          }), !p3 || !r2.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function(e5) {
            return "object" === i3(e5) && e5.buffer && e5.buffer.constructor === ArrayBuffer;
          });
          var y2 = function(e5) {
            return function(t4) {
              return new x2(true).update(t4)[e5]();
            };
          };
          function x2(e5) {
            if (e5)
              g2[0] = g2[16] = g2[1] = g2[2] = g2[3] = g2[4] = g2[5] = g2[6] = g2[7] = g2[8] = g2[9] = g2[10] = g2[11] = g2[12] = g2[13] = g2[14] = g2[15] = 0, this.blocks = g2, this.buffer8 = s3;
            else if (p3) {
              var t4 = new ArrayBuffer(68);
              this.buffer8 = new Uint8Array(t4), this.blocks = new Uint32Array(t4);
            } else
              this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
            this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = false, this.first = true;
          }
          x2.prototype.update = function(e5) {
            if (!this.finalized) {
              var t4, n3 = i3(e5);
              if ("string" !== n3) {
                if ("object" !== n3)
                  throw o2;
                if (null === e5)
                  throw o2;
                if (!p3 || e5.constructor !== ArrayBuffer && "ArrayBuffer" !== e5.constructor.name) {
                  if (!(Array.isArray(e5) || p3 && ArrayBuffer.isView(e5)))
                    throw o2;
                } else
                  e5 = new Uint8Array(e5);
                t4 = true;
              }
              for (var a4, r3, s4 = 0, c4 = e5.length, l3 = this.blocks, u3 = this.buffer8; s4 < c4; ) {
                if (this.hashed && (this.hashed = false, l3[0] = l3[16], l3[16] = l3[1] = l3[2] = l3[3] = l3[4] = l3[5] = l3[6] = l3[7] = l3[8] = l3[9] = l3[10] = l3[11] = l3[12] = l3[13] = l3[14] = l3[15] = 0), t4)
                  if (p3)
                    for (r3 = this.start; s4 < c4 && r3 < 64; ++s4)
                      u3[r3++] = e5[s4];
                  else
                    for (r3 = this.start; s4 < c4 && r3 < 64; ++s4)
                      l3[r3 >> 2] |= e5[s4] << f3[3 & r3++];
                else if (p3)
                  for (r3 = this.start; s4 < c4 && r3 < 64; ++s4)
                    (a4 = e5.charCodeAt(s4)) < 128 ? u3[r3++] = a4 : a4 < 2048 ? (u3[r3++] = 192 | a4 >> 6, u3[r3++] = 128 | 63 & a4) : a4 < 55296 || a4 >= 57344 ? (u3[r3++] = 224 | a4 >> 12, u3[r3++] = 128 | a4 >> 6 & 63, u3[r3++] = 128 | 63 & a4) : (a4 = 65536 + ((1023 & a4) << 10 | 1023 & e5.charCodeAt(++s4)), u3[r3++] = 240 | a4 >> 18, u3[r3++] = 128 | a4 >> 12 & 63, u3[r3++] = 128 | a4 >> 6 & 63, u3[r3++] = 128 | 63 & a4);
                else
                  for (r3 = this.start; s4 < c4 && r3 < 64; ++s4)
                    (a4 = e5.charCodeAt(s4)) < 128 ? l3[r3 >> 2] |= a4 << f3[3 & r3++] : a4 < 2048 ? (l3[r3 >> 2] |= (192 | a4 >> 6) << f3[3 & r3++], l3[r3 >> 2] |= (128 | 63 & a4) << f3[3 & r3++]) : a4 < 55296 || a4 >= 57344 ? (l3[r3 >> 2] |= (224 | a4 >> 12) << f3[3 & r3++], l3[r3 >> 2] |= (128 | a4 >> 6 & 63) << f3[3 & r3++], l3[r3 >> 2] |= (128 | 63 & a4) << f3[3 & r3++]) : (a4 = 65536 + ((1023 & a4) << 10 | 1023 & e5.charCodeAt(++s4)), l3[r3 >> 2] |= (240 | a4 >> 18) << f3[3 & r3++], l3[r3 >> 2] |= (128 | a4 >> 12 & 63) << f3[3 & r3++], l3[r3 >> 2] |= (128 | a4 >> 6 & 63) << f3[3 & r3++], l3[r3 >> 2] |= (128 | 63 & a4) << f3[3 & r3++]);
                this.lastByteIndex = r3, this.bytes += r3 - this.start, r3 >= 64 ? (this.start = r3 - 64, this.hash(), this.hashed = true) : this.start = r3;
              }
              return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
            }
          }, x2.prototype.finalize = function() {
            if (!this.finalized) {
              this.finalized = true;
              var e5 = this.blocks, t4 = this.lastByteIndex;
              e5[t4 >> 2] |= d3[3 & t4], t4 >= 56 && (this.hashed || this.hash(), e5[0] = e5[16], e5[16] = e5[1] = e5[2] = e5[3] = e5[4] = e5[5] = e5[6] = e5[7] = e5[8] = e5[9] = e5[10] = e5[11] = e5[12] = e5[13] = e5[14] = e5[15] = 0), e5[14] = this.bytes << 3, e5[15] = this.hBytes << 3 | this.bytes >>> 29, this.hash();
            }
          }, x2.prototype.hash = function() {
            var e5, t4, n3, i4, o3, a4, r3 = this.blocks;
            this.first ? t4 = ((t4 = ((e5 = ((e5 = r3[0] - 680876937) << 7 | e5 >>> 25) - 271733879 << 0) ^ (n3 = ((n3 = (-271733879 ^ (i4 = ((i4 = (-1732584194 ^ 2004318071 & e5) + r3[1] - 117830708) << 12 | i4 >>> 20) + e5 << 0) & (-271733879 ^ e5)) + r3[2] - 1126478375) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e5)) + r3[3] - 1316259209) << 22 | t4 >>> 10) + n3 << 0 : (e5 = this.h0, t4 = this.h1, n3 = this.h2, t4 = ((t4 += ((e5 = ((e5 += ((i4 = this.h3) ^ t4 & (n3 ^ i4)) + r3[0] - 680876936) << 7 | e5 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e5 & (t4 ^ n3)) + r3[1] - 389564586) << 12 | i4 >>> 20) + e5 << 0) & (e5 ^ t4)) + r3[2] + 606105819) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e5)) + r3[3] - 1044525330) << 22 | t4 >>> 10) + n3 << 0), t4 = ((t4 += ((e5 = ((e5 += (i4 ^ t4 & (n3 ^ i4)) + r3[4] - 176418897) << 7 | e5 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e5 & (t4 ^ n3)) + r3[5] + 1200080426) << 12 | i4 >>> 20) + e5 << 0) & (e5 ^ t4)) + r3[6] - 1473231341) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e5)) + r3[7] - 45705983) << 22 | t4 >>> 10) + n3 << 0, t4 = ((t4 += ((e5 = ((e5 += (i4 ^ t4 & (n3 ^ i4)) + r3[8] + 1770035416) << 7 | e5 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e5 & (t4 ^ n3)) + r3[9] - 1958414417) << 12 | i4 >>> 20) + e5 << 0) & (e5 ^ t4)) + r3[10] - 42063) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e5)) + r3[11] - 1990404162) << 22 | t4 >>> 10) + n3 << 0, t4 = ((t4 += ((e5 = ((e5 += (i4 ^ t4 & (n3 ^ i4)) + r3[12] + 1804603682) << 7 | e5 >>> 25) + t4 << 0) ^ (n3 = ((n3 += (t4 ^ (i4 = ((i4 += (n3 ^ e5 & (t4 ^ n3)) + r3[13] - 40341101) << 12 | i4 >>> 20) + e5 << 0) & (e5 ^ t4)) + r3[14] - 1502002290) << 17 | n3 >>> 15) + i4 << 0) & (i4 ^ e5)) + r3[15] + 1236535329) << 22 | t4 >>> 10) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e5 = ((e5 += (n3 ^ i4 & (t4 ^ n3)) + r3[1] - 165796510) << 5 | e5 >>> 27) + t4 << 0) ^ t4)) + r3[6] - 1069501632) << 9 | i4 >>> 23) + e5 << 0) ^ e5 & ((n3 = ((n3 += (e5 ^ t4 & (i4 ^ e5)) + r3[11] + 643717713) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r3[0] - 373897302) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e5 = ((e5 += (n3 ^ i4 & (t4 ^ n3)) + r3[5] - 701558691) << 5 | e5 >>> 27) + t4 << 0) ^ t4)) + r3[10] + 38016083) << 9 | i4 >>> 23) + e5 << 0) ^ e5 & ((n3 = ((n3 += (e5 ^ t4 & (i4 ^ e5)) + r3[15] - 660478335) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r3[4] - 405537848) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e5 = ((e5 += (n3 ^ i4 & (t4 ^ n3)) + r3[9] + 568446438) << 5 | e5 >>> 27) + t4 << 0) ^ t4)) + r3[14] - 1019803690) << 9 | i4 >>> 23) + e5 << 0) ^ e5 & ((n3 = ((n3 += (e5 ^ t4 & (i4 ^ e5)) + r3[3] - 187363961) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r3[8] + 1163531501) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ n3 & ((e5 = ((e5 += (n3 ^ i4 & (t4 ^ n3)) + r3[13] - 1444681467) << 5 | e5 >>> 27) + t4 << 0) ^ t4)) + r3[2] - 51403784) << 9 | i4 >>> 23) + e5 << 0) ^ e5 & ((n3 = ((n3 += (e5 ^ t4 & (i4 ^ e5)) + r3[7] + 1735328473) << 14 | n3 >>> 18) + i4 << 0) ^ i4)) + r3[12] - 1926607734) << 20 | t4 >>> 12) + n3 << 0, t4 = ((t4 += ((a4 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e5 = ((e5 += (o3 ^ i4) + r3[5] - 378558) << 4 | e5 >>> 28) + t4 << 0)) + r3[8] - 2022574463) << 11 | i4 >>> 21) + e5 << 0) ^ e5) ^ (n3 = ((n3 += (a4 ^ t4) + r3[11] + 1839030562) << 16 | n3 >>> 16) + i4 << 0)) + r3[14] - 35309556) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((a4 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e5 = ((e5 += (o3 ^ i4) + r3[1] - 1530992060) << 4 | e5 >>> 28) + t4 << 0)) + r3[4] + 1272893353) << 11 | i4 >>> 21) + e5 << 0) ^ e5) ^ (n3 = ((n3 += (a4 ^ t4) + r3[7] - 155497632) << 16 | n3 >>> 16) + i4 << 0)) + r3[10] - 1094730640) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((a4 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e5 = ((e5 += (o3 ^ i4) + r3[13] + 681279174) << 4 | e5 >>> 28) + t4 << 0)) + r3[0] - 358537222) << 11 | i4 >>> 21) + e5 << 0) ^ e5) ^ (n3 = ((n3 += (a4 ^ t4) + r3[3] - 722521979) << 16 | n3 >>> 16) + i4 << 0)) + r3[6] + 76029189) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((a4 = (i4 = ((i4 += ((o3 = t4 ^ n3) ^ (e5 = ((e5 += (o3 ^ i4) + r3[9] - 640364487) << 4 | e5 >>> 28) + t4 << 0)) + r3[12] - 421815835) << 11 | i4 >>> 21) + e5 << 0) ^ e5) ^ (n3 = ((n3 += (a4 ^ t4) + r3[15] + 530742520) << 16 | n3 >>> 16) + i4 << 0)) + r3[2] - 995338651) << 23 | t4 >>> 9) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e5 = ((e5 += (n3 ^ (t4 | ~i4)) + r3[0] - 198630844) << 6 | e5 >>> 26) + t4 << 0) | ~n3)) + r3[7] + 1126891415) << 10 | i4 >>> 22) + e5 << 0) ^ ((n3 = ((n3 += (e5 ^ (i4 | ~t4)) + r3[14] - 1416354905) << 15 | n3 >>> 17) + i4 << 0) | ~e5)) + r3[5] - 57434055) << 21 | t4 >>> 11) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e5 = ((e5 += (n3 ^ (t4 | ~i4)) + r3[12] + 1700485571) << 6 | e5 >>> 26) + t4 << 0) | ~n3)) + r3[3] - 1894986606) << 10 | i4 >>> 22) + e5 << 0) ^ ((n3 = ((n3 += (e5 ^ (i4 | ~t4)) + r3[10] - 1051523) << 15 | n3 >>> 17) + i4 << 0) | ~e5)) + r3[1] - 2054922799) << 21 | t4 >>> 11) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e5 = ((e5 += (n3 ^ (t4 | ~i4)) + r3[8] + 1873313359) << 6 | e5 >>> 26) + t4 << 0) | ~n3)) + r3[15] - 30611744) << 10 | i4 >>> 22) + e5 << 0) ^ ((n3 = ((n3 += (e5 ^ (i4 | ~t4)) + r3[6] - 1560198380) << 15 | n3 >>> 17) + i4 << 0) | ~e5)) + r3[13] + 1309151649) << 21 | t4 >>> 11) + n3 << 0, t4 = ((t4 += ((i4 = ((i4 += (t4 ^ ((e5 = ((e5 += (n3 ^ (t4 | ~i4)) + r3[4] - 145523070) << 6 | e5 >>> 26) + t4 << 0) | ~n3)) + r3[11] - 1120210379) << 10 | i4 >>> 22) + e5 << 0) ^ ((n3 = ((n3 += (e5 ^ (i4 | ~t4)) + r3[2] + 718787259) << 15 | n3 >>> 17) + i4 << 0) | ~e5)) + r3[9] - 343485551) << 21 | t4 >>> 11) + n3 << 0, this.first ? (this.h0 = e5 + 1732584193 << 0, this.h1 = t4 - 271733879 << 0, this.h2 = n3 - 1732584194 << 0, this.h3 = i4 + 271733878 << 0, this.first = false) : (this.h0 = this.h0 + e5 << 0, this.h1 = this.h1 + t4 << 0, this.h2 = this.h2 + n3 << 0, this.h3 = this.h3 + i4 << 0);
          }, x2.prototype.hex = function() {
            this.finalize();
            var e5 = this.h0, t4 = this.h1, n3 = this.h2, i4 = this.h3;
            return u2[e5 >> 4 & 15] + u2[15 & e5] + u2[e5 >> 12 & 15] + u2[e5 >> 8 & 15] + u2[e5 >> 20 & 15] + u2[e5 >> 16 & 15] + u2[e5 >> 28 & 15] + u2[e5 >> 24 & 15] + u2[t4 >> 4 & 15] + u2[15 & t4] + u2[t4 >> 12 & 15] + u2[t4 >> 8 & 15] + u2[t4 >> 20 & 15] + u2[t4 >> 16 & 15] + u2[t4 >> 28 & 15] + u2[t4 >> 24 & 15] + u2[n3 >> 4 & 15] + u2[15 & n3] + u2[n3 >> 12 & 15] + u2[n3 >> 8 & 15] + u2[n3 >> 20 & 15] + u2[n3 >> 16 & 15] + u2[n3 >> 28 & 15] + u2[n3 >> 24 & 15] + u2[i4 >> 4 & 15] + u2[15 & i4] + u2[i4 >> 12 & 15] + u2[i4 >> 8 & 15] + u2[i4 >> 20 & 15] + u2[i4 >> 16 & 15] + u2[i4 >> 28 & 15] + u2[i4 >> 24 & 15];
          }, x2.prototype.toString = x2.prototype.hex, x2.prototype.digest = function() {
            this.finalize();
            var e5 = this.h0, t4 = this.h1, n3 = this.h2, i4 = this.h3;
            return [255 & e5, e5 >> 8 & 255, e5 >> 16 & 255, e5 >> 24 & 255, 255 & t4, t4 >> 8 & 255, t4 >> 16 & 255, t4 >> 24 & 255, 255 & n3, n3 >> 8 & 255, n3 >> 16 & 255, n3 >> 24 & 255, 255 & i4, i4 >> 8 & 255, i4 >> 16 & 255, i4 >> 24 & 255];
          }, x2.prototype.array = x2.prototype.digest, x2.prototype.arrayBuffer = function() {
            this.finalize();
            var e5 = new ArrayBuffer(16), t4 = new Uint32Array(e5);
            return t4[0] = this.h0, t4[1] = this.h1, t4[2] = this.h2, t4[3] = this.h3, e5;
          }, x2.prototype.buffer = x2.prototype.arrayBuffer, x2.prototype.base64 = function() {
            for (var e5, t4, n3, i4 = "", o3 = this.array(), a4 = 0; a4 < 15; )
              e5 = o3[a4++], t4 = o3[a4++], n3 = o3[a4++], i4 += h3[e5 >>> 2] + h3[63 & (e5 << 4 | t4 >>> 4)] + h3[63 & (t4 << 2 | n3 >>> 6)] + h3[63 & n3];
            return e5 = o3[a4], i4 += h3[e5 >>> 2] + h3[e5 << 4 & 63] + "==";
          };
          var k2 = function() {
            var e5 = y2("hex");
            e5.getCtx = e5.create = function() {
              return new x2();
            }, e5.update = function(t5) {
              return e5.create().update(t5);
            };
            for (var t4 = 0; t4 < m3.length; ++t4) {
              var n3 = m3[t4];
              e5[n3] = y2(n3);
            }
            return e5;
          }();
          c3 ? e4.exports = k2 : (r2.md5 = k2, l2 && (void 0 === (t3 = (function() {
            return k2;
          }).call(k2, n2, k2, e4)) || (e4.exports = t3)));
        }();
      }).call(this, n2(11)(e3));
    }, function(e3, t2) {
      e3.exports = function(e4) {
        return e4.webpackPolyfill || (e4.deprecate = function() {
        }, e4.paths = [], e4.children || (e4.children = []), Object.defineProperty(e4, "loaded", { enumerable: true, get: function() {
          return e4.l;
        } }), Object.defineProperty(e4, "id", { enumerable: true, get: function() {
          return e4.i;
        } }), e4.webpackPolyfill = 1), e4;
      };
    }, function(e3, t2) {
      (function(t3) {
        e3.exports = t3;
      }).call(this, {});
    }, function(e3, t2) {
      var n2, i3, o2, a3, r2, s3, c3, l2 = l2 || function(e4, t3) {
        var n3 = {}, i4 = n3.lib = {}, o3 = function() {
        }, a4 = i4.Base = { extend: function(e5) {
          o3.prototype = this;
          var t4 = new o3();
          return e5 && t4.mixIn(e5), t4.hasOwnProperty("init") || (t4.init = function() {
            t4.$super.init.apply(this, arguments);
          }), t4.init.prototype = t4, t4.$super = this, t4;
        }, create: function() {
          var e5 = this.extend();
          return e5.init.apply(e5, arguments), e5;
        }, init: function() {
        }, mixIn: function(e5) {
          for (var t4 in e5)
            e5.hasOwnProperty(t4) && (this[t4] = e5[t4]);
          e5.hasOwnProperty("toString") && (this.toString = e5.toString);
        }, clone: function() {
          return this.init.prototype.extend(this);
        } }, r3 = i4.WordArray = a4.extend({ init: function(e5, t4) {
          e5 = this.words = e5 || [], this.sigBytes = null != t4 ? t4 : 4 * e5.length;
        }, toString: function(e5) {
          return (e5 || c4).stringify(this);
        }, concat: function(e5) {
          var t4 = this.words, n4 = e5.words, i5 = this.sigBytes;
          if (e5 = e5.sigBytes, this.clamp(), i5 % 4)
            for (var o4 = 0; o4 < e5; o4++)
              t4[i5 + o4 >>> 2] |= (n4[o4 >>> 2] >>> 24 - o4 % 4 * 8 & 255) << 24 - (i5 + o4) % 4 * 8;
          else if (65535 < n4.length)
            for (o4 = 0; o4 < e5; o4 += 4)
              t4[i5 + o4 >>> 2] = n4[o4 >>> 2];
          else
            t4.push.apply(t4, n4);
          return this.sigBytes += e5, this;
        }, clamp: function() {
          var t4 = this.words, n4 = this.sigBytes;
          t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e4.ceil(n4 / 4);
        }, clone: function() {
          var e5 = a4.clone.call(this);
          return e5.words = this.words.slice(0), e5;
        }, random: function(t4) {
          for (var n4 = [], i5 = 0; i5 < t4; i5 += 4)
            n4.push(4294967296 * e4.random() | 0);
          return new r3.init(n4, t4);
        } }), s4 = n3.enc = {}, c4 = s4.Hex = { stringify: function(e5) {
          var t4 = e5.words;
          e5 = e5.sigBytes;
          for (var n4 = [], i5 = 0; i5 < e5; i5++) {
            var o4 = t4[i5 >>> 2] >>> 24 - i5 % 4 * 8 & 255;
            n4.push((o4 >>> 4).toString(16)), n4.push((15 & o4).toString(16));
          }
          return n4.join("");
        }, parse: function(e5) {
          for (var t4 = e5.length, n4 = [], i5 = 0; i5 < t4; i5 += 2)
            n4[i5 >>> 3] |= parseInt(e5.substr(i5, 2), 16) << 24 - i5 % 8 * 4;
          return new r3.init(n4, t4 / 2);
        } }, l3 = s4.Latin1 = { stringify: function(e5) {
          var t4 = e5.words;
          e5 = e5.sigBytes;
          for (var n4 = [], i5 = 0; i5 < e5; i5++)
            n4.push(String.fromCharCode(t4[i5 >>> 2] >>> 24 - i5 % 4 * 8 & 255));
          return n4.join("");
        }, parse: function(e5) {
          for (var t4 = e5.length, n4 = [], i5 = 0; i5 < t4; i5++)
            n4[i5 >>> 2] |= (255 & e5.charCodeAt(i5)) << 24 - i5 % 4 * 8;
          return new r3.init(n4, t4);
        } }, p3 = s4.Utf8 = { stringify: function(e5) {
          try {
            return decodeURIComponent(escape(l3.stringify(e5)));
          } catch (e6) {
            throw Error("Malformed UTF-8 data");
          }
        }, parse: function(e5) {
          return l3.parse(unescape(encodeURIComponent(e5)));
        } }, u2 = i4.BufferedBlockAlgorithm = a4.extend({ reset: function() {
          this._data = new r3.init(), this._nDataBytes = 0;
        }, _append: function(e5) {
          "string" == typeof e5 && (e5 = p3.parse(e5)), this._data.concat(e5), this._nDataBytes += e5.sigBytes;
        }, _process: function(t4) {
          var n4 = this._data, i5 = n4.words, o4 = n4.sigBytes, a5 = this.blockSize, s5 = o4 / (4 * a5);
          if (t4 = (s5 = t4 ? e4.ceil(s5) : e4.max((0 | s5) - this._minBufferSize, 0)) * a5, o4 = e4.min(4 * t4, o4), t4) {
            for (var c5 = 0; c5 < t4; c5 += a5)
              this._doProcessBlock(i5, c5);
            c5 = i5.splice(0, t4), n4.sigBytes -= o4;
          }
          return new r3.init(c5, o4);
        }, clone: function() {
          var e5 = a4.clone.call(this);
          return e5._data = this._data.clone(), e5;
        }, _minBufferSize: 0 });
        i4.Hasher = u2.extend({ cfg: a4.extend(), init: function(e5) {
          this.cfg = this.cfg.extend(e5), this.reset();
        }, reset: function() {
          u2.reset.call(this), this._doReset();
        }, update: function(e5) {
          return this._append(e5), this._process(), this;
        }, finalize: function(e5) {
          return e5 && this._append(e5), this._doFinalize();
        }, blockSize: 16, _createHelper: function(e5) {
          return function(t4, n4) {
            return new e5.init(n4).finalize(t4);
          };
        }, _createHmacHelper: function(e5) {
          return function(t4, n4) {
            return new d3.HMAC.init(e5, n4).finalize(t4);
          };
        } });
        var d3 = n3.algo = {};
        return n3;
      }(Math);
      i3 = (r2 = (n2 = l2).lib).WordArray, o2 = r2.Hasher, a3 = [], r2 = n2.algo.SHA1 = o2.extend({ _doReset: function() {
        this._hash = new i3.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
      }, _doProcessBlock: function(e4, t3) {
        for (var n3 = this._hash.words, i4 = n3[0], o3 = n3[1], r3 = n3[2], s4 = n3[3], c4 = n3[4], l3 = 0; 80 > l3; l3++) {
          if (16 > l3)
            a3[l3] = 0 | e4[t3 + l3];
          else {
            var p3 = a3[l3 - 3] ^ a3[l3 - 8] ^ a3[l3 - 14] ^ a3[l3 - 16];
            a3[l3] = p3 << 1 | p3 >>> 31;
          }
          p3 = (i4 << 5 | i4 >>> 27) + c4 + a3[l3], p3 = 20 > l3 ? p3 + (1518500249 + (o3 & r3 | ~o3 & s4)) : 40 > l3 ? p3 + (1859775393 + (o3 ^ r3 ^ s4)) : 60 > l3 ? p3 + ((o3 & r3 | o3 & s4 | r3 & s4) - 1894007588) : p3 + ((o3 ^ r3 ^ s4) - 899497514), c4 = s4, s4 = r3, r3 = o3 << 30 | o3 >>> 2, o3 = i4, i4 = p3;
        }
        n3[0] = n3[0] + i4 | 0, n3[1] = n3[1] + o3 | 0, n3[2] = n3[2] + r3 | 0, n3[3] = n3[3] + s4 | 0, n3[4] = n3[4] + c4 | 0;
      }, _doFinalize: function() {
        var e4 = this._data, t3 = e4.words, n3 = 8 * this._nDataBytes, i4 = 8 * e4.sigBytes;
        return t3[i4 >>> 5] |= 128 << 24 - i4 % 32, t3[14 + (i4 + 64 >>> 9 << 4)] = Math.floor(n3 / 4294967296), t3[15 + (i4 + 64 >>> 9 << 4)] = n3, e4.sigBytes = 4 * t3.length, this._process(), this._hash;
      }, clone: function() {
        var e4 = o2.clone.call(this);
        return e4._hash = this._hash.clone(), e4;
      } }), n2.SHA1 = o2._createHelper(r2), n2.HmacSHA1 = o2._createHmacHelper(r2), function() {
        var e4 = l2, t3 = e4.enc.Utf8;
        e4.algo.HMAC = e4.lib.Base.extend({ init: function(e5, n3) {
          e5 = this._hasher = new e5.init(), "string" == typeof n3 && (n3 = t3.parse(n3));
          var i4 = e5.blockSize, o3 = 4 * i4;
          n3.sigBytes > o3 && (n3 = e5.finalize(n3)), n3.clamp();
          for (var a4 = this._oKey = n3.clone(), r3 = this._iKey = n3.clone(), s4 = a4.words, c4 = r3.words, l3 = 0; l3 < i4; l3++)
            s4[l3] ^= 1549556828, c4[l3] ^= 909522486;
          a4.sigBytes = r3.sigBytes = o3, this.reset();
        }, reset: function() {
          var e5 = this._hasher;
          e5.reset(), e5.update(this._iKey);
        }, update: function(e5) {
          return this._hasher.update(e5), this;
        }, finalize: function(e5) {
          var t4 = this._hasher;
          return e5 = t4.finalize(e5), t4.reset(), t4.finalize(this._oKey.clone().concat(e5));
        } });
      }(), c3 = (s3 = l2).lib.WordArray, s3.enc.Base64 = { stringify: function(e4) {
        var t3 = e4.words, n3 = e4.sigBytes, i4 = this._map;
        e4.clamp();
        for (var o3 = [], a4 = 0; a4 < n3; a4 += 3)
          for (var r3 = (t3[a4 >>> 2] >>> 24 - a4 % 4 * 8 & 255) << 16 | (t3[a4 + 1 >>> 2] >>> 24 - (a4 + 1) % 4 * 8 & 255) << 8 | t3[a4 + 2 >>> 2] >>> 24 - (a4 + 2) % 4 * 8 & 255, s4 = 0; s4 < 4 && a4 + 0.75 * s4 < n3; s4++)
            o3.push(i4.charAt(r3 >>> 6 * (3 - s4) & 63));
        var c4 = i4.charAt(64);
        if (c4)
          for (; o3.length % 4; )
            o3.push(c4);
        return o3.join("");
      }, parse: function(e4) {
        var t3 = e4.length, n3 = this._map, i4 = n3.charAt(64);
        if (i4) {
          var o3 = e4.indexOf(i4);
          -1 != o3 && (t3 = o3);
        }
        for (var a4 = [], r3 = 0, s4 = 0; s4 < t3; s4++)
          if (s4 % 4) {
            var l3 = n3.indexOf(e4.charAt(s4 - 1)) << s4 % 4 * 2, p3 = n3.indexOf(e4.charAt(s4)) >>> 6 - s4 % 4 * 2;
            a4[r3 >>> 2] |= (l3 | p3) << 24 - r3 % 4 * 8, r3++;
          }
        return c3.create(a4, r3);
      }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }, e3.exports = l2;
    }, function(e3, t2) {
      var n2 = function(e4) {
        var t3 = (e4 = e4 || {}).Base64, n3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i3 = function(e5) {
          for (var t4 = {}, n4 = 0, i4 = e5.length; n4 < i4; n4++)
            t4[e5.charAt(n4)] = n4;
          return t4;
        }(n3), o2 = String.fromCharCode, a3 = function(e5) {
          if (e5.length < 2)
            return (t4 = e5.charCodeAt(0)) < 128 ? e5 : t4 < 2048 ? o2(192 | t4 >>> 6) + o2(128 | 63 & t4) : o2(224 | t4 >>> 12 & 15) + o2(128 | t4 >>> 6 & 63) + o2(128 | 63 & t4);
          var t4 = 65536 + 1024 * (e5.charCodeAt(0) - 55296) + (e5.charCodeAt(1) - 56320);
          return o2(240 | t4 >>> 18 & 7) + o2(128 | t4 >>> 12 & 63) + o2(128 | t4 >>> 6 & 63) + o2(128 | 63 & t4);
        }, r2 = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, s3 = function(e5) {
          return e5.replace(r2, a3);
        }, c3 = function(e5) {
          var t4 = [0, 2, 1][e5.length % 3], i4 = e5.charCodeAt(0) << 16 | (e5.length > 1 ? e5.charCodeAt(1) : 0) << 8 | (e5.length > 2 ? e5.charCodeAt(2) : 0);
          return [n3.charAt(i4 >>> 18), n3.charAt(i4 >>> 12 & 63), t4 >= 2 ? "=" : n3.charAt(i4 >>> 6 & 63), t4 >= 1 ? "=" : n3.charAt(63 & i4)].join("");
        }, l2 = e4.btoa ? function(t4) {
          return e4.btoa(t4);
        } : function(e5) {
          return e5.replace(/[\s\S]{1,3}/g, c3);
        }, p3 = function(e5) {
          return l2(s3(e5));
        }, u2 = function(e5, t4) {
          return t4 ? p3(String(e5)).replace(/[+\/]/g, function(e6) {
            return "+" == e6 ? "-" : "_";
          }).replace(/=/g, "") : p3(String(e5));
        }, d3 = new RegExp(["[À-ß][-¿]", "[à-ï][-¿]{2}", "[ð-÷][-¿]{3}"].join("|"), "g"), f3 = function(e5) {
          switch (e5.length) {
            case 4:
              var t4 = ((7 & e5.charCodeAt(0)) << 18 | (63 & e5.charCodeAt(1)) << 12 | (63 & e5.charCodeAt(2)) << 6 | 63 & e5.charCodeAt(3)) - 65536;
              return o2(55296 + (t4 >>> 10)) + o2(56320 + (1023 & t4));
            case 3:
              return o2((15 & e5.charCodeAt(0)) << 12 | (63 & e5.charCodeAt(1)) << 6 | 63 & e5.charCodeAt(2));
            default:
              return o2((31 & e5.charCodeAt(0)) << 6 | 63 & e5.charCodeAt(1));
          }
        }, m3 = function(e5) {
          return e5.replace(d3, f3);
        }, h3 = function(e5) {
          var t4 = e5.length, n4 = t4 % 4, a4 = (t4 > 0 ? i3[e5.charAt(0)] << 18 : 0) | (t4 > 1 ? i3[e5.charAt(1)] << 12 : 0) | (t4 > 2 ? i3[e5.charAt(2)] << 6 : 0) | (t4 > 3 ? i3[e5.charAt(3)] : 0), r3 = [o2(a4 >>> 16), o2(a4 >>> 8 & 255), o2(255 & a4)];
          return r3.length -= [0, 0, 2, 1][n4], r3.join("");
        }, g2 = e4.atob ? function(t4) {
          return e4.atob(t4);
        } : function(e5) {
          return e5.replace(/[\s\S]{1,4}/g, h3);
        }, v3 = function(e5) {
          return m3(g2(e5));
        }, y2 = function(e5) {
          return v3(String(e5).replace(/[-_]/g, function(e6) {
            return "-" == e6 ? "+" : "/";
          }).replace(/[^A-Za-z0-9\+\/]/g, ""));
        };
        return { VERSION: "2.1.9", atob: g2, btoa: l2, fromBase64: y2, toBase64: u2, utob: s3, encode: u2, encodeURI: function(e5) {
          return u2(e5, true);
        }, btou: m3, decode: y2, noConflict: function() {
          var n4 = e4.Base64;
          return e4.Base64 = t3, n4;
        } };
      }();
      e3.exports = n2;
    }, function(e3, t2, n2) {
      const i3 = n2(4), o2 = n2(16), a3 = n2(23);
      e3.exports = { XMLParser: o2, XMLValidator: i3, XMLBuilder: a3 };
    }, function(e3, t2, n2) {
      const { buildOptions: i3 } = n2(17), o2 = n2(18), { prettify: a3 } = n2(22), r2 = n2(4);
      e3.exports = class {
        constructor(e4) {
          this.externalEntities = {}, this.options = i3(e4);
        }
        parse(e4, t3) {
          if ("string" == typeof e4)
            ;
          else {
            if (!e4.toString)
              throw new Error("XML data is accepted in String or Bytes[] form.");
            e4 = e4.toString();
          }
          if (t3) {
            true === t3 && (t3 = {});
            const n4 = r2.validate(e4, t3);
            if (true !== n4)
              throw Error(`${n4.err.msg}:${n4.err.line}:${n4.err.col}`);
          }
          const n3 = new o2(this.options);
          n3.addExternalEntities(this.externalEntities);
          const i4 = n3.parseXml(e4);
          return this.options.preserveOrder || void 0 === i4 ? i4 : a3(i4, this.options);
        }
        addEntity(e4, t3) {
          if (-1 !== t3.indexOf("&"))
            throw new Error("Entity value can't have '&'");
          if (-1 !== e4.indexOf("&") || -1 !== e4.indexOf(";"))
            throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
          if ("&" === t3)
            throw new Error("An entity with value '&' is not permitted");
          this.externalEntities[e4] = t3;
        }
      };
    }, function(e3, t2) {
      const n2 = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(e4, t3) {
        return t3;
      }, attributeValueProcessor: function(e4, t3) {
        return t3;
      }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(e4, t3, n3) {
        return e4;
      } };
      t2.buildOptions = function(e4) {
        return Object.assign({}, n2, e4);
      }, t2.defaultOptions = n2;
    }, function(e3, t2, n2) {
      const i3 = n2(1), o2 = n2(19), a3 = n2(20), r2 = n2(21), s3 = n2(5);
      function c3(e4) {
        const t3 = Object.keys(e4);
        for (let n3 = 0; n3 < t3.length; n3++) {
          const i4 = t3[n3];
          this.lastEntities[i4] = { regex: new RegExp("&" + i4 + ";", "g"), val: e4[i4] };
        }
      }
      function l2(e4, t3, n3, i4, o3, a4, r3) {
        if (void 0 !== e4 && (this.options.trimValues && !i4 && (e4 = e4.trim()), e4.length > 0)) {
          r3 || (e4 = this.replaceEntitiesValue(e4));
          const i5 = this.options.tagValueProcessor(t3, e4, n3, o3, a4);
          if (null == i5)
            return e4;
          if (typeof i5 != typeof e4 || i5 !== e4)
            return i5;
          if (this.options.trimValues)
            return b2(e4, this.options.parseTagValue, this.options.numberParseOptions);
          return e4.trim() === e4 ? b2(e4, this.options.parseTagValue, this.options.numberParseOptions) : e4;
        }
      }
      function p3(e4) {
        if (this.options.removeNSPrefix) {
          const t3 = e4.split(":"), n3 = "/" === e4.charAt(0) ? "/" : "";
          if ("xmlns" === t3[0])
            return "";
          2 === t3.length && (e4 = n3 + t3[1]);
        }
        return e4;
      }
      const u2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
      function d3(e4, t3, n3) {
        if (true !== this.options.ignoreAttributes && "string" == typeof e4) {
          const n4 = i3.getAllMatches(e4, u2), o3 = n4.length, a4 = {};
          for (let e5 = 0; e5 < o3; e5++) {
            const i4 = this.resolveNameSpace(n4[e5][1]);
            if (this.ignoreAttributesFn(i4, t3))
              continue;
            let o4 = n4[e5][4], r3 = this.options.attributeNamePrefix + i4;
            if (i4.length)
              if (this.options.transformAttributeName && (r3 = this.options.transformAttributeName(r3)), "__proto__" === r3 && (r3 = "#__proto__"), void 0 !== o4) {
                this.options.trimValues && (o4 = o4.trim()), o4 = this.replaceEntitiesValue(o4);
                const e6 = this.options.attributeValueProcessor(i4, o4, t3);
                a4[r3] = null == e6 ? o4 : typeof e6 != typeof o4 || e6 !== o4 ? e6 : b2(o4, this.options.parseAttributeValue, this.options.numberParseOptions);
              } else
                this.options.allowBooleanAttributes && (a4[r3] = true);
          }
          if (!Object.keys(a4).length)
            return;
          if (this.options.attributesGroupName) {
            const e5 = {};
            return e5[this.options.attributesGroupName] = a4, e5;
          }
          return a4;
        }
      }
      const f3 = function(e4) {
        const t3 = new o2("!xml");
        let n3 = t3, i4 = "", r3 = "";
        for (let s4 = 0; s4 < e4.length; s4++) {
          if ("<" === e4[s4])
            if ("/" === e4[s4 + 1]) {
              const t4 = y2(e4, ">", s4, "Closing Tag is not closed.");
              let o3 = e4.substring(s4 + 2, t4).trim();
              if (this.options.removeNSPrefix) {
                const e5 = o3.indexOf(":");
                -1 !== e5 && (o3 = o3.substr(e5 + 1));
              }
              this.options.transformTagName && (o3 = this.options.transformTagName(o3)), n3 && (i4 = this.saveTextToParentTag(i4, n3, r3));
              const a4 = r3.substring(r3.lastIndexOf(".") + 1);
              if (o3 && -1 !== this.options.unpairedTags.indexOf(o3))
                throw new Error(`Unpaired tag can not be used as closing tag: </${o3}>`);
              let c4 = 0;
              a4 && -1 !== this.options.unpairedTags.indexOf(a4) ? (c4 = r3.lastIndexOf(".", r3.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : c4 = r3.lastIndexOf("."), r3 = r3.substring(0, c4), n3 = this.tagsNodeStack.pop(), i4 = "", s4 = t4;
            } else if ("?" === e4[s4 + 1]) {
              let t4 = x2(e4, s4, false, "?>");
              if (!t4)
                throw new Error("Pi Tag is not closed.");
              if (i4 = this.saveTextToParentTag(i4, n3, r3), this.options.ignoreDeclaration && "?xml" === t4.tagName || this.options.ignorePiTags)
                ;
              else {
                const e5 = new o2(t4.tagName);
                e5.add(this.options.textNodeName, ""), t4.tagName !== t4.tagExp && t4.attrExpPresent && (e5[":@"] = this.buildAttributesMap(t4.tagExp, r3, t4.tagName)), this.addChild(n3, e5, r3);
              }
              s4 = t4.closeIndex + 1;
            } else if ("!--" === e4.substr(s4 + 1, 3)) {
              const t4 = y2(e4, "-->", s4 + 4, "Comment is not closed.");
              if (this.options.commentPropName) {
                const o3 = e4.substring(s4 + 4, t4 - 2);
                i4 = this.saveTextToParentTag(i4, n3, r3), n3.add(this.options.commentPropName, [{ [this.options.textNodeName]: o3 }]);
              }
              s4 = t4;
            } else if ("!D" === e4.substr(s4 + 1, 2)) {
              const t4 = a3(e4, s4);
              this.docTypeEntities = t4.entities, s4 = t4.i;
            } else if ("![" === e4.substr(s4 + 1, 2)) {
              const t4 = y2(e4, "]]>", s4, "CDATA is not closed.") - 2, o3 = e4.substring(s4 + 9, t4);
              i4 = this.saveTextToParentTag(i4, n3, r3);
              let a4 = this.parseTextData(o3, n3.tagname, r3, true, false, true, true);
              null == a4 && (a4 = ""), this.options.cdataPropName ? n3.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o3 }]) : n3.add(this.options.textNodeName, a4), s4 = t4 + 2;
            } else {
              let a4 = x2(e4, s4, this.options.removeNSPrefix), c4 = a4.tagName;
              const l3 = a4.rawTagName;
              let p4 = a4.tagExp, u3 = a4.attrExpPresent, d4 = a4.closeIndex;
              this.options.transformTagName && (c4 = this.options.transformTagName(c4)), n3 && i4 && "!xml" !== n3.tagname && (i4 = this.saveTextToParentTag(i4, n3, r3, false));
              const f4 = n3;
              if (f4 && -1 !== this.options.unpairedTags.indexOf(f4.tagname) && (n3 = this.tagsNodeStack.pop(), r3 = r3.substring(0, r3.lastIndexOf("."))), c4 !== t3.tagname && (r3 += r3 ? "." + c4 : c4), this.isItStopNode(this.options.stopNodes, r3, c4)) {
                let t4 = "";
                if (p4.length > 0 && p4.lastIndexOf("/") === p4.length - 1)
                  "/" === c4[c4.length - 1] ? (c4 = c4.substr(0, c4.length - 1), r3 = r3.substr(0, r3.length - 1), p4 = c4) : p4 = p4.substr(0, p4.length - 1), s4 = a4.closeIndex;
                else if (-1 !== this.options.unpairedTags.indexOf(c4))
                  s4 = a4.closeIndex;
                else {
                  const n4 = this.readStopNodeData(e4, l3, d4 + 1);
                  if (!n4)
                    throw new Error(`Unexpected end of ${l3}`);
                  s4 = n4.i, t4 = n4.tagContent;
                }
                const i5 = new o2(c4);
                c4 !== p4 && u3 && (i5[":@"] = this.buildAttributesMap(p4, r3, c4)), t4 && (t4 = this.parseTextData(t4, c4, r3, true, u3, true, true)), r3 = r3.substr(0, r3.lastIndexOf(".")), i5.add(this.options.textNodeName, t4), this.addChild(n3, i5, r3);
              } else {
                if (p4.length > 0 && p4.lastIndexOf("/") === p4.length - 1) {
                  "/" === c4[c4.length - 1] ? (c4 = c4.substr(0, c4.length - 1), r3 = r3.substr(0, r3.length - 1), p4 = c4) : p4 = p4.substr(0, p4.length - 1), this.options.transformTagName && (c4 = this.options.transformTagName(c4));
                  const e5 = new o2(c4);
                  c4 !== p4 && u3 && (e5[":@"] = this.buildAttributesMap(p4, r3, c4)), this.addChild(n3, e5, r3), r3 = r3.substr(0, r3.lastIndexOf("."));
                } else {
                  const e5 = new o2(c4);
                  this.tagsNodeStack.push(n3), c4 !== p4 && u3 && (e5[":@"] = this.buildAttributesMap(p4, r3, c4)), this.addChild(n3, e5, r3), n3 = e5;
                }
                i4 = "", s4 = d4;
              }
            }
          else
            i4 += e4[s4];
        }
        return t3.child;
      };
      function m3(e4, t3, n3) {
        const i4 = this.options.updateTag(t3.tagname, n3, t3[":@"]);
        false === i4 || ("string" == typeof i4 ? (t3.tagname = i4, e4.addChild(t3)) : e4.addChild(t3));
      }
      const h3 = function(e4) {
        if (this.options.processEntities) {
          for (let t3 in this.docTypeEntities) {
            const n3 = this.docTypeEntities[t3];
            e4 = e4.replace(n3.regx, n3.val);
          }
          for (let t3 in this.lastEntities) {
            const n3 = this.lastEntities[t3];
            e4 = e4.replace(n3.regex, n3.val);
          }
          if (this.options.htmlEntities)
            for (let t3 in this.htmlEntities) {
              const n3 = this.htmlEntities[t3];
              e4 = e4.replace(n3.regex, n3.val);
            }
          e4 = e4.replace(this.ampEntity.regex, this.ampEntity.val);
        }
        return e4;
      };
      function g2(e4, t3, n3, i4) {
        return e4 && (void 0 === i4 && (i4 = 0 === Object.keys(t3.child).length), void 0 !== (e4 = this.parseTextData(e4, t3.tagname, n3, false, !!t3[":@"] && 0 !== Object.keys(t3[":@"]).length, i4)) && "" !== e4 && t3.add(this.options.textNodeName, e4), e4 = ""), e4;
      }
      function v3(e4, t3, n3) {
        const i4 = "*." + n3;
        for (const n4 in e4) {
          const o3 = e4[n4];
          if (i4 === o3 || t3 === o3)
            return true;
        }
        return false;
      }
      function y2(e4, t3, n3, i4) {
        const o3 = e4.indexOf(t3, n3);
        if (-1 === o3)
          throw new Error(i4);
        return o3 + t3.length - 1;
      }
      function x2(e4, t3, n3, i4 = ">") {
        const o3 = function(e5, t4, n4 = ">") {
          let i5, o4 = "";
          for (let a5 = t4; a5 < e5.length; a5++) {
            let t5 = e5[a5];
            if (i5)
              t5 === i5 && (i5 = "");
            else if ('"' === t5 || "'" === t5)
              i5 = t5;
            else if (t5 === n4[0]) {
              if (!n4[1])
                return { data: o4, index: a5 };
              if (e5[a5 + 1] === n4[1])
                return { data: o4, index: a5 };
            } else
              "	" === t5 && (t5 = " ");
            o4 += t5;
          }
        }(e4, t3 + 1, i4);
        if (!o3)
          return;
        let a4 = o3.data;
        const r3 = o3.index, s4 = a4.search(/\s/);
        let c4 = a4, l3 = true;
        -1 !== s4 && (c4 = a4.substring(0, s4), a4 = a4.substring(s4 + 1).trimStart());
        const p4 = c4;
        if (n3) {
          const e5 = c4.indexOf(":");
          -1 !== e5 && (c4 = c4.substr(e5 + 1), l3 = c4 !== o3.data.substr(e5 + 1));
        }
        return { tagName: c4, tagExp: a4, closeIndex: r3, attrExpPresent: l3, rawTagName: p4 };
      }
      function k2(e4, t3, n3) {
        const i4 = n3;
        let o3 = 1;
        for (; n3 < e4.length; n3++)
          if ("<" === e4[n3])
            if ("/" === e4[n3 + 1]) {
              const a4 = y2(e4, ">", n3, `${t3} is not closed`);
              if (e4.substring(n3 + 2, a4).trim() === t3 && (o3--, 0 === o3))
                return { tagContent: e4.substring(i4, n3), i: a4 };
              n3 = a4;
            } else if ("?" === e4[n3 + 1]) {
              n3 = y2(e4, "?>", n3 + 1, "StopNode is not closed.");
            } else if ("!--" === e4.substr(n3 + 1, 3)) {
              n3 = y2(e4, "-->", n3 + 3, "StopNode is not closed.");
            } else if ("![" === e4.substr(n3 + 1, 2)) {
              n3 = y2(e4, "]]>", n3, "StopNode is not closed.") - 2;
            } else {
              const i5 = x2(e4, n3, ">");
              if (i5) {
                (i5 && i5.tagName) === t3 && "/" !== i5.tagExp[i5.tagExp.length - 1] && o3++, n3 = i5.closeIndex;
              }
            }
      }
      function b2(e4, t3, n3) {
        if (t3 && "string" == typeof e4) {
          const t4 = e4.trim();
          return "true" === t4 || "false" !== t4 && r2(e4, n3);
        }
        return i3.isExist(e4) ? e4 : "";
      }
      e3.exports = class {
        constructor(e4) {
          this.options = e4, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (e5, t3) => String.fromCharCode(Number.parseInt(t3, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (e5, t3) => String.fromCharCode(Number.parseInt(t3, 16)) } }, this.addExternalEntities = c3, this.parseXml = f3, this.parseTextData = l2, this.resolveNameSpace = p3, this.buildAttributesMap = d3, this.isItStopNode = v3, this.replaceEntitiesValue = h3, this.readStopNodeData = k2, this.saveTextToParentTag = g2, this.addChild = m3, this.ignoreAttributesFn = s3(this.options.ignoreAttributes);
        }
      };
    }, function(e3, t2, n2) {
      e3.exports = class {
        constructor(e4) {
          this.tagname = e4, this.child = [], this[":@"] = {};
        }
        add(e4, t3) {
          "__proto__" === e4 && (e4 = "#__proto__"), this.child.push({ [e4]: t3 });
        }
        addChild(e4) {
          "__proto__" === e4.tagname && (e4.tagname = "#__proto__"), e4[":@"] && Object.keys(e4[":@"]).length > 0 ? this.child.push({ [e4.tagname]: e4.child, ":@": e4[":@"] }) : this.child.push({ [e4.tagname]: e4.child });
        }
      };
    }, function(e3, t2, n2) {
      const i3 = n2(1);
      function o2(e4, t3) {
        let n3 = "";
        for (; t3 < e4.length && "'" !== e4[t3] && '"' !== e4[t3]; t3++)
          n3 += e4[t3];
        if (n3 = n3.trim(), -1 !== n3.indexOf(" "))
          throw new Error("External entites are not supported");
        const i4 = e4[t3++];
        let o3 = "";
        for (; t3 < e4.length && e4[t3] !== i4; t3++)
          o3 += e4[t3];
        return [n3, o3, t3];
      }
      function a3(e4, t3) {
        return "!" === e4[t3 + 1] && "-" === e4[t3 + 2] && "-" === e4[t3 + 3];
      }
      function r2(e4, t3) {
        return "!" === e4[t3 + 1] && "E" === e4[t3 + 2] && "N" === e4[t3 + 3] && "T" === e4[t3 + 4] && "I" === e4[t3 + 5] && "T" === e4[t3 + 6] && "Y" === e4[t3 + 7];
      }
      function s3(e4, t3) {
        return "!" === e4[t3 + 1] && "E" === e4[t3 + 2] && "L" === e4[t3 + 3] && "E" === e4[t3 + 4] && "M" === e4[t3 + 5] && "E" === e4[t3 + 6] && "N" === e4[t3 + 7] && "T" === e4[t3 + 8];
      }
      function c3(e4, t3) {
        return "!" === e4[t3 + 1] && "A" === e4[t3 + 2] && "T" === e4[t3 + 3] && "T" === e4[t3 + 4] && "L" === e4[t3 + 5] && "I" === e4[t3 + 6] && "S" === e4[t3 + 7] && "T" === e4[t3 + 8];
      }
      function l2(e4, t3) {
        return "!" === e4[t3 + 1] && "N" === e4[t3 + 2] && "O" === e4[t3 + 3] && "T" === e4[t3 + 4] && "A" === e4[t3 + 5] && "T" === e4[t3 + 6] && "I" === e4[t3 + 7] && "O" === e4[t3 + 8] && "N" === e4[t3 + 9];
      }
      function p3(e4) {
        if (i3.isName(e4))
          return e4;
        throw new Error(`Invalid entity name ${e4}`);
      }
      e3.exports = function(e4, t3) {
        const n3 = {};
        if ("O" !== e4[t3 + 3] || "C" !== e4[t3 + 4] || "T" !== e4[t3 + 5] || "Y" !== e4[t3 + 6] || "P" !== e4[t3 + 7] || "E" !== e4[t3 + 8])
          throw new Error("Invalid Tag instead of DOCTYPE");
        {
          t3 += 9;
          let i4 = 1, u2 = false, d3 = false, f3 = "";
          for (; t3 < e4.length; t3++)
            if ("<" !== e4[t3] || d3)
              if (">" === e4[t3]) {
                if (d3 ? "-" === e4[t3 - 1] && "-" === e4[t3 - 2] && (d3 = false, i4--) : i4--, 0 === i4)
                  break;
              } else
                "[" === e4[t3] ? u2 = true : f3 += e4[t3];
            else {
              if (u2 && r2(e4, t3))
                t3 += 7, [entityName, val, t3] = o2(e4, t3 + 1), -1 === val.indexOf("&") && (n3[p3(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
              else if (u2 && s3(e4, t3))
                t3 += 8;
              else if (u2 && c3(e4, t3))
                t3 += 8;
              else if (u2 && l2(e4, t3))
                t3 += 9;
              else {
                if (!a3)
                  throw new Error("Invalid DOCTYPE");
                d3 = true;
              }
              i4++, f3 = "";
            }
          if (0 !== i4)
            throw new Error("Unclosed DOCTYPE");
        }
        return { entities: n3, i: t3 };
      };
    }, function(e3, t2) {
      const n2 = /^[-+]?0x[a-fA-F0-9]+$/, i3 = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
      !Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt), !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
      const o2 = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
      e3.exports = function(e4, t3 = {}) {
        if (t3 = Object.assign({}, o2, t3), !e4 || "string" != typeof e4)
          return e4;
        let a3 = e4.trim();
        if (void 0 !== t3.skipLike && t3.skipLike.test(a3))
          return e4;
        if (t3.hex && n2.test(a3))
          return Number.parseInt(a3, 16);
        {
          const n3 = i3.exec(a3);
          if (n3) {
            const i4 = n3[1], o3 = n3[2];
            let r2 = function(e5) {
              if (e5 && -1 !== e5.indexOf("."))
                return "." === (e5 = e5.replace(/0+$/, "")) ? e5 = "0" : "." === e5[0] ? e5 = "0" + e5 : "." === e5[e5.length - 1] && (e5 = e5.substr(0, e5.length - 1)), e5;
              return e5;
            }(n3[3]);
            const s3 = n3[4] || n3[6];
            if (!t3.leadingZeros && o3.length > 0 && i4 && "." !== a3[2])
              return e4;
            if (!t3.leadingZeros && o3.length > 0 && !i4 && "." !== a3[1])
              return e4;
            {
              const n4 = Number(a3), c3 = "" + n4;
              return -1 !== c3.search(/[eE]/) || s3 ? t3.eNotation ? n4 : e4 : -1 !== a3.indexOf(".") ? "0" === c3 && "" === r2 || c3 === r2 || i4 && c3 === "-" + r2 ? n4 : e4 : o3 ? r2 === c3 || i4 + r2 === c3 ? n4 : e4 : a3 === c3 || a3 === i4 + c3 ? n4 : e4;
            }
          }
          return e4;
        }
      };
    }, function(e3, t2, n2) {
      function i3(e4, t3, n3) {
        let s3;
        const c3 = {};
        for (let l2 = 0; l2 < e4.length; l2++) {
          const p3 = e4[l2], u2 = o2(p3);
          let d3 = "";
          if (d3 = void 0 === n3 ? u2 : n3 + "." + u2, u2 === t3.textNodeName)
            void 0 === s3 ? s3 = p3[u2] : s3 += "" + p3[u2];
          else {
            if (void 0 === u2)
              continue;
            if (p3[u2]) {
              let e5 = i3(p3[u2], t3, d3);
              const n4 = r2(e5, t3);
              p3[":@"] ? a3(e5, p3[":@"], d3, t3) : 1 !== Object.keys(e5).length || void 0 === e5[t3.textNodeName] || t3.alwaysCreateTextNode ? 0 === Object.keys(e5).length && (t3.alwaysCreateTextNode ? e5[t3.textNodeName] = "" : e5 = "") : e5 = e5[t3.textNodeName], void 0 !== c3[u2] && c3.hasOwnProperty(u2) ? (Array.isArray(c3[u2]) || (c3[u2] = [c3[u2]]), c3[u2].push(e5)) : t3.isArray(u2, d3, n4) ? c3[u2] = [e5] : c3[u2] = e5;
            }
          }
        }
        return "string" == typeof s3 ? s3.length > 0 && (c3[t3.textNodeName] = s3) : void 0 !== s3 && (c3[t3.textNodeName] = s3), c3;
      }
      function o2(e4) {
        const t3 = Object.keys(e4);
        for (let e5 = 0; e5 < t3.length; e5++) {
          const n3 = t3[e5];
          if (":@" !== n3)
            return n3;
        }
      }
      function a3(e4, t3, n3, i4) {
        if (t3) {
          const o3 = Object.keys(t3), a4 = o3.length;
          for (let r3 = 0; r3 < a4; r3++) {
            const a5 = o3[r3];
            i4.isArray(a5, n3 + "." + a5, true, true) ? e4[a5] = [t3[a5]] : e4[a5] = t3[a5];
          }
        }
      }
      function r2(e4, t3) {
        const { textNodeName: n3 } = t3, i4 = Object.keys(e4).length;
        return 0 === i4 || !(1 !== i4 || !e4[n3] && "boolean" != typeof e4[n3] && 0 !== e4[n3]);
      }
      t2.prettify = function(e4, t3) {
        return i3(e4, t3);
      };
    }, function(e3, t2, n2) {
      const i3 = n2(24), o2 = n2(5), a3 = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: "  ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(e4, t3) {
        return t3;
      }, attributeValueProcessor: function(e4, t3) {
        return t3;
      }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&amp;" }, { regex: new RegExp(">", "g"), val: "&gt;" }, { regex: new RegExp("<", "g"), val: "&lt;" }, { regex: new RegExp("'", "g"), val: "&apos;" }, { regex: new RegExp('"', "g"), val: "&quot;" }], processEntities: true, stopNodes: [], oneListGroup: false };
      function r2(e4) {
        this.options = Object.assign({}, a3, e4), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
          return false;
        } : (this.ignoreAttributesFn = o2(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = l2), this.processTextOrObjNode = s3, this.options.format ? (this.indentate = c3, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
          return "";
        }, this.tagEndChar = ">", this.newLine = "");
      }
      function s3(e4, t3, n3, i4) {
        const o3 = this.j2x(e4, n3 + 1, i4.concat(t3));
        return void 0 !== e4[this.options.textNodeName] && 1 === Object.keys(e4).length ? this.buildTextValNode(e4[this.options.textNodeName], t3, o3.attrStr, n3) : this.buildObjectNode(o3.val, t3, o3.attrStr, n3);
      }
      function c3(e4) {
        return this.options.indentBy.repeat(e4);
      }
      function l2(e4) {
        return !(!e4.startsWith(this.options.attributeNamePrefix) || e4 === this.options.textNodeName) && e4.substr(this.attrPrefixLen);
      }
      r2.prototype.build = function(e4) {
        return this.options.preserveOrder ? i3(e4, this.options) : (Array.isArray(e4) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e4 = { [this.options.arrayNodeName]: e4 }), this.j2x(e4, 0, []).val);
      }, r2.prototype.j2x = function(e4, t3, n3) {
        let i4 = "", o3 = "";
        const a4 = n3.join(".");
        for (let r3 in e4)
          if (Object.prototype.hasOwnProperty.call(e4, r3))
            if (void 0 === e4[r3])
              this.isAttribute(r3) && (o3 += "");
            else if (null === e4[r3])
              this.isAttribute(r3) ? o3 += "" : "?" === r3[0] ? o3 += this.indentate(t3) + "<" + r3 + "?" + this.tagEndChar : o3 += this.indentate(t3) + "<" + r3 + "/" + this.tagEndChar;
            else if (e4[r3] instanceof Date)
              o3 += this.buildTextValNode(e4[r3], r3, "", t3);
            else if ("object" != typeof e4[r3]) {
              const n4 = this.isAttribute(r3);
              if (n4 && !this.ignoreAttributesFn(n4, a4))
                i4 += this.buildAttrPairStr(n4, "" + e4[r3]);
              else if (!n4)
                if (r3 === this.options.textNodeName) {
                  let t4 = this.options.tagValueProcessor(r3, "" + e4[r3]);
                  o3 += this.replaceEntitiesValue(t4);
                } else
                  o3 += this.buildTextValNode(e4[r3], r3, "", t3);
            } else if (Array.isArray(e4[r3])) {
              const i5 = e4[r3].length;
              let a5 = "", s4 = "";
              for (let c4 = 0; c4 < i5; c4++) {
                const i6 = e4[r3][c4];
                if (void 0 === i6)
                  ;
                else if (null === i6)
                  "?" === r3[0] ? o3 += this.indentate(t3) + "<" + r3 + "?" + this.tagEndChar : o3 += this.indentate(t3) + "<" + r3 + "/" + this.tagEndChar;
                else if ("object" == typeof i6)
                  if (this.options.oneListGroup) {
                    const e5 = this.j2x(i6, t3 + 1, n3.concat(r3));
                    a5 += e5.val, this.options.attributesGroupName && i6.hasOwnProperty(this.options.attributesGroupName) && (s4 += e5.attrStr);
                  } else
                    a5 += this.processTextOrObjNode(i6, r3, t3, n3);
                else if (this.options.oneListGroup) {
                  let e5 = this.options.tagValueProcessor(r3, i6);
                  e5 = this.replaceEntitiesValue(e5), a5 += e5;
                } else
                  a5 += this.buildTextValNode(i6, r3, "", t3);
              }
              this.options.oneListGroup && (a5 = this.buildObjectNode(a5, r3, s4, t3)), o3 += a5;
            } else if (this.options.attributesGroupName && r3 === this.options.attributesGroupName) {
              const t4 = Object.keys(e4[r3]), n4 = t4.length;
              for (let o4 = 0; o4 < n4; o4++)
                i4 += this.buildAttrPairStr(t4[o4], "" + e4[r3][t4[o4]]);
            } else
              o3 += this.processTextOrObjNode(e4[r3], r3, t3, n3);
        return { attrStr: i4, val: o3 };
      }, r2.prototype.buildAttrPairStr = function(e4, t3) {
        return t3 = this.options.attributeValueProcessor(e4, "" + t3), t3 = this.replaceEntitiesValue(t3), this.options.suppressBooleanAttributes && "true" === t3 ? " " + e4 : " " + e4 + '="' + t3 + '"';
      }, r2.prototype.buildObjectNode = function(e4, t3, n3, i4) {
        if ("" === e4)
          return "?" === t3[0] ? this.indentate(i4) + "<" + t3 + n3 + "?" + this.tagEndChar : this.indentate(i4) + "<" + t3 + n3 + this.closeTag(t3) + this.tagEndChar;
        {
          let o3 = "</" + t3 + this.tagEndChar, a4 = "";
          return "?" === t3[0] && (a4 = "?", o3 = ""), !n3 && "" !== n3 || -1 !== e4.indexOf("<") ? false !== this.options.commentPropName && t3 === this.options.commentPropName && 0 === a4.length ? this.indentate(i4) + `<!--${e4}-->` + this.newLine : this.indentate(i4) + "<" + t3 + n3 + a4 + this.tagEndChar + e4 + this.indentate(i4) + o3 : this.indentate(i4) + "<" + t3 + n3 + a4 + ">" + e4 + o3;
        }
      }, r2.prototype.closeTag = function(e4) {
        let t3 = "";
        return -1 !== this.options.unpairedTags.indexOf(e4) ? this.options.suppressUnpairedNode || (t3 = "/") : t3 = this.options.suppressEmptyNode ? "/" : `></${e4}`, t3;
      }, r2.prototype.buildTextValNode = function(e4, t3, n3, i4) {
        if (false !== this.options.cdataPropName && t3 === this.options.cdataPropName)
          return this.indentate(i4) + `<![CDATA[${e4}]]>` + this.newLine;
        if (false !== this.options.commentPropName && t3 === this.options.commentPropName)
          return this.indentate(i4) + `<!--${e4}-->` + this.newLine;
        if ("?" === t3[0])
          return this.indentate(i4) + "<" + t3 + n3 + "?" + this.tagEndChar;
        {
          let o3 = this.options.tagValueProcessor(t3, e4);
          return o3 = this.replaceEntitiesValue(o3), "" === o3 ? this.indentate(i4) + "<" + t3 + n3 + this.closeTag(t3) + this.tagEndChar : this.indentate(i4) + "<" + t3 + n3 + ">" + o3 + "</" + t3 + this.tagEndChar;
        }
      }, r2.prototype.replaceEntitiesValue = function(e4) {
        if (e4 && e4.length > 0 && this.options.processEntities)
          for (let t3 = 0; t3 < this.options.entities.length; t3++) {
            const n3 = this.options.entities[t3];
            e4 = e4.replace(n3.regex, n3.val);
          }
        return e4;
      }, e3.exports = r2;
    }, function(e3, t2) {
      function n2(e4, t3, s3, c3) {
        let l2 = "", p3 = false;
        for (let u2 = 0; u2 < e4.length; u2++) {
          const d3 = e4[u2], f3 = i3(d3);
          if (void 0 === f3)
            continue;
          let m3 = "";
          if (m3 = 0 === s3.length ? f3 : `${s3}.${f3}`, f3 === t3.textNodeName) {
            let e5 = d3[f3];
            a3(m3, t3) || (e5 = t3.tagValueProcessor(f3, e5), e5 = r2(e5, t3)), p3 && (l2 += c3), l2 += e5, p3 = false;
            continue;
          }
          if (f3 === t3.cdataPropName) {
            p3 && (l2 += c3), l2 += `<![CDATA[${d3[f3][0][t3.textNodeName]}]]>`, p3 = false;
            continue;
          }
          if (f3 === t3.commentPropName) {
            l2 += c3 + `<!--${d3[f3][0][t3.textNodeName]}-->`, p3 = true;
            continue;
          }
          if ("?" === f3[0]) {
            const e5 = o2(d3[":@"], t3), n3 = "?xml" === f3 ? "" : c3;
            let i4 = d3[f3][0][t3.textNodeName];
            i4 = 0 !== i4.length ? " " + i4 : "", l2 += n3 + `<${f3}${i4}${e5}?>`, p3 = true;
            continue;
          }
          let h3 = c3;
          "" !== h3 && (h3 += t3.indentBy);
          const g2 = c3 + `<${f3}${o2(d3[":@"], t3)}`, v3 = n2(d3[f3], t3, m3, h3);
          -1 !== t3.unpairedTags.indexOf(f3) ? t3.suppressUnpairedNode ? l2 += g2 + ">" : l2 += g2 + "/>" : v3 && 0 !== v3.length || !t3.suppressEmptyNode ? v3 && v3.endsWith(">") ? l2 += g2 + `>${v3}${c3}</${f3}>` : (l2 += g2 + ">", v3 && "" !== c3 && (v3.includes("/>") || v3.includes("</")) ? l2 += c3 + t3.indentBy + v3 + c3 : l2 += v3, l2 += `</${f3}>`) : l2 += g2 + "/>", p3 = true;
        }
        return l2;
      }
      function i3(e4) {
        const t3 = Object.keys(e4);
        for (let n3 = 0; n3 < t3.length; n3++) {
          const i4 = t3[n3];
          if (e4.hasOwnProperty(i4) && ":@" !== i4)
            return i4;
        }
      }
      function o2(e4, t3) {
        let n3 = "";
        if (e4 && !t3.ignoreAttributes)
          for (let i4 in e4) {
            if (!e4.hasOwnProperty(i4))
              continue;
            let o3 = t3.attributeValueProcessor(i4, e4[i4]);
            o3 = r2(o3, t3), true === o3 && t3.suppressBooleanAttributes ? n3 += ` ${i4.substr(t3.attributeNamePrefix.length)}` : n3 += ` ${i4.substr(t3.attributeNamePrefix.length)}="${o3}"`;
          }
        return n3;
      }
      function a3(e4, t3) {
        let n3 = (e4 = e4.substr(0, e4.length - t3.textNodeName.length - 1)).substr(e4.lastIndexOf(".") + 1);
        for (let i4 in t3.stopNodes)
          if (t3.stopNodes[i4] === e4 || t3.stopNodes[i4] === "*." + n3)
            return true;
        return false;
      }
      function r2(e4, t3) {
        if (e4 && e4.length > 0 && t3.processEntities)
          for (let n3 = 0; n3 < t3.entities.length; n3++) {
            const i4 = t3.entities[n3];
            e4 = e4.replace(i4.regex, i4.val);
          }
        return e4;
      }
      e3.exports = function(e4, t3) {
        let i4 = "";
        return t3.format && t3.indentBy.length > 0 && (i4 = "\n"), n2(e4, t3, "", i4);
      };
    }, function(e3, t2, n2) {
      var i3 = n2(7), o2 = n2(0), a3 = {};
      e3.exports.transferToTaskMethod = function(e4, t3) {
        a3[t3] = e4[t3], e4[t3] = function(e5, n3) {
          e5.SkipTask ? a3[t3].call(this, e5, n3) : this._addTask(t3, e5, n3);
        };
      }, e3.exports.init = function(e4) {
        var t3, n3, r2 = [], s3 = {}, c3 = 0, l2 = 0, p3 = function(e5) {
          var t4 = { id: e5.id, Bucket: e5.Bucket, Region: e5.Region, Key: e5.Key, FilePath: e5.FilePath, state: e5.state, loaded: e5.loaded, size: e5.size, speed: e5.speed, percent: e5.percent, hashPercent: e5.hashPercent, error: e5.error };
          return e5.FilePath && (t4.FilePath = e5.FilePath), t4;
        }, u2 = (n3 = function() {
          t3 = 0, e4.emit("task-list-update", { list: o2.map(r2, p3) }), e4.emit("list-update", { list: o2.map(r2, p3) });
        }, function() {
          t3 || (t3 = setTimeout(n3));
        }), d3 = function() {
          if (!(r2.length <= e4.options.UploadQueueSize)) {
            for (var t4 = 0; t4 < l2 && t4 < r2.length && r2.length > e4.options.UploadQueueSize; ) {
              var n4 = "waiting" === r2[t4].state || "checking" === r2[t4].state || "uploading" === r2[t4].state;
              r2[t4] && n4 ? t4++ : (s3[r2[t4].id] && delete s3[r2[t4].id], r2.splice(t4, 1), l2--);
            }
            u2();
          }
        }, f3 = function t4() {
          if (!(c3 >= e4.options.FileParallelLimit)) {
            for (; r2[l2] && "waiting" !== r2[l2].state; )
              l2++;
            if (!(l2 >= r2.length)) {
              var n4 = r2[l2];
              l2++, c3++, n4.state = "checking", n4.params.onTaskStart && n4.params.onTaskStart(p3(n4)), !n4.params.UploadData && (n4.params.UploadData = {});
              var i4 = o2.formatParams(n4.api, n4.params);
              a3[n4.api].call(e4, i4, function(i5, o3) {
                e4._isRunningTask(n4.id) && ("checking" !== n4.state && "uploading" !== n4.state || (n4.state = i5 ? "error" : "success", i5 && (n4.error = i5), c3--, u2(), t4(), n4.callback && n4.callback(i5, o3), "success" === n4.state && (n4.params && (delete n4.params.UploadData, delete n4.params.Body, delete n4.params), delete n4.callback)), d3());
              }), u2(), setTimeout(t4);
            }
          }
        }, m3 = function(t4, n4) {
          var o3 = s3[t4];
          if (o3) {
            var a4 = o3 && "waiting" === o3.state, r3 = o3 && ("checking" === o3.state || "uploading" === o3.state);
            if ("canceled" === n4 && "canceled" !== o3.state || "paused" === n4 && a4 || "paused" === n4 && r3) {
              if ("paused" === n4 && o3.params.Body && "function" == typeof o3.params.Body.pipe)
                return;
              o3.state = n4, e4.emit("inner-kill-task", { TaskId: t4, toState: n4 });
              try {
                var l3 = o3 && o3.params && o3.params.UploadData.UploadId;
              } catch (e5) {
              }
              "canceled" === n4 && l3 && i3.removeUsing(l3), u2(), r3 && (c3--, f3()), "canceled" === n4 && (o3.params && (delete o3.params.UploadData, delete o3.params.Body, delete o3.params), delete o3.callback);
            }
            d3();
          }
        };
        e4._addTasks = function(t4) {
          o2.each(t4, function(t5) {
            e4._addTask(t5.api, t5.params, t5.callback, true);
          }), u2();
        }, e4._addTask = function(t4, n4, i4, a4) {
          var c4 = "postObject" === e4.options.SimpleUploadMethod ? "postObject" : "putObject";
          "sliceUploadFile" !== t4 || o2.canFileSlice() || (t4 = c4), n4 = o2.formatParams(t4, n4);
          var l3 = o2.uuid();
          n4.TaskId = l3, n4.onTaskReady && n4.onTaskReady(l3);
          var p4 = { params: n4, callback: i4, api: t4, index: r2.length, id: l3, Bucket: n4.Bucket, Region: n4.Region, Key: n4.Key, FilePath: n4.FilePath || "", state: "waiting", loaded: 0, size: 0, speed: 0, percent: 0, hashPercent: 0, error: null }, m4 = n4.onHashProgress;
          n4.onHashProgress = function(t5) {
            e4._isRunningTask(p4.id) && (p4.hashPercent = t5.percent, m4 && m4(t5), u2());
          };
          var h3 = n4.onProgress;
          return n4.onProgress = function(t5) {
            e4._isRunningTask(p4.id) && ("checking" === p4.state && (p4.state = "uploading"), p4.loaded = t5.loaded, p4.size = t5.total, p4.speed = t5.speed, p4.percent = t5.percent, h3 && h3(t5), u2());
          }, o2.getFileSize(t4, n4, function(e5, t5) {
            e5 ? i4(e5) : (s3[l3] = p4, r2.push(p4), p4.size = t5, !a4 && u2(), f3(), d3());
          }), l3;
        }, e4._isRunningTask = function(e5) {
          var t4 = s3[e5];
          return !(!t4 || "checking" !== t4.state && "uploading" !== t4.state);
        }, e4.getTaskList = function() {
          return o2.map(r2, p3);
        }, e4.cancelTask = function(e5) {
          m3(e5, "canceled");
        }, e4.pauseTask = function(e5) {
          m3(e5, "paused");
        }, e4.restartTask = function(e5) {
          var t4 = s3[e5];
          !t4 || "paused" !== t4.state && "error" !== t4.state || (t4.state = "waiting", u2(), l2 = Math.min(l2, t4.index), f3());
        }, e4.isUploadRunning = function() {
          return c3 || l2 < r2.length;
        };
      };
    }, function(e3, t2, n2) {
      var i3 = n2(27), o2 = n2(0), a3 = n2(28);
      function r2(e4) {
        var t3 = { GrantFullControl: [], GrantWrite: [], GrantRead: [], GrantReadAcp: [], GrantWriteAcp: [], ACL: "" }, n3 = { FULL_CONTROL: "GrantFullControl", WRITE: "GrantWrite", READ: "GrantRead", READ_ACP: "GrantReadAcp", WRITE_ACP: "GrantWriteAcp" }, i4 = (e4 && e4.AccessControlList || {}).Grant;
        i4 && (i4 = o2.isArray(i4) ? i4 : [i4]);
        var a4 = { READ: 0, WRITE: 0, FULL_CONTROL: 0 };
        return i4 && i4.length && o2.each(i4, function(i5) {
          "qcs::cam::anyone:anyone" === i5.Grantee.ID || "http://cam.qcloud.com/groups/global/AllUsers" === i5.Grantee.URI ? a4[i5.Permission] = 1 : i5.Grantee.ID !== e4.Owner.ID && t3[n3[i5.Permission]].push('id="' + i5.Grantee.ID + '"');
        }), a4.FULL_CONTROL || a4.WRITE && a4.READ ? t3.ACL = "public-read-write" : a4.READ ? t3.ACL = "public-read" : t3.ACL = "private", o2.each(n3, function(e5) {
          t3[e5] = s3(t3[e5].join(","));
        }), t3;
      }
      function s3(e4) {
        var t3, n3, i4 = e4.split(","), o3 = {};
        for (t3 = 0; t3 < i4.length; )
          o3[n3 = i4[t3].trim()] ? i4.splice(t3, 1) : (o3[n3] = true, i4[t3] = n3, t3++);
        return i4.join(",");
      }
      function c3(e4) {
        var t3 = e4.bucket, n3 = t3.substr(0, t3.lastIndexOf("-")), i4 = t3.substr(t3.lastIndexOf("-") + 1), a4 = e4.domain, r3 = e4.region, s4 = e4.object;
        a4 || (a4 = ["cn-south", "cn-south-2", "cn-north", "cn-east", "cn-southwest", "sg"].indexOf(r3) > -1 ? "{Region}.myqcloud.com" : "cos.{Region}.myqcloud.com", e4.ForcePathStyle || (a4 = "{Bucket}." + a4)), a4 = (a4 = a4.replace(/\{\{AppId\}\}/gi, i4).replace(/\{\{Bucket\}\}/gi, n3).replace(/\{\{Region\}\}/gi, r3).replace(/\{\{.*?\}\}/gi, "")).replace(/\{AppId\}/gi, i4).replace(/\{BucketName\}/gi, n3).replace(/\{Bucket\}/gi, t3).replace(/\{Region\}/gi, r3).replace(/\{.*?\}/gi, ""), /^[a-zA-Z]+:\/\//.test(a4) || (a4 = "https://" + a4), "/" === a4.slice(-1) && (a4 = a4.slice(0, -1));
        var c4 = a4;
        return e4.ForcePathStyle && (c4 += "/" + t3), c4 += "/", s4 && (c4 += o2.camSafeUrlEncode(s4).replace(/%2F/g, "/")), e4.isLocation && (c4 = c4.replace(/^https?:\/\//, "")), c4;
      }
      var l2 = function(e4) {
        if (!e4.Bucket || !e4.Region)
          return "";
        var t3 = void 0 === e4.UseAccelerate ? this.options.UseAccelerate : e4.UseAccelerate;
        return (e4.Url || c3({ ForcePathStyle: this.options.ForcePathStyle, protocol: this.options.Protocol, domain: this.options.Domain, bucket: e4.Bucket, region: t3 ? "accelerate" : e4.Region })).replace(/^https?:\/\/([^/]+)(\/.*)?$/, "$1");
      };
      function p3(e4, t3) {
        var n3 = o2.clone(e4.Headers), i4 = "";
        o2.each(n3, function(e5, t4) {
          ("" === e5 || ["content-type", "cache-control"].indexOf(t4.toLowerCase()) > -1) && delete n3[t4], "host" === t4.toLowerCase() && (i4 = e5);
        });
        var a4 = false !== e4.ForceSignHost;
        !i4 && e4.SignHost && a4 && (n3.Host = e4.SignHost);
        var r3 = false, s4 = function(e5, n4) {
          r3 || (r3 = true, n4 && n4.XCosSecurityToken && !n4.SecurityToken && ((n4 = o2.clone(n4)).SecurityToken = n4.XCosSecurityToken, delete n4.XCosSecurityToken), t3 && t3(e5, n4));
        }, c4 = this, l3 = e4.Bucket || "", p4 = e4.Region || "", u3 = "name/cos:PostObject" !== e4.Action && e4.Key ? e4.Key : "";
        c4.options.ForcePathStyle && l3 && (u3 = l3 + "/" + u3);
        var d4 = "/" + u3, f4 = {}, m4 = e4.Scope;
        if (!m4) {
          var h4 = e4.Action || "", g2 = e4.ResourceKey || e4.Key || "";
          m4 = e4.Scope || [{ action: h4, bucket: l3, region: p4, prefix: g2 }];
        }
        var v3 = o2.md5(JSON.stringify(m4));
        c4._StsCache = c4._StsCache || [], function() {
          var e5, t4;
          for (e5 = c4._StsCache.length - 1; e5 >= 0; e5--) {
            t4 = c4._StsCache[e5];
            var n4 = Math.round(o2.getSkewTime(c4.options.SystemClockOffset) / 1e3) + 30;
            if (t4.StartTime && n4 < t4.StartTime || n4 >= t4.ExpiredTime)
              c4._StsCache.splice(e5, 1);
            else if (!t4.ScopeLimit || t4.ScopeLimit && t4.ScopeKey === v3) {
              f4 = t4;
              break;
            }
          }
        }();
        var y2 = function() {
          var t4 = "";
          f4.StartTime && e4.Expires ? t4 = f4.StartTime + ";" + (f4.StartTime + 1 * e4.Expires) : f4.StartTime && f4.ExpiredTime && (t4 = f4.StartTime + ";" + f4.ExpiredTime);
          var i5 = { Authorization: o2.getAuth({ SecretId: f4.TmpSecretId, SecretKey: f4.TmpSecretKey, Method: e4.Method, Pathname: d4, Query: e4.Query, Headers: n3, Expires: e4.Expires, SystemClockOffset: c4.options.SystemClockOffset, KeyTime: t4, ForceSignHost: a4 }), SecurityToken: f4.SecurityToken || f4.XCosSecurityToken || "", Token: f4.Token || "", ClientIP: f4.ClientIP || "", ClientUA: f4.ClientUA || "", SignFrom: "client" };
          s4(null, i5);
        }, x2 = function(e5) {
          if (e5.Authorization) {
            var t4 = false, n4 = e5.Authorization;
            if (n4)
              if (n4.indexOf(" ") > -1)
                t4 = false;
              else if (n4.indexOf("q-sign-algorithm=") > -1 && n4.indexOf("q-ak=") > -1 && n4.indexOf("q-sign-time=") > -1 && n4.indexOf("q-key-time=") > -1 && n4.indexOf("q-url-param-list=") > -1)
                t4 = true;
              else
                try {
                  (n4 = atob(n4)).indexOf("a=") > -1 && n4.indexOf("k=") > -1 && n4.indexOf("t=") > -1 && n4.indexOf("r=") > -1 && n4.indexOf("b=") > -1 && (t4 = true);
                } catch (e6) {
                }
            if (!t4)
              return o2.error(new Error("getAuthorization callback params format error"));
          } else {
            if (!e5.TmpSecretId)
              return o2.error(new Error('getAuthorization callback params missing "TmpSecretId"'));
            if (!e5.TmpSecretKey)
              return o2.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));
            if (!e5.SecurityToken && !e5.XCosSecurityToken)
              return o2.error(new Error('getAuthorization callback params missing "SecurityToken"'));
            if (!e5.ExpiredTime)
              return o2.error(new Error('getAuthorization callback params missing "ExpiredTime"'));
            if (e5.ExpiredTime && 10 !== e5.ExpiredTime.toString().length)
              return o2.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));
            if (e5.StartTime && 10 !== e5.StartTime.toString().length)
              return o2.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'));
          }
          return false;
        };
        if (f4.ExpiredTime && f4.ExpiredTime - o2.getSkewTime(c4.options.SystemClockOffset) / 1e3 > 60)
          y2();
        else if (c4.options.getAuthorization)
          c4.options.getAuthorization.call(c4, { Bucket: l3, Region: p4, Method: e4.Method, Key: u3, Pathname: d4, Query: e4.Query, Headers: n3, Scope: m4, SystemClockOffset: c4.options.SystemClockOffset, ForceSignHost: a4 }, function(e5) {
            "string" == typeof e5 && (e5 = { Authorization: e5 });
            var t4 = x2(e5);
            if (t4)
              return s4(t4);
            e5.Authorization ? s4(null, e5) : ((f4 = e5 || {}).Scope = m4, f4.ScopeKey = v3, c4._StsCache.push(f4), y2());
          });
        else {
          if (!c4.options.getSTS)
            return function() {
              var t4 = "";
              if (c4.options.StartTime && e4.Expires) {
                if (10 !== c4.options.StartTime.toString().length)
                  return s4(o2.error(new Error('params "StartTime" should be 10 digits')));
                t4 = c4.options.StartTime + ";" + (c4.options.StartTime + 1 * e4.Expires);
              } else if (c4.options.StartTime && c4.options.ExpiredTime) {
                if (10 !== c4.options.StartTime.toString().length)
                  return s4(o2.error(new Error('params "StartTime" should be 10 digits')));
                if (10 !== c4.options.ExpiredTime.toString().length)
                  return s4(o2.error(new Error('params "ExpiredTime" should be 10 digits')));
                t4 = c4.options.StartTime + ";" + 1 * c4.options.ExpiredTime;
              }
              var i5 = { Authorization: o2.getAuth({ SecretId: e4.SecretId || c4.options.SecretId, SecretKey: e4.SecretKey || c4.options.SecretKey, Method: e4.Method, Pathname: d4, Query: e4.Query, Headers: n3, Expires: e4.Expires, KeyTime: t4, SystemClockOffset: c4.options.SystemClockOffset, ForceSignHost: a4 }), SecurityToken: c4.options.SecurityToken || c4.options.XCosSecurityToken, SignFrom: "client" };
              return s4(null, i5), i5;
            }();
          c4.options.getSTS.call(c4, { Bucket: l3, Region: p4 }, function(e5) {
            (f4 = e5 || {}).Scope = m4, f4.ScopeKey = v3, f4.TmpSecretId || (f4.TmpSecretId = f4.SecretId), f4.TmpSecretKey || (f4.TmpSecretKey = f4.SecretKey);
            var t4 = x2(f4);
            if (t4)
              return s4(t4);
            c4._StsCache.push(f4), y2();
          });
        }
        return "";
      }
      function u2(e4) {
        var t3 = this, n3 = false, i4 = false, a4 = false, r3 = e4.headers && (e4.headers.date || e4.headers.Date) || e4.error && e4.error.ServerTime;
        try {
          var s4 = e4.error.Code, c4 = e4.error.Message;
          ("RequestTimeTooSkewed" === s4 || "AccessDenied" === s4 && "Request has expired" === c4) && (a4 = true);
        } catch (e5) {
        }
        if (e4) {
          if (a4 && r3) {
            var l3 = Date.parse(r3);
            this.options.CorrectClockSkew && Math.abs(o2.getSkewTime(this.options.SystemClockOffset) - l3) >= 3e4 && (this.options.SystemClockOffset = l3 - Date.now(), n3 = true);
          } else {
            if (5 === Math.floor(e4.statusCode / 100))
              return { canRetry: true, networkError: false };
            if ("timeout" === e4.message)
              return { canRetry: true, networkError: t3.options.AutoSwitchHost };
          }
          if (e4.statusCode) {
            var p4 = Math.floor(e4.statusCode / 100), u3 = (null == e4 ? void 0 : e4.headers) && (null == e4 ? void 0 : e4.headers["x-cos-request-id"]);
            [3, 4, 5].includes(p4) && !u3 && (n3 = t3.options.AutoSwitchHost, i4 = true);
          } else
            n3 = true, i4 = t3.options.AutoSwitchHost;
        }
        return { canRetry: n3, networkError: i4 };
      }
      function d3(e4) {
        var t3 = e4.requestUrl, n3 = e4.clientCalcSign, i4 = e4.networkError;
        if (!this.options.AutoSwitchHost)
          return false;
        if (!t3)
          return false;
        if (!n3)
          return false;
        if (!i4)
          return false;
        return /^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t3) && !/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t3);
      }
      function f3(e4, t3) {
        var n3 = this;
        !e4.headers && (e4.headers = {}), !e4.qs && (e4.qs = {}), e4.VersionId && (e4.qs.versionId = e4.VersionId), e4.qs = o2.clearKey(e4.qs), e4.headers && (e4.headers = o2.clearKey(e4.headers)), e4.qs && (e4.qs = o2.clearKey(e4.qs));
        var i4 = o2.clone(e4.qs);
        e4.action && (i4[e4.action] = "");
        var a4 = e4.url || e4.Url, r3 = e4.SignHost || l2.call(this, { Bucket: e4.Bucket, Region: e4.Region, Url: a4 }), s4 = e4.tracker;
        !function o3(a5) {
          var c4 = n3.options.SystemClockOffset;
          e4.SwitchHost && (r3 = r3.replace(/myqcloud.com/, "tencentcos.cn")), s4 && s4.setParams({ signStartTime: (/* @__PURE__ */ new Date()).getTime(), httpRetryTimes: a5 - 1 }), p3.call(n3, { Bucket: e4.Bucket || "", Region: e4.Region || "", Method: e4.method, Key: e4.Key, Query: i4, Headers: e4.headers, SignHost: r3, Action: e4.Action, ResourceKey: e4.ResourceKey, Scope: e4.Scope, ForceSignHost: n3.options.ForceSignHost }, function(i5, r4) {
            i5 ? t3(i5) : (s4 && s4.setParams({ signEndTime: (/* @__PURE__ */ new Date()).getTime(), httpStartTime: (/* @__PURE__ */ new Date()).getTime() }), e4.AuthData = r4, m3.call(n3, e4, function(i6, l3) {
              var p4 = false, f4 = false;
              if (i6) {
                var m4 = u2.call(n3, i6);
                p4 = m4.canRetry || c4 !== n3.options.SystemClockOffset, f4 = m4.networkError;
              }
              if (s4 && s4.setParams({ httpEndTime: (/* @__PURE__ */ new Date()).getTime() }), i6 && a5 < 4 && p4) {
                e4.headers && (delete e4.headers.Authorization, delete e4.headers.token, delete e4.headers.clientIP, delete e4.headers.clientUA, e4.headers["x-cos-security-token"] && delete e4.headers["x-cos-security-token"], e4.headers["x-ci-security-token"] && delete e4.headers["x-ci-security-token"]);
                var h4 = d3.call(n3, { requestUrl: (null == i6 ? void 0 : i6.url) || "", clientCalcSign: "client" === (null == r4 ? void 0 : r4.SignFrom), networkError: f4 });
                e4.SwitchHost = h4, e4.headers["x-cos-sdk-retry"] = "true", o3(a5 + 1);
              } else
                t3(i6, l3);
            }));
          });
        }(1);
      }
      function m3(e4, t3) {
        var n3 = this, a4 = e4.TaskId;
        if (!a4 || n3._isRunningTask(a4)) {
          var r3 = e4.Bucket, s4 = e4.Region, l3 = e4.Key, p4 = e4.method || "GET", u3 = e4.url || e4.Url, d4 = e4.body, f4 = e4.json, m4 = e4.rawBody, h4 = e4.dataType, g2 = n3.options.HttpDNSServiceId;
          n3.options.UseAccelerate && (s4 = "accelerate"), u3 = u3 || c3({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: r3, region: s4, object: l3 }), e4.SwitchHost && (u3 = u3.replace(/myqcloud.com/, "tencentcos.cn"));
          var v3 = l3 ? u3 : "";
          e4.action && (u3 = u3 + "?" + e4.action), e4.qsStr && (u3 = u3.indexOf("?") > -1 ? u3 + "&" + e4.qsStr : u3 + "?" + e4.qsStr);
          var y2 = { method: p4, url: u3, headers: e4.headers, qs: e4.qs, filePath: e4.filePath, body: d4, json: f4, httpDNSServiceId: g2, dataType: h4 }, x2 = "x-cos-security-token";
          o2.isCIHost(u3) && (x2 = "x-ci-security-token"), y2.headers.Authorization = e4.AuthData.Authorization, e4.AuthData.Token && (y2.headers.token = e4.AuthData.Token), e4.AuthData.ClientIP && (y2.headers.clientIP = e4.AuthData.ClientIP), e4.AuthData.ClientUA && (y2.headers.clientUA = e4.AuthData.ClientUA), e4.AuthData.SecurityToken && (y2.headers[x2] = e4.AuthData.SecurityToken), y2.headers && (y2.headers = o2.clearKey(y2.headers)), y2 = o2.clearKey(y2), e4.onProgress && "function" == typeof e4.onProgress && (y2.onProgress = function(t4) {
            if (!a4 || n3._isRunningTask(a4)) {
              var i4 = t4 ? t4.loaded : 0;
              e4.onProgress({ loaded: i4, total: t4.total });
            }
          }), this.options.Timeout && (y2.timeout = this.options.Timeout), n3.options.ForcePathStyle && (y2.pathStyle = n3.options.ForcePathStyle), n3.emit("before-send", y2);
          var k2, b2 = y2.url.includes("accelerate."), C2 = y2.qs ? Object.keys(y2.qs).map(function(e5) {
            return "".concat(e5, "=").concat(y2.qs[e5]);
          }).join("&") : "", S2 = C2 ? y2.url + "?" + C2 : y2.url;
          if (e4.tracker)
            e4.tracker.setParams({ url: S2, httpMethod: y2.method, accelerate: b2, httpSize: (null === (k2 = y2.body) || void 0 === k2 ? void 0 : k2.size) || 0 }), e4.tracker.parent && !e4.tracker.parent.params.url && e4.tracker.parent.setParams({ url: v3, accelerate: b2 });
          var w2 = i3(y2, function(e5, i4, r4) {
            if ("abort" !== e5) {
              var s5, c4 = function(e6, r5) {
                if (a4 && n3.off("inner-kill-task", T2), !s5) {
                  s5 = true;
                  var c5 = {};
                  i4 && i4.statusCode && (c5.statusCode = i4.statusCode), i4 && i4.headers && (c5.headers = i4.headers), e6 ? (y2.url && (c5.url = y2.url), y2.method && (c5.method = y2.method), e6 = o2.extend(e6 || {}, c5), t3(e6, null)) : (r5 = o2.extend(r5 || {}, c5), t3(null, r5)), w2 = null;
                }
              };
              if (e5)
                c4({ error: e5 });
              else {
                var l4 = i4.statusCode, p5 = 2 === Math.floor(l4 / 100);
                if (m4) {
                  if (p5)
                    return c4(null, { body: r4 });
                  if (r4 instanceof ArrayBuffer) {
                    var u4 = o2.arrayBufferToString(r4), d5 = o2.parseResBody(u4);
                    return c4({ error: d5.Error || d5 });
                  }
                }
                var f5 = o2.parseResBody(r4);
                p5 ? f5.Error ? c4({ error: f5.Error }) : c4(null, f5) : c4({ error: f5.Error || f5 });
              }
            }
          }), T2 = function e5(t4) {
            t4.TaskId === a4 && (w2 && w2.abort && w2.abort(), n3.off("inner-kill-task", e5));
          };
          a4 && n3.on("inner-kill-task", T2);
        }
      }
      var h3 = { getService: function(e4, t3) {
        "function" == typeof e4 && (t3 = e4, e4 = {});
        var n3 = "https:", i4 = this.options.ServiceDomain, a4 = e4.Region;
        i4 ? (i4 = i4.replace(/\{\{Region\}\}/gi, a4 || "").replace(/\{\{.*?\}\}/gi, ""), /^[a-zA-Z]+:\/\//.test(i4) || (i4 = n3 + "//" + i4), "/" === i4.slice(-1) && (i4 = i4.slice(0, -1))) : i4 = a4 ? n3 + "//cos." + a4 + ".myqcloud.com" : n3 + "//service.cos.myqcloud.com";
        i4.replace(/^https?:\/\/([^/]+)(\/.*)?$/, "$1"), f3.call(this, { Action: "name/cos:GetService", url: i4, method: "GET", headers: e4.Headers, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          var i5 = n4 && n4.ListAllMyBucketsResult && n4.ListAllMyBucketsResult.Buckets && n4.ListAllMyBucketsResult.Buckets.Bucket || [];
          i5 = o2.isArray(i5) ? i5 : [i5];
          var a5 = n4 && n4.ListAllMyBucketsResult && n4.ListAllMyBucketsResult.Owner || {};
          t3(null, { Buckets: i5, Owner: a5, statusCode: n4.statusCode, headers: n4.headers });
        });
      }, putBucket: function(e4, t3) {
        var n3 = this, i4 = "";
        if (e4.BucketAZConfig) {
          var a4 = { BucketAZConfig: e4.BucketAZConfig };
          i4 = o2.json2xml({ CreateBucketConfiguration: a4 });
        }
        f3.call(this, { Action: "name/cos:PutBucket", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, body: i4, tracker: e4.tracker }, function(i5, o3) {
          if (i5)
            return t3(i5);
          var a5 = c3({ protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e4.Bucket, region: e4.Region, isLocation: true });
          t3(null, { Location: a5, statusCode: o3.statusCode, headers: o3.headers });
        });
      }, headBucket: function(e4, t3) {
        f3.call(this, { Action: "name/cos:HeadBucket", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, method: "HEAD", tracker: e4.tracker }, function(e5, n3) {
          t3(e5, n3);
        });
      }, getBucket: function(e4, t3) {
        var n3 = {};
        n3.prefix = e4.Prefix || "", n3.delimiter = e4.Delimiter, n3.marker = e4.Marker, n3["max-keys"] = e4.MaxKeys, n3["encoding-type"] = e4.EncodingType, f3.call(this, { Action: "name/cos:GetBucket", ResourceKey: n3.prefix, method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, qs: n3, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          var i4 = n4.ListBucketResult || {}, a4 = i4.Contents || [], r3 = i4.CommonPrefixes || [];
          a4 = o2.isArray(a4) ? a4 : [a4], r3 = o2.isArray(r3) ? r3 : [r3];
          var s4 = o2.clone(i4);
          o2.extend(s4, { Contents: a4, CommonPrefixes: r3, statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, deleteBucket: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucket", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, method: "DELETE", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketAcl: function(e4, t3) {
        var n3 = e4.Headers, i4 = "";
        if (e4.AccessControlPolicy) {
          var a4 = o2.clone(e4.AccessControlPolicy || {}), r3 = a4.Grants || a4.Grant;
          r3 = o2.isArray(r3) ? r3 : [r3], delete a4.Grant, delete a4.Grants, a4.AccessControlList = { Grant: r3 }, i4 = o2.json2xml({ AccessControlPolicy: a4 }), n3["Content-Type"] = "application/xml", n3["Content-MD5"] = o2.binaryBase64(o2.md5(i4));
        }
        o2.each(n3, function(e5, t4) {
          0 === t4.indexOf("x-cos-grant-") && (n3[t4] = s3(n3[t4]));
        }), f3.call(this, { Action: "name/cos:PutBucketACL", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, headers: n3, action: "acl", body: i4, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketAcl: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketACL", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "acl", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          var i4 = n3.AccessControlPolicy || {}, a4 = i4.Owner || {}, s4 = i4.AccessControlList.Grant || [];
          s4 = o2.isArray(s4) ? s4 : [s4];
          var c4 = r2(i4);
          n3.headers && n3.headers["x-cos-acl"] && (c4.ACL = n3.headers["x-cos-acl"]), c4 = o2.extend(c4, { Owner: a4, Grants: s4, statusCode: n3.statusCode, headers: n3.headers }), t3(null, c4);
        });
      }, putBucketCors: function(e4, t3) {
        var n3 = (e4.CORSConfiguration || {}).CORSRules || e4.CORSRules || [];
        n3 = o2.clone(o2.isArray(n3) ? n3 : [n3]), o2.each(n3, function(e5) {
          o2.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function(t4) {
            var n4 = t4 + "s", i5 = e5[n4] || e5[t4] || [];
            delete e5[n4], e5[t4] = o2.isArray(i5) ? i5 : [i5];
          });
        });
        var i4 = { CORSRule: n3 };
        e4.ResponseVary && (i4.ResponseVary = e4.ResponseVary);
        var a4 = o2.json2xml({ CORSConfiguration: i4 }), r3 = e4.Headers;
        r3["Content-Type"] = "application/xml", r3["Content-MD5"] = o2.binaryBase64(o2.md5(a4)), f3.call(this, { Action: "name/cos:PutBucketCORS", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: a4, action: "cors", headers: r3, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketCors: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketCORS", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "cors", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 === e5.statusCode && e5.error && "NoSuchCORSConfiguration" === e5.error.Code) {
              var i4 = { CORSRules: [], statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            } else
              t3(e5);
          else {
            var a4 = n3.CORSConfiguration || {}, r3 = a4.CORSRules || a4.CORSRule || [];
            r3 = o2.clone(o2.isArray(r3) ? r3 : [r3]);
            var s4 = a4.ResponseVary;
            o2.each(r3, function(e6) {
              o2.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function(t4) {
                var n4 = t4 + "s", i5 = e6[n4] || e6[t4] || [];
                delete e6[t4], e6[n4] = o2.isArray(i5) ? i5 : [i5];
              });
            }), t3(null, { CORSRules: r3, ResponseVary: s4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketCors: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketCORS", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "cors", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode || e5.statusCode, headers: n3.headers });
        });
      }, getBucketLocation: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketLocation", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "location", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          t3(null, n3);
        });
      }, getBucketPolicy: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketPolicy", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "policy", rawBody: true, tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return e5.statusCode && 403 === e5.statusCode ? t3({ ErrorStatus: "Access Denied" }) : e5.statusCode && 405 === e5.statusCode ? t3({ ErrorStatus: "Method Not Allowed" }) : e5.statusCode && 404 === e5.statusCode ? t3({ ErrorStatus: "Policy Not Found" }) : t3(e5);
          var i4 = {};
          try {
            i4 = JSON.parse(n3.body);
          } catch (e6) {
          }
          t3(null, { Policy: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketPolicy: function(e4, t3) {
        var n3 = e4.Policy, i4 = n3;
        try {
          "string" == typeof n3 ? n3 = JSON.parse(i4) : i4 = JSON.stringify(n3);
        } catch (e5) {
          t3({ error: "Policy format error" });
        }
        var a4 = e4.Headers;
        a4["Content-Type"] = "application/json", a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Action: "name/cos:PutBucketPolicy", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, action: "policy", body: i4, headers: a4, json: true, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, deleteBucketPolicy: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketPolicy", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "policy", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode || e5.statusCode, headers: n3.headers });
        });
      }, putBucketTagging: function(e4, t3) {
        var n3 = e4.Tagging || {}, i4 = n3.TagSet || n3.Tags || e4.Tags || [];
        i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]);
        var a4 = o2.json2xml({ Tagging: { TagSet: { Tag: i4 } } }), r3 = e4.Headers;
        r3["Content-Type"] = "application/xml", r3["Content-MD5"] = o2.binaryBase64(o2.md5(a4)), f3.call(this, { Action: "name/cos:PutBucketTagging", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: a4, action: "tagging", headers: r3, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketTagging: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketTagging", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "tagging", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 !== e5.statusCode || !e5.error || "Not Found" !== e5.error && "NoSuchTagSet" !== e5.error.Code)
              t3(e5);
            else {
              var i4 = { Tags: [], statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            }
          else {
            var a4 = [];
            try {
              a4 = n3.Tagging.TagSet.Tag || [];
            } catch (e6) {
            }
            a4 = o2.clone(o2.isArray(a4) ? a4 : [a4]), t3(null, { Tags: a4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketTagging: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketTagging", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "tagging", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketLifecycle: function(e4, t3) {
        var n3 = (e4.LifecycleConfiguration || {}).Rules || e4.Rules || [];
        n3 = o2.clone(n3);
        var i4 = o2.json2xml({ LifecycleConfiguration: { Rule: n3 } }), a4 = e4.Headers;
        a4["Content-Type"] = "application/xml", a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Action: "name/cos:PutBucketLifecycle", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: i4, action: "lifecycle", headers: a4, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketLifecycle: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketLifecycle", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "lifecycle", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 === e5.statusCode && e5.error && "NoSuchLifecycleConfiguration" === e5.error.Code) {
              var i4 = { Rules: [], statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            } else
              t3(e5);
          else {
            var a4 = [];
            try {
              a4 = n3.LifecycleConfiguration.Rule || [];
            } catch (e6) {
            }
            a4 = o2.clone(o2.isArray(a4) ? a4 : [a4]), t3(null, { Rules: a4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketLifecycle: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketLifecycle", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "lifecycle", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketVersioning: function(e4, t3) {
        if (e4.VersioningConfiguration) {
          var n3 = e4.VersioningConfiguration || {}, i4 = o2.json2xml({ VersioningConfiguration: n3 }), a4 = e4.Headers;
          a4["Content-Type"] = "application/xml", a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Action: "name/cos:PutBucketVersioning", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: i4, action: "versioning", headers: a4, tracker: e4.tracker }, function(e5, n4) {
            return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param VersioningConfiguration" });
      }, getBucketVersioning: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketVersioning", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "versioning", tracker: e4.tracker }, function(e5, n3) {
          e5 || !n3.VersioningConfiguration && (n3.VersioningConfiguration = {}), t3(e5, n3);
        });
      }, putBucketReplication: function(e4, t3) {
        var n3 = o2.clone(e4.ReplicationConfiguration), i4 = o2.json2xml({ ReplicationConfiguration: n3 });
        i4 = (i4 = i4.replace(/<(\/?)Rules>/gi, "<$1Rule>")).replace(/<(\/?)Tags>/gi, "<$1Tag>");
        var a4 = e4.Headers;
        a4["Content-Type"] = "application/xml", a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Action: "name/cos:PutBucketReplication", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: i4, action: "replication", headers: a4, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketReplication: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketReplication", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "replication", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 !== e5.statusCode || !e5.error || "Not Found" !== e5.error && "ReplicationConfigurationnotFoundError" !== e5.error.Code)
              t3(e5);
            else {
              var i4 = { ReplicationConfiguration: { Rules: [] }, statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            }
          else
            e5 || !n3.ReplicationConfiguration && (n3.ReplicationConfiguration = {}), n3.ReplicationConfiguration.Rule && (n3.ReplicationConfiguration.Rules = n3.ReplicationConfiguration.Rule, delete n3.ReplicationConfiguration.Rule), t3(e5, n3);
        });
      }, deleteBucketReplication: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketReplication", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "replication", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketWebsite: function(e4, t3) {
        if (e4.WebsiteConfiguration) {
          var n3 = o2.clone(e4.WebsiteConfiguration || {}), i4 = n3.RoutingRules || n3.RoutingRule || [];
          i4 = o2.isArray(i4) ? i4 : [i4], delete n3.RoutingRule, delete n3.RoutingRules, i4.length && (n3.RoutingRules = { RoutingRule: i4 });
          var a4 = o2.json2xml({ WebsiteConfiguration: n3 }), r3 = e4.Headers;
          r3["Content-Type"] = "application/xml", r3["Content-MD5"] = o2.binaryBase64(o2.md5(a4)), f3.call(this, { Action: "name/cos:PutBucketWebsite", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: a4, action: "website", headers: r3, tracker: e4.tracker }, function(e5, n4) {
            return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param WebsiteConfiguration" });
      }, getBucketWebsite: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketWebsite", method: "GET", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, action: "website", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 === e5.statusCode && "NoSuchWebsiteConfiguration" === e5.error.Code) {
              var i4 = { WebsiteConfiguration: {}, statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            } else
              t3(e5);
          else {
            var a4 = n3.WebsiteConfiguration || {};
            if (a4.RoutingRules) {
              var r3 = o2.clone(a4.RoutingRules.RoutingRule || []);
              r3 = o2.makeArray(r3), a4.RoutingRules = r3;
            }
            t3(null, { WebsiteConfiguration: a4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteBucketWebsite: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketWebsite", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "website", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketReferer: function(e4, t3) {
        if (e4.RefererConfiguration) {
          var n3 = o2.clone(e4.RefererConfiguration || {}), i4 = n3.DomainList || {}, a4 = i4.Domains || i4.Domain || [];
          (a4 = o2.isArray(a4) ? a4 : [a4]).length && (n3.DomainList = { Domain: a4 });
          var r3 = o2.json2xml({ RefererConfiguration: n3 }), s4 = e4.Headers;
          s4["Content-Type"] = "application/xml", s4["Content-MD5"] = o2.binaryBase64(o2.md5(r3)), f3.call(this, { Action: "name/cos:PutBucketReferer", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: r3, action: "referer", headers: s4, tracker: e4.tracker }, function(e5, n4) {
            return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param RefererConfiguration" });
      }, getBucketReferer: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketReferer", method: "GET", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, action: "referer", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 === e5.statusCode && "NoSuchRefererConfiguration" === e5.error.Code) {
              var i4 = { WebsiteConfiguration: {}, statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            } else
              t3(e5);
          else {
            var a4 = n3.RefererConfiguration || {};
            if (a4.DomainList) {
              var r3 = o2.makeArray(a4.DomainList.Domain || []);
              a4.DomainList = { Domains: r3 };
            }
            t3(null, { RefererConfiguration: a4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, putBucketDomain: function(e4, t3) {
        var n3 = (e4.DomainConfiguration || {}).DomainRule || e4.DomainRule || [];
        n3 = o2.clone(n3);
        var i4 = o2.json2xml({ DomainConfiguration: { DomainRule: n3 } }), a4 = e4.Headers;
        a4["Content-Type"] = "application/xml", a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Action: "name/cos:PutBucketDomain", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: i4, action: "domain", headers: a4, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketDomain: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketDomain", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "domain", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          var i4 = [];
          try {
            i4 = n3.DomainConfiguration.DomainRule || [];
          } catch (e6) {
          }
          i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]), t3(null, { DomainRule: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, deleteBucketDomain: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketDomain", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "domain", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketOrigin: function(e4, t3) {
        var n3 = (e4.OriginConfiguration || {}).OriginRule || e4.OriginRule || [];
        n3 = o2.clone(n3);
        var i4 = o2.json2xml({ OriginConfiguration: { OriginRule: n3 } }), a4 = e4.Headers;
        a4["Content-Type"] = "application/xml", a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Action: "name/cos:PutBucketOrigin", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: i4, action: "origin", headers: a4, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketOrigin: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketOrigin", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "origin", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          var i4 = [];
          try {
            i4 = n3.OriginConfiguration.OriginRule || [];
          } catch (e6) {
          }
          i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]), t3(null, { OriginRule: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, deleteBucketOrigin: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketOrigin", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "origin", tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketLogging: function(e4, t3) {
        var n3 = o2.json2xml({ BucketLoggingStatus: e4.BucketLoggingStatus || "" }), i4 = e4.Headers;
        i4["Content-Type"] = "application/xml", i4["Content-MD5"] = o2.binaryBase64(o2.md5(n3)), f3.call(this, { Action: "name/cos:PutBucketLogging", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: n3, action: "logging", headers: i4, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketLogging: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketLogging", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "logging", tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          delete n3.BucketLoggingStatus._xmlns, t3(null, { BucketLoggingStatus: n3.BucketLoggingStatus, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketInventory: function(e4, t3) {
        var n3 = o2.clone(e4.InventoryConfiguration);
        if (n3.OptionalFields) {
          var i4 = n3.OptionalFields || [];
          n3.OptionalFields = { Field: i4 };
        }
        if (n3.Destination && n3.Destination.COSBucketDestination && n3.Destination.COSBucketDestination.Encryption) {
          var a4 = n3.Destination.COSBucketDestination.Encryption;
          Object.keys(a4).indexOf("SSECOS") > -1 && (a4["SSE-COS"] = a4.SSECOS, delete a4.SSECOS);
        }
        var r3 = o2.json2xml({ InventoryConfiguration: n3 }), s4 = e4.Headers;
        s4["Content-Type"] = "application/xml", s4["Content-MD5"] = o2.binaryBase64(o2.md5(r3)), f3.call(this, { Action: "name/cos:PutBucketInventory", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: r3, action: "inventory", qs: { id: e4.Id }, headers: s4, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getBucketInventory: function(e4, t3) {
        f3.call(this, { Action: "name/cos:GetBucketInventory", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "inventory", qs: { id: e4.Id }, tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          var i4 = n3.InventoryConfiguration;
          if (i4 && i4.OptionalFields && i4.OptionalFields.Field) {
            var a4 = i4.OptionalFields.Field;
            o2.isArray(a4) || (a4 = [a4]), i4.OptionalFields = a4;
          }
          if (i4.Destination && i4.Destination.COSBucketDestination && i4.Destination.COSBucketDestination.Encryption) {
            var r3 = i4.Destination.COSBucketDestination.Encryption;
            Object.keys(r3).indexOf("SSE-COS") > -1 && (r3.SSECOS = r3["SSE-COS"], delete r3["SSE-COS"]);
          }
          t3(null, { InventoryConfiguration: i4, statusCode: n3.statusCode, headers: n3.headers });
        });
      }, listBucketInventory: function(e4, t3) {
        f3.call(this, { Action: "name/cos:ListBucketInventory", method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "inventory", qs: { "continuation-token": e4.ContinuationToken }, tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          var i4 = n3.ListInventoryConfigurationResult, a4 = i4.InventoryConfiguration || [];
          a4 = o2.isArray(a4) ? a4 : [a4], delete i4.InventoryConfiguration, o2.each(a4, function(e6) {
            if (e6 && e6.OptionalFields && e6.OptionalFields.Field) {
              var t4 = e6.OptionalFields.Field;
              o2.isArray(t4) || (t4 = [t4]), e6.OptionalFields = t4;
            }
            if (e6.Destination && e6.Destination.COSBucketDestination && e6.Destination.COSBucketDestination.Encryption) {
              var n4 = e6.Destination.COSBucketDestination.Encryption;
              Object.keys(n4).indexOf("SSE-COS") > -1 && (n4.SSECOS = n4["SSE-COS"], delete n4["SSE-COS"]);
            }
          }), i4.InventoryConfigurations = a4, o2.extend(i4, { statusCode: n3.statusCode, headers: n3.headers }), t3(null, i4);
        });
      }, deleteBucketInventory: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteBucketInventory", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "inventory", qs: { id: e4.Id }, tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, putBucketAccelerate: function(e4, t3) {
        if (e4.AccelerateConfiguration) {
          var n3 = { AccelerateConfiguration: e4.AccelerateConfiguration || {} }, i4 = o2.json2xml(n3), a4 = { "Content-Type": "application/xml" };
          a4["Content-MD5"] = o2.binaryBase64(o2.md5(i4)), f3.call(this, { Interface: "putBucketAccelerate", Action: "name/cos:PutBucketAccelerate", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, body: i4, action: "accelerate", headers: a4, tracker: e4.tracker }, function(e5, n4) {
            if (e5)
              return t3(e5);
            t3(null, { statusCode: n4.statusCode, headers: n4.headers });
          });
        } else
          t3({ error: "missing param AccelerateConfiguration" });
      }, getBucketAccelerate: function(e4, t3) {
        f3.call(this, { Interface: "getBucketAccelerate", Action: "name/cos:GetBucketAccelerate", method: "GET", Bucket: e4.Bucket, Region: e4.Region, action: "accelerate", tracker: e4.tracker }, function(e5, n3) {
          e5 || !n3.AccelerateConfiguration && (n3.AccelerateConfiguration = {}), t3(e5, n3);
        });
      }, getObject: function(e4, t3) {
        if (this.options.ObjectKeySimplifyCheck && "/" === o2.simplifyPath(e4.Key))
          return void t3(o2.error(new Error("The Getobject Key is illegal")));
        var n3 = e4.Query || {}, i4 = e4.QueryString || "", a4 = e4.tracker;
        a4 && a4.setParams({ signStartTime: (/* @__PURE__ */ new Date()).getTime() }), n3["response-content-type"] = e4.ResponseContentType, n3["response-content-language"] = e4.ResponseContentLanguage, n3["response-expires"] = e4.ResponseExpires, n3["response-cache-control"] = e4.ResponseCacheControl, n3["response-content-disposition"] = e4.ResponseContentDisposition, n3["response-content-encoding"] = e4.ResponseContentEncoding, f3.call(this, { Action: "name/cos:GetObject", method: "GET", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, VersionId: e4.VersionId, headers: e4.Headers, qs: n3, qsStr: i4, rawBody: true, dataType: e4.DataType, tracker: a4 }, function(n4, i5) {
          if (n4) {
            var a5 = n4.statusCode;
            return e4.Headers["If-Modified-Since"] && a5 && 304 === a5 ? t3(null, { NotModified: true }) : t3(n4);
          }
          t3(null, { Body: i5.body, ETag: o2.attr(i5.headers, "etag", ""), statusCode: i5.statusCode, headers: i5.headers });
        });
      }, headObject: function(e4, t3) {
        f3.call(this, { Action: "name/cos:HeadObject", method: "HEAD", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, VersionId: e4.VersionId, headers: e4.Headers, tracker: e4.tracker }, function(n3, i4) {
          if (n3) {
            var a4 = n3.statusCode;
            return e4.Headers["If-Modified-Since"] && a4 && 304 === a4 ? t3(null, { NotModified: true, statusCode: a4 }) : t3(n3);
          }
          i4.ETag = o2.attr(i4.headers, "etag", ""), t3(null, i4);
        });
      }, listObjectVersions: function(e4, t3) {
        var n3 = {};
        n3.prefix = e4.Prefix || "", n3.delimiter = e4.Delimiter, n3["key-marker"] = e4.KeyMarker, n3["version-id-marker"] = e4.VersionIdMarker, n3["max-keys"] = e4.MaxKeys, n3["encoding-type"] = e4.EncodingType, f3.call(this, { Action: "name/cos:GetBucketObjectVersions", ResourceKey: n3.prefix, method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, qs: n3, action: "versions", tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          var i4 = n4.ListVersionsResult || {}, a4 = i4.DeleteMarker || [];
          a4 = o2.isArray(a4) ? a4 : [a4];
          var r3 = i4.Version || [];
          r3 = o2.isArray(r3) ? r3 : [r3];
          var s4 = o2.clone(i4);
          delete s4.DeleteMarker, delete s4.Version, o2.extend(s4, { DeleteMarkers: a4, Versions: r3, statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, putObject: function(e4, t3) {
        var n3 = this, i4 = e4.ContentLength, r3 = o2.throttleOnProgress.call(n3, i4, e4.onProgress), s4 = e4.Headers;
        s4["Cache-Control"] || s4["cache-control"] || (s4["Cache-Control"] = ""), s4["Content-Type"] || s4["content-type"] || (s4["Content-Type"] = a3.getType(e4.Key) || "application/octet-stream");
        var l3 = e4.UploadAddMetaMd5 || n3.options.UploadAddMetaMd5 || n3.options.UploadCheckContentMd5, p4 = e4.tracker;
        l3 && p4 && p4.setParams({ md5StartTime: (/* @__PURE__ */ new Date()).getTime() }), o2.getBodyMd5(l3, e4.Body, function(a4) {
          a4 && (p4 && p4.setParams({ md5EndTime: (/* @__PURE__ */ new Date()).getTime() }), n3.options.UploadCheckContentMd5 && (s4["Content-MD5"] = o2.binaryBase64(a4)), (e4.UploadAddMetaMd5 || n3.options.UploadAddMetaMd5) && (s4["x-cos-meta-md5"] = a4)), void 0 !== e4.ContentLength && (s4["Content-Length"] = e4.ContentLength), r3(null, true), f3.call(n3, { Action: "name/cos:PutObject", TaskId: e4.TaskId, method: "PUT", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, qs: e4.Query, body: e4.Body, onProgress: r3, tracker: p4 }, function(a5, s5) {
            if (a5)
              return r3(null, true), t3(a5);
            r3({ loaded: i4, total: i4 }, true);
            var l4 = c3({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e4.Bucket, region: n3.options.UseAccelerate ? "accelerate" : e4.Region, object: e4.Key });
            l4 = l4.substr(l4.indexOf("://") + 3), s5.Location = l4, s5.ETag = o2.attr(s5.headers, "etag", ""), t3(null, s5);
          });
        });
      }, postObject: function(e4, t3) {
        var n3 = this, i4 = {}, a4 = e4.FilePath;
        if (a4) {
          for (var r3 in i4["Cache-Control"] = e4.CacheControl, i4["Content-Disposition"] = e4.ContentDisposition, i4["Content-Encoding"] = e4.ContentEncoding, i4["Content-MD5"] = e4.ContentMD5, i4["Content-Length"] = e4.ContentLength, i4["Content-Type"] = e4.ContentType, i4.Expect = e4.Expect, i4.Expires = e4.Expires, i4["x-cos-acl"] = e4.ACL, i4["x-cos-grant-read"] = e4.GrantRead, i4["x-cos-grant-write"] = e4.GrantWrite, i4["x-cos-grant-full-control"] = e4.GrantFullControl, i4["x-cos-storage-class"] = e4.StorageClass, i4["x-cos-mime-limit"] = e4.MimeLimit, i4["x-cos-traffic-limit"] = e4.TrafficLimit, i4["x-cos-forbid-overwrite"] = e4.ForbidOverwrite, i4["x-cos-server-side-encryption-customer-algorithm"] = e4.SSECustomerAlgorithm, i4["x-cos-server-side-encryption-customer-key"] = e4.SSECustomerKey, i4["x-cos-server-side-encryption-customer-key-MD5"] = e4.SSECustomerKeyMD5, i4["x-cos-server-side-encryption"] = e4.ServerSideEncryption, i4["x-cos-server-side-encryption-cos-kms-key-id"] = e4.SSEKMSKeyId, i4["x-cos-server-side-encryption-context"] = e4.SSEContext, delete i4["Content-Length"], delete i4["content-length"], e4)
            r3.indexOf("x-cos-meta-") > -1 && (i4[r3] = e4[r3]);
          var s4 = o2.throttleOnProgress.call(n3, i4["Content-Length"], e4.onProgress);
          f3.call(this, { Action: "name/cos:PostObject", method: "POST", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: i4, qs: e4.Query, filePath: a4, TaskId: e4.TaskId, onProgress: s4, tracker: e4.tracker }, function(i5, o3) {
            if (s4(null, true), i5)
              return t3(i5);
            if (o3 && o3.headers) {
              var r4 = o3.headers, l3 = r4.etag || r4.Etag || r4.ETag || "", p4 = a4.substr(a4.lastIndexOf("/") + 1), u3 = c3({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e4.Bucket, region: e4.Region, object: e4.Key.replace(/\$\{filename\}/g, p4), isLocation: true });
              return t3(null, { Location: u3, statusCode: o3.statusCode, headers: r4, ETag: l3 });
            }
            t3(null, o3);
          });
        } else
          t3({ error: "missing param FilePath" });
      }, deleteObject: function(e4, t3) {
        f3.call(this, { Action: "name/cos:DeleteObject", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, VersionId: e4.VersionId, tracker: e4.tracker }, function(e5, n3) {
          if (e5) {
            var i4 = e5.statusCode;
            return i4 && 204 === i4 ? t3(null, { statusCode: i4 }) : i4 && 404 === i4 ? t3(null, { BucketNotFound: true, statusCode: i4 }) : t3(e5);
          }
          t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, getObjectAcl: function(e4, t3) {
        var n3 = {};
        e4.VersionId && (n3.versionId = e4.VersionId), f3.call(this, { Action: "name/cos:GetObjectACL", method: "GET", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, qs: n3, action: "acl", tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          var i4 = n4.AccessControlPolicy || {}, a4 = i4.Owner || {}, s4 = i4.AccessControlList && i4.AccessControlList.Grant || [];
          s4 = o2.isArray(s4) ? s4 : [s4];
          var c4 = r2(i4);
          n4.headers && n4.headers["x-cos-acl"] && (c4.ACL = n4.headers["x-cos-acl"]), c4 = o2.extend(c4, { Owner: a4, Grants: s4, statusCode: n4.statusCode, headers: n4.headers }), t3(null, c4);
        });
      }, putObjectAcl: function(e4, t3) {
        var n3 = e4.Headers, i4 = "";
        if (e4.AccessControlPolicy) {
          var a4 = o2.clone(e4.AccessControlPolicy || {}), r3 = a4.Grants || a4.Grant;
          r3 = o2.isArray(r3) ? r3 : [r3], delete a4.Grant, delete a4.Grants, a4.AccessControlList = { Grant: r3 }, i4 = o2.json2xml({ AccessControlPolicy: a4 }), n3["Content-Type"] = "application/xml", n3["Content-MD5"] = o2.binaryBase64(o2.md5(i4));
        }
        o2.each(n3, function(e5, t4) {
          0 === t4.indexOf("x-cos-grant-") && (n3[t4] = s3(n3[t4]));
        }), f3.call(this, { Action: "name/cos:PutObjectACL", method: "PUT", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, action: "acl", headers: n3, body: i4, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, optionsObject: function(e4, t3) {
        var n3 = e4.Headers;
        n3.Origin = e4.Origin, n3["Access-Control-Request-Method"] = e4.AccessControlRequestMethod, n3["Access-Control-Request-Headers"] = e4.AccessControlRequestHeaders, f3.call(this, { Action: "name/cos:OptionsObject", method: "OPTIONS", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: n3, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return e5.statusCode && 403 === e5.statusCode ? t3(null, { OptionsForbidden: true, statusCode: e5.statusCode }) : t3(e5);
          var i4 = n4.headers || {};
          t3(null, { AccessControlAllowOrigin: i4["access-control-allow-origin"], AccessControlAllowMethods: i4["access-control-allow-methods"], AccessControlAllowHeaders: i4["access-control-allow-headers"], AccessControlExposeHeaders: i4["access-control-expose-headers"], AccessControlMaxAge: i4["access-control-max-age"], statusCode: n4.statusCode, headers: n4.headers });
        });
      }, putObjectCopy: function(e4, t3) {
        var n3 = e4.Headers;
        !n3["Cache-Control"] && n3["cache-control"] && (n3["Cache-Control"] = "");
        var i4 = e4.CopySource || "", a4 = o2.getSourceParams.call(this, i4);
        if (a4) {
          var r3 = a4.Bucket, s4 = a4.Region, c4 = decodeURIComponent(a4.Key);
          f3.call(this, { Scope: [{ action: "name/cos:GetObject", bucket: r3, region: s4, prefix: c4 }, { action: "name/cos:PutObject", bucket: e4.Bucket, region: e4.Region, prefix: e4.Key }], method: "PUT", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, VersionId: e4.VersionId, headers: e4.Headers, tracker: e4.tracker }, function(e5, n4) {
            if (e5)
              return t3(e5);
            var i5 = o2.clone(n4.CopyObjectResult || {});
            o2.extend(i5, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, i5);
          });
        } else
          t3({ error: "CopySource format error" });
      }, deleteMultipleObject: function(e4, t3) {
        var n3 = e4.Objects || [], i4 = e4.Quiet;
        n3 = o2.isArray(n3) ? n3 : [n3];
        var a4 = o2.json2xml({ Delete: { Object: n3, Quiet: i4 || false } }), r3 = e4.Headers;
        r3["Content-Type"] = "application/xml", r3["Content-MD5"] = o2.binaryBase64(o2.md5(a4));
        var s4 = o2.map(n3, function(t4) {
          return { action: "name/cos:DeleteObject", bucket: e4.Bucket, region: e4.Region, prefix: t4.Key };
        });
        f3.call(this, { Scope: s4, method: "POST", Bucket: e4.Bucket, Region: e4.Region, body: a4, action: "delete", headers: r3, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          var i5 = n4.DeleteResult || {}, a5 = i5.Deleted || [], r4 = i5.Error || [];
          a5 = o2.isArray(a5) ? a5 : [a5], r4 = o2.isArray(r4) ? r4 : [r4];
          var s5 = o2.clone(i5);
          o2.extend(s5, { Error: r4, Deleted: a5, statusCode: n4.statusCode, headers: n4.headers }), t3(null, s5);
        });
      }, restoreObject: function(e4, t3) {
        var n3 = e4.Headers;
        if (e4.RestoreRequest) {
          var i4 = e4.RestoreRequest || {}, a4 = o2.json2xml({ RestoreRequest: i4 });
          n3["Content-Type"] = "application/xml", n3["Content-MD5"] = o2.binaryBase64(o2.md5(a4)), f3.call(this, { Action: "name/cos:RestoreObject", method: "POST", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, VersionId: e4.VersionId, body: a4, action: "restore", headers: n3, tracker: e4.tracker }, function(e5, n4) {
            t3(e5, n4);
          });
        } else
          t3({ error: "missing param RestoreRequest" });
      }, putObjectTagging: function(e4, t3) {
        var n3 = e4.Tagging || {}, i4 = n3.TagSet || n3.Tags || e4.Tags || [];
        i4 = o2.clone(o2.isArray(i4) ? i4 : [i4]);
        var a4 = o2.json2xml({ Tagging: { TagSet: { Tag: i4 } } }), r3 = e4.Headers;
        r3["Content-Type"] = "application/xml", r3["Content-MD5"] = o2.binaryBase64(o2.md5(a4)), f3.call(this, { Interface: "putObjectTagging", Action: "name/cos:PutObjectTagging", method: "PUT", Bucket: e4.Bucket, Key: e4.Key, Region: e4.Region, body: a4, action: "tagging", headers: r3, VersionId: e4.VersionId, tracker: e4.tracker }, function(e5, n4) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, getObjectTagging: function(e4, t3) {
        f3.call(this, { Interface: "getObjectTagging", Action: "name/cos:GetObjectTagging", method: "GET", Key: e4.Key, Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, action: "tagging", VersionId: e4.VersionId, tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            if (404 !== e5.statusCode || !e5.error || "Not Found" !== e5.error && "NoSuchTagSet" !== e5.error.Code)
              t3(e5);
            else {
              var i4 = { Tags: [], statusCode: e5.statusCode };
              e5.headers && (i4.headers = e5.headers), t3(null, i4);
            }
          else {
            var a4 = [];
            try {
              a4 = n3.Tagging.TagSet.Tag || [];
            } catch (e6) {
            }
            a4 = o2.clone(o2.isArray(a4) ? a4 : [a4]), t3(null, { Tags: a4, statusCode: n3.statusCode, headers: n3.headers });
          }
        });
      }, deleteObjectTagging: function(e4, t3) {
        f3.call(this, { Interface: "deleteObjectTagging", Action: "name/cos:DeleteObjectTagging", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, action: "tagging", VersionId: e4.VersionId, tracker: e4.tracker }, function(e5, n3) {
          return e5 && 204 === e5.statusCode ? t3(null, { statusCode: e5.statusCode }) : e5 ? t3(e5) : void t3(null, { statusCode: n3.statusCode, headers: n3.headers });
        });
      }, appendObject: function(e4, t3) {
        f3.call(this, { Action: "name/cos:AppendObject", method: "POST", Bucket: e4.Bucket, Region: e4.Region, action: "append", Key: e4.Key, body: e4.Body, qs: { position: e4.Position }, headers: e4.Headers, tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          t3(null, n3);
        });
      }, uploadPartCopy: function(e4, t3) {
        var n3 = e4.CopySource || "", i4 = o2.getSourceParams.call(this, n3);
        if (i4) {
          var a4 = i4.Bucket, r3 = i4.Region, s4 = decodeURIComponent(i4.Key);
          f3.call(this, { Scope: [{ action: "name/cos:GetObject", bucket: a4, region: r3, prefix: s4 }, { action: "name/cos:PutObject", bucket: e4.Bucket, region: e4.Region, prefix: e4.Key }], method: "PUT", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, VersionId: e4.VersionId, qs: { partNumber: e4.PartNumber, uploadId: e4.UploadId }, headers: e4.Headers, tracker: e4.tracker }, function(e5, n4) {
            if (e5)
              return t3(e5);
            var i5 = o2.clone(n4.CopyPartResult || {});
            o2.extend(i5, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, i5);
          });
        } else
          t3({ error: "CopySource format error" });
      }, multipartInit: function(e4, t3) {
        var n3 = e4.Headers, i4 = e4.tracker;
        n3["Cache-Control"] || n3["cache-control"] || (n3["Cache-Control"] = ""), n3["Content-Type"] || n3["content-type"] || (n3["Content-Type"] = a3.getType(e4.Key) || "application/octet-stream"), f3.call(this, { Action: "name/cos:InitiateMultipartUpload", method: "POST", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, action: "uploads", headers: e4.Headers, qs: e4.Query, tracker: i4 }, function(e5, n4) {
          return e5 ? (i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartInit" }), t3(e5)) : (n4 = o2.clone(n4 || {})) && n4.InitiateMultipartUploadResult ? t3(null, o2.extend(n4.InitiateMultipartUploadResult, { statusCode: n4.statusCode, headers: n4.headers })) : void t3(null, n4);
        });
      }, multipartUpload: function(e4, t3) {
        var n3 = this;
        o2.getFileSize("multipartUpload", e4, function() {
          var i4 = e4.tracker, a4 = n3.options.UploadCheckContentMd5;
          a4 && i4 && i4.setParams({ md5StartTime: (/* @__PURE__ */ new Date()).getTime() }), o2.getBodyMd5(a4, e4.Body, function(r3) {
            r3 && (e4.Headers["Content-MD5"] = o2.binaryBase64(r3), a4 && i4 && i4.setParams({ md5EndTime: (/* @__PURE__ */ new Date()).getTime() })), i4 && i4.setParams({ partNumber: e4.PartNumber }), f3.call(n3, { Action: "name/cos:UploadPart", TaskId: e4.TaskId, method: "PUT", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, qs: { partNumber: e4.PartNumber, uploadId: e4.UploadId }, headers: e4.Headers, onProgress: e4.onProgress, body: e4.Body || null, tracker: i4 }, function(e5, n4) {
              if (e5)
                return i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartUpload" }), t3(e5);
              t3(null, { ETag: o2.attr(n4.headers, "etag", {}), statusCode: n4.statusCode, headers: n4.headers });
            });
          });
        });
      }, multipartComplete: function(e4, t3) {
        for (var n3 = this, i4 = e4.UploadId, a4 = e4.Parts, r3 = e4.tracker, s4 = 0, l3 = a4.length; s4 < l3; s4++)
          0 !== a4[s4].ETag.indexOf('"') && (a4[s4].ETag = '"' + a4[s4].ETag + '"');
        var p4 = o2.json2xml({ CompleteMultipartUpload: { Part: a4 } }), u3 = e4.Headers;
        u3["Content-Type"] = "application/xml", u3["Content-MD5"] = o2.binaryBase64(o2.md5(p4)), f3.call(this, { Action: "name/cos:CompleteMultipartUpload", method: "POST", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, qs: { uploadId: i4 }, body: p4, headers: u3, tracker: r3 }, function(i5, a5) {
          if (i5)
            return r3 && r3.parent && r3.parent.setParams({ errorNode: "multipartComplete" }), t3(i5);
          var s5 = c3({ ForcePathStyle: n3.options.ForcePathStyle, protocol: n3.options.Protocol, domain: n3.options.Domain, bucket: e4.Bucket, region: n3.options.UseAccelerate ? "accelerate" : e4.Region, object: e4.Key, isLocation: true }), l4 = a5.CompleteMultipartUploadResult || {}, p5 = o2.extend(l4, { Location: s5, statusCode: a5.statusCode, headers: a5.headers });
          t3(null, p5);
        });
      }, multipartList: function(e4, t3) {
        var n3 = {};
        n3.delimiter = e4.Delimiter, n3["encoding-type"] = e4.EncodingType, n3.prefix = e4.Prefix || "", n3["max-uploads"] = e4.MaxUploads, n3["key-marker"] = e4.KeyMarker, n3["upload-id-marker"] = e4.UploadIdMarker, n3 = o2.clearKey(n3);
        var i4 = e4.tracker;
        i4 && i4.setParams({ signStartTime: (/* @__PURE__ */ new Date()).getTime() }), f3.call(this, { Action: "name/cos:ListMultipartUploads", ResourceKey: n3.prefix, method: "GET", Bucket: e4.Bucket, Region: e4.Region, headers: e4.Headers, qs: n3, action: "uploads", tracker: i4 }, function(e5, n4) {
          if (e5)
            return i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartList" }), t3(e5);
          if (n4 && n4.ListMultipartUploadsResult) {
            var a4 = n4.ListMultipartUploadsResult.Upload || [], r3 = n4.ListMultipartUploadsResult.CommonPrefixes || [];
            r3 = o2.isArray(r3) ? r3 : [r3], a4 = o2.isArray(a4) ? a4 : [a4], n4.ListMultipartUploadsResult.Upload = a4, n4.ListMultipartUploadsResult.CommonPrefixes = r3;
          }
          var s4 = o2.clone(n4.ListMultipartUploadsResult || {});
          o2.extend(s4, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, multipartListPart: function(e4, t3) {
        var n3 = {}, i4 = e4.tracker;
        n3.uploadId = e4.UploadId, n3["encoding-type"] = e4.EncodingType, n3["max-parts"] = e4.MaxParts, n3["part-number-marker"] = e4.PartNumberMarker, f3.call(this, { Action: "name/cos:ListParts", method: "GET", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, qs: n3, tracker: i4 }, function(e5, n4) {
          if (e5)
            return i4 && i4.parent && i4.parent.setParams({ errorNode: "multipartListPart" }), t3(e5);
          var a4 = n4.ListPartsResult || {}, r3 = a4.Part || [];
          r3 = o2.isArray(r3) ? r3 : [r3], a4.Part = r3;
          var s4 = o2.clone(a4);
          o2.extend(s4, { statusCode: n4.statusCode, headers: n4.headers }), t3(null, s4);
        });
      }, multipartAbort: function(e4, t3) {
        var n3 = {};
        n3.uploadId = e4.UploadId, f3.call(this, { Action: "name/cos:AbortMultipartUpload", method: "DELETE", Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, headers: e4.Headers, qs: n3, tracker: e4.tracker }, function(e5, n4) {
          if (e5)
            return t3(e5);
          t3(null, { statusCode: n4.statusCode, headers: n4.headers });
        });
      }, request: function(e4, t3) {
        f3.call(this, { method: e4.Method, Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, action: e4.Action, headers: e4.Headers, qs: e4.Query, body: e4.Body, Url: e4.Url, rawBody: e4.RawBody, dataType: e4.DataType, tracker: e4.tracker }, function(e5, n3) {
          if (e5)
            return t3(e5);
          n3 && n3.body && (n3.Body = n3.body, delete n3.body), t3(e5, n3);
        });
      }, getObjectUrl: function(e4, t3) {
        var n3 = this, i4 = void 0 === e4.UseAccelerate ? n3.options.UseAccelerate : e4.UseAccelerate, a4 = c3({ ForcePathStyle: n3.options.ForcePathStyle, protocol: e4.Protocol || n3.options.Protocol, domain: e4.Domain || n3.options.Domain, bucket: e4.Bucket, region: i4 ? "accelerate" : e4.Region, object: e4.Key }), r3 = "";
        e4.Query && (r3 += o2.obj2str(e4.Query)), e4.QueryString && (r3 += (r3 ? "&" : "") + e4.QueryString);
        var s4 = a4;
        if (void 0 !== e4.Sign && !e4.Sign)
          return r3 && (s4 += "?" + r3), t3(null, { Url: s4 }), s4;
        var u3 = l2.call(this, { Bucket: e4.Bucket, Region: e4.Region, UseAccelerate: e4.UseAccelerate, Url: a4 }), d4 = p3.call(this, { Action: "PUT" === (e4.Method || "").toUpperCase() ? "name/cos:PutObject" : "name/cos:GetObject", Bucket: e4.Bucket || "", Region: e4.Region || "", Method: e4.Method || "get", Key: e4.Key, Expires: e4.Expires, Headers: e4.Headers, Query: e4.Query, SignHost: u3, ForceSignHost: false !== e4.ForceSignHost && n3.options.ForceSignHost }, function(e5, n4) {
          if (t3)
            if (e5)
              t3(e5);
            else {
              var i5 = a4;
              i5 += "?" + (n4.Authorization.indexOf("q-signature") > -1 ? function(e6) {
                var t4 = e6.match(/q-url-param-list.*?(?=&)/g)[0], n5 = "q-url-param-list=" + encodeURIComponent(t4.replace(/q-url-param-list=/, "")).toLowerCase(), i6 = new RegExp(t4, "g");
                return e6.replace(i6, n5);
              }(n4.Authorization) : "sign=" + encodeURIComponent(n4.Authorization)), n4.SecurityToken && (i5 += "&x-cos-security-token=" + n4.SecurityToken), n4.ClientIP && (i5 += "&clientIP=" + n4.ClientIP), n4.ClientUA && (i5 += "&clientUA=" + n4.ClientUA), n4.Token && (i5 += "&token=" + n4.Token), r3 && (i5 += "&" + r3), setTimeout(function() {
                t3(null, { Url: i5 });
              });
            }
        });
        return d4 ? (s4 += "?" + d4.Authorization + (d4.SecurityToken ? "&x-cos-security-token=" + d4.SecurityToken : ""), r3 && (s4 += "&" + r3)) : r3 && (s4 += "?" + r3), s4;
      }, getAuth: function(e4) {
        return o2.getAuth({ SecretId: e4.SecretId || this.options.SecretId || "", SecretKey: e4.SecretKey || this.options.SecretKey || "", Bucket: e4.Bucket, Region: e4.Region, Method: e4.Method, Key: e4.Key, Query: e4.Query, Headers: e4.Headers, Expires: e4.Expires, SystemClockOffset: this.options.SystemClockOffset });
      } };
      e3.exports.init = function(e4, t3) {
        t3.transferToTaskMethod(h3, "postObject"), t3.transferToTaskMethod(h3, "putObject"), o2.each(h3, function(t4, n3) {
          e4.prototype[n3] = o2.apiWrapper(n3, t4);
        });
      };
    }, function(e3, t2) {
      function n2(e4) {
        return encodeURIComponent(e4).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
      }
      var i3 = function(e4, t3) {
        var i4, o2, a3, r2 = [], s3 = function(e5, t4) {
          var i5 = [];
          for (var o3 in e5)
            e5.hasOwnProperty(o3) && i5.push(t4 ? n2(o3).toLowerCase() : o3);
          return i5.sort(function(e6, t5) {
            return (e6 = e6.toLowerCase()) === (t5 = t5.toLowerCase()) ? 0 : e6 > t5 ? 1 : -1;
          });
        }(e4);
        for (i4 = 0; i4 < s3.length; i4++)
          a3 = void 0 === e4[o2 = s3[i4]] || null === e4[o2] ? "" : "" + e4[o2], o2 = t3 ? n2(o2).toLowerCase() : n2(o2), a3 = n2(a3) || "", r2.push(o2 + "=" + a3);
        return r2.join("&");
      };
      e3.exports = function(e4, t3) {
        var n3, o2 = e4.filePath, a3 = e4.headers || {}, r2 = e4.url || e4.Url, s3 = e4.method, c3 = e4.onProgress, l2 = e4.httpDNSServiceId, p3 = function(e5, n4) {
          var i4 = n4.header, o3 = {};
          if (i4)
            for (var a4 in i4)
              i4.hasOwnProperty(a4) && (o3[a4.toLowerCase()] = i4[a4]);
          t3(e5, { statusCode: n4.statusCode, headers: o3 }, n4.data);
        };
        if (o2) {
          var u2, d3 = r2.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);
          e4.pathStyle ? (u2 = decodeURIComponent(d3[3] || ""), r2 = d3[1] + d3[2]) : (u2 = decodeURIComponent(d3[2] + d3[3] || ""), r2 = d3[1]);
          var f3 = { key: u2, success_action_status: 200, Signature: a3.Authorization }, m3 = ["Cache-Control", "Content-Type", "Content-Disposition", "Content-Encoding", "Expires", "x-cos-storage-class", "x-cos-security-token", "x-ci-security-token"];
          for (var h3 in e4.headers)
            e4.headers.hasOwnProperty(h3) && (h3.indexOf("x-cos-meta-") > -1 || m3.indexOf(h3) > -1) && (f3[h3] = e4.headers[h3]);
          a3["x-cos-acl"] && (f3.acl = a3["x-cos-acl"]), !f3["Content-Type"] && (f3["Content-Type"] = ""), (n3 = wx$1.uploadFile({ url: r2, method: s3, name: "file", header: a3, filePath: o2, formData: f3, timeout: e4.timeout, success: function(e5) {
            p3(null, e5);
          }, fail: function(e5) {
            p3(e5.errMsg, e5);
          } })).onProgressUpdate(function(e5) {
            c3 && c3({ loaded: e5.totalBytesSent, total: e5.totalBytesExpectedToSend, progress: e5.progress / 100 });
          });
        } else {
          var g2 = e4.qs && i3(e4.qs) || "";
          g2 && (r2 += (r2.indexOf("?") > -1 ? "&" : "?") + g2), a3["Content-Length"] && delete a3["Content-Length"];
          var v3 = { url: r2, method: s3, header: a3, dataType: "text", data: e4.body, responseType: e4.dataType || "text", timeout: e4.timeout, redirect: "manual", success: function(e5) {
            p3(null, e5);
          }, fail: function(e5) {
            p3(e5.errMsg, e5);
          } };
          l2 && Object.assign(v3, { enableHttpDNS: true, httpDNSServiceId: l2 }), n3 = wx$1.request(v3);
        }
        return n3;
      };
    }, function(e3, t2, n2) {
      let i3 = n2(29);
      e3.exports = new i3(n2(30), n2(31));
    }, function(e3, t2, n2) {
      function i3() {
        this._types = /* @__PURE__ */ Object.create(null), this._extensions = /* @__PURE__ */ Object.create(null);
        for (let e4 = 0; e4 < arguments.length; e4++)
          this.define(arguments[e4]);
        this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
      }
      i3.prototype.define = function(e4, t3) {
        for (let n3 in e4) {
          let i4 = e4[n3].map(function(e5) {
            return e5.toLowerCase();
          });
          n3 = n3.toLowerCase();
          for (let e5 = 0; e5 < i4.length; e5++) {
            const o2 = i4[e5];
            if ("*" !== o2[0]) {
              if (!t3 && o2 in this._types)
                throw new Error('Attempt to change mapping for "' + o2 + '" extension from "' + this._types[o2] + '" to "' + n3 + '". Pass `force=true` to allow this, otherwise remove "' + o2 + '" from the list of extensions for "' + n3 + '".');
              this._types[o2] = n3;
            }
          }
          if (t3 || !this._extensions[n3]) {
            const e5 = i4[0];
            this._extensions[n3] = "*" !== e5[0] ? e5 : e5.substr(1);
          }
        }
      }, i3.prototype.getType = function(e4) {
        let t3 = (e4 = String(e4)).replace(/^.*[/\\]/, "").toLowerCase(), n3 = t3.replace(/^.*\./, "").toLowerCase(), i4 = t3.length < e4.length;
        return (n3.length < t3.length - 1 || !i4) && this._types[n3] || null;
      }, i3.prototype.getExtension = function(e4) {
        return (e4 = /^\s*([^;\s]*)/.test(e4) && RegExp.$1) && this._extensions[e4.toLowerCase()] || null;
      }, e3.exports = i3;
    }, function(e3, t2) {
      e3.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
    }, function(e3, t2) {
      e3.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
    }, function(e3, t2, n2) {
      function i3() {
        /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
        i3 = function() {
          return t3;
        };
        var e4, t3 = {}, n3 = Object.prototype, a4 = n3.hasOwnProperty, r3 = Object.defineProperty || function(e5, t4, n4) {
          e5[t4] = n4.value;
        }, s4 = "function" == typeof Symbol ? Symbol : {}, c4 = s4.iterator || "@@iterator", l3 = s4.asyncIterator || "@@asyncIterator", p4 = s4.toStringTag || "@@toStringTag";
        function u3(e5, t4, n4) {
          return Object.defineProperty(e5, t4, { value: n4, enumerable: true, configurable: true, writable: true }), e5[t4];
        }
        try {
          u3({}, "");
        } catch (e5) {
          u3 = function(e6, t4, n4) {
            return e6[t4] = n4;
          };
        }
        function d4(e5, t4, n4, i4) {
          var o3 = t4 && t4.prototype instanceof x3 ? t4 : x3, a5 = Object.create(o3.prototype), s5 = new j2(i4 || []);
          return r3(a5, "_invoke", { value: A2(e5, n4, s5) }), a5;
        }
        function f4(e5, t4, n4) {
          try {
            return { type: "normal", arg: e5.call(t4, n4) };
          } catch (e6) {
            return { type: "throw", arg: e6 };
          }
        }
        t3.wrap = d4;
        var m4 = "suspendedStart", h4 = "suspendedYield", g3 = "executing", v4 = "completed", y3 = {};
        function x3() {
        }
        function k3() {
        }
        function b3() {
        }
        var C3 = {};
        u3(C3, c4, function() {
          return this;
        });
        var S2 = Object.getPrototypeOf, w2 = S2 && S2(S2(I2([])));
        w2 && w2 !== n3 && a4.call(w2, c4) && (C3 = w2);
        var T2 = b3.prototype = x3.prototype = Object.create(C3);
        function R2(e5) {
          ["next", "throw", "return"].forEach(function(t4) {
            u3(e5, t4, function(e6) {
              return this._invoke(t4, e6);
            });
          });
        }
        function B2(e5, t4) {
          function n4(i5, r4, s5, c5) {
            var l4 = f4(e5[i5], e5, r4);
            if ("throw" !== l4.type) {
              var p5 = l4.arg, u4 = p5.value;
              return u4 && "object" == o2(u4) && a4.call(u4, "__await") ? t4.resolve(u4.__await).then(function(e6) {
                n4("next", e6, s5, c5);
              }, function(e6) {
                n4("throw", e6, s5, c5);
              }) : t4.resolve(u4).then(function(e6) {
                p5.value = e6, s5(p5);
              }, function(e6) {
                return n4("throw", e6, s5, c5);
              });
            }
            c5(l4.arg);
          }
          var i4;
          r3(this, "_invoke", { value: function(e6, o3) {
            function a5() {
              return new t4(function(t5, i5) {
                n4(e6, o3, t5, i5);
              });
            }
            return i4 = i4 ? i4.then(a5, a5) : a5();
          } });
        }
        function A2(t4, n4, i4) {
          var o3 = m4;
          return function(a5, r4) {
            if (o3 === g3)
              throw Error("Generator is already running");
            if (o3 === v4) {
              if ("throw" === a5)
                throw r4;
              return { value: e4, done: true };
            }
            for (i4.method = a5, i4.arg = r4; ; ) {
              var s5 = i4.delegate;
              if (s5) {
                var c5 = P2(s5, i4);
                if (c5) {
                  if (c5 === y3)
                    continue;
                  return c5;
                }
              }
              if ("next" === i4.method)
                i4.sent = i4._sent = i4.arg;
              else if ("throw" === i4.method) {
                if (o3 === m4)
                  throw o3 = v4, i4.arg;
                i4.dispatchException(i4.arg);
              } else
                "return" === i4.method && i4.abrupt("return", i4.arg);
              o3 = g3;
              var l4 = f4(t4, n4, i4);
              if ("normal" === l4.type) {
                if (o3 = i4.done ? v4 : h4, l4.arg === y3)
                  continue;
                return { value: l4.arg, done: i4.done };
              }
              "throw" === l4.type && (o3 = v4, i4.method = "throw", i4.arg = l4.arg);
            }
          };
        }
        function P2(t4, n4) {
          var i4 = n4.method, o3 = t4.iterator[i4];
          if (o3 === e4)
            return n4.delegate = null, "throw" === i4 && t4.iterator.return && (n4.method = "return", n4.arg = e4, P2(t4, n4), "throw" === n4.method) || "return" !== i4 && (n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a '" + i4 + "' method")), y3;
          var a5 = f4(o3, t4.iterator, n4.arg);
          if ("throw" === a5.type)
            return n4.method = "throw", n4.arg = a5.arg, n4.delegate = null, y3;
          var r4 = a5.arg;
          return r4 ? r4.done ? (n4[t4.resultName] = r4.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e4), n4.delegate = null, y3) : r4 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, y3);
        }
        function E2(e5) {
          var t4 = { tryLoc: e5[0] };
          1 in e5 && (t4.catchLoc = e5[1]), 2 in e5 && (t4.finallyLoc = e5[2], t4.afterLoc = e5[3]), this.tryEntries.push(t4);
        }
        function O2(e5) {
          var t4 = e5.completion || {};
          t4.type = "normal", delete t4.arg, e5.completion = t4;
        }
        function j2(e5) {
          this.tryEntries = [{ tryLoc: "root" }], e5.forEach(E2, this), this.reset(true);
        }
        function I2(t4) {
          if (t4 || "" === t4) {
            var n4 = t4[c4];
            if (n4)
              return n4.call(t4);
            if ("function" == typeof t4.next)
              return t4;
            if (!isNaN(t4.length)) {
              var i4 = -1, r4 = function n5() {
                for (; ++i4 < t4.length; )
                  if (a4.call(t4, i4))
                    return n5.value = t4[i4], n5.done = false, n5;
                return n5.value = e4, n5.done = true, n5;
              };
              return r4.next = r4;
            }
          }
          throw new TypeError(o2(t4) + " is not iterable");
        }
        return k3.prototype = b3, r3(T2, "constructor", { value: b3, configurable: true }), r3(b3, "constructor", { value: k3, configurable: true }), k3.displayName = u3(b3, p4, "GeneratorFunction"), t3.isGeneratorFunction = function(e5) {
          var t4 = "function" == typeof e5 && e5.constructor;
          return !!t4 && (t4 === k3 || "GeneratorFunction" === (t4.displayName || t4.name));
        }, t3.mark = function(e5) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(e5, b3) : (e5.__proto__ = b3, u3(e5, p4, "GeneratorFunction")), e5.prototype = Object.create(T2), e5;
        }, t3.awrap = function(e5) {
          return { __await: e5 };
        }, R2(B2.prototype), u3(B2.prototype, l3, function() {
          return this;
        }), t3.AsyncIterator = B2, t3.async = function(e5, n4, i4, o3, a5) {
          void 0 === a5 && (a5 = Promise);
          var r4 = new B2(d4(e5, n4, i4, o3), a5);
          return t3.isGeneratorFunction(n4) ? r4 : r4.next().then(function(e6) {
            return e6.done ? e6.value : r4.next();
          });
        }, R2(T2), u3(T2, p4, "Generator"), u3(T2, c4, function() {
          return this;
        }), u3(T2, "toString", function() {
          return "[object Generator]";
        }), t3.keys = function(e5) {
          var t4 = Object(e5), n4 = [];
          for (var i4 in t4)
            n4.push(i4);
          return n4.reverse(), function e6() {
            for (; n4.length; ) {
              var i5 = n4.pop();
              if (i5 in t4)
                return e6.value = i5, e6.done = false, e6;
            }
            return e6.done = true, e6;
          };
        }, t3.values = I2, j2.prototype = { constructor: j2, reset: function(t4) {
          if (this.prev = 0, this.next = 0, this.sent = this._sent = e4, this.done = false, this.delegate = null, this.method = "next", this.arg = e4, this.tryEntries.forEach(O2), !t4)
            for (var n4 in this)
              "t" === n4.charAt(0) && a4.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e4);
        }, stop: function() {
          this.done = true;
          var e5 = this.tryEntries[0].completion;
          if ("throw" === e5.type)
            throw e5.arg;
          return this.rval;
        }, dispatchException: function(t4) {
          if (this.done)
            throw t4;
          var n4 = this;
          function i4(i5, o4) {
            return s5.type = "throw", s5.arg = t4, n4.next = i5, o4 && (n4.method = "next", n4.arg = e4), !!o4;
          }
          for (var o3 = this.tryEntries.length - 1; o3 >= 0; --o3) {
            var r4 = this.tryEntries[o3], s5 = r4.completion;
            if ("root" === r4.tryLoc)
              return i4("end");
            if (r4.tryLoc <= this.prev) {
              var c5 = a4.call(r4, "catchLoc"), l4 = a4.call(r4, "finallyLoc");
              if (c5 && l4) {
                if (this.prev < r4.catchLoc)
                  return i4(r4.catchLoc, true);
                if (this.prev < r4.finallyLoc)
                  return i4(r4.finallyLoc);
              } else if (c5) {
                if (this.prev < r4.catchLoc)
                  return i4(r4.catchLoc, true);
              } else {
                if (!l4)
                  throw Error("try statement without catch or finally");
                if (this.prev < r4.finallyLoc)
                  return i4(r4.finallyLoc);
              }
            }
          }
        }, abrupt: function(e5, t4) {
          for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
            var i4 = this.tryEntries[n4];
            if (i4.tryLoc <= this.prev && a4.call(i4, "finallyLoc") && this.prev < i4.finallyLoc) {
              var o3 = i4;
              break;
            }
          }
          o3 && ("break" === e5 || "continue" === e5) && o3.tryLoc <= t4 && t4 <= o3.finallyLoc && (o3 = null);
          var r4 = o3 ? o3.completion : {};
          return r4.type = e5, r4.arg = t4, o3 ? (this.method = "next", this.next = o3.finallyLoc, y3) : this.complete(r4);
        }, complete: function(e5, t4) {
          if ("throw" === e5.type)
            throw e5.arg;
          return "break" === e5.type || "continue" === e5.type ? this.next = e5.arg : "return" === e5.type ? (this.rval = this.arg = e5.arg, this.method = "return", this.next = "end") : "normal" === e5.type && t4 && (this.next = t4), y3;
        }, finish: function(e5) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.finallyLoc === e5)
              return this.complete(n4.completion, n4.afterLoc), O2(n4), y3;
          }
        }, catch: function(e5) {
          for (var t4 = this.tryEntries.length - 1; t4 >= 0; --t4) {
            var n4 = this.tryEntries[t4];
            if (n4.tryLoc === e5) {
              var i4 = n4.completion;
              if ("throw" === i4.type) {
                var o3 = i4.arg;
                O2(n4);
              }
              return o3;
            }
          }
          throw Error("illegal catch attempt");
        }, delegateYield: function(t4, n4, i4) {
          return this.delegate = { iterator: I2(t4), resultName: n4, nextLoc: i4 }, "next" === this.method && (this.arg = e4), y3;
        } }, t3;
      }
      function o2(e4) {
        return o2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e5) {
          return typeof e5;
        } : function(e5) {
          return e5 && "function" == typeof Symbol && e5.constructor === Symbol && e5 !== Symbol.prototype ? "symbol" : typeof e5;
        }, o2(e4);
      }
      function a3(e4, t3, n3, i4, o3, a4, r3) {
        try {
          var s4 = e4[a4](r3), c4 = s4.value;
        } catch (e5) {
          return void n3(e5);
        }
        s4.done ? t3(c4) : Promise.resolve(c4).then(i4, o3);
      }
      function r2(e4) {
        return function() {
          var t3 = this, n3 = arguments;
          return new Promise(function(i4, o3) {
            var r3 = e4.apply(t3, n3);
            function s4(e5) {
              a3(r3, i4, o3, s4, c4, "next", e5);
            }
            function c4(e5) {
              a3(r3, i4, o3, s4, c4, "throw", e5);
            }
            s4(void 0);
          });
        };
      }
      var s3 = n2(7), c3 = n2(33), l2 = n2(6).EventProxy, p3 = n2(0), u2 = n2(2);
      function d3(e4, t3) {
        var n3 = e4.TaskId, i4 = e4.Bucket, o3 = e4.Region, a4 = e4.Key, r3 = e4.StorageClass, u3 = this, d4 = {}, h4 = e4.FileSize, g3 = e4.SliceSize, v4 = Math.ceil(h4 / g3), y3 = 0, x3 = p3.throttleOnProgress.call(u3, h4, e4.onHashProgress), k3 = function(t4, n4) {
          var i5 = t4.length;
          if (0 === i5)
            return n4(null, true);
          if (i5 > v4)
            return n4(null, false);
          if (i5 > 1 && Math.max(t4[0].Size, t4[1].Size) !== g3)
            return n4(null, false);
          !function o4(a5) {
            if (a5 < i5) {
              var r4 = t4[a5];
              !function(t5, n5) {
                var i6 = g3 * (t5 - 1), o5 = Math.min(i6 + g3, h4), a6 = o5 - i6;
                d4[t5] ? n5(null, { PartNumber: t5, ETag: d4[t5], Size: a6 }) : p3.fileSlice(e4.FilePath, i6, o5, function(e5) {
                  try {
                    var i7 = p3.getFileMd5(e5);
                  } catch (e6) {
                    return n5(e6);
                  }
                  var o6 = '"' + i7 + '"';
                  d4[t5] = o6, y3 += a6, n5(null, { PartNumber: t5, ETag: o6, Size: a6 }), x3({ loaded: y3, total: h4 });
                });
              }(r4.PartNumber, function(e5, t5) {
                t5 && t5.ETag === r4.ETag && t5.Size === r4.Size ? o4(a5 + 1) : n4(null, false);
              });
            } else
              n4(null, true);
          }(0);
        }, b3 = new l2();
        b3.on("error", function(e5) {
          if (u3._isRunningTask(n3))
            return t3(e5);
        }), b3.on("upload_id_available", function(e5) {
          var n4 = {}, i5 = [];
          p3.each(e5.PartList, function(e6) {
            n4[e6.PartNumber] = e6;
          });
          for (var o4 = 1; o4 <= v4; o4++) {
            var a5 = n4[o4];
            a5 ? (a5.PartNumber = o4, a5.Uploaded = true) : a5 = { PartNumber: o4, ETag: null, Uploaded: false }, i5.push(a5);
          }
          e5.PartList = i5, t3(null, e5);
        }), b3.on("no_available_upload_id", function() {
          if (u3._isRunningTask(n3)) {
            var s4 = p3.extend({ Bucket: i4, Region: o3, Key: a4, Headers: p3.clone(e4.Headers), Query: p3.clone(e4.Query), StorageClass: r3, calledBySdk: "sliceUploadFile", tracker: e4.tracker }, e4);
            u3.multipartInit(s4, function(e5, i5) {
              if (u3._isRunningTask(n3)) {
                if (e5)
                  return b3.emit("error", e5);
                var o4 = i5.UploadId;
                if (!o4)
                  return t3({ Message: "no upload id" });
                b3.emit("upload_id_available", { UploadId: o4, PartList: [] });
              }
            });
          }
        }), b3.on("has_and_check_upload_id", function(t4) {
          t4 = t4.reverse(), c3.eachLimit(t4, 1, function(t5, r4) {
            u3._isRunningTask(n3) && (s3.using[t5] ? r4() : m3.call(u3, { Bucket: i4, Region: o3, Key: a4, UploadId: t5, tracker: e4.tracker }, function(e5, i5) {
              if (u3._isRunningTask(n3)) {
                if (e5)
                  return s3.removeUsing(t5), b3.emit("error", e5);
                var o4 = i5.PartList;
                o4.forEach(function(e6) {
                  e6.PartNumber *= 1, e6.Size *= 1, e6.ETag = e6.ETag || "";
                }), k3(o4, function(e6, i6) {
                  if (u3._isRunningTask(n3))
                    return e6 ? b3.emit("error", e6) : void (i6 ? r4({ UploadId: t5, PartList: o4 }) : r4());
                });
              }
            }));
          }, function(e5) {
            u3._isRunningTask(n3) && (x3(null, true), e5 && e5.UploadId ? b3.emit("upload_id_available", e5) : b3.emit("no_available_upload_id"));
          });
        }), b3.on("seek_local_avail_upload_id", function(t4) {
          var r4 = s3.getFileId(e4.FileStat, e4.ChunkSize, i4, a4), c4 = s3.getUploadIdList(r4);
          if (r4 && c4) {
            !function r5(l3) {
              if (l3 >= c4.length)
                b3.emit("has_and_check_upload_id", t4);
              else {
                var d5 = c4[l3];
                if (!p3.isInArray(t4, d5))
                  return s3.removeUploadId(d5), void r5(l3 + 1);
                s3.using[d5] ? r5(l3 + 1) : m3.call(u3, { Bucket: i4, Region: o3, Key: a4, UploadId: d5, tracker: e4.tracker }, function(e5, t5) {
                  u3._isRunningTask(n3) && (e5 ? (s3.removeUploadId(d5), r5(l3 + 1)) : b3.emit("upload_id_available", { UploadId: d5, PartList: t5.PartList }));
                });
              }
            }(0);
          } else
            b3.emit("has_and_check_upload_id", t4);
        }), b3.on("get_remote_upload_id_list", function() {
          f3.call(u3, { Bucket: i4, Region: o3, Key: a4, tracker: e4.tracker }, function(t4, o4) {
            if (u3._isRunningTask(n3)) {
              if (t4)
                return b3.emit("error", t4);
              var c4 = p3.filter(o4.UploadList, function(e5) {
                return e5.Key === a4 && (!r3 || e5.StorageClass.toUpperCase() === r3.toUpperCase());
              }).reverse().map(function(e5) {
                return e5.UploadId || e5.UploadID;
              });
              if (c4.length)
                b3.emit("seek_local_avail_upload_id", c4);
              else {
                var l3, d5 = s3.getFileId(e4.FileStat, e4.ChunkSize, i4, a4);
                d5 && (l3 = s3.getUploadIdList(d5)) && p3.each(l3, function(e5) {
                  s3.removeUploadId(e5);
                }), b3.emit("no_available_upload_id");
              }
            }
          });
        }), b3.emit("get_remote_upload_id_list");
      }
      function f3(e4, t3) {
        var n3 = this, i4 = [], o3 = { Bucket: e4.Bucket, Region: e4.Region, Prefix: e4.Key, calledBySdk: e4.calledBySdk || "sliceUploadFile", tracker: e4.tracker };
        !function e5() {
          n3.multipartList(o3, function(n4, a4) {
            if (n4)
              return t3(n4);
            i4.push.apply(i4, a4.Upload || []), "true" === a4.IsTruncated ? (o3.KeyMarker = a4.NextKeyMarker, o3.UploadIdMarker = a4.NextUploadIdMarker, e5()) : t3(null, { UploadList: i4 });
          });
        }();
      }
      function m3(e4, t3) {
        var n3 = this, i4 = [], o3 = { Bucket: e4.Bucket, Region: e4.Region, Key: e4.Key, UploadId: e4.UploadId, calledBySdk: "sliceUploadFile", tracker: e4.tracker };
        !function e5() {
          n3.multipartListPart(o3, function(n4, a4) {
            if (n4)
              return t3(n4);
            i4.push.apply(i4, a4.Part || []), "true" === a4.IsTruncated ? (o3.PartNumberMarker = a4.NextPartNumberMarker, e5()) : t3(null, { PartList: i4 });
          });
        }();
      }
      function h3(e4, t3) {
        var n3 = this, i4 = e4.TaskId, o3 = e4.Bucket, a4 = e4.Region, r3 = e4.Key, s4 = e4.UploadData, l3 = e4.FileSize, u3 = e4.SliceSize, d4 = Math.min(e4.AsyncLimit || n3.options.ChunkParallelLimit || 1, 256), f4 = e4.FilePath, m4 = Math.ceil(l3 / u3), h4 = 0, v4 = e4.ServerSideEncryption, y3 = p3.filter(s4.PartList, function(e5) {
          return e5.Uploaded && (h4 += e5.PartNumber >= m4 && l3 % u3 || u3), !e5.Uploaded;
        }), x3 = e4.onProgress;
        c3.eachLimit(y3, d4, function(t4, c4) {
          if (n3._isRunningTask(i4)) {
            var p4 = t4.PartNumber, d5 = Math.min(l3, t4.PartNumber * u3) - (t4.PartNumber - 1) * u3, m5 = 0;
            g2.call(n3, { TaskId: i4, Bucket: o3, Region: a4, Key: r3, SliceSize: u3, FileSize: l3, PartNumber: p4, ServerSideEncryption: v4, FilePath: f4, UploadData: s4, onProgress: function(e5) {
              h4 += e5.loaded - m5, m5 = e5.loaded, x3({ loaded: h4, total: l3 });
            }, tracker: e4.tracker }, function(e5, o4) {
              n3._isRunningTask(i4) && (e5 ? h4 -= m5 : (h4 += d5 - m5, t4.ETag = o4.ETag), x3({ loaded: h4, total: l3 }), c4(e5 || null, o4));
            });
          }
        }, function(e5) {
          if (n3._isRunningTask(i4))
            return e5 ? t3(e5) : void t3(null, { UploadId: s4.UploadId, SliceList: s4.PartList });
        });
      }
      function g2(e4, t3) {
        var n3 = this, i4 = e4.TaskId, o3 = e4.Bucket, a4 = e4.Region, r3 = e4.Key, s4 = e4.FileSize, l3 = e4.FilePath, u3 = 1 * e4.PartNumber, d4 = e4.SliceSize, f4 = e4.ServerSideEncryption, m4 = e4.UploadData, h4 = n3.options.ChunkRetryTimes + 1, g3 = e4.Headers || {}, v4 = d4 * (u3 - 1), y3 = d4, x3 = v4 + d4;
        x3 > s4 && (y3 = (x3 = s4) - v4);
        var k3 = ["x-cos-traffic-limit", "x-cos-mime-limit"], b3 = {};
        p3.each(g3, function(e5, t4) {
          k3.indexOf(t4) > -1 && (b3[t4] = e5);
        }), p3.fileSlice(l3, v4, x3, function(s5) {
          var l4 = p3.getFileMd5(s5), d5 = l4 ? p3.binaryBase64(l4) : null, g4 = m4.PartList[u3 - 1];
          c3.retry(h4, function(t4) {
            n3._isRunningTask(i4) && n3.multipartUpload({ TaskId: i4, Bucket: o3, Region: a4, Key: r3, ContentLength: y3, PartNumber: u3, UploadId: m4.UploadId, ServerSideEncryption: f4, Body: s5, Headers: b3, onProgress: e4.onProgress, ContentMD5: d5, calledBySdk: "sliceUploadFile", tracker: e4.tracker }, function(e5, o4) {
              if (n3._isRunningTask(i4))
                return e5 ? t4(e5) : (g4.Uploaded = true, t4(null, o4));
            });
          }, function(e5, o4) {
            if (n3._isRunningTask(i4))
              return t3(e5, o4);
          });
        });
      }
      function v3(e4, t3) {
        var n3 = e4.Bucket, i4 = e4.Region, o3 = e4.Key, a4 = e4.UploadId, r3 = e4.SliceList, s4 = this, l3 = this.options.ChunkRetryTimes + 1, p4 = r3.map(function(e5) {
          return { PartNumber: e5.PartNumber, ETag: e5.ETag };
        });
        c3.retry(l3, function(t4) {
          s4.multipartComplete({ Bucket: n3, Region: i4, Key: o3, UploadId: a4, Parts: p4, calledBySdk: "sliceUploadFile", Headers: e4.Headers || {}, tracker: e4.tracker }, t4);
        }, function(e5, n4) {
          t3(e5, n4);
        });
      }
      function y2(e4, t3) {
        var n3 = e4.Bucket, i4 = e4.Region, o3 = e4.Key, a4 = e4.AbortArray, r3 = e4.AsyncLimit || 1, s4 = this, l3 = 0, p4 = new Array(a4.length);
        c3.eachLimit(a4, r3, function(t4, a5) {
          var r4 = l3;
          if (o3 && o3 !== t4.Key)
            return p4[r4] = { error: { KeyNotMatch: true } }, void a5(null);
          var c4 = t4.UploadId || t4.UploadID;
          s4.multipartAbort({ Bucket: n3, Region: i4, Key: t4.Key, Headers: e4.Headers, UploadId: c4 }, function(e5) {
            var o4 = { Bucket: n3, Region: i4, Key: t4.Key, UploadId: c4 };
            p4[r4] = { error: e5, task: o4 }, a5(null);
          }), l3++;
        }, function(e5) {
          if (e5)
            return t3(e5);
          for (var n4 = [], i5 = [], o4 = 0, a5 = p4.length; o4 < a5; o4++) {
            var r4 = p4[o4];
            r4.task && (r4.error ? i5.push(r4.task) : n4.push(r4.task));
          }
          return t3(null, { successList: n4, errorList: i5 });
        });
      }
      function x2() {
        return (x2 = r2(i3().mark(function e4(t3, n3) {
          var a4, r3, s4, c4, l3, d4, f4, m4, h4, g3, v4, y3;
          return i3().wrap(function(e5) {
            for (; ; )
              switch (e5.prev = e5.next) {
                case 0:
                  return a4 = this, r3 = void 0 === t3.SliceSize ? a4.options.SliceSize : t3.SliceSize, s4 = [], e5.prev = 3, e5.next = 6, p3.getFileSizeByPath(t3.FilePath);
                case 6:
                  c4 = e5.sent, e5.next = 13;
                  break;
                case 9:
                  return e5.prev = 9, e5.t0 = e5.catch(3), n3({ error: e5.t0 }), e5.abrupt("return");
                case 13:
                  l3 = { TaskId: "" }, a4.options.EnableReporter && (d4 = a4.options.UseAccelerate || "string" == typeof a4.options.Domain && a4.options.Domain.includes("accelerate."), f4 = c4 > r3 ? "sliceUploadFile" : "putObject", t3.tracker = new u2({ Beacon: a4.options.BeaconReporter, clsReporter: a4.options.ClsReporter, bucket: t3.Bucket, region: t3.Region, apiName: "uploadFile", realApi: f4, fileKey: t3.Key, fileSize: c4, accelerate: d4, deepTracker: a4.options.DeepTracker, customId: a4.options.CustomId, delay: a4.options.TrackerDelay })), p3.each(t3, function(e6, t4) {
                    "object" !== o2(e6) && "function" != typeof e6 && (l3[t4] = e6);
                  }), m4 = t3.onTaskReady, t3.onTaskReady = function(e6) {
                    l3.TaskId = e6, m4 && m4(e6);
                  }, h4 = t3.onFileFinish, g3 = function(e6, i4) {
                    t3.tracker && t3.tracker.report(e6, i4), h4 && h4(e6, i4, l3), n3 && n3(e6, i4);
                  }, v4 = "postObject" === a4.options.SimpleUploadMethod ? "postObject" : "putObject", y3 = c4 > r3 ? "sliceUploadFile" : v4, s4.push({ api: y3, params: t3, callback: g3 }), a4._addTasks(s4);
                case 24:
                case "end":
                  return e5.stop();
              }
          }, e4, this, [[3, 9]]);
        }))).apply(this, arguments);
      }
      function k2() {
        return k2 = r2(i3().mark(function e4(t3, n3) {
          var a4, s4, c4, l3, d4, f4, m4, h4, g3, v4, y3;
          return i3().wrap(function(e5) {
            for (; ; )
              switch (e5.prev = e5.next) {
                case 0:
                  return a4 = this, s4 = void 0 === t3.SliceSize ? a4.options.SliceSize : t3.SliceSize, c4 = 0, l3 = 0, d4 = p3.throttleOnProgress.call(a4, l3, t3.onProgress), f4 = t3.files.length, m4 = t3.onFileFinish, h4 = Array(f4), g3 = function(e6, t4, i4) {
                    d4(null, true), m4 && m4(e6, t4, i4), h4[i4.Index] = { options: i4, error: e6, data: t4 }, --f4 <= 0 && n3 && n3(null, { files: h4 });
                  }, v4 = [], y3 = function() {
                    return t3.files.map(function(e6, t4) {
                      return new Promise(function() {
                        var n4 = r2(i3().mark(function n5(r3) {
                          var f5, m5, h5, y4, x3, k3, b3, C3, S2, w2, T2;
                          return i3().wrap(function(n6) {
                            for (; ; )
                              switch (n6.prev = n6.next) {
                                case 0:
                                  return f5 = 0, n6.prev = 1, n6.next = 4, p3.getFileSizeByPath(e6.FilePath);
                                case 4:
                                  f5 = n6.sent, n6.next = 9;
                                  break;
                                case 7:
                                  n6.prev = 7, n6.t0 = n6.catch(1);
                                case 9:
                                  m5 = { Index: t4, TaskId: "" }, c4 += f5, a4.options.EnableReporter && (h5 = a4.options.UseAccelerate || "string" == typeof a4.options.Domain && a4.options.Domain.includes("accelerate."), y4 = f5 > s4 ? "sliceUploadFile" : "putObject", e6.tracker = new u2({ Beacon: a4.options.BeaconReporter, clsReporter: a4.options.ClsReporter, bucket: e6.Bucket, region: e6.Region, apiName: "uploadFiles", realApi: y4, fileKey: e6.Key, fileSize: f5, accelerate: h5, deepTracker: a4.options.DeepTracker, customId: a4.options.CustomId, delay: a4.options.TrackerDelay })), p3.each(e6, function(e7, t5) {
                                    "object" !== o2(e7) && "function" != typeof e7 && (m5[t5] = e7);
                                  }), x3 = e6.onTaskReady, e6.onTaskReady = function(e7) {
                                    m5.TaskId = e7, x3 && x3(e7);
                                  }, k3 = 0, b3 = e6.onProgress, e6.onProgress = function(e7) {
                                    l3 = l3 - k3 + e7.loaded, k3 = e7.loaded, b3 && b3(e7), d4({ loaded: l3, total: c4 });
                                  }, C3 = e6.onFileFinish, S2 = function(t5, n7) {
                                    e6.tracker && e6.tracker.report(t5, n7), C3 && C3(t5, n7), g3 && g3(t5, n7, m5);
                                  }, w2 = "postObject" === a4.options.SimpleUploadMethod ? "postObject" : "putObject", T2 = f5 > s4 ? "sliceUploadFile" : w2, v4.push({ api: T2, params: e6, callback: S2 }), r3(true);
                                case 24:
                                case "end":
                                  return n6.stop();
                              }
                          }, n5, null, [[1, 7]]);
                        }));
                        return function(e7) {
                          return n4.apply(this, arguments);
                        };
                      }());
                    });
                  }, e5.next = 13, Promise.all(y3());
                case 13:
                  a4._addTasks(v4);
                case 14:
                case "end":
                  return e5.stop();
              }
          }, e4, this);
        })), k2.apply(this, arguments);
      }
      function b2(e4, t3) {
        var n3 = e4.TaskId, i4 = e4.Bucket, o3 = e4.Region, a4 = e4.Key, r3 = e4.CopySource, s4 = e4.UploadId, l3 = 1 * e4.PartNumber, p4 = e4.CopySourceRange, u3 = this.options.ChunkRetryTimes + 1, d4 = this;
        c3.retry(u3, function(t4) {
          d4.uploadPartCopy({ TaskId: n3, Bucket: i4, Region: o3, Key: a4, CopySource: r3, UploadId: s4, PartNumber: l3, CopySourceRange: p4, onProgress: e4.onProgress, tracker: e4.tracker, calledBySdk: e4.calledBySdk }, function(e5, n4) {
            t4(e5 || null, n4);
          });
        }, function(e5, n4) {
          return t3(e5, n4);
        });
      }
      var C2 = { sliceUploadFile: function(e4, t3) {
        var n3 = this;
        if (!p3.canFileSlice())
          return e4.SkipTask = true, void ("postObject" === n3.options.SimpleUploadMethod ? n3.postObject(e4, t3) : n3.putObject(e4, t3));
        var i4, o3, a4 = new l2(), r3 = e4.TaskId, c4 = e4.Bucket, u3 = e4.Region, f4 = e4.Key, m4 = e4.FilePath, g3 = e4.ChunkSize || e4.SliceSize || n3.options.ChunkSize, y3 = e4.AsyncLimit, x3 = e4.StorageClass, k3 = e4.ServerSideEncryption, b3 = e4.onHashProgress, C3 = e4.tracker;
        C3 && C3.setParams({ chunkSize: g3 }), a4.on("error", function(i5) {
          if (n3._isRunningTask(r3)) {
            var o4 = { UploadId: e4.UploadData.UploadId || "", err: i5, error: i5 };
            return t3(o4);
          }
        }), a4.on("upload_complete", function(n4) {
          var i5 = p3.extend({ UploadId: e4.UploadData.UploadId || "" }, n4);
          t3(null, i5);
        }), a4.on("upload_slice_complete", function(t4) {
          var l3 = {};
          p3.each(e4.Headers, function(e5, t5) {
            var n4 = t5.toLowerCase();
            0 !== n4.indexOf("x-cos-meta-") && "pic-operations" !== n4 || (l3[t5] = e5);
          }), v3.call(n3, { Bucket: c4, Region: u3, Key: f4, UploadId: t4.UploadId, SliceList: t4.SliceList, Headers: l3, tracker: C3 }, function(e5, c5) {
            if (n3._isRunningTask(r3)) {
              if (s3.removeUsing(t4.UploadId), e5)
                return o3(null, true), a4.emit("error", e5);
              s3.removeUploadId(t4.UploadId), o3({ loaded: i4, total: i4 }, true), a4.emit("upload_complete", c5);
            }
          });
        }), a4.on("get_upload_data_finish", function(t4) {
          var l3 = s3.getFileId(e4.FileStat, e4.ChunkSize, c4, f4);
          l3 && s3.saveUploadId(l3, t4.UploadId, n3.options.UploadIdCacheLimit), s3.setUsing(t4.UploadId), o3(null, true), h3.call(n3, { TaskId: r3, Bucket: c4, Region: u3, Key: f4, FilePath: m4, FileSize: i4, SliceSize: g3, AsyncLimit: y3, ServerSideEncryption: k3, UploadData: t4, onProgress: o3, tracker: C3 }, function(e5, t5) {
            if (n3._isRunningTask(r3))
              return e5 ? (o3(null, true), a4.emit("error", e5)) : void a4.emit("upload_slice_complete", t5);
          });
        }), a4.on("get_file_size_finish", function() {
          if (o3 = p3.throttleOnProgress.call(n3, i4, e4.onProgress), e4.UploadData.UploadId)
            a4.emit("get_upload_data_finish", e4.UploadData);
          else {
            var t4 = p3.extend({ TaskId: r3, Bucket: c4, Region: u3, Key: f4, Headers: e4.Headers, StorageClass: x3, FilePath: m4, FileSize: i4, SliceSize: g3, onHashProgress: b3, tracker: C3 }, e4);
            t4.FileSize = i4, d3.call(n3, t4, function(t5, i5) {
              if (n3._isRunningTask(r3)) {
                if (t5)
                  return a4.emit("error", t5);
                e4.UploadData.UploadId = i5.UploadId, e4.UploadData.PartList = i5.PartList, a4.emit("get_upload_data_finish", e4.UploadData);
              }
            });
          }
        }), i4 = e4.ContentLength, delete e4.ContentLength, !e4.Headers && (e4.Headers = {}), p3.each(e4.Headers, function(t4, n4) {
          "content-length" === n4.toLowerCase() && delete e4.Headers[n4];
        }), function() {
          for (var t4 = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], o4 = 1048576, a5 = 0; a5 < t4.length && !(i4 / (o4 = 1024 * t4[a5] * 1024) <= n3.options.MaxPartNumber); a5++)
            ;
          e4.ChunkSize = e4.SliceSize = g3 = Math.max(g3, o4);
        }(), 0 === i4 ? (e4.Body = "", e4.ContentLength = 0, e4.SkipTask = true, n3.putObject(e4, function(e5, n4) {
          if (e5)
            return t3(e5);
          t3(null, n4);
        })) : a4.emit("get_file_size_finish");
      }, abortUploadTask: function(e4, t3) {
        var n3 = e4.Bucket, i4 = e4.Region, o3 = e4.Key, a4 = e4.UploadId, r3 = e4.Level || "task", s4 = e4.AsyncLimit, c4 = this, p4 = new l2();
        if (p4.on("error", function(e5) {
          return t3(e5);
        }), p4.on("get_abort_array", function(a5) {
          y2.call(c4, { Bucket: n3, Region: i4, Key: o3, Headers: e4.Headers, AsyncLimit: s4, AbortArray: a5 }, function(e5, n4) {
            if (e5)
              return t3(e5);
            t3(null, n4);
          });
        }), "bucket" === r3)
          f3.call(c4, { Bucket: n3, Region: i4, calledBySdk: "abortUploadTask" }, function(e5, n4) {
            if (e5)
              return t3(e5);
            p4.emit("get_abort_array", n4.UploadList || []);
          });
        else if ("file" === r3) {
          if (!o3)
            return t3({ error: "abort_upload_task_no_key" });
          f3.call(c4, { Bucket: n3, Region: i4, Key: o3, calledBySdk: "abortUploadTask" }, function(e5, n4) {
            if (e5)
              return t3(e5);
            p4.emit("get_abort_array", n4.UploadList || []);
          });
        } else {
          if ("task" !== r3)
            return t3({ error: "abort_unknown_level" });
          if (!a4)
            return t3({ error: "abort_upload_task_no_id" });
          if (!o3)
            return t3({ error: "abort_upload_task_no_key" });
          p4.emit("get_abort_array", [{ Key: o3, UploadId: a4 }]);
        }
      }, uploadFile: function(e4, t3) {
        return x2.apply(this, arguments);
      }, uploadFiles: function(e4, t3) {
        return k2.apply(this, arguments);
      }, sliceCopyFile: function(e4, t3) {
        var n3 = new l2(), i4 = this, o3 = e4.Bucket, a4 = e4.Region, r3 = e4.Key, u3 = e4.CopySource, d4 = p3.getSourceParams.call(this, u3);
        if (d4) {
          var f4 = d4.Bucket, h4 = d4.Region, g3 = decodeURIComponent(d4.Key), v4 = void 0 === e4.CopySliceSize ? i4.options.CopySliceSize : e4.CopySliceSize;
          v4 = Math.max(0, v4);
          var y3, x3, k3 = e4.CopyChunkSize || this.options.CopyChunkSize, C3 = this.options.CopyChunkParallelLimit, S2 = this.options.ChunkRetryTimes + 1, w2 = 0, T2 = 0, R2 = {}, B2 = {}, A2 = {};
          n3.on("copy_slice_complete", function(n4) {
            p3.each(e4.Headers, function(e5, t4) {
              0 === t4.toLowerCase().indexOf("x-cos-meta-") && e5;
            });
            var u4 = p3.map(n4.PartList, function(e5) {
              return { PartNumber: e5.PartNumber, ETag: e5.ETag };
            });
            c3.retry(S2, function(t4) {
              i4.multipartComplete({ Bucket: o3, Region: a4, Key: r3, UploadId: n4.UploadId, Parts: u4, tracker: e4.tracker, calledBySdk: "sliceCopyFile" }, t4);
            }, function(e5, i5) {
              if (s3.removeUsing(n4.UploadId), e5)
                return x3(null, true), t3(e5);
              s3.removeUploadId(n4.UploadId), x3({ loaded: y3, total: y3 }, true), t3(null, i5);
            });
          }), n3.on("get_copy_data_finish", function(l3) {
            var d5 = s3.getCopyFileId(u3, R2, k3, o3, r3);
            d5 && s3.saveUploadId(d5, l3.UploadId, i4.options.UploadIdCacheLimit), s3.setUsing(l3.UploadId);
            var f5 = p3.filter(l3.PartList, function(e5) {
              return e5.Uploaded && (T2 += e5.PartNumber >= w2 && y3 % k3 || k3), !e5.Uploaded;
            });
            c3.eachLimit(f5, C3, function(t4, n4) {
              var s4 = t4.PartNumber, p4 = t4.CopySourceRange, d6 = t4.end - t4.start, f6 = 0;
              c3.retry(S2, function(t5) {
                b2.call(i4, { Bucket: o3, Region: a4, Key: r3, CopySource: u3, UploadId: l3.UploadId, PartNumber: s4, CopySourceRange: p4, tracker: e4.tracker, calledBySdk: "sliceCopyFile", onProgress: function(e5) {
                  T2 += e5.loaded - f6, f6 = e5.loaded, x3({ loaded: T2, total: y3 });
                } }, t5);
              }, function(e5, i5) {
                if (e5)
                  return n4(e5);
                x3({ loaded: T2, total: y3 }), T2 += d6 - f6, t4.ETag = i5.ETag, n4(e5 || null, i5);
              });
            }, function(e5) {
              if (e5)
                return s3.removeUsing(l3.UploadId), x3(null, true), t3(e5);
              n3.emit("copy_slice_complete", l3);
            });
          }), n3.on("get_chunk_size_finish", function() {
            var c4 = function() {
              i4.multipartInit({ Bucket: o3, Region: a4, Key: r3, Headers: A2, tracker: e4.tracker, calledBySdk: "sliceCopyFile" }, function(i5, o4) {
                if (i5)
                  return t3(i5);
                e4.UploadId = o4.UploadId, n3.emit("get_copy_data_finish", { UploadId: e4.UploadId, PartList: e4.PartList });
              });
            }, l3 = s3.getCopyFileId(u3, R2, k3, o3, r3), d5 = s3.getUploadIdList(l3);
            if (!l3 || !d5)
              return c4();
            !function t4(l4) {
              if (l4 >= d5.length)
                return c4();
              var u4 = d5[l4];
              if (s3.using[u4])
                return t4(l4 + 1);
              m3.call(i4, { Bucket: o3, Region: a4, Key: r3, UploadId: u4, tracker: e4.tracker, calledBySdk: "sliceCopyFile" }, function(i5, o4) {
                if (i5)
                  s3.removeUploadId(u4), t4(l4 + 1);
                else {
                  if (s3.using[u4])
                    return t4(l4 + 1);
                  var a5 = {}, r4 = 0;
                  p3.each(o4.PartList, function(e5) {
                    var t5 = parseInt(e5.Size), n4 = r4 + t5 - 1;
                    a5[e5.PartNumber + "|" + r4 + "|" + n4] = e5.ETag, r4 += t5;
                  }), p3.each(e4.PartList, function(e5) {
                    var t5 = a5[e5.PartNumber + "|" + e5.start + "|" + e5.end];
                    t5 && (e5.ETag = t5, e5.Uploaded = true);
                  }), n3.emit("get_copy_data_finish", { UploadId: u4, PartList: e4.PartList });
                }
              });
            }(0);
          }), n3.on("get_file_size_finish", function() {
            var o4;
            if (function() {
              for (var t4 = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], n4 = 1048576, o5 = 0; o5 < t4.length && !(y3 / (n4 = 1024 * t4[o5] * 1024) <= i4.options.MaxPartNumber); o5++)
                ;
              e4.ChunkSize = k3 = Math.max(k3, n4), w2 = Math.ceil(y3 / k3);
              for (var a6 = [], r4 = 1; r4 <= w2; r4++) {
                var s4 = (r4 - 1) * k3, c4 = r4 * k3 < y3 ? r4 * k3 - 1 : y3 - 1, l3 = { PartNumber: r4, start: s4, end: c4, CopySourceRange: "bytes=" + s4 + "-" + c4 };
                a6.push(l3);
              }
              e4.PartList = a6;
            }(), (o4 = "Replaced" === e4.Headers["x-cos-metadata-directive"] ? e4.Headers : B2)["x-cos-storage-class"] = e4.Headers["x-cos-storage-class"] || B2["x-cos-storage-class"], o4 = p3.clearKey(o4), "ARCHIVE" === B2["x-cos-storage-class"] || "DEEP_ARCHIVE" === B2["x-cos-storage-class"]) {
              var a5 = B2["x-cos-restore"];
              if (!a5 || 'ongoing-request="true"' === a5)
                return void t3({ error: "Unrestored archive object is not allowed to be copied" });
            }
            delete o4["x-cos-copy-source"], delete o4["x-cos-metadata-directive"], delete o4["x-cos-copy-source-If-Modified-Since"], delete o4["x-cos-copy-source-If-Unmodified-Since"], delete o4["x-cos-copy-source-If-Match"], delete o4["x-cos-copy-source-If-None-Match"], n3.emit("get_chunk_size_finish");
          }), i4.headObject({ Bucket: f4, Region: h4, Key: g3, tracker: e4.tracker, calledBySdk: "sliceCopyFile" }, function(o4, a5) {
            if (o4)
              o4.statusCode && 404 === o4.statusCode ? t3({ ErrorStatus: g3 + " Not Exist" }) : t3(o4);
            else if (void 0 !== (y3 = e4.FileSize = a5.headers["content-length"]) && y3)
              if (e4.tracker && e4.tracker.setParams({ httpSize: y3 }), x3 = p3.throttleOnProgress.call(i4, y3, e4.onProgress), y3 <= v4)
                e4.Headers["x-cos-metadata-directive"] || (e4.Headers["x-cos-metadata-directive"] = "Copy"), i4.putObjectCopy(Object.assign(e4, { calledBySdk: "sliceCopyFile" }), function(e5, n4) {
                  if (e5)
                    return x3(null, true), t3(e5);
                  x3({ loaded: y3, total: y3 }, true), t3(e5, n4);
                });
              else {
                var r4 = a5.headers;
                R2 = r4, B2 = { "Cache-Control": r4["cache-control"], "Content-Disposition": r4["content-disposition"], "Content-Encoding": r4["content-encoding"], "Content-Type": r4["content-type"], Expires: r4.expires, "x-cos-storage-class": r4["x-cos-storage-class"] }, p3.each(r4, function(e5, t4) {
                  var n4 = "x-cos-meta-";
                  0 === t4.indexOf(n4) && t4.length > 11 && (B2[t4] = e5);
                }), n3.emit("get_file_size_finish");
              }
            else
              t3({ error: 'get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.' });
          });
        } else
          t3({ error: "CopySource format error" });
      } };
      e3.exports.init = function(e4, t3) {
        t3.transferToTaskMethod(C2, "sliceUploadFile"), p3.each(C2, function(t4, n3) {
          e4.prototype[n3] = p3.apiWrapper(n3, t4);
        });
      };
    }, function(e3, t2) {
      var n2 = { eachLimit: function(e4, t3, n3, i3) {
        if (i3 = i3 || function() {
        }, !e4.length || t3 <= 0)
          return i3();
        var o2 = 0, a3 = 0, r2 = 0;
        !function s3() {
          if (o2 >= e4.length)
            return i3();
          for (; r2 < t3 && a3 < e4.length; )
            r2 += 1, n3(e4[(a3 += 1) - 1], function(t4) {
              t4 ? (i3(t4), i3 = function() {
              }) : (r2 -= 1, (o2 += 1) >= e4.length ? i3() : s3());
            });
        }();
      }, retry: function(e4, t3, n3) {
        e4 < 1 ? n3() : function i3(o2) {
          t3(function(t4, a3) {
            t4 && o2 < e4 ? i3(o2 + 1) : n3(t4, a3);
          });
        }(1);
      } };
      e3.exports = n2;
    }]);
  });
})(cosWxSdkV5_min);
var cosWxSdkV5_minExports = cosWxSdkV5_min.exports;
const COS = /* @__PURE__ */ getDefaultExportFromCjs(cosWxSdkV5_minExports);
var chat = { exports: {} };
(function(module2, exports2) {
  !function(e3, t2) {
    module2.exports = t2();
  }(commonjsGlobal, function() {
    function l2(e4, t3) {
      (null == t3 || t3 > e4.length) && (t3 = e4.length);
      for (var n3 = 0, o3 = Array(t3); n3 < t3; n3++)
        o3[n3] = e4[n3];
      return o3;
    }
    function b2(e4) {
      if (Array.isArray(e4))
        return e4;
    }
    function i3(e4, t3, n3) {
      t3 = x2(t3);
      var o3 = e4, t3 = V2() ? Reflect.construct(t3, n3 || [], x2(e4).constructor) : t3.apply(e4, n3);
      if (!t3 || "object" != typeof t3 && "function" != typeof t3) {
        if (void 0 !== t3)
          throw new TypeError("Derived constructors may only return object or undefined");
        if (void 0 === (t3 = o3))
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return t3;
    }
    function p3(e4, t3) {
      if (!(e4 instanceof t3))
        throw new TypeError("Cannot call a class as a function");
    }
    function w2(e4, t3) {
      for (var n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        o3.enumerable = o3.enumerable || false, o3.configurable = true, "value" in o3 && (o3.writable = true), Object.defineProperty(e4, J3(o3.key), o3);
      }
    }
    function e3(e4, t3, n3) {
      return t3 && w2(e4.prototype, t3), n3 && w2(e4, n3), Object.defineProperty(e4, "prototype", { writable: false }), e4;
    }
    function F2(e4, t3) {
      var n3, o3, i4, a4, s4 = "undefined" != typeof Symbol && e4[Symbol.iterator] || e4["@@iterator"];
      if (s4)
        return i4 = !(o3 = true), { s: function() {
          s4 = s4.call(e4);
        }, n: function() {
          var e5 = s4.next();
          return o3 = e5.done, e5;
        }, e: function(e5) {
          i4 = true, n3 = e5;
        }, f: function() {
          try {
            o3 || null == s4.return || s4.return();
          } finally {
            if (i4)
              throw n3;
          }
        } };
      if (Array.isArray(e4) || (s4 = X3(e4)) || t3 && e4 && "number" == typeof e4.length)
        return s4 && (e4 = s4), a4 = 0, { s: t3 = function() {
        }, n: function() {
          return a4 >= e4.length ? { done: true } : { done: false, value: e4[a4++] };
        }, e: function(e5) {
          throw e5;
        }, f: t3 };
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    function q2(e4, t3, n3) {
      return (t3 = J3(t3)) in e4 ? Object.defineProperty(e4, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e4[t3] = n3, e4;
    }
    function x2(e4) {
      return (x2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e5) {
        return e5.__proto__ || Object.getPrototypeOf(e5);
      })(e4);
    }
    function t2(e4, t3) {
      if ("function" != typeof t3 && null !== t3)
        throw new TypeError("Super expression must either be null or a function");
      e4.prototype = Object.create(t3 && t3.prototype, { constructor: { value: e4, writable: true, configurable: true } }), Object.defineProperty(e4, "prototype", { writable: false }), t3 && Y2(e4, t3);
    }
    function V2() {
      try {
        var e4 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
      } catch (e5) {
      }
      return (V2 = function() {
        return !!e4;
      })();
    }
    function B2(e4) {
      if ("undefined" != typeof Symbol && null != e4[Symbol.iterator] || null != e4["@@iterator"])
        return Array.from(e4);
    }
    function H2() {
      throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    function K2(t3, e4) {
      var n3, o3 = Object.keys(t3);
      return Object.getOwnPropertySymbols && (n3 = Object.getOwnPropertySymbols(t3), e4 && (n3 = n3.filter(function(e5) {
        return Object.getOwnPropertyDescriptor(t3, e5).enumerable;
      })), o3.push.apply(o3, n3)), o3;
    }
    function y2(t3) {
      for (var e4 = 1; e4 < arguments.length; e4++) {
        var n3 = null != arguments[e4] ? arguments[e4] : {};
        e4 % 2 ? K2(Object(n3), true).forEach(function(e5) {
          q2(t3, e5, n3[e5]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t3, Object.getOwnPropertyDescriptors(n3)) : K2(Object(n3)).forEach(function(e5) {
          Object.defineProperty(t3, e5, Object.getOwnPropertyDescriptor(n3, e5));
        });
      }
      return t3;
    }
    function W2(e4, t3) {
      if (null == e4)
        return {};
      var n3, o3 = function(e5, t4) {
        if (null == e5)
          return {};
        var n4, o4 = {};
        for (n4 in e5)
          if ({}.hasOwnProperty.call(e5, n4)) {
            if (0 <= t4.indexOf(n4))
              continue;
            o4[n4] = e5[n4];
          }
        return o4;
      }(e4, t3);
      if (Object.getOwnPropertySymbols)
        for (var i4 = Object.getOwnPropertySymbols(e4), a4 = 0; a4 < i4.length; a4++)
          n3 = i4[a4], 0 <= t3.indexOf(n3) || {}.propertyIsEnumerable.call(e4, n3) && (o3[n3] = e4[n3]);
      return o3;
    }
    function Y2(e4, t3) {
      return (Y2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e5, t4) {
        return e5.__proto__ = t4, e5;
      })(e4, t3);
    }
    function j2(e4, t3) {
      return b2(e4) || function(e5, t4) {
        var n3 = null == e5 ? null : "undefined" != typeof Symbol && e5[Symbol.iterator] || e5["@@iterator"];
        if (null != n3) {
          var o3, i4, a4, s4, r3 = [], c4 = true, u3 = false;
          try {
            if (a4 = (n3 = n3.call(e5)).next, 0 === t4) {
              if (Object(n3) !== n3)
                return;
              c4 = false;
            } else
              for (; !(c4 = (o3 = a4.call(n3)).done) && (r3.push(o3.value), r3.length !== t4); c4 = true)
                ;
          } catch (e6) {
            u3 = true, i4 = e6;
          } finally {
            try {
              if (!c4 && null != n3.return && (s4 = n3.return(), Object(s4) !== s4))
                return;
            } finally {
              if (u3)
                throw i4;
            }
          }
          return r3;
        }
      }(e4, t3) || X3(e4, t3) || H2();
    }
    function d3(e4) {
      return function(e5) {
        if (Array.isArray(e5))
          return l2(e5);
      }(e4) || B2(e4) || X3(e4) || function() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function J3(e4) {
      e4 = function(e5) {
        if ("object" != typeof e5 || !e5)
          return e5;
        var t3 = e5[Symbol.toPrimitive];
        if (void 0 === t3)
          return String(e5);
        t3 = t3.call(e5, "string");
        if ("object" != typeof t3)
          return t3;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }(e4);
      return "symbol" == typeof e4 ? e4 : e4 + "";
    }
    function z2(e4) {
      return (z2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e5) {
        return typeof e5;
      } : function(e5) {
        return e5 && "function" == typeof Symbol && e5.constructor === Symbol && e5 !== Symbol.prototype ? "symbol" : typeof e5;
      })(e4);
    }
    function X3(e4, t3) {
      var n3;
      if (e4)
        return "string" == typeof e4 ? l2(e4, t3) : "Map" === (n3 = "Object" === (n3 = {}.toString.call(e4).slice(8, -1)) && e4.constructor ? e4.constructor.name : n3) || "Set" === n3 ? Array.from(e4) : "Arguments" === n3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n3) ? l2(e4, t3) : void 0;
    }
    function Z2(e4) {
      var n3 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
      return function(e5) {
        if (null === e5 || !function(t4) {
          try {
            return -1 !== Function.toString.call(t4).indexOf("[native code]");
          } catch (e6) {
            return "function" == typeof t4;
          }
        }(e5))
          return e5;
        if ("function" != typeof e5)
          throw new TypeError("Super expression must either be null or a function");
        if (void 0 !== n3) {
          if (n3.has(e5))
            return n3.get(e5);
          n3.set(e5, t3);
        }
        function t3() {
          return function(e6, t4, n4) {
            var o3;
            return V2() ? Reflect.construct.apply(null, arguments) : ((o3 = [null]).push.apply(o3, t4), t4 = new (e6.bind.apply(e6, o3))(), n4 && Y2(t4, n4.prototype), t4);
          }(e5, arguments, x2(this).constructor);
        }
        return t3.prototype = Object.create(e5.prototype, { constructor: { value: t3, enumerable: false, writable: true, configurable: true } }), Y2(t3, e5);
      }(e4);
    }
    var h3 = { SDK_READY: "sdkStateReady", SDK_NOT_READY: "sdkStateNotReady", SDK_DESTROY: "sdkDestroy", MESSAGE_RECEIVED: "onMessageReceived", ROOM_CUSTOM_DATA_RECEIVED: "onRoomCustomDataReceived", MESSAGE_MODIFIED: "onMessageModified", MESSAGE_REVOKED: "onMessageRevoked", MESSAGE_READ_BY_PEER: "onMessageReadByPeer", MESSAGE_READ_RECEIPT_RECEIVED: "onMessageReadReceiptReceived", MESSAGE_EXTENSIONS_UPDATED: "onMessageExtensionsUpdated", MESSAGE_EXTENSIONS_DELETED: "onMessageExtensionsDeleted", MESSAGE_REACTIONS_UPDATED: "onMessageReactionsUpdated", CONVERSATION_LIST_UPDATED: "onConversationListUpdated", TOTAL_UNREAD_MESSAGE_COUNT_UPDATED: "onTotalUnreadMessageCountUpdated", CONVERSATION_GROUP_LIST_UPDATED: "onConversationGroupListUpdated", CONVERSATION_IN_GROUP_UPDATED: "onConversationInGroupUpdated", GROUP_LIST_UPDATED: "onGroupListUpdated", GROUP_ATTRIBUTES_UPDATED: "groupAttributesUpdated", GROUP_COUNTER_UPDATED: "onGroupCounterUpdated", TOPIC_CREATED: "onTopicCreated", TOPIC_DELETED: "onTopicDeleted", TOPIC_UPDATED: "onTopicUpdated", PROFILE_UPDATED: "onProfileUpdated", USER_STATUS_UPDATED: "onUserStatusUpdated", BLACKLIST_UPDATED: "blacklistUpdated", FRIEND_LIST_UPDATED: "onFriendListUpdated", FRIEND_GROUP_LIST_UPDATED: "onFriendGroupListUpdated", FRIEND_APPLICATION_LIST_UPDATED: "onFriendApplicationListUpdated", MY_FOLLOWERS_LIST_UPDATED: "onMyFollowersListUpdated", MY_FOLLOWING_LIST_UPDATED: "onMyFollowingListUpdated", MUTUAL_FOLLOWERS_LIST_UPDATED: "onMutualFollowersListUpdated", KICKED_OUT: "kickedOut", ERROR: "error", NET_STATE_CHANGE: "netStateChange", ALL_RECEIVE_MESSAGE_OPT_UPDATED: "onAllReceiveMessageOptUpdated", SERVER_CONFIG_UPDATED: "onServerConfigUpdated" }, R2 = { MSG_TEXT: "TIMTextElem", MSG_IMAGE: "TIMImageElem", MSG_SOUND: "TIMSoundElem", MSG_AUDIO: "TIMSoundElem", MSG_FILE: "TIMFileElem", MSG_FACE: "TIMFaceElem", MSG_VIDEO: "TIMVideoFileElem", MSG_GEO: "TIMLocationElem", MSG_LOCATION: "TIMLocationElem", MSG_GRP_TIP: "TIMGroupTipElem", MSG_GRP_SYS_NOTICE: "TIMGroupSystemNoticeElem", MSG_CUSTOM: "TIMCustomElem", MSG_MERGER: "TIMRelayElem", MSG_PRIORITY_HIGH: "High", MSG_PRIORITY_NORMAL: "Normal", MSG_PRIORITY_LOW: "Low", MSG_PRIORITY_LOWEST: "Lowest", CONV_C2C: "C2C", CONV_GROUP: "GROUP", CONV_TOPIC: "TOPIC", CONV_SYSTEM: "@TIM#SYSTEM", CONV_AT_ME: 1, CONV_AT_ALL: 2, CONV_AT_ALL_AT_ME: 3, CONV_MARK_TYPE_STAR: 1, CONV_MARK_TYPE_UNREAD: 2, CONV_MARK_TYPE_FOLD: 4, CONV_MARK_TYPE_HIDE: 8, GRP_PRIVATE: "Private", GRP_WORK: "Private", GRP_PUBLIC: "Public", GRP_CHATROOM: "ChatRoom", GRP_MEETING: "ChatRoom", GRP_AVCHATROOM: "AVChatRoom", GRP_COMMUNITY: "Community", GRP_ROOM: "Room", GRP_LIVE: "Live", GRP_MBR_ROLE_OWNER: "Owner", GRP_MBR_ROLE_ADMIN: "Admin", GRP_MBR_ROLE_MEMBER: "Member", GRP_MBR_ROLE_CUSTOM: "Custom", GRP_TIP_MBR_JOIN: 1, GRP_TIP_MBR_QUIT: 2, GRP_TIP_MBR_KICKED_OUT: 3, GRP_TIP_MBR_SET_ADMIN: 4, GRP_TIP_MBR_CANCELED_ADMIN: 5, GRP_TIP_GRP_PROFILE_UPDATED: 6, GRP_TIP_MBR_PROFILE_UPDATED: 7, GRP_TIP_BAN_AVCHATROOM_MEMBER: 10, GRP_TIP_UNBAN_AVCHATROOM_MEMBER: 11, MSG_REMIND_ACPT_AND_NOTE: "AcceptAndNotify", MSG_REMIND_ACPT_NOT_NOTE: "AcceptNotNotify", MSG_REMIND_DISCARD: "Discard", RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT: "AcceptNotNotifyExceptAt", NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT: "AcceptNotNotifyExceptAt", NOT_RECEIVE_MSG_EXCEPT_AT: "NotReceiveMsgExceptAt", GENDER_UNKNOWN: "Gender_Type_Unknown", GENDER_FEMALE: "Gender_Type_Female", GENDER_MALE: "Gender_Type_Male", KICKED_OUT_MULT_ACCOUNT: "multipleAccount", KICKED_OUT_MULT_DEVICE: "multipleDevice", KICKED_OUT_USERSIG_EXPIRED: "userSigExpired", KICKED_OUT_REST_API: "REST_API_Kick", ALLOW_TYPE_ALLOW_ANY: "AllowType_Type_AllowAny", ALLOW_TYPE_NEED_CONFIRM: "AllowType_Type_NeedConfirm", ALLOW_TYPE_DENY_ANY: "AllowType_Type_DenyAny", FORBID_TYPE_NONE: "AdminForbid_Type_None", FORBID_TYPE_SEND_OUT: "AdminForbid_Type_SendOut", JOIN_OPTIONS_FREE_ACCESS: "FreeAccess", JOIN_OPTIONS_NEED_PERMISSION: "NeedPermission", JOIN_OPTIONS_DISABLE_APPLY: "DisableApply", JOIN_STATUS_SUCCESS: "JoinedSuccess", JOIN_STATUS_ALREADY_IN_GROUP: "AlreadyInGroup", JOIN_STATUS_WAIT_APPROVAL: "WaitAdminApproval", INVITE_OPTIONS_DISABLE_INVITE: "DisableInvite", INVITE_OPTIONS_NEED_PERMISSION: "NeedPermission", INVITE_OPTIONS_FREE_ACCESS: "FreeAccess", GRP_PROFILE_OWNER_ID: "ownerID", GRP_PROFILE_CREATE_TIME: "createTime", GRP_PROFILE_LAST_INFO_TIME: "lastInfoTime", GRP_PROFILE_MEMBER_NUM: "memberNum", GRP_PROFILE_MAX_MEMBER_NUM: "maxMemberNum", GRP_PROFILE_JOIN_OPTION: "joinOption", GRP_PROFILE_INVITE_OPTION: "inviteOption", GRP_PROFILE_INTRODUCTION: "introduction", GRP_PROFILE_NOTIFICATION: "notification", GRP_PROFILE_MUTE_ALL_MBRS: "muteAllMembers", SNS_ADD_TYPE_SINGLE: "Add_Type_Single", SNS_ADD_TYPE_BOTH: "Add_Type_Both", SNS_DELETE_TYPE_SINGLE: "Delete_Type_Single", SNS_DELETE_TYPE_BOTH: "Delete_Type_Both", SNS_APPLICATION_TYPE_BOTH: "Pendency_Type_Both", SNS_APPLICATION_SENT_TO_ME: "Pendency_Type_ComeIn", SNS_APPLICATION_SENT_BY_ME: "Pendency_Type_SendOut", SNS_APPLICATION_AGREE: "Response_Action_Agree", SNS_APPLICATION_AGREE_AND_ADD: "Response_Action_AgreeAndAdd", SNS_CHECK_TYPE_BOTH: "CheckResult_Type_Both", SNS_CHECK_TYPE_SINGLE: "CheckResult_Type_Single", SNS_TYPE_NO_RELATION: "CheckResult_Type_NoRelation", SNS_TYPE_A_WITH_B: "CheckResult_Type_AWithB", SNS_TYPE_B_WITH_A: "CheckResult_Type_BWithA", SNS_TYPE_BOTH_WAY: "CheckResult_Type_BothWay", NET_STATE_CONNECTED: "connected", NET_STATE_CONNECTING: "connecting", NET_STATE_DISCONNECTED: "disconnected", MSG_AT_ALL: "__kImSDK_MesssageAtALL__", READ_ALL_C2C_MSG: "readAllC2CMessage", READ_ALL_GROUP_MSG: "readAllGroupMessage", READ_ALL_MSG: "readAllMessage", USER_STATUS_UNKNOWN: 0, USER_STATUS_ONLINE: 1, USER_STATUS_OFFLINE: 2, USER_STATUS_UNLOGINED: 3, IOS_OFFLINE_PUSH_NO_SOUND: "push.no_sound", IOS_OFFLINE_PUSH_DEFAULT_SOUND: "default" }, _2 = { NEW_INVITATION_RECEIVED: "newInvitationReceived", INVITEE_ACCEPTED: "ts_invitee_accepted", INVITEE_REJECTED: "ts_invitee_rejected", INVITATION_CANCELLED: "ts_invitation_cancelled", INVITATION_TIMEOUT: "ts_invitation_timeout", INVITATION_MODIFIED: "ts_invitation_modified", ACTION_TYPE_UNKNOWN: 0, ACTION_TYPE_INVITE: 1, ACTION_TYPE_CANCEL_INVITE: 2, ACTION_TYPE_ACCEPT_INVITE: 3, ACTION_TYPE_REJECT_INVITE: 4, ACTION_TYPE_INVITE_TIMEOUT: 5 }, Q3 = e3(function e4() {
      p3(this, e4), this.cache = [], this.options = null;
    }, [{ key: "use", value: function(e4) {
      if ("function" != typeof e4)
        throw "middleware must be a function";
      return this.cache.push(e4), this;
    } }, { key: "next", value: function(e4) {
      if (this.middlewares && 0 < this.middlewares.length)
        return this.middlewares.shift().call(this, this.options, this.next.bind(this));
    } }, { key: "run", value: function(e4) {
      return this.middlewares = this.cache.map(function(e5) {
        return e5;
      }), this.options = e4, this.next();
    } }]), $3 = e3(function e4() {
      var t3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, n3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
      p3(this, e4), this.high = t3, this.low = n3;
    }, [{ key: "equal", value: function(e4) {
      return null !== e4 && this.low === e4.low && this.high === e4.high;
    } }, { key: "toString", value: function() {
      var e4 = Number(this.high).toString(16), t3 = Number(this.low).toString(16);
      if (t3.length < 8)
        for (var n3 = 8 - t3.length; n3; )
          t3 = "0" + t3, n3--;
      return e4 + t3;
    } }]), ee3 = { TEST: { CHINA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, OVERSEA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, SINGAPORE: { DEFAULT: "wss://wsssgp-dev.im.qcloud.com" }, KOREA: { DEFAULT: "wss://wsskr-dev.im.qcloud.com" }, GERMANY: { DEFAULT: "wss://wssger-dev.im.qcloud.com" }, IND: { DEFAULT: "wss://wssind-dev.im.qcloud.com" }, JPN: { DEFAULT: "wss://wssjpn-dev.im.qcloud.com" }, USA: { DEFAULT: "wss://wssusa-dev.im.qcloud.com" }, INDONESIA: { DEFAULT: "wss://wssidn-dev.im.qcloud.com" } }, PRODUCTION: { CHINA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", IPV6: "wss://wssv6.im.qcloud.com", BACKUP: "wss://wss.tim.qq.com", BACKUP_WEB: "wss://*w4c.my-cpaas.com", STAT: "https://events.im.qcloud.com", ANYCAST: "wss://162.14.13.203" }, OVERSEA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", IPV6: "wss://wssv6.im.qcloud.com", BACKUP: "wss://wss.my-imcloud.com", BACKUP_WEB: "wss://*w4c.my-cpaas.com", STAT: "https://api.my-imcloud.com" }, SINGAPORE: { DEFAULT0: "wss://*w4s.my-imcloud.com", DEFAULT: "wss://wsssgp.im.qcloud.com", IPV6: "wss://wsssgpv6.im.qcloud.com", BACKUP: "wss://wsssgp.my-imcloud.com", BACKUP_WEB: "wss://*w4s.my-cpaas.com", STAT: "https://apisgp.my-imcloud.com", ANYCAST: "wss://162.14.19.159" }, KOREA: { DEFAULT0: "wss://*w4k.my-imcloud.com", DEFAULT: "wss://wsskr.im.qcloud.com", IPV6: "wss://wsskrv6.im.qcloud.com", BACKUP: "wss://wsskr.my-imcloud.com", BACKUP_WEB: "wss://*w4k.my-cpaas.com", STAT: "https://apikr.my-imcloud.com", ANYCAST: "wss://162.14.13.104" }, GERMANY: { DEFAULT0: "wss://*w4g.my-imcloud.com", DEFAULT: "wss://wssger.im.qcloud.com", IPV6: "wss://wssgerv6.im.qcloud.com", BACKUP: "wss://wssger.my-imcloud.com", BACKUP_WEB: "wss://*w4g.my-cpaas.com", STAT: "https://apiger.my-imcloud.com", ANYCAST: "wss://162.14.3.17" }, IND: { DEFAULT0: "wss://*w4i.my-imcloud.com", DEFAULT: "wss://wssind.my-imcloud.com", IPV6: "wss://wssindv6.im.qcloud.com", BACKUP: "wss://wssind.im.qcloud.com", BACKUP_WEB: "wss://*w4i.my-cpaas.com", STAT: "https://apiind.my-imcloud.com", ANYCAST: "wss://162.14.19.46" }, JPN: { DEFAULT0: "wss://*w4j.my-imcloud.com", DEFAULT: "wss://wssjpn.im.qcloud.com", IPV6: "wss://wssjpnv6.im.qcloud.com", BACKUP: "wss://wssjpn.my-imcloud.com", BACKUP_WEB: "wss://*w4j.my-cpaas.com", STAT: "https://apijpn.my-imcloud.com" }, USA: { DEFAULT0: "wss://*w4u.my-imcloud.com", DEFAULT: "wss://wssusa.im.qcloud.com", IPV6: "wss://wssusav6.im.qcloud.com", BACKUP: "wss://wssusa.my-imcloud.com", BACKUP_WEB: "wss://*w4u.my-cpaas.com", STAT: "https://apiusa.my-imcloud.com", ANYCAST: "wss://162.14.10.42" }, INDONESIA: { DEFAULT0: "wss://*w4y.my-imcloud.com", DEFAULT: "wss://wssidn.im.qcloud.com", IPV6: "wss://wssidnv6.im.qcloud.com", BACKUP: "wss://wssidn.my-imcloud.com", BACKUP_WEB: "wss://*w4y.my-cpaas.com", STAT: "https://apiidn.my-imcloud.com", ANYCAST: "wss://43.129.34.169" } } }, te3 = { ANDROID: 2, IOS: 3, MAC: 4, WEB: 7, WX_MP: 8, QQ_MP: 9, TT_MP: 10, BAIDU_MP: 11, ALI_MP: 12, IPAD: 13, UNI_NATIVE_APP: 15, DONUT_NATIVE_APP: 19, NS_NATIVE_APP: 20, RN_NATIVE_APP: 21 }, ne2 = "1.7.3", oe2 = 537048168, ae3 = "CHINA", a3 = { HOST: { CURRENT: { DEFAULT: "wss://wss.im.qcloud.com", STAT: "https://events.im.qcloud.com" }, setCurrent: function() {
      this.CURRENT = ee3.PRODUCTION[0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ae3];
    } }, NAME: { OPEN_IM: "openim", OPEN_IM_MSG_EXT: "openim_msg_ext_http_svc", GRP: "group_open_http_svc", GRP_AV: "group_open_avchatroom_http_svc", GRP_COMMUNITY: "million_group_open_http_svc", GRP_ATTR: "group_open_attr_http_svc", FD: "sns", PROFILE: "profile", RECENT_CONTACT: "recentcontact", PIC: "openpic", BIG_GRP_NO_AUTH: "group_open_http_noauth_svc", BIG_GRP_POLLING: "group_open_long_polling_http_svc", BIG_GRP_POLLING_NO_AUTH: "group_open_long_polling_http_noauth_svc", IM_OPEN_STAT: "imopenstat", WEB_IM: "webim", IM_COS_SIGN: "im_cos_sign_svr", CUSTOM_UPLOAD: "im_cos_msg", HEARTBEAT: "heartbeat", IM_OPEN_PUSH: "im_open_push", IM_OPEN_STATUS: "im_open_status", IM_LONG_MSG: "im_long_msg", IM_CONFIG_MANAGER: "im_sdk_config_mgr", STAT_SERVICE: "StatSvc", OVERLOAD_PUSH: "OverLoadPush", IM_MSG_AUDIT_MGR: "im_msg_audit_mgr", TUIROOM_SVR: "tui_room_svr", IM_OPEN_TRANSLATE: "im_open_translate", IM_OPEN_SPEECH: "im_open_speech", MSG_SEARCH: "message_search", GRP_SEARCH: "group_search", GRP_MEMBER_SEARCH: "group_member_search", USER_SEARCH: "user_search", FOLLOW: "follow", OFFLINE_PUSH_REPORT: "offline_push_report", IM_MSG_LOGIC: "im_msg_db_logic" } }, g2 = { SEARCH_GRP_SNS: new $3(0, Math.pow(2, 1)).toString(), AV_HISTORY_MSG: new $3(0, Math.pow(2, 2)).toString(), GRP_COMMUNITY: new $3(0, Math.pow(2, 3)).toString(), MSG_TO_SPECIFIED_GRP_MBR: new $3(0, Math.pow(2, 4)).toString(), AV_MBR_LIST: new $3(0, Math.pow(2, 6)).toString(), USER_STATUS: new $3(0, Math.pow(2, 7)).toString(), CONV_MARK: new $3(0, Math.pow(2, 9)).toString(), CONV_GROUP: new $3(0, Math.pow(2, 10)).toString(), AV_BAN_MBR: new $3(0, Math.pow(2, 11)).toString(), MSG_EXT: new $3(0, Math.pow(2, 13)).toString(), GRP_COUNTER: new $3(0, Math.pow(2, 15)).toString(), PLUGIN_TRANSLATE: new $3(Math.pow(2, 6)).toString(), PLUGIN_VOICE_TO_TEXT: new $3(Math.pow(2, 7)).toString(), PLUGIN_CS: new $3(Math.pow(2, 8)).toString(), PLUGIN_PUSH: new $3(Math.pow(2, 9)).toString(), PLUGIN_BOT: new $3(Math.pow(2, 10)).toString(), MSG_REACTION: new $3(Math.pow(2, 16)).toString(), FOLLOW: new $3(Math.pow(2, 20)).toString() }, se2 = "group_profile", re3 = ["Type", "Name", "Introduction", "Notification", "FaceUrl", "Owner_Account", "CreateTime", "InfoSeq", "LastInfoTime", "LastMsgTime", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "NextMsgSeq", "ShutUpAllMember", "InviteJoinOption"], ce3 = ["Role", "JoinTime", "MsgSeq", "MsgFlag"], ue2 = "web.sdk.qcloud.com", le2 = "web.sdk.cloud.tencent.cn", de2 = "web.sdk.tencent.cn";
    a3.HOST.setCurrent(ae3);
    for (var pe3, _e3 = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), he3 = _e3 && "function" == typeof wx$1.createGamePortal, ge2 = "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting), fe2 = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting), me2 = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting), ve3 = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting), n2 = "undefined" != typeof jd && "function" == typeof jd.getSystemInfoSync, Ie2 = "undefined" != typeof index && "undefined" == typeof window && "function" == typeof index.requireNativePlugin, o2 = _e3 && "object" === z2(wx$1.miniapp), Me3 = "undefined" != typeof index, v3 = _e3 || ge2 || fe2 || me2 || ve3 || Ie2 || n2, s3 = "undefined" == typeof window && !v3 && "undefined" != typeof commonjsGlobal && void 0 !== commonjsGlobal.NativeScriptGlobals, ye3 = "undefined" != typeof commonjsGlobal && (void 0 !== commonjsGlobal.nativeModuleProxy || void 0 !== commonjsGlobal.ReactNative), Ce3 = "undefined" != typeof index ? !v3 : "undefined" != typeof window && !v3 && !ye3, I2 = ge2 ? qq : fe2 ? tt : me2 ? swan : ve3 ? my : _e3 ? wx$1 : Ie2 ? index : n2 ? jd : {}, Te2 = Ce3 && window && window.navigator && window.navigator.userAgent || "", De3 = (n2 = "WEB", /(micromessenger|webbrowser)/i.test(Te2) ? n2 = "WEB" : ge2 ? n2 = "QQ_MP" : fe2 ? n2 = "TT_MP" : me2 ? n2 = "BAIDU_MP" : ve3 ? n2 = "ALI_MP" : _e3 ? n2 = o2 ? "DONUT_NATIVE_APP" : "WX_MP" : Ie2 ? n2 = "UNI_NATIVE_APP" : s3 ? n2 = "NS_NATIVE_APP" : ye3 && (n2 = "RN_NATIVE_APP"), te3[n2]), o2 = /iPad/i.test(Te2), s3 = /iPhone/i.test(Te2) && !o2, n2 = /iPod/i.test(Te2), Ee3 = s3 || o2 || n2, Le3 = (s3 = Te2.match(/OS (\d+)_/i)) && s3[1] ? s3[1] : null, Se3 = /Android/i.test(Te2), ke3 = (o2 = Te2.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i)) ? (n2 = o2[1] && parseFloat(o2[1]), s3 = o2[2] && parseFloat(o2[2]), n2 && s3 ? parseFloat(o2[1] + "." + o2[2]) : n2 || null) : null, s3 = /Edge/i.test(Te2), o2 = !s3 && /Chrome/i.test(Te2), Re2 = /MSIE/.test(Te2) || -1 < Te2.indexOf("Trident") && -1 < Te2.indexOf("rv:11.0"), Ae3 = n2 = !(n2 = (n2 = /MSIE\s(\d+)\.\d/.exec(Te2)) && parseFloat(n2[1])) && /Trident\/7.0/i.test(Te2) && /rv:11.0/.test(Te2) ? 11 : n2, n2 = /Safari/i.test(Te2) && !o2 && !Se3 && !s3, Oe2 = /Windows/i.test(Te2), Ne2 = /MAC OS X/i.test(Te2), Ge3 = Ce3 && "undefined" != typeof Worker && !Re2, Pe2 = Se3 || Ee3, Ue2 = Ce3 && void 0 !== window.tencent_cloud_im_csig_flutter_for_web_25F_cy, be2 = "undefined" != typeof window && void 0 !== window.navigator && (o2 = window.navigator.standalone, !(!Ee3 || o2 || n2)), we3 = "undefined" != typeof console ? console : "undefined" != typeof commonjsGlobal && commonjsGlobal.console ? commonjsGlobal.console : "undefined" != typeof window && window.console ? window.console : {}, Fe2 = function() {
    }, qe2 = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "group", "groupCollapsed", "groupEnd", "info", "log", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], xe2 = qe2.length; xe2--; )
      pe3 = qe2[xe2], console[pe3] || (we3[pe3] = Fe2);
    function Ve3() {
      var e4 = /* @__PURE__ */ new Date();
      return e4.setTime(Ye3()), e4;
    }
    function Be2() {
      We3 = 0;
    }
    function He2() {
      return Math.floor(Ye3() / 1e3);
    }
    var Ke3 = we3, We3 = 0, Ye3 = function() {
      return (/* @__PURE__ */ new Date()).getTime() + We3;
    }, je2 = 0;
    function Je3() {
      return en2() ? "%c Chat %c" : "Chat";
    }
    function ze3() {
      var e4 = Ve3();
      return e4.toLocaleTimeString("en-US", { hour12: false }) + "." + function(e5) {
        var t3;
        switch (e5.toString().length) {
          case 1:
            t3 = "00" + e5;
            break;
          case 2:
            t3 = "0" + e5;
            break;
          default:
            t3 = e5;
        }
        return t3;
      }(e4.getMilliseconds());
    }
    var M2 = { arguments2String: function(e4) {
      var t3 = "";
      if (1 === e4.length)
        t3 = e4[0];
      else
        for (var n3 = 0, o3 = e4.length; n3 < o3; n3++) {
          if (Tt2(e4[n3]))
            try {
              t3 += Dt2(e4[n3]) ? JSON.stringify(e4[n3], ["message", "code"]) : JSON.stringify(e4[n3]);
            } catch (e5) {
              t3 += e5 ? e5.message : "";
              break;
            }
          else
            t3 += e4[n3];
          t3 += " ";
        }
      return t3;
    }, _exec: function(e4, t3) {
      en2() ? Ke3[e4](Je3(), "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", ze3(), t3) : Ke3[e4]("".concat(Je3(), " ").concat(ze3(), " ").concat(t3));
    }, d: function() {
      var e4;
      je2 <= -1 && (e4 = this.arguments2String(arguments), this._exec("debug", e4));
    }, l: function() {
      var e4;
      je2 <= 0 && (e4 = this.arguments2String(arguments), this._exec("log", e4));
    }, log: function() {
      var e4;
      je2 <= 0 && (e4 = this.arguments2String(arguments), this._exec("log", e4));
    }, i: function() {
      var e4;
      je2 <= 1 && (e4 = this.arguments2String(arguments), this._exec("info", e4));
    }, w: function() {
      var e4;
      je2 <= 2 && (e4 = this.arguments2String(arguments), this._exec("warn", e4));
    }, e: function() {
      var e4;
      je2 <= 3 && (e4 = this.arguments2String(arguments), this._exec("error", e4));
    }, setLevel: function(e4) {
      e4 < 4 && this._exec("log", "set level from " + je2 + " to " + e4), je2 = e4;
    }, getLevel: function() {
      return je2;
    } }, Xe3 = { JPG: 1, JPEG: 1, GIF: 2, PNG: 3, BMP: 4, UNKNOWN: 255 }, s3 = "Tag_Profile_IM_", f3 = { NICK: "".concat(s3, "Nick"), GENDER: "".concat(s3, "Gender"), BIRTHDAY: "".concat(s3, "BirthDay"), LOCATION: "".concat(s3, "Location"), SELFSIGNATURE: "".concat(s3, "SelfSignature"), ALLOWTYPE: "".concat(s3, "AllowType"), LANGUAGE: "".concat(s3, "Language"), AVATAR: "".concat(s3, "Image"), MESSAGESETTINGS: "".concat(s3, "MsgSettings"), ADMINFORBIDTYPE: "".concat(s3, "AdminForbidType"), LEVEL: "".concat(s3, "Level"), ROLE: "".concat(s3, "Role") }, Ze3 = { GROUP: "".concat("Tag_SNS_IM_", "Group"), REMARK: "".concat("Tag_SNS_IM_", "Remark"), ADDSOURCE: "".concat("Tag_SNS_IM_", "AddSource"), ADDWORDING: "".concat("Tag_SNS_IM_", "Wording"), ADDTIME: "".concat("Tag_SNS_IM_", "AddTime") }, o2 = "Gender_Type_", Qe3 = { UNKNOWN: "".concat(o2, "Unknown"), FEMALE: "".concat(o2, "Female"), MALE: "".concat(o2, "Male") }, $e3 = { NONE: "".concat("AdminForbid_Type_", "None"), SEND_OUT: "".concat("AdminForbid_Type_", "SendOut") }, et3 = { NEED_CONFIRM: "".concat("AllowType_Type_", "NeedConfirm"), ALLOW_ANY: "".concat("AllowType_Type_", "AllowAny"), DENY_ANY: "".concat("AllowType_Type_", "DenyAny") }, nt3 = "JoinedSuccess", ot3 = "WaitAdminApproval", it3 = "@TOPIC#_", at3 = Object.prototype.hasOwnProperty;
    function S2(e4) {
      if (null == e4)
        return true;
      if ("boolean" == typeof e4)
        return false;
      if ("number" == typeof e4)
        return 0 === e4;
      if ("string" == typeof e4)
        return 0 === e4.length;
      if ("function" == typeof e4)
        return 0 === e4.length;
      if (Array.isArray(e4))
        return 0 === e4.length;
      if (e4 instanceof Error)
        return "" === e4.message;
      if (m3(e4)) {
        for (var t3 in e4)
          if (at3.call(e4, t3))
            return false;
        return true;
      }
      return !!(st3(e4) || rt3(e4) || ct3(e4)) && 0 === e4.size;
    }
    function st3(e4) {
      return "map" === Et3(e4);
    }
    function rt3(e4) {
      return "set" === Et3(e4);
    }
    function ct3(e4) {
      return "file" === Et3(e4);
    }
    function A2(e4) {
      return null !== e4 && ("number" == typeof e4 && !isNaN(+e4) || "object" === z2(e4) && e4.constructor === Number);
    }
    function ut3(e4) {
      return null !== e4 && "object" === z2(e4);
    }
    function m3(e4) {
      if ("object" === z2(e4) && null !== e4) {
        if (null === (e4 = Object.getPrototypeOf(e4)))
          return 1;
        for (var t3 = e4; null !== Object.getPrototypeOf(t3); )
          t3 = Object.getPrototypeOf(t3);
        return e4 === t3;
      }
    }
    function O2(e4) {
      return "function" == typeof Array.isArray ? Array.isArray(e4) : "array" === Et3(e4);
    }
    function lt3(e4) {
      return O2(e4) && 0 < e4.length;
    }
    function dt3(e4) {
      return "function" == typeof e4;
    }
    function pt3(e4) {
      return "filelist" === Et3(e4);
    }
    function _t2(e4) {
      return "string" == typeof e4 && (e4 = e4[0], !/[^a-zA-Z0-9]/.test(e4));
    }
    function ht3(e4, t3, n3, o3) {
      if (!Tt2(e4) || !Tt2(t3))
        return 0;
      for (var i4, a4 = 0, s4 = Object.keys(t3), r3 = 0, c4 = s4.length; r3 < c4; r3++)
        if (i4 = s4[r3], !(N2(t3[i4]) || n3 && n3.includes(i4)))
          if (Tt2(e4[i4]) && Tt2(t3[i4]))
            a4 += ht3(e4[i4], t3[i4], n3, o3);
          else {
            if (o3 && o3.includes(t3[i4]))
              continue;
            e4[i4] !== t3[i4] && (e4[i4] = t3[i4], a4 += 1);
          }
      return a4;
    }
    function gt3(e4, t3) {
      var n3, o3 = /* @__PURE__ */ new Map(), i4 = F2(e4.entries());
      try {
        for (i4.s(); !(n3 = i4.n()).done; ) {
          var a4 = j2(n3.value, 2), s4 = a4[0], r3 = a4[1];
          r3 && o3.set(s4, t3 ? JSON.stringify(r3) : JSON.parse(JSON.stringify(r3)));
        }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
      return o3;
    }
    function ft3(e4) {
      if (0 === e4.length)
        return 0;
      for (var t3 = 0, n3 = 0, o3 = "undefined" != typeof document && void 0 !== document.characterSet ? document.characterSet : "UTF-8"; void 0 !== e4[t3]; )
        n3 += e4[t3++].charCodeAt[t3] <= 255 ? 1 : false === o3 ? 3 : 2;
      return n3;
    }
    function mt3(e4) {
      return e4 = e4 || 99999999, Math.round(Math.random() * e4);
    }
    function vt3() {
      for (var e4 = "", t3 = 32; 0 < t3; --t3)
        e4 += Lt2[Math.floor(Math.random() * St3)];
      return e4;
    }
    function It2(e4, t3) {
      for (var n3 in e4)
        if (e4[n3] === t3)
          return 1;
    }
    function Mt2(e4) {
      return -1 === e4.indexOf("http://") || -1 === e4.indexOf("https://") ? "https://" + e4 : e4.replace(/https|http/, "https");
    }
    function yt3(e4) {
      if (0 === Object.getOwnPropertyNames(e4).length)
        return /* @__PURE__ */ Object.create(null);
      var t3, n3, o3 = Array.isArray(e4) ? [] : /* @__PURE__ */ Object.create(null);
      for (n3 in e4)
        null !== e4[n3] ? void 0 !== e4[n3] ? (t3 = z2(e4[n3]), 0 <= ["string", "number", "function", "boolean"].indexOf(t3) ? o3[n3] = e4[n3] : o3[n3] = yt3(e4[n3])) : o3[n3] = void 0 : o3[n3] = null;
      return o3;
    }
    var Ct3 = ["url"], C2 = function(e4) {
      return "string" == typeof e4;
    }, N2 = function(e4) {
      return void 0 === e4;
    }, Tt2 = function(e4) {
      return O2(e4) || ut3(e4);
    }, Dt2 = function(e4) {
      return e4 instanceof Error;
    }, Et3 = function(e4) {
      return Object.prototype.toString.call(e4).match(/^\[object (.*)\]$/)[1].toLowerCase();
    }, Lt2 = (Date.now || (Date.now = function() {
      return (/* @__PURE__ */ new Date()).getTime();
    }), "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), St3 = Lt2.length, kt2 = {};
    function Rt2(o3, e4) {
      var i4;
      return !(!O2(o3) || !O2(e4)) && (i4 = false, e4.forEach(function(e5) {
        var t3 = e5.key, e5 = e5.value, n3 = o3.find(function(e6) {
          return e6.key === t3;
        });
        n3 ? n3.value !== e5 && (n3.value = e5, i4 = true) : (o3.push({ key: t3, value: e5 }), i4 = true);
      }), i4);
    }
    function At2(e4) {
      return S2(e4) ? [] : e4.filter(function(e5) {
        return true === e5.isModified;
      });
    }
    function Ot2(e4) {
      if (m3(e4) && m3(e4.webhookInfo)) {
        var t3 = [];
        if (e4.webhookInfo.disableCloudMessagePreHook && t3.push("ForbidBeforeSendMsgCallback"), e4.webhookInfo.disableCloudMessagePostHook && t3.push("ForbidAfterSendMsgCallback"), 0 !== t3.length)
          return t3;
      }
    }
    function Nt2(e4) {
      return S2(e4) ? [] : e4.filter(function(e5) {
        return false === e5.isModified;
      });
    }
    function Gt2(e4) {
      return e4 === R2.GRP_AVCHATROOM;
    }
    function Pt2(e4) {
      var t3 = e4.type, e4 = e4.groupID;
      return t3 === R2.GRP_COMMUNITY || "".concat(e4).startsWith("@TGS#_") && !"".concat(e4).includes(it3);
    }
    function Ut2(e4) {
      return "".concat(e4).startsWith("@TGS#_") && "".concat(e4).includes(it3);
    }
    function bt3(e4) {
      return C2(e4) && e4.slice(0, 3) === R2.CONV_C2C;
    }
    function wt2(e4) {
      return C2(e4) && e4.slice(0, 5) === R2.CONV_GROUP;
    }
    function Ft2(e4) {
      return C2(e4) && e4 === R2.CONV_SYSTEM;
    }
    function qt2(t3, n3) {
      var o3 = {};
      return Object.keys(t3).forEach(function(e4) {
        o3[e4] = n3(t3[e4], e4);
      }), o3;
    }
    function xt2(o3) {
      return ye3 ? Promise.resolve({ width: 0, height: 0 }) : v3 ? new Promise(function(t3, e4) {
        I2.getImageInfo({ src: o3, success: function(e5) {
          t3({ width: e5.width, height: e5.height });
        }, fail: function() {
          t3({ width: 0, height: 0 });
        } });
      }) : Re2 && 9 === Ae3 ? Promise.resolve({ width: 0, height: 0 }) : new Promise(function(e4, t3) {
        var n3 = new Image();
        n3.onload = function() {
          e4({ width: this.width, height: this.height }), n3 = null;
        }, n3.onerror = function() {
          e4({ width: 0, height: 0 }), n3 = null;
        }, n3.src = o3;
      });
    }
    function Vt2() {
      function e4() {
        return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
      }
      return "".concat(e4() + e4()).concat(e4()).concat(e4()).concat(e4()).concat(e4()).concat(e4()).concat(e4());
    }
    function Bt2() {
      var e4 = Se3 ? "android" : Ee3 ? "ios" : Oe2 ? "windows" : Ne2 ? "mac" : "unknown";
      if (v3)
        try {
          var t3 = I2.getSystemInfoSync().platform;
          void 0 !== t3 && (e4 = t3);
        } catch (e5) {
        }
      return e4;
    }
    function Ht2(e4, t3) {
      e4 = e4.split("."), t3 = t3.split(".");
      for (var n3 = Math.max(e4.length, t3.length); e4.length < n3; )
        e4.push("0");
      for (; t3.length < n3; )
        t3.push("0");
      for (var o3 = 0; o3 < n3; o3++) {
        var i4 = parseInt(e4[o3]), a4 = parseInt(t3[o3]);
        if (a4 < i4)
          return 1;
        if (i4 < a4)
          return -1;
      }
      return 0;
    }
    function Kt2(e4) {
      var t3 = e4.originUrl, t3 = void 0 === t3 ? void 0 : t3, n3 = e4.originWidth, o3 = e4.originHeight, e4 = e4.min, e4 = void 0 === e4 ? 198 : e4, n3 = parseInt(n3), o3 = parseInt(o3), i4 = { url: void 0, width: 0, height: 0 };
      return (n3 <= o3 ? n3 : o3) <= e4 ? (i4.url = t3, i4.width = n3, i4.height = o3) : (o3 <= n3 ? (i4.width = Math.ceil(n3 * e4 / o3), i4.height = e4) : (i4.width = e4, i4.height = Math.ceil(o3 * e4 / n3)), o3 = t3 && -1 < t3.indexOf("?") ? "".concat(t3, "&") : "".concat(t3, "?"), i4.url = "".concat(o3, 198 === e4 ? "imageView2/3/w/198/h/198" : "imageView2/3/w/720/h/720")), N2(t3) ? W2(i4, Ct3) : i4;
    }
    function Wt2(e4) {
      var t3 = e4[2];
      e4[2] = e4[1], e4[1] = t3;
      for (var n3 = 0; n3 < e4.length; n3++)
        e4[n3].setType(n3);
    }
    function Yt2(e4) {
      e4 = e4.servcmd;
      return e4.slice(e4.indexOf(".") + 1);
    }
    function jt2(e4, t3) {
      return Math.round(Number(e4) * Math.pow(10, t3)) / Math.pow(10, t3);
    }
    function Jt2(e4, t3) {
      return e4.includes(t3);
    }
    function zt2(e4, t3) {
      return e4.includes(t3);
    }
    function Xt2(e4) {
      return e4.split(it3)[0];
    }
    function Zt2(e4, t3, n3) {
      if (N2(t3))
        return "";
      switch (e4) {
        case R2.MSG_TEXT:
          return t3.text;
        case R2.MSG_IMAGE:
          return n3 ? "[Image]" : "[图片]";
        case R2.MSG_LOCATION:
          return n3 ? "[Location]" : "[位置]";
        case R2.MSG_AUDIO:
          return n3 ? "[Voice]" : "[语音]";
        case R2.MSG_VIDEO:
          return n3 ? "[Video]" : "[视频]";
        case R2.MSG_FILE:
          return n3 ? "[File]" : "[文件]";
        case R2.MSG_CUSTOM:
          return n3 ? "[Custom Messages]" : "[自定义消息]";
        case R2.MSG_GRP_TIP:
          return n3 ? "[Group Notification]" : "[群提示消息]";
        case R2.MSG_GRP_SYS_NOTICE:
          return n3 ? "[Group System Message]" : "[群系统通知]";
        case R2.MSG_FACE:
          return n3 ? "[Animated Sticker]" : "[动画表情]";
        case R2.MSG_MERGER:
          return n3 ? "[Chat Record]" : "[聊天记录]";
        default:
          return "";
      }
    }
    function Qt2(e4) {
      return e4 === R2.MSG_TEXT || e4 === R2.MSG_CUSTOM || e4 === R2.MSG_LOCATION || e4 === R2.MSG_FACE;
    }
    function $t2(e4) {
      var t3 = [];
      if (C2(e4)) {
        var n3 = e4.length;
        if (0 !== n3)
          for (var o3 = n3 - 1; 0 <= o3; o3--)
            "1" === e4[o3] && t3.push(Math.pow(2, n3 - o3 - 1));
      }
      return t3;
    }
    function en2() {
      return !Re2 && !v3;
    }
    function tn2(e4) {
      return "the length of userIDList cannot exceed ".concat(e4);
    }
    function nn2(e4) {
      var t3;
      if (O2(e4) && 0 !== e4.length)
        return t3 = 0, e4.forEach(function(e5) {
          t3 += e5;
        }), t3.toFixed(0);
    }
    function on2(e4) {
      var t3;
      if (O2(e4) && 0 !== e4.length)
        return t3 = 0, e4.forEach(function(e5) {
          t3 += e5;
        }), (t3 / e4.length).toFixed(0);
    }
    function an2(e4, t3, n3) {
      var t3 = !(1 < arguments.length && void 0 !== t3) || t3, n3 = !(2 < arguments.length && void 0 !== n3) || n3, o3 = Date.now();
      return t3 ? n3 ? "".concat(o3 - e4, " ms") : "".concat(Math.round((o3 - e4) / 1e3), " s") : n3 ? o3 - e4 : Math.round((o3 - e4) / 1e3);
    }
    function sn2(e4) {
      return e4 && 1 < e4 ? true : false;
    }
    function rn2(e4, t3, n3, o3) {
      var i4, a4, s4;
      return void 0 === t3 || (i4 = true, t3.required && S2(e4) && (M2.e("[".concat(n3, '] Missing required params: "').concat(o3, '".')), i4 = false), S2(e4) || (a4 = Et3(e4)) === (s4 = t3.type.toLowerCase()) || "asyncfunction" === a4 && "function" === s4 || (M2.e("[".concat(n3, '] Invalid params: type check failed for "').concat(o3, '". Expected ').concat(t3.type, ".")), i4 = false), t3.validator && !t3.validator(e4, n3, o3) && (M2.e("[".concat(n3, '] Invalid params: custom validator check failed for "').concat(o3, '".')), i4 = false), i4);
    }
    function cn2(e4) {
      return !(!e4 || !(bt3(e4) || wt2(e4) || Ft2(e4)) && ((e4 = u2("InvalidConversationID", e4)) && M2.w(e4), 1));
    }
    function r2(e4) {
      "" !== e4.desc && "" !== u2("API_REFER") && M2.w("[".concat(e4.api, "] | ").concat(e4.paramName, " | ").concat(e4.desc, ", ").concat(u2("API_REFER")).concat(e4.api));
    }
    function un2() {
      return u2("StringRequiredLog");
    }
    function ln2(e4) {
      return u2("NonEmptyStringRequiredLog", e4);
    }
    function dn2() {
      return u2("NumberRequiredLog");
    }
    function pn2() {
      return u2("UndefinedNotAllowedLog");
    }
    function _n2() {
      return u2("FileRequiredLog");
    }
    function hn2() {
      return u2("FunctionRequiredLog");
    }
    function gn2() {
      return u2("ArrayRequiredLog");
    }
    function fn2() {
      return u2("NonEmptyArrayLog");
    }
    function mn2() {
      return u2("CallbackMissingLog");
    }
    function vn2() {
      return u2("PositiveIntegerRequiredLog");
    }
    function In2(e4, t3) {
      return u2("StringNotLongerThanLog", e4, t3);
    }
    function Mn2(e4, t3) {
      return u2("NumberGreaterThanLog", e4, t3);
    }
    function yn2(e4, t3) {
      return u2("NumberGreaterOrEqualLog", e4, t3);
    }
    function Cn2(e4) {
      return u2("KeyValueStringRequiredLog", e4);
    }
    function Tn2() {
      return u2("PlainObjectRequiredLog");
    }
    function Dn2() {
      return u2("NonEmptyContentRequiredLog");
    }
    function En2() {
      return u2("FileNotSelectedLog");
    }
    function Ln2() {
      return u2("MessageInstanceRequiredLog");
    }
    function Sn2() {
      return u2("NonAnonymousFunctionLog");
    }
    function kn2() {
      return u2("MessageExtensionNotAvailableLog");
    }
    function Rn2() {
      return u2("MessageReactionRequiredLog");
    }
    function An2(e4, t3) {
      return u2("ContainsUnsupportedTypeLog", e4, t3);
    }
    function On2(e4, t3, n3, o3) {
      var i4 = o3.allowUndefined, a4 = o3.allowEmpty, o3 = o3.maxLength;
      return N2(e4) ? !!i4 || (r2({ api: t3, paramName: n3, desc: pn2() }), false) : O2(e4) ? !(0 === e4.length && (r2({ api: t3, paramName: n3, desc: fn2() }), !a4) || o3 && e4.length > o3 && (r2({ api: t3, paramName: n3, desc: u2("MaximumArrayLengthLog", n3, o3) }), 1)) : (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    }
    function Nn2(e4, t3, n3, o3) {
      var i4 = o3.allowUndefined, a4 = o3.min, o3 = o3.max;
      return N2(e4) ? !!i4 || (r2({ api: t3, paramName: n3, desc: pn2() }), false) : A2(e4) ? A2(a4) && e4 < a4 ? (r2({ api: t3, paramName: n3, desc: 0 === a4 ? yn2(n3, a4) : Mn2(n3, a4 - 1) }), false) : !(A2(o3) && o3 < e4 && (r2({ api: t3, paramName: n3, desc: u2("MaximumNumberLog", n3, o3) }), 1)) : (r2({ api: t3, paramName: n3, desc: dn2() }), false);
    }
    function T2(e4) {
      return { code: 0, data: e4 || {} };
    }
    function D2(e4) {
      return Promise.resolve(T2(e4));
    }
    function E2(e4) {
      var t3, n3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1];
      return e4 instanceof L2 ? (n3 && null !== Kn2 && Kn2.emit(h3.ERROR, e4), Promise.reject(e4)) : e4 instanceof Error ? (t3 = new L2({ code: k2.UNCAUGHT_ERROR }), n3 && null !== Kn2 && Kn2.emit(h3.ERROR, t3), Promise.reject(t3)) : N2(e4) || N2(e4.code) ? Promise.reject(new L2({ code: k2.UNCAUGHT_ERROR })) : (t3 = new L2(e4), n3 && null !== Kn2 && Kn2.emit(h3.ERROR, t3), Promise.reject(t3));
    }
    var Gn2 = "unSend", Pn2 = "success", Un2 = "fail", bn2 = "notStart", wn2 = "pending", Fn2 = "resolved", qn2 = "rejected", n2 = { type: "String", required: true }, s3 = { type: "Array", required: true }, o2 = { type: "Object", required: true }, xn2 = { type: "Boolean", required: true }, c3 = { type: "number", required: true }, Vn2 = { keywordListForMsg: { type: "Array", required: false, validator: function(e4, t3, n3) {
      return On2(e4, t3, n3, { allowUndefined: true, allowEmpty: true, maxLength: 5 });
    } }, keywordListExceptMsg: { type: "Array", required: true, validator: function(e4, t3, n3) {
      return On2(e4, t3, n3, { allowUndefined: false, allowEmpty: false, maxLength: 5 });
    } }, keywordListMatchType: { type: "String", required: false, validator: function(e4, t3, n3) {
      return !e4 || "or" === e4 || "and" === e4 || r2({ api: t3, paramName: n3, desc: "".concat(e4, " is invalid match type") });
    } }, cursor: { type: "String", required: false }, count: { type: "Number", required: false, validator: function(e4, t3, n3) {
      return Nn2(e4, t3, n3, { allowUndefined: true, min: 1, max: 100 });
    } }, groupTypeList: { type: "Array", required: false, validator: function(e4, t3, n3) {
      var o3;
      return !e4 || !(!On2(e4, t3, n3, { allowUndefined: true, allowEmpty: true }) || (o3 = [R2.GRP_PUBLIC, R2.GRP_COMMUNITY, R2.GRP_WORK, R2.GRP_MEETING], 0 < e4.filter(function(e5) {
        return -1 === o3.indexOf(e5);
      }).length && (r2({ api: t3, paramName: n3, desc: An2(n3, "group") }), 1)));
    } } }, u2 = null, Bn2 = { hookGetAPITips: function(e4) {
      u2 = e4;
    }, login: { userID: n2, userSig: n2 }, addToBlacklist: { userIDList: s3 }, removeFromBlacklist: { userIDList: s3 }, on: [{ name: "eventName", type: "String", validator: function(e4, t3, n3) {
      return "string" == typeof e4 && 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: ln2(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e4, t3, n3) {
      return "function" != typeof e4 ? (r2({ api: t3, paramName: n3, desc: hn2() }), false) : ("" === e4.name && r2({ api: t3, paramName: n3, desc: Sn2() }), true);
    } }], once: [{ name: "eventName", type: "String", validator: function(e4, t3, n3) {
      return "string" == typeof e4 && 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: ln2(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e4, t3, n3) {
      return "function" != typeof e4 ? (r2({ api: t3, paramName: n3, desc: hn2() }), false) : ("" === e4.name && r2({ api: t3, paramName: n3, desc: Sn2() }), true);
    } }], off: [{ name: "eventName", type: "String", validator: function(e4, t3, n3) {
      return "string" == typeof e4 && 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: ln2(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e4, t3, n3) {
      return "function" != typeof e4 ? (r2({ api: t3, paramName: n3, desc: hn2() }), false) : ("" === e4.name && r2({ api: t3, paramName: n3, desc: Sn2() }), true);
    } }], sendMessage: [y2({ name: "message" }, o2)], setMessageExtensions: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return e4.status === Pn2 && true === e4.isSupportExtension || (r2({ api: t3, paramName: n3, desc: kn2() }), false);
    } }), y2({ name: "extensions" }, s3)], getMessageExtensions: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return e4.status === Pn2 && true === e4.isSupportExtension || (r2({ api: t3, paramName: n3, desc: kn2() }), false);
    } })], deleteMessageExtensions: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return e4.status === Pn2 && true === e4.isSupportExtension || (r2({ api: t3, paramName: n3, desc: kn2() }), false);
    } })], addMessageReaction: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return e4.status === Pn2 || (r2({ api: t3, paramName: n3, desc: Rn2() }), false);
    } }), y2({ name: "reactionID" }, n2)], removeMessageReaction: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return e4.status === Pn2 || (r2({ api: t3, paramName: n3, desc: Rn2() }), false);
    } }), y2({ name: "reactionID" }, n2)], getMessageReactions: { messageList: y2({}, s3) }, getAllUserListOfMessageReaction: { message: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return e4.status === Pn2 || (r2({ api: t3, paramName: n3, desc: Rn2() }), false);
    } }), reactionID: y2({}, n2), nextSeq: { type: "Number" }, count: { type: "Number" } }, getMessageList: { conversationID: y2(y2({}, n2), {}, { validator: cn2 }), nextReqMessageID: { type: "String" }, count: { type: "Number", validator: function(e4, t3, n3) {
      return !(!N2(e4) && !/^[1-9][0-9]*$/.test(e4) && (r2({ api: t3, paramName: n3, desc: vn2() }), 1));
    } } }, getMessageListHopping: { conversationID: y2(y2({}, n2), {}, { validator: cn2 }), sequence: { type: "Number" }, time: { type: "Number" }, direction: { type: "Number", validator: function(e4, t3, n3) {
      return !(!N2(e4) && 0 !== e4 && 1 !== e4 && (r2({ api: t3, paramName: n3, desc: u2("0Or1RequiredLog") }), 1));
    } }, count: { type: "Number", validator: function(e4, t3, n3) {
      return !(!N2(e4) && !/^[1-9][0-9]*$/.test(e4) && (r2({ api: t3, paramName: n3, desc: vn2 }), 1));
    } } }, setMessageRead: { conversationID: y2(y2({}, n2), {}, { validator: cn2 }) }, setAllMessageRead: { scope: { type: "String", required: false, validator: function(e4, t3, n3) {
      return !e4 || -1 !== [R2.READ_ALL_C2C_MSG, R2.READ_ALL_GROUP_MSG, R2.READ_ALL_MSG].indexOf(e4) || (r2({ api: t3, paramName: n3, desc: u2("ValidScopeRequired") }), false);
    } } }, getConversationProfile: [y2(y2({ name: "conversationID" }, n2), {}, { validator: cn2 })], clearHistoryMessage: [y2(y2({ name: "conversationID" }, n2), {}, { validator: cn2 })], pinConversation: { conversationID: y2(y2({}, n2), {}, { validator: cn2 }), isPinned: y2({}, xn2) }, setConversationDraft: { conversationID: y2(y2({}, n2), {}, { validator: cn2 }), draftText: { type: "String", validator: function(e4, t3, n3) {
      return !!C2(e4) || (r2({ api: t3, paramName: n3, desc: un2() }), false);
    } } }, setConversationCustomData: { conversationIDList: y2({}, s3), customData: { type: "String", validator: function(e4, t3, n3) {
      return C2(e4) ? !(256 < e4.length && (r2({ api: t3, paramName: n3, desc: In2(n3, 256) }), 1)) : (r2({ api: t3, paramName: n3, desc: un2() }), false);
    } } }, markConversation: { conversationIDList: y2({}, s3), markType: { type: "number", validator: function(e4, t3, n3) {
      return A2(e4) ? e4 <= 0 ? (r2({ api: t3, paramName: n3, desc: Mn2(n3, 0) }), false) : !(e4 >= Math.pow(2, 64) && (r2({ api: t3, paramName: n3, desc: u2("NumberLessThanLog", n3, "Math.pow(2,64)") }), 1)) : (r2({ api: t3, paramName: n3, desc: dn2() }), false);
    } }, enableMark: y2({}, xn2) }, createConversationGroup: { conversationIDList: y2({}, s3), groupName: y2(y2({}, n2), {}, { validator: function(e4, t3, n3) {
      return !(!e4 || 32 < e4.length && (r2({ api: t3, paramName: n3, desc: In2(n3, 32) }), 1));
    } }) }, deleteConversationGroup: [y2({ name: "groupName" }, n2)], renameConversationGroup: { oldName: y2({}, n2), newName: y2(y2({}, n2), {}, { validator: function(e4, t3, n3) {
      return !(!e4 || 32 < e4.length && (r2({ api: t3, paramName: n3, desc: In2(n3, 32) }), 1));
    } }) }, addConversationsToGroup: { conversationIDList: y2({}, s3), groupName: y2({}, n2) }, deleteConversationsFromGroup: { conversationIDList: y2({}, s3), groupName: y2({}, n2) }, getGroupList: { groupProfileFilter: { type: "Array" } }, getGroupProfile: { groupID: n2, groupCustomFieldFilter: { type: "Array" }, memberCustomFieldFilter: { type: "Array" } }, getGroupProfileAdvance: { groupIDList: s3 }, createGroup: { name: n2 }, joinGroup: { groupID: n2, type: { type: "String" }, applyMessage: { type: "String" } }, quitGroup: [y2({ name: "groupID" }, n2)], handleApplication: { message: o2, handleAction: n2, handleMessage: { type: "String" } }, changeGroupOwner: { groupID: n2, newOwnerID: n2 }, updateGroupProfile: { groupID: n2, muteAllMembers: { type: "Boolean" } }, dismissGroup: [y2({ name: "groupID" }, n2)], searchGroupByID: [y2({ name: "groupID" }, n2)], getGroupOnlineMemberCount: [y2({ name: "groupID" }, n2)], initGroupAttributes: { groupID: n2, groupAttributes: y2(y2({}, o2), {}, { validator: function(t3, n3, o3) {
      var i4 = true;
      return Object.keys(t3).forEach(function(e4) {
        if (!C2(t3[e4]))
          return r2({ api: n3, paramName: o3, desc: Cn2("value") }), i4 = false;
      }), i4;
    } }) }, setGroupAttributes: { groupID: n2, groupAttributes: y2(y2({}, o2), {}, { validator: function(t3, n3, o3) {
      var i4 = true;
      return Object.keys(t3).forEach(function(e4) {
        if (!C2(t3[e4]))
          return r2({ api: n3, paramName: o3, desc: Cn2("value") }), i4 = false;
      }), i4;
    } }) }, deleteGroupAttributes: { groupID: n2, keyList: { type: "Array", validator: function(e4, t3, n3) {
      var o3;
      return N2(e4) || !O2(e4) ? (r2({ api: t3, paramName: n3, desc: gn2() }), false) : !!S2(e4) || (o3 = true, e4.forEach(function(e5) {
        if (!C2(e5))
          return r2({ api: t3, paramName: n3, desc: u2("StringArrayRequiredLog") }), o3 = false;
      }), o3);
    } } }, getGroupAttributes: { groupID: n2, keyList: { type: "Array", validator: function(e4, t3, n3) {
      var o3;
      return N2(e4) || !O2(e4) ? (r2({ api: t3, paramName: n3, desc: gn2() }), false) : !!S2(e4) || (o3 = true, e4.forEach(function(e5) {
        if (!C2(e5))
          return r2({ api: t3, paramName: n3, desc: Cn2("key") }), o3 = false;
      }), o3);
    } } }, setGroupCounters: { groupID: n2, counters: o2 }, increaseGroupCounter: { groupID: n2, key: n2, value: c3 }, decreaseGroupCounter: { groupID: n2, key: n2, value: c3 }, getGroupCounters: { groupID: n2 }, getGroupMemberList: { groupID: n2, count: { type: "Number" } }, getGroupMemberProfile: { groupID: n2, userIDList: s3, memberCustomFieldFilter: { type: "Array" } }, addGroupMember: { groupID: n2, userIDList: s3 }, setGroupMemberRole: { groupID: n2, userID: n2, role: n2 }, setGroupMemberMuteTime: { groupID: n2, userID: n2, muteTime: { type: "Number", validator: function(e4) {
      return 0 <= e4;
    } } }, setGroupMemberNameCard: { groupID: n2, userID: { type: "String" }, nameCard: { type: "String", validator: function(e4, t3, n3) {
      return C2(e4) ? (e4.length, true) : (r2({ api: t3, paramName: n3, desc: un2() }), false);
    } } }, setGroupMemberCustomField: { groupID: n2, userID: { type: "String" }, memberCustomField: s3 }, deleteGroupMember: { groupID: n2 }, markGroupMemberList: { groupID: n2, markType: { type: "number", validator: function(e4, t3, n3) {
      return A2(e4) ? !(e4 < 1e3 && (r2({ api: t3, paramName: n3, desc: yn2(n3, 1e3) }), 1)) : (r2({ api: t3, paramName: n3, desc: dn2() }), false);
    } }, userIDList: y2({}, s3), enableMark: y2({}, xn2) }, createTextMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? C2(e4.text) ? 0 !== e4.text.length || (r2({ api: t3, paramName: "payload.text", desc: Dn2() }), false) : (r2({ api: t3, paramName: "payload.text", desc: un2() }), false) : (r2({ api: t3, paramName: n3, desc: Tn2() }), false);
    } }) }, createTextAtMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? C2(e4.text) ? 0 === e4.text.length ? (r2({ api: t3, paramName: "payload.text", desc: Dn2() }), false) : !(e4.atUserList && !O2(e4.atUserList) && (r2({ api: t3, paramName: "payload.atUserList", desc: gn2() }), 1)) : (r2({ api: t3, paramName: "payload.text", desc: un2() }), false) : (r2({ api: t3, paramName: n3, desc: Tn2() }), false);
    } }) }, createCustomMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? e4.data && !C2(e4.data) ? (r2({ api: t3, paramName: "payload.data", desc: un2() }), false) : e4.description && !C2(e4.description) ? (r2({ api: t3, paramName: "payload.description", desc: un2() }), false) : !(e4.extension && !C2(e4.extension) && (r2({ api: t3, paramName: "payload.extension", desc: un2() }), 1)) : (r2({ api: t3, paramName: "payload", desc: Tn2() }), false);
    } }) }, createImageMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      if (!m3(e4))
        return r2({ api: t3, paramName: n3, desc: Tn2() }), false;
      if (N2(e4.file))
        return r2({ api: t3, paramName: "payload.file", desc: pn2() }), false;
      if (Ce3) {
        if (!(e4.file instanceof HTMLInputElement || ct3(e4.file)))
          return m3(e4.file) && "undefined" != typeof index ? 0 !== e4.file.tempFilePaths.length && 0 !== e4.file.tempFiles.length || (r2({ api: t3, paramName: "payload.file", desc: En2() }), false) : (r2({ api: t3, paramName: "payload.file", desc: _n2() }), false);
        if (e4.file instanceof HTMLInputElement && 0 === e4.file.files.length)
          return r2({ api: t3, paramName: "payload.file", desc: En2() }), false;
      }
      return true;
    }, onProgress: { type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: mn2() }), true;
    } } }) }, createAudioMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return !!m3(e4) || (r2({ api: t3, paramName: n3, desc: Tn2() }), false);
    } }), onProgress: { type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: mn2() }), true;
    } } }, createVideoMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      if (!m3(e4))
        return r2({ api: t3, paramName: n3, desc: Tn2() }), false;
      if (N2(e4.file))
        return r2({ api: t3, paramName: "payload.file", desc: pn2() }), false;
      if (Ce3) {
        if (!(e4.file instanceof HTMLInputElement || ct3(e4.file)))
          return m3(e4.file) && "undefined" != typeof index ? !!ct3(e4.file.tempFile) || (r2({ api: t3, paramName: "payload.file", desc: En2() }), false) : (r2({ api: t3, paramName: "payload.file", desc: _n2() }), false);
        if (e4.file instanceof HTMLInputElement && 0 === e4.file.files.length)
          return r2({ api: t3, paramName: "payload.file", desc: En2() }), false;
      }
      return true;
    } }), onProgress: { type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: mn2() }), true;
    } } }, createFaceMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? A2(e4.index) ? !!C2(e4.data) || (r2({ api: t3, paramName: "payload.data", desc: un2() }), false) : (r2({ api: t3, paramName: "payload.index", desc: dn2() }), false) : (r2({ api: t3, paramName: n3, desc: Tn2() }), false);
    } }) }, createFileMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      if (!m3(e4))
        return r2({ api: t3, paramName: n3, desc: Tn2() }), false;
      if (N2(e4.file))
        return r2({ api: t3, paramName: "payload.file", desc: pn2() }), false;
      if (Ce3) {
        if (!(e4.file instanceof HTMLInputElement || ct3(e4.file)))
          return m3(e4.file) && "undefined" != typeof index ? 0 !== e4.file.tempFilePaths.length && 0 !== e4.file.tempFiles.length || (r2({ api: t3, paramName: "payload.file", desc: En2() }), false) : (r2({ api: t3, paramName: "payload.file", desc: _n2() }), false);
        if (e4.file instanceof HTMLInputElement && 0 === e4.file.files.length)
          return r2({ api: t3, paramName: "payload.file", desc: En2() }), false;
      }
      return true;
    } }), onProgress: { type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: mn2() }), true;
    } } }, createLocationMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? C2(e4.description) ? A2(e4.longitude) ? !!A2(e4.latitude) || (r2({ api: t3, paramName: "payload.latitude", desc: dn2() }), false) : (r2({ api: t3, paramName: "payload.longitude", desc: dn2() }), false) : (r2({ api: t3, paramName: "payload.description", desc: un2() }), false) : (r2({ api: t3, paramName: n3, desc: Tn2() }), false);
    } }) }, createMergerMessage: { to: n2, conversationType: n2, payload: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      var o3;
      return S2(e4.messageList) ? (r2({ api: t3, paramName: "payload.messageList", desc: fn2() }), false) : S2(e4.compatibleText) ? (r2({ api: t3, paramName: "payload.compatibleText", desc: ln2("compatibleText") }), false) : (o3 = false, e4.messageList.forEach(function(e5) {
        e5.status === Un2 && (o3 = true);
      }), !o3 || (r2({ api: t3, paramName: "payload.messageList", desc: u2("MergeFailedMessageLog") }), false));
    } }) }, revokeMessage: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return S2(e4) ? (r2({ api: t3, paramName: n3, desc: Ln2() }), false) : e4.conversationType === R2.CONV_SYSTEM ? (r2({ api: t3, paramName: n3, desc: u2("MessageCanBeRevokedDesc") }), false) : true !== e4.isRevoked || (r2({ api: t3, paramName: n3, desc: u2("MessageRevokedLog") }), false);
    } })], deleteMessage: [y2(y2({ name: "messageList" }, s3), {}, { validator: function(e4, t3, n3) {
      return !S2(e4) || (r2({ api: t3, paramName: n3, desc: fn2() }), false);
    } })], translateText: { sourceTextList: s3, sourceLanguage: n2, targetLanguage: n2 }, convertVoiceToText: { message: y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return S2(e4) ? (r2({ api: t3, paramName: n3, desc: Ln2() }), false) : e4.type === R2.MSG_AUDIO && e4.status === Pn2 || (r2({ api: t3, paramName: n3, desc: u2("AudioMessageRequiredLog") }), false);
    } }) }, modifyMessage: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return S2(e4) ? (r2({ api: t3, paramName: n3, desc: Ln2() }), false) : e4.conversationType === R2.CONV_SYSTEM ? (r2({ api: t3, paramName: n3, desc: u2("MessageCanBeModifiedLog") }), false) : true !== e4._onlineOnlyFlag || (r2({ api: t3, paramName: n3, desc: u2("OnlineMessageNotSupportLog") }), false);
    } })], searchCloudMessages: { keywordList: Vn2.keywordListForMsg, keywordListMatchType: Vn2.keywordListMatchType, cursor: Vn2.cursor, senderUserIDList: { type: "Array", required: false, validator: function(e4, t3, n3) {
      return On2(e4, t3, n3, { allowUndefined: true, allowEmpty: true, maxLength: 5 });
    } }, messageTypeList: { type: "Array", required: false, validator: function(e4, t3, n3) {
      var o3;
      return !e4 || !(!On2(e4, t3, n3, { allowUndefined: true, allowEmpty: true }) || (o3 = [R2.MSG_TEXT, R2.MSG_IMAGE, R2.MSG_AUDIO, R2.MSG_FILE, R2.MSG_VIDEO, R2.MSG_LOCATION, R2.MSG_CUSTOM, R2.MSG_MERGER], 0 < e4.filter(function(e5) {
        return -1 === o3.indexOf(e5);
      }).length && (r2({ api: t3, paramName: n3, desc: An2(n3, "message") }), 1)));
    } }, conversationID: { type: "String", required: false, validator: function(e4) {
      return !e4 || cn2(e4);
    } }, timePosition: { type: "number", required: false, validator: function(e4, t3, n3) {
      return Nn2(e4, t3, n3, { allowUndefined: true, min: 0 });
    } }, timePeriod: { type: "number", required: false, validator: function(e4, t3, n3) {
      return Nn2(e4, t3, n3, { allowUndefined: true, min: 0 });
    } } }, searchCloudUsers: { keywordList: Vn2.keywordListExceptMsg, keywordListMatchType: Vn2.keywordListMatchType, cursor: Vn2.cursor, count: Vn2.count, miniBirthday: { type: "Number", required: false, validator: function(e4, t3, n3) {
      return Nn2(e4, t3, n3, { allowUndefined: true, min: 0 });
    } }, maxBirthday: { type: "Number", required: false, validator: function(e4, t3, n3) {
      return Nn2(e4, t3, n3, { allowUndefined: true, min: 0 });
    } }, gender: { type: "String", required: false, validator: function(e4, t3, n3) {
      return !e4 || e4 === R2.GENDER_FEMALE || e4 === R2.GENDER_MALE || r2({ api: t3, paramName: n3, desc: "".concat(e4, " is invalid match type") });
    } } }, searchCloudGroups: { keywordList: Vn2.keywordListExceptMsg, keywordListMatchType: Vn2.keywordListMatchType, cursor: Vn2.cursor, count: Vn2.count, groupTypeList: Vn2.groupTypeList }, searchCloudGroupMembers: { keywordList: Vn2.keywordListExceptMsg, keywordListMatchType: Vn2.keywordListMatchType, cursor: Vn2.cursor, count: Vn2.count, groupTypeList: Vn2.groupTypeList, groupIDList: { type: "Array", required: false, validator: function(e4, t3, n3) {
      return On2(e4, t3, n3, { allowUndefined: true, allowEmpty: true });
    } } }, getUserProfile: { userIDList: { type: "Array", validator: function(e4, t3, n3) {
      return O2(e4) ? (0 === e4.length && r2({ api: t3, paramName: n3, desc: fn2() }), true) : (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, updateMyProfile: { profileCustomField: { type: "Array", validator: function(e4, t3, n3) {
      return !!N2(e4) || !!O2(e4) || (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, setSelfStatus: { customStatus: { type: "String", validator: function(e4, t3, n3) {
      return !!C2(e4) || (r2({ api: t3, paramName: n3, desc: un2() }), false);
    } } }, getUserStatus: { userIDList: { type: "Array", validator: function(e4, t3, n3) {
      return O2(e4) ? 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: fn2() }), false) : (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, subscribeUserStatus: { userIDList: { type: "Array", validator: function(e4, t3, n3) {
      return O2(e4) ? 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: fn2() }), false) : (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, unsubscribeUserStatus: { userIDList: { type: "Array", validator: function(e4, t3, n3) {
      return !e4 || !!O2(e4) || (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, addFriend: { to: n2, source: { type: "String", required: true, validator: function(e4, t3, n3) {
      return !(!e4 || (e4.startsWith("AddSource_Type_") ? 8 < e4.replace("AddSource_Type_", "").length && (r2({ api: t3, paramName: n3, desc: In2("keyword", 8) }), 1) : (r2({ api: t3, paramName: n3, desc: u2("SourcePrefixLog") }), 1)));
    } }, remark: { type: "String", required: false, validator: function(e4, t3, n3) {
      return !(C2(e4) && 96 < e4.length && (r2({ api: t3, paramName: n3, desc: In2(n3, 96) }), 1));
    } } }, deleteFriend: { userIDList: s3 }, checkFriend: { userIDList: s3 }, getFriendProfile: { userIDList: s3 }, updateFriend: { userID: n2, remark: { type: "String", required: false, validator: function(e4, t3, n3) {
      return !(C2(e4) && 96 < e4.length && (r2({ api: t3, paramName: n3, desc: In2(n3, 96) }), 1));
    } }, friendCustomField: { type: "Array", required: false, validator: function(e4, t3, n3) {
      var o3;
      return !e4 || (O2(e4) ? (o3 = true, e4.forEach(function(e5) {
        return C2(e5.key) && -1 !== e5.key.indexOf("Tag_SNS_Custom") ? C2(e5.value) ? 8 < e5.key.replace("Tag_SNS_Custom_", "").length ? (r2({ api: t3, paramName: n3, desc: In2("keyword", 8) }), o3 = false) : void 0 : (r2({ api: t3, paramName: n3, desc: Cn2("value") }), o3 = false) : (r2({ api: t3, paramName: n3, desc: u2("FriendCustomFieldPrefixLog") }), o3 = false);
      }), o3) : (r2({ api: t3, paramName: n3, desc: gn2() }), false));
    } } }, acceptFriendApplication: { userID: n2 }, refuseFriendApplication: { userID: n2 }, deleteFriendApplication: { userID: n2 }, createFriendGroup: { name: n2 }, deleteFriendGroup: { name: n2 }, addToFriendGroup: { name: n2, userIDList: s3 }, removeFromFriendGroup: { name: n2, userIDList: s3 }, renameFriendGroup: { oldName: n2, newName: n2 }, sendMessageReadReceipt: [{ name: "messageList", type: "Array", validator: function(e4, t3, n3) {
      return O2(e4) ? 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: fn2() }), false) : (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } }], getMessageReadReceiptList: [{ name: "messageList", type: "Array", validator: function(e4, t3, n3) {
      return O2(e4) ? 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: fn2() }), false) : (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } }], createTopicInCommunity: { groupID: n2, topicName: n2 }, deleteTopicFromCommunity: { groupID: n2, topicIDList: { type: "Array", validator: function(e4, t3, n3) {
      return !e4 || !!O2(e4) || (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, updateTopicProfile: { groupID: n2, topicID: n2 }, getTopicList: { groupID: n2, topicIDList: { type: "Array", validator: function(e4, t3, n3) {
      return !e4 || !!O2(e4) || (r2({ api: t3, paramName: n3, desc: gn2() }), false);
    } } }, followUser: [y2({ name: "userIDList" }, s3)], unfollowUser: [y2({ name: "userIDList" }, s3)], getMyFollowingList: [y2(y2({ name: "startIndex" }, n2), {}, { required: false })], getMyFollowersList: [y2(y2({ name: "startIndex" }, n2), {}, { required: false })], getMutualFollowersList: [y2(y2({ name: "startIndex" }, n2), {}, { required: false })], getUserFollowInfo: [y2(y2({ name: "userIDList" }, s3), {}, { required: false })], checkFollowType: [y2({ name: "userIDList" }, s3)], addSignalingListener: [{ name: "eventName", type: "String", validator: function(e4, t3, n3) {
      return "string" == typeof e4 && 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: ln2(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e4, t3, n3) {
      return "function" != typeof e4 ? (r2({ api: t3, paramName: n3, desc: hn2() }), false) : ("" === e4.name && r2({ api: t3, paramName: n3, desc: Sn2() }), true);
    } }], removeSignalingListener: [{ name: "eventName", type: "String", validator: function(e4, t3, n3) {
      return "string" == typeof e4 && 0 !== e4.length || (r2({ api: t3, paramName: n3, desc: ln2(n3) }), false);
    } }, { name: "handler", type: "Function", validator: function(e4, t3, n3) {
      return "function" != typeof e4 ? (r2({ api: t3, paramName: n3, desc: hn2() }), false) : ("" === e4.name && r2({ api: t3, paramName: n3, desc: Sn2() }), true);
    } }], invite: { userID: n2 }, inviteSync: [y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? !!C2(e4.userID) || (r2({ api: t3, paramName: "options.userID", desc: un2() }), false) : (r2({ api: t3, paramName: "options", desc: Tn2() }), false);
    } }), { name: "successCb", type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: hn2() }), true;
    } }, { name: "errorCb", type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: hn2() }), true;
    } }], inviteInGroup: { groupID: n2, inviteeList: s3 }, inviteInGroupSync: [y2(y2({}, o2), {}, { validator: function(e4, t3, n3) {
      return m3(e4) ? C2(e4.groupID) ? !!O2(e4.inviteeList) || (r2({ api: t3, paramName: "options.inviteeList", desc: gn2() }), false) : (r2({ api: t3, paramName: "options.groupID", desc: un2() }), false) : (r2({ api: t3, paramName: "options", desc: Tn2() }), false);
    } }), { name: "successCb", type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: hn2() }), true;
    } }, { name: "errorCb", type: "Function", required: false, validator: function(e4, t3, n3) {
      return N2(e4) && r2({ api: t3, paramName: n3, desc: hn2() }), true;
    } }], accept: { inviteID: n2 }, reject: { inviteID: n2 }, getSignalingInfo: [y2(y2({ name: "message" }, o2), {}, { validator: function(e4, t3, n3) {
      return !S2(e4) || (r2({ api: t3, paramName: n3, desc: Ln2() }), false);
    } })], modifyInvitation: { inviteID: n2, data: n2 } }, Hn2 = { login: 1, logout: 1, getLoginUser: 1, getServerTime: 1, on: 1, once: 1, off: 1, setLogLevel: 1, registerPlugin: 1, destroy: 1, isReady: 1, createTextMessage: 1, createTextAtMessage: 1, createImageMessage: 1, createAudioMessage: 1, createVideoMessage: 1, createCustomMessage: 1, createFaceMessage: 1, createFileMessage: 1, createLocationMessage: 1, createMergerMessage: 1, downloadMergerMessage: 1, createForwardMessage: 1, sendMessage: 1, resendMessage: 1, revokeMessage: 1, deleteMessage: 1, translateText: 1, convertVoiceToText: 1, modifyMessage: 1, sendMessageReadReceipt: 1, getGroupMessageReadMemberList: 1, getMessageReadReceiptList: 1, setMessageExtensions: 1, getMessageExtensions: 1, deleteMessageExtensions: 1, addMessageReaction: 1, removeMessageReaction: 1, getMessageReactions: 1, getAllUserListOfMessageReaction: 1, getMessageList: 1, findMessage: 1, getMessageListHopping: 1, setMessageRead: 1, setAllMessageRead: 1, getConversationList: 1, getConversationProfile: 1, deleteConversation: 1, setConversationDraft: 1, pinConversation: 1, getTotalUnreadMessageCount: 1, setConversationCustomData: 1, markConversation: 1, createConversationGroup: 1, getConversationGroupList: 1, deleteConversationGroup: 1, renameConversationGroup: 1, addConversationsToGroup: 1, deleteConversationsFromGroup: 1, clearHistoryMessage: 1, setMessageRemindType: 1, setAllReceiveMessageOpt: 1, getAllReceiveMessageOpt: 1, getGroupList: 1, getGroupProfile: 1, createGroup: 1, joinGroup: 1, updateGroupProfile: 1, quitGroup: 1, dismissGroup: 1, changeGroupOwner: 1, searchGroupByID: 1, getGroupApplicationList: 1, handleGroupApplication: 1, initGroupAttributes: 1, setGroupAttributes: 1, deleteGroupAttributes: 1, getGroupAttributes: 1, setGroupCounters: 1, increaseGroupCounter: 1, decreaseGroupCounter: 1, getGroupCounters: 1, getJoinedCommunityList: 1, createTopicInCommunity: 1, deleteTopicFromCommunity: 1, updateTopicProfile: 1, getTopicList: 1, getGroupMemberProfile: 1, getGroupMemberList: 1, addGroupMember: 1, deleteGroupMember: 1, setGroupMemberNameCard: 1, setGroupMemberMuteTime: 1, setGroupMemberRole: 1, setGroupMemberCustomField: 1, getGroupOnlineMemberCount: 1, markGroupMemberList: 1, getMyProfile: 1, getUserProfile: 1, updateMyProfile: 1, setSelfStatus: 1, getUserStatus: 1, subscribeUserStatus: 1, unsubscribeUserStatus: 1, getBlacklist: 1, addToBlacklist: 1, removeFromBlacklist: 1, searchCloudMessages: 1, searchCloudUsers: 1, searchCloudGroups: 1, searchCloudGroupMembers: 1, getFriendList: 1, addFriend: 1, deleteFriend: 1, checkFriend: 1, updateFriend: 1, getFriendProfile: 1, getFriendApplicationList: 1, refuseFriendApplication: 1, deleteFriendApplication: 1, acceptFriendApplication: 1, setFriendApplicationRead: 1, getFriendGroupList: 1, createFriendGroup: 1, renameFriendGroup: 1, deleteFriendGroup: 1, addToFriendGroup: 1, removeFromFriendGroup: 1, followUser: 1, unfollowUser: 1, getMyFollowingList: 1, getMyFollowersList: 1, getMutualFollowersList: 1, getUserFollowInfo: 1, checkFollowType: 1, callExperimentalAPI: 1, addSignalingListener: 1, removeSignalingListener: 1, invite: 1, inviteSync: 1, inviteInGroup: 1, inviteInGroupSync: 1, cancel: 1, accept: 1, reject: 1, getSignalingInfo: 1, modifyInvitation: 1 }, L2 = (t2(ro2, Z2(Error)), e3(ro2)), k2 = { NO_SDKAPPID: 2e3, NO_ACCOUNT_TYPE: 2001, NO_IDENTIFIER: 2002, NO_USERSIG: 2003, NO_TINYID: 2022, NO_A2KEY: 2023, USER_NOT_LOGGED_IN: 2024, REPEAT_LOGIN: 2025, COS_UNDETECTED: 2040, COS_GET_SIG_FAIL: 2041, MSG_SEND_FAIL: 2100, MSG_SEND_FAIL_NOT_IN_AV: 2101, MSG_INSTANCE_REQUIRED: 2105, MSG_INVALID_CONV_TYPE: 2106, MSG_F_IS_EMPTY: 2108, MSG_ONPROGRESS_ERR: 2109, MSG_REVOKE_FAIL: 2110, MSG_DELETE_FAIL: 2111, MSG_UNREAD_ALL_FAIL: 2112, READ_RECEIPT_MSG_LIST_EMPTY: 2114, MSG_SEND_GRP_WITH_TOPIC_FAIL: 2115, CANNOT_DELETE_GRP_SYSTEM_NOTICE: 2116, TRANSLATE_TEXT_FAIL: 2117, VOICE_TO_TEXT_FAIL: 2118, UNSUPPORTED_VOICE_FORMAT: 2119, MSG_I_SELECT_F_FIRST: 2251, MSG_I_TYPES_LIMIT: 2252, MSG_I_SIZE_LIMIT: 2253, MSG_A_UPLOAD_FAIL: 2300, MSG_A_SIZE_LIMIT: 2301, MSG_V_UPLOAD_FAIL: 2350, MSG_V_SIZE_LIMIT: 2351, MSG_V_TYPES_LIMIT: 2352, MSG_F_UPLOAD_FAIL: 2400, MSG_F_SELECT_F_FIRST: 2401, MSG_F_SIZE_LIMIT: 2402, MSG_F_URL_IS_EMPTY: 2403, MSG_MERGER_TYPE_INVALID: 2450, MSG_MERGER_KEY_INVALID: 2451, MSG_MERGER_DOWNLOAD_FAIL: 2452, MSG_FORWARD_TYPE_INVALID: 2453, MSG_FORWARD_INVALID_ELEMENTS: 2454, MSG_MODIFY_CONFLICT: 2480, MSG_MODIFY_DISABLED_IN_AV: 2481, CONV_NOT_FOUND: 2500, USER_OR_GRP_NOT_FOUND: 2501, CONV_UN_RECORDED_TYPE: 2502, INVALID_CONV_ID: 2503, ILLEGAL_GRP_TYPE: 2600, ILLEGAL_GRP_ID: 2602, CANNOT_FIND_GRP: 2603, CANNOT_CHANGE_OWNER_IN_AV: 2620, CANNOT_CHANGE_OWNER_TO_SELF: 2621, MEMBER_NOT_IN_GRP: 2623, JOIN_GRP_FAIL: 2660, CANNOT_ADD_MEMBER_IN_AV: 2661, CANNOT_JOIN_NON_AV_WITHOUT_LOGIN: 2662, NOT_OWNER: 2681, INVALID_MEMBER_ROLE: 2683, CANNOT_SET_SELF_MEMBER_ROLE: 2684, CANNOT_MUTE_SELF: 2685, BAN_DURATION_INVALID: 2686, OPERATION_NOT_SUPPORTED_IN_AV: 2687, NOT_MY_FRIEND: 2700, ALREADY_MY_FRIEND: 2701, FRIEND_GRP_EXISTED: 2710, FRIEND_GRP_NOT_EXIST: 2711, FRIEND_APPLICATION_NOT_EXIST: 2716, UPDATE_PROFILE_INVALID_PARAM: 2721, UPDATE_PROFILE_NO_KEY: 2722, CANNOT_ADD_SELF_TO_BLACKLIST: 2742, NETWORK_ERROR: 2800, NETWORK_TIMEOUT: 2801, NO_NETWORK: 2805, UNCAUGHT_ERROR: 2903, INVALID_OPERATION: 2905, INVALID_TRTC_CMD: 2995, OVER_FREQUENCY_LIMIT: 2996, NO_PROTOCOL: 2997, NO_MODULE: 2998, SDK_IS_NOT_READY: 2999, LOGGING_IN: 3e3, LOGIN_FAILED: 3001, KICKED_OUT_MULT_DEVICE: 3002, KICKED_OUT_MULT_ACCOUNT: 3003, KICKED_OUT_USERSIG_EXPIRED: 3004, LOGGED_OUT: 3005, KICKED_OUT_REST_API: 3006, ILLEGAL_TOPIC_ID: 3021, NO_USE: 3122, PROFANITY_FOUND: 3123, OPTIONS_IS_EMPTY: 3153, MSG_A2KEY_EXPIRED: 20002, ACCOUNT_A2KEY_EXPIRED: 70001, HELLO_ANSWER_KICKED_OUT: 1002, OPEN_SERVICE_OVERLOAD_ERROR: 60022, SIGNALING_INVALID_INVITE_ID: 8010, SIGNALING_NO_PERMISSION: 8011, SIGNALING_ALREADY_EXISTS: 8012, INVALID_CANCEL_MESSAGE: 8020 }, Kn2 = null, c3 = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._n = "";
    }, [{ key: "isLoggedIn", value: function() {
      return this._m.get(12).isLoggedIn();
    } }, { key: "isOversea", value: function() {
      return this._m.get(12).isOversea();
    } }, { key: "isPrivateNetWork", value: function() {
      var e4 = this._m.get(12);
      return e4.isPrivateNetWork() && !e4.getFileDownloadProxy();
    } }, { key: "getFileDownloadProxy", value: function() {
      return this._m.get(12).getFileDownloadProxy();
    } }, { key: "getDownloadFileAuthKey", value: function() {
      return this._m.get(12).getDownloadFileAuthKey();
    } }, { key: "getMyUserID", value: function() {
      return this._m.get(12).getUserID();
    } }, { key: "getMyTinyID", value: function() {
      return this._m.get(12).getTinyID();
    } }, { key: "getSDKAppID", value: function() {
      return this._m.get(12).getSDKAppID();
    } }, { key: "isIntl", value: function() {
      return this._m.get(12).isIntl();
    } }, { key: "isUsingChatCore", value: function() {
      return this._m.get(12).isUsingChatCore();
    } }, { key: "isDevMode", value: function() {
      return this._m.get(12).isDevMode();
    } }, { key: "get", value: function(e4) {
      return this._m.get(e4);
    } }, { key: "getPlatform", value: function() {
      return De3;
    } }, { key: "getCloudConfig", value: function(e4) {
      return this._m.get(23).getCloudConfig(e4);
    } }, { key: "emitOEvt", value: function(e4, t3) {
      this._m.getOEmitInst().emit(e4, t3);
    } }, { key: "emitIEvt", value: function(e4, t3) {
      this._m.getIEmitInst().emit(e4, t3);
    } }, { key: "getIEmitInst", value: function() {
      return this._m.getIEmitInst();
    } }, { key: "req", value: function(e4) {
      return this._m.get(20).req(e4);
    } }, { key: "canIUse", value: function(e4) {
      return this._m.get(27).canIUse(e4);
    } }, { key: "getErrMsg", value: function(e4, t3, n3) {
      return this._m.getErrMsg(e4, t3, n3);
    } }, { key: "warn", value: function(e4, t3, n3) {
      e4 = this.getErrMsg(e4, t3, n3);
      e4 && M2.w(e4);
    } }, { key: "noUse", value: function(e4) {
      var t3 = k2.NO_USE;
      return E2({ code: t3, message: this.getErrMsg(t3, e4) });
    } }]), G2 = { LOGIN: "wslogin", LOGOUT: "wslogout", HELLO: "wshello", KICK_OTHER: "KickOther", SYNC_UNREAD_MSG: "getmsg", SEND_C2C_MSG: "sendmsg", SEND_GRP_MSG: "send_group_msg", GET_USER_PROFILE: "portrait_get_all", UPDATE_MY_PROFILE: "portrait_set", GET_BL: "black_list_get", ADD_TO_BL: "black_list_add", RM_FROM_BL: "black_list_delete", GET_FD_LIST: "friend_get", GET_FD_PROFILE: "friend_get_specified", CHECK_FD: "friend_check", DEL_FD: "friend_delete", ADD_FD: "friend_add", UPDATE_FD: "friend_update", RESPOND_FD_APPLICATION: "friend_response", GET_FD_APPLICATION_LIST: "pendency_get", DEL_FD_APPLICATION: "pendency_delete", REFUSE_FD_APPLICATION: "pendency_refuse", REPORT_FD_APPLICATION: "pendency_report", GET_FD_GRP_LIST: "group_get", CREATE_FD_GRP: "group_add", DEL_FD_GRP: "group_delete", UPDATE_FD_GRP: "group_update", REVOKE_C2C_MSG: "msgwithdraw", SET_C2C_MSG_READ: "msgreaded", SET_C2C_PEER_MUTE_NOTIFICATIONS: "set_c2c_peer_mute_notifications", GET_C2C_PEER_MUTE_NOTIFICATIONS: "get_c2c_peer_mute_notifications", GET_C2C_ROAMING_MSG: "getroammsg", GET_C2C_PEER_READ_TIME: "get_peer_read_time", DEL_C2C_MSG: "delete_c2c_msg_ramble", MODIFY_C2C_MSG: "modify_c2c_msg", MODIFY_C2C_MSG_EXT: "set_key_values", GET_C2C_MSG_EXT: "get_key_values", ADD_C2C_MSG_REACTION: "reaction_add", RM_C2C_MSG_REACTION: "reaction_del", GET_C2C_MSG_REACTIONS: "reaction_multi_stat", GET_C2C_MSG_REACTION_USER_LIST: "reaction_iterate", PAGING_GET_CONV_LIST: "page_get", DEL_CONV: "batch_delete", CLEAR_HISTORY_MSG: "clear_msg", PIN_CONV: "top", DEL_GROUP_AT_TIPS: "deletemsg", SET_CONV_CUSTOM_DATA: "set_conv_custom_data", MARK_CONV: "mark_contact", CREATE_CONV_GRP: "create_contact_group", DEL_CONV_GRP: "del_contact_group", RENAME_CONV_GRP: "update_contact_group", ADD_CONV_TO_GRP: "add_conv_to_group", DEL_CONV_FROM_GRP: "del_conv_from_group", GET_CONV_GRP_LIST: "get_contact_group", SEARCH_CONV_GRP_MARK: "search_contact_group", GET_GRP_LIST: "get_joined_group_list", GET_GRP_PROFILE: "get_group_self_member_info", CREATE_GRP: "create_group", DISMISS_GRP: "destroy_group", UPDATE_GRP_PROFILE: "modify_group_base_info", APPLY_JOIN_GRP: "apply_join_group", APPLY_JOIN_GRP_NOAUTH: "apply_join_group_noauth", QUIT_GRP: "quit_group", SEARCH_GRP: "get_group_public_info", CHANGE_GRP_OWNER: "change_group_owner", HANDLE_GRP_APPLICATION: "handle_apply_join_group", HANDLE_INVITE_JOIN_GRP: "handle_invite_join_permission_group", HANDLE_GRP_INVITATION: "handle_invite_join_group", REVOKE_GRP_MSG: "group_msg_recall", SET_GRP_MSG_READ: "msg_read_report", SET_ALL_MSG_READ: "read_all_unread_msg", GET_GRP_ROAMING_MSG: "group_msg_get", GET_READ_RECEIPT: "get_group_msg_receipt", SEND_READ_RECEIPT: "group_msg_receipt", SEND_C2C_READ_RECEIPT: "c2c_msg_read_receipt", GET_READ_RECEIPT_DETAIL: "get_group_msg_receipt_detail", GET_GRP_RECEIPTS_BY_USERS: "get_group_msg_receipts_by_users", GET_GRP_PENDENCY: "get_pendency", DEL_GRP_SYSTEM_NOTICE: "deletemsg", AV_POLLING: "get_msg", AV_NOAUTH_POLLING: "get_msg_noauth", GET_ONLINE_MBR_NUM: "get_online_member_num", DEL_GRP_MSG: "delete_group_ramble_msg_by_seq", MODIFY_GRP_MSG: "modify_group_msg", SET_GRP_ATTR: "set_group_attr", MODIFY_GRP_ATTR: "modify_group_attr", DEL_GRP_ATTR: "delete_group_attr", CLEAR_GRP_ATTR: "clear_group_attr", GET_GRP_ATTR: "get_group_attr", MODIFY_GRP_MSG_EXT: "group_set_key_values", GET_GRP_MSG_EXT: "group_get_key_values", GET_GRP_NOTIFY: "batch_get_group_notify", UPDATE_GRP_COUNTER: "update_group_counter", GET_GRP_COUNTER: "get_group_counter", ADD_GRP_MSG_REACTION: "group_reaction_add", RM_GRP_MSG_REACTION: "group_reaction_del", GET_GRP_MSG_REACTIONS: "group_reaction_multi_stat", GET_GRP_MSG_REACTION_USER_LIST: "group_reaction_iterate", GET_GRP_MBR_LIST: "get_group_member_info", GET_AV_MBR_LIST: "get_members", GET_GRP_MBR_PROFILE: "get_specified_group_member_info", ADD_GRP_MBR: "add_group_member", DEL_GRP_MBR: "delete_group_member", BAN_AV_MBR: "ban_group_member", MODIFY_GRP_MBR_INFO: "modify_group_member_info", MARK_AV_MBR_INFO: "modify_user_info", COS_SIGN: "cos", COS_PRE_SIG: "pre_sig", SIMPLE_COS_PRE_SIG: "simple_sig", GET_IMAGE_INFO: "get_imageinfo", GET_IP: "get_final_ip", VIDEO_COVER: "video_cover", SSO_STAT: "tim_web_report_v2", PING: "alive", MSG_PUSH: "msg_push", CS: "query", GRP_CS: "query_grp", MBR_CS: "query_grp_member", USER_CS: "query_user", MULTI_MSG_PUSH: "multi_msg_push_ws", MSG_PUSH_ACK: "ws_msg_push_ack", STATUS_FORCE_OFFLINE: "stat_forceoffline", UPLOAD_MERGER_MSG: "save_relay_json_msg", DOWNLOAD_MERGER_MSG: "get_relay_json_msg", FETCH_CLOUD_CTRL_CONFIG: "fetch_config", PUSHED_CLOUD_CTRL_CONFIG: "push_configv2", FETCH_COMMERCIAL_CONFIG: "fetch_imsdk_purchase_bitsv2", PUSHED_COMMERCIAL_CONFIG: "push_imsdk_purchase_bitsv2", OVERLOAD_NOTIFY: "notify2", CREATE_TOPIC: "create_topic", DEL_TOPIC: "destroy_topic", UPDATE_TOPIC_PROFILE: "modify_topic", GET_TOPIC_LIST: "get_topic", SET_SELF_STATUS: "ws_set_custom_status", GET_USER_STATUS: "ws_get_user_status", SUB_USER_STATUS: "ws_status_subscribe", UNSUB_USER_STATUS: "ws_status_unsubscribe", STAT_BACKGROUND: "ws_stat_background", STAT_FOREGROUND: "ws_stat_foreground", SET_TOKEN: "ws_stat_settoken", PUSH_REPORT: "uniapp_sdk_report", GET_PROFANITY_LIST: "get_local_words", TRANSLATE_TEXT: "ws_batch_trans_text", VOICE_TO_TEXT: "ws_sentence_recognition", FOLLOW: "follow_add", UNFOLLOW: "follow_delete", GET_FOLLOW: "follow_get", GET_FOLLOW_INFO: "follow_get_info", CHECK_FOLLOW_TYPE: "follow_check", SET_ALL_RECEIVE_MSG_OPT: "ws_set_do_not_disturb", GET_ALL_RECEIVE_MSG_OPT: "ws_get_do_not_disturb" }, Wn2 = "networkRTT", Yn2 = "messageE2EDelay", jn2 = "sendMessageC2C", Jn2 = "sendMessageGroup", zn2 = "sendMessageGroupAV", Xn2 = "sendMessageRichMedia", Zn2 = "cosUpload", Qn2 = "messageReceivedGroup", $n2 = "messageReceivedGroupAVPush", eo2 = "messageReceivedGroupAVPull", to2 = q2(q2(q2(q2(q2(q2(q2(q2(q2(q2({}, Wn2, 2), Yn2, 3), jn2, 4), Jn2, 5), zn2, 6), Xn2, 7), Qn2, 8), $n2, 9), eo2, 10), Zn2, 11), no2 = { info: 4, warning: 5, error: 6 }, oo2 = { wifi: 1, "2g": 2, "3g": 3, "4g": 4, "5g": 5, unknown: 6, none: 7, online: 8 }, io2 = { login: 4, plugin_search: 16, plugin_translate: 16, plugin_voice_to_text: 16, plugin_cs: 16, plugin_push: 16, plugin_bot: 16, plugin_emoji_reaction: 16, tui_key_features: 16 }, P2 = e3(so2, [{ key: "updateTimeStamp", value: function() {
      this.timestamp = Ye3();
    } }, { key: "start", value: function(e4) {
      return this._startts = e4, this;
    } }, { key: "end", value: function() {
      var e4, t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0];
      this._sentFlag || (this._netMonitorModule && (e4 = this._netMonitorModule.getNetworkType(), this.setNetworkType(e4)), e4 = Ye3(), 0 === this.costTime && (this.costTime = e4 - this._startts), this.setMoreMessage("startts:".concat(this._startts, " endts:").concat(e4)), n3 ? (this._sentFlag = true, this._eventStatModule && this._eventStatModule.pushIn(this)) : setTimeout(function() {
        t3._sentFlag = true, t3._eventStatModule && t3._eventStatModule.pushIn(t3);
      }, 0));
    } }, { key: "setError", value: function(e4) {
      var t3;
      return e4 instanceof Error ? this._sentFlag || (t3 = true, (t3 = this._netMonitorModule ? this._netMonitorModule.isOnline() : t3) ? (e4.code && this.setCode(e4.code), e4.message && this.setMoreMessage(e4.message)) : this.setCode(k2.NO_NETWORK), this.setLevel("error")) : M2.w("".concat(this._n, ".setError value not instanceof Error, please check!")), this;
    } }, { key: "setCode", value: function(e4) {
      return N2(e4) || this._sentFlag || ("ECONNABORTED" === e4 && (this.code = 103), A2(e4) ? this.code = e4 : M2.w("".concat(this._n, ".setCode value not a number, please check!"), e4, z2(e4))), this;
    } }, { key: "setMessage", value: function(e4) {
      return N2(e4) || this._sentFlag || (A2(e4) && (this.message = e4.toString()), C2(e4) && (this.message = e4)), this;
    } }, { key: "setCostTime", value: function(e4) {
      return this.costTime = e4, this;
    } }, { key: "setLevel", value: function(e4) {
      return N2(e4) || this._sentFlag || (this.level = no2[e4]), this;
    } }, { key: "setMoreMessage", value: function(e4) {
      return S2(this.moreMessage) ? this.moreMessage = "".concat(e4) : this.moreMessage += " ".concat(e4), this;
    } }, { key: "setNetworkType", value: function(e4) {
      return N2(e4) ? M2.w("".concat(this._n, ".setNetworkType value is undefined, please check!")) : (e4 = oo2[e4.toLowerCase()], N2(e4) || (this.networkType = e4)), this;
    } }, { key: "getStartTs", value: function() {
      return this._startts;
    } }, { key: "setUIPlatform", value: function(e4) {
      return this.uiPlatform = e4, this;
    } }, { key: "setExtension", value: function(e4) {
      return this.extension = e4, this;
    } }, { key: "setEventType", value: function(e4) {
      return this.eventType = e4, this;
    } }], [{ key: "bindEventStatModule", value: function(e4) {
      so2.prototype._eventStatModule = e4;
    } }, { key: "bindNetMonitorModule", value: function(e4) {
      so2.prototype._netMonitorModule = e4;
    } }]), ao2 = e3(function e4(t3) {
      p3(this, e4), this.type = R2.MSG_TEXT, this.content = { text: t3.text || "" };
    }, [{ key: "setText", value: function(e4) {
      this.content.text = e4;
    } }, { key: "sendable", value: function() {
      return 0 !== this.content.text.length;
    } }]);
    function so2(e4) {
      p3(this, so2), this._n = "SSOLogData", this.eventType = io2[e4] || 0, this.timestamp = 0, this.networkType = 8, this.code = 0, this.message = "", this.moreMessage = "", this.extension = e4, this.costTime = 0, this.duplicate = false, this.level = 4, this.uiPlatform = void 0, this._sentFlag = false, this._startts = Ye3();
    }
    function ro2(e4) {
      p3(this, ro2), t3 = i3(this, ro2);
      var t3, n3 = e4.code, o3 = e4.message, e4 = e4.data;
      return t3.code = n3, o3 ? t3.message = o3 : t3._getErrMsg && (t3.message = t3._getErrMsg(t3.code)), t3.data = e4 || {}, t3;
    }
    function co2(e4, t3, n3, o3) {
      var i4, o3 = 3 < arguments.length && void 0 !== o3 ? o3 : [];
      return e4 && (i4 = e4, t3 && (e4.startsWith("http://") ? i4 = e4.replace(/^http:\/\/[^/]+/, t3) : e4.startsWith("https://") && (i4 = e4.replace(/^https:\/\/[^/]+/, t3))), n3 && -1 === i4.indexOf("authKey=") && po2(i4, o3) ? (-1 < i4.indexOf("?") ? "".concat(i4, "&authKey=") : "".concat(i4, "?authKey=")).concat(n3) : i4);
    }
    function uo2(e4, t3, n3) {
      var o3 = 2 < arguments.length && void 0 !== n3 ? n3 : [], n3 = t3[0].content || t3[0].payload;
      return e4 === R2.MSG_IMAGE ? n3.imageInfoArray.forEach(function(e5) {
        po2(e5.imageUrl, o3) && (e5.imageUrl = lo2(e5.imageUrl));
      }) : e4 === R2.MSG_VIDEO ? (po2(n3.snapshotUrl, o3) && (n3.snapshotUrl = lo2(n3.snapshotUrl), n3.thumbUrl = lo2(n3.thumbUrl)), po2(n3.remoteVideoUrl, o3) && (n3.remoteVideoUrl = lo2(n3.remoteVideoUrl))) : e4 === R2.MSG_AUDIO ? po2(n3.remoteAudioUrl, o3) && (n3.remoteAudioUrl = lo2(n3.remoteAudioUrl)) : e4 === R2.MSG_FILE ? po2(n3.fileUrl, o3) && (n3.fileUrl = lo2(n3.fileUrl)) : e4 === R2.MSG_MERGER && (e4 = (n3 = t3[0].content || t3[0].payload).downloadKey, n3 = void 0 === (n3 = n3.messageList) ? [] : n3, S2(void 0 === e4 ? "" : e4)) && n3.forEach(function(e5) {
        uo2(e5.messageBody[0].type, e5.messageBody, o3);
      }), t3;
    }
    function lo2(e4) {
      if (!e4)
        return e4;
      if (-1 === e4.indexOf("authKey="))
        return e4;
      for (var e4 = e4.split("?"), t3 = e4[1].split("&"), n3 = 0, o3 = 0; o3 < t3.length; o3++)
        if (-1 < t3[o3].indexOf("authKey=")) {
          n3 = o3;
          break;
        }
      return t3.splice(n3, 1), 0 < t3.length ? "".concat(e4[0], "?").concat(t3.join("&")) : e4[0];
    }
    function po2(e4, t3) {
      var n3 = false;
      if (e4) {
        var e4 = e4.match(/:\/\/([0-9]?\.)?(.[^/:]+)/), o3 = e4 && e4[2] || "";
        if (o3.includes("rich-dev"))
          return 1;
        for (var i4 = 0; i4 < t3.length; i4++)
          if (o3.endsWith(t3[i4])) {
            n3 = true;
            break;
          }
      }
      return n3;
    }
    var _o2 = e3(function e4(t3, n3, o3, i4) {
      p3(this, e4), this._imageMemoryURL = "", this._fileDownloadProxy = n3, this._authKey = o3, this._fileDNList = i4, v3 || ye3 ? this.createImageDataASURL(t3.file) : this.createImageDataASURLInWeb(t3.file), this._initImageInfoModel(), this.type = R2.MSG_IMAGE, this._percent = 0, this.content = { imageFormat: t3.imageFormat || Xe3.UNKNOWN, uuid: t3.uuid, imageInfoArray: [] }, this.initImageInfoArray(t3.imageInfoArray), this._autoFixUrl();
    }, [{ key: "_initImageInfoModel", value: function() {
      var t3 = this;
      this._ImageInfoModel = function(e4) {
        this.instanceID = mt3(9999999), this.sizeType = e4.type || 0, this.type = 0, this.size = e4.size || 0, this.width = e4.width || 0, this.height = e4.height || 0, this.imageUrl = e4.imageUrl || e4.url || "", this.url = co2(e4.url || t3._imageMemoryURL, t3._fileDownloadProxy, t3._authKey, t3._fileDNList);
      }, this._ImageInfoModel.prototype = { setSizeType: function(e4) {
        this.sizeType = e4;
      }, setType: function(e4) {
        this.type = e4;
      }, setImageUrl: function(e4) {
        e4 && (this.imageUrl = co2(e4, t3._fileDownloadProxy, t3._authKey, t3._fileDNList));
      }, getImageUrl: function() {
        return this.imageUrl;
      } };
    } }, { key: "initImageInfoArray", value: function(e4) {
      for (var t3, n3 = 0, o3 = null; n3 <= 2; )
        t3 = N2(e4) || N2(e4[n3]) ? { type: 0, size: 0, width: 0, height: 0, url: "" } : e4[n3], (o3 = new this._ImageInfoModel(t3)).setSizeType(n3 + 1), o3.setType(n3), this.addImageInfo(o3), n3++;
      this.updateAccessSideImageInfoArray();
    } }, { key: "updateImageInfoArray", value: function(e4) {
      for (var t3, n3 = this.content.imageInfoArray.length, o3 = 0; o3 < n3; o3++)
        t3 = this.content.imageInfoArray[o3], e4[o3].size && (t3.size = e4[o3].size), e4[o3].url && t3.setImageUrl(e4[o3].url), e4[o3].width && (t3.width = e4[o3].width), e4[o3].height && (t3.height = e4[o3].height);
    } }, { key: "_autoFixUrl", value: function() {
      for (var e4 = this.content.imageInfoArray.length, t3 = "", n3 = "", o3 = ["http", "https"], i4 = null, a4 = 0; a4 < e4; a4++)
        this.content.imageInfoArray[a4].url && "" !== (i4 = this.content.imageInfoArray[a4]).imageUrl && (n3 = i4.imageUrl.slice(0, i4.imageUrl.indexOf("://") + 1), t3 = i4.imageUrl.slice(i4.imageUrl.indexOf("://") + 1), o3.indexOf(n3) < 0 && (n3 = "https:"), this.content.imageInfoArray[a4].setImageUrl([n3, t3].join("")));
    } }, { key: "updatePercent", value: function(e4) {
      this._percent = e4, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateImageFormat", value: function(e4) {
      this.content.imageFormat = Xe3[e4.toUpperCase()] || Xe3.UNKNOWN;
    } }, { key: "createImageDataASURLInWeb", value: function(e4) {
      void 0 !== e4 && 0 < e4.files.length && (this._imageMemoryURL = window.URL.createObjectURL(e4.files[0]));
    } }, { key: "createImageDataASURL", value: function(e4) {
      e4 && e4.url && (this._imageMemoryURL = e4.url);
    } }, { key: "replaceImageInfo", value: function(e4, t3) {
      this.content.imageInfoArray[t3] instanceof this._ImageInfoModel || (this.content.imageInfoArray[t3] = e4);
    } }, { key: "addImageInfo", value: function(e4) {
      3 <= this.content.imageInfoArray.length || this.content.imageInfoArray.push(e4);
    } }, { key: "updateAccessSideImageInfoArray", value: function() {
      var e4 = this.content.imageInfoArray, t3 = e4[0], n3 = t3.width, n3 = void 0 === n3 ? 0 : n3, t3 = t3.height, t3 = void 0 === t3 ? 0 : t3;
      0 !== n3 && 0 !== t3 && (Wt2(e4), Object.assign(e4[2], Kt2({ originWidth: n3, originHeight: t3, min: 720 })));
    } }, { key: "sendable", value: function() {
      return 0 !== this.content.imageInfoArray.length && "" !== this.content.imageInfoArray[0].imageUrl && 0 !== this.content.imageInfoArray[0].size;
    } }]), ho2 = e3(function e4(t3) {
      p3(this, e4), this.type = R2.MSG_FACE, this.content = t3 || null;
    }, [{ key: "sendable", value: function() {
      return null !== this.content;
    } }]), go2 = e3(function e4(t3, n3, o3, i4) {
      p3(this, e4), this.type = R2.MSG_AUDIO, this._percent = 0, this._fileDownloadProxy = n3, this._authKey = o3, this._fileDNList = i4, this.content = { downloadFlag: 2, second: t3.second, size: t3.size, url: co2(t3.url, this._fileDownloadProxy, this._authKey, this._fileDNList), remoteAudioUrl: co2(t3.url || "", this._fileDownloadProxy, this._authKey, this._fileDNList), uuid: t3.uuid };
    }, [{ key: "updatePercent", value: function(e4) {
      this._percent = e4, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateAudioUrl", value: function(e4) {
      this.content.remoteAudioUrl = co2(e4, this._fileDownloadProxy, this._authKey, this._fileDNList);
    } }, { key: "sendable", value: function() {
      return "" !== this.content.remoteAudioUrl;
    } }]), fo2 = { from: true, groupID: true, groupName: true, to: true }, mo2 = e3(function e4(t3) {
      p3(this, e4), this.type = R2.MSG_GRP_TIP, this.content = {}, this._initContent(t3);
    }, [{ key: "_initContent", value: function(t3) {
      var n3 = this;
      Object.keys(t3).forEach(function(e4) {
        switch (e4) {
          case "remarkInfo":
            break;
          case "groupProfile":
            n3.content.groupProfile = {}, n3._initGroupProfile(t3[e4]);
            break;
          case "operatorInfo":
            n3.content.operatorInfo = {}, n3._initOperatorInfo(t3[e4]);
            break;
          case "memberInfoList":
          case "msgMemberInfo":
            n3._updateMemberList(t3[e4]);
            break;
          case "memberExtraInfo":
          case "onlineMemberInfo":
            break;
          case "memberNum":
            n3.content[e4] = t3[e4], n3.content.memberCount = t3[e4];
            break;
          case "newGroupProfile":
            n3.content.newGroupProfile = {}, n3._initNewGroupProfile(t3[e4]);
            break;
          default:
            n3.content[e4] = t3[e4];
        }
      }), this.content.userIDList || (this.content.userIDList = [this.content.operatorID]);
    } }, { key: "_initGroupProfile", value: function(e4) {
      for (var t3 = Object.keys(e4), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        fo2[o3] && (this.content.groupProfile[o3] = e4[o3]);
      }
    } }, { key: "_initOperatorInfo", value: function(e4) {
      for (var t3 = Object.keys(e4), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        this.content.operatorInfo[o3] = e4[o3];
      }
    } }, { key: "_updateMemberList", value: function(e4) {
      S2(this.content.memberList) ? this.content.memberList = e4 : this.content.memberList.forEach(function(t3) {
        e4.forEach(function(e5) {
          t3.userID === e5.userID && Object.assign(t3, e5);
        });
      });
    } }, { key: "_initNewGroupProfile", value: function(e4) {
      for (var t3 = Object.keys(e4), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        this.content.newGroupProfile[o3] = "muteAllMembers" !== o3 ? e4[o3] : 1 === e4[o3];
      }
    } }]), vo2 = { from: true, groupID: true, groupName: true, to: true, groupType: true }, Io2 = e3(function e4(t3) {
      p3(this, e4), this.type = R2.MSG_GRP_SYS_NOTICE, this.content = {}, this._initContent(t3);
    }, [{ key: "_initContent", value: function(t3) {
      var n3 = this;
      Object.keys(t3).forEach(function(e4) {
        switch (e4) {
          case "memberInfoList":
            break;
          case "remarkInfo":
            n3.content.handleMessage = t3[e4];
            break;
          case "groupProfile":
            n3.content.groupProfile = {}, n3._initGroupProfile(t3[e4]);
            break;
          default:
            n3.content[e4] = t3[e4];
        }
      });
    } }, { key: "_initGroupProfile", value: function(e4) {
      for (var t3 = Object.keys(e4), n3 = 0; n3 < t3.length; n3++) {
        var o3 = t3[n3];
        vo2[o3] && ("groupName" === o3 ? this.content.groupProfile.name = e4[o3] : this.content.groupProfile[o3] = e4[o3]);
      }
    } }]), Mo2 = e3(function e4(t3, n3, o3, i4) {
      p3(this, e4), this.type = R2.MSG_FILE, this._percent = 0;
      var a4 = this._getFileInfo(t3);
      this.content = { downloadFlag: 2, fileUrl: co2(t3.url || t3.fileUrl, n3, o3, i4) || "", uuid: t3.uuid, fileName: a4.name || "", fileSize: a4.size || 0 };
    }, [{ key: "_getFileInfo", value: function(e4) {
      var t3, n3;
      return N2(e4.fileName) || N2(e4.fileSize) ? (t3 = e4.file.files[0], Ie2 && (t3.path && -1 !== t3.path.indexOf(".") && (n3 = t3.path.slice(t3.path.lastIndexOf(".") + 1).toLowerCase(), t3.type = n3, t3.name || (t3.name = "".concat(mt3(999999), ".").concat(n3))), t3.name || (t3.type = "", t3.name = t3.path.slice(t3.path.lastIndexOf("/") + 1).toLowerCase()), t3.suffix && (t3.type = t3.suffix), t3.url || (t3.url = t3.path)), { size: t3.size, name: t3.name }) : { size: e4.fileSize, name: e4.fileName };
    } }, { key: "updatePercent", value: function(e4) {
      this._percent = e4, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateFileUrl", value: function(e4) {
      this.content.fileUrl = e4;
    } }, { key: "sendable", value: function() {
      return "" !== this.content.fileUrl && "" !== this.content.fileName && 0 !== this.content.fileSize;
    } }]), yo2 = e3(function e4(t3) {
      p3(this, e4), this.type = R2.MSG_CUSTOM, this.content = { data: t3.data || "", description: t3.description || "", extension: t3.extension || "" };
    }, [{ key: "setData", value: function(e4) {
      return this.content.data = e4, this;
    } }, { key: "setDescription", value: function(e4) {
      return this.content.description = e4, this;
    } }, { key: "setExtension", value: function(e4) {
      return this.content.extension = e4, this;
    } }, { key: "sendable", value: function() {
      return 0 !== this.content.data.length || 0 !== this.content.description.length || 0 !== this.content.extension.length;
    } }]), Co2 = e3(function e4(t3, n3, o3, i4) {
      p3(this, e4), this.type = R2.MSG_VIDEO, this._percent = 0, this._fileDownloadProxy = n3, this._authKey = o3, this._fileDNList = i4, this.content = { remoteVideoUrl: co2(t3.remoteVideoUrl || t3.videoUrl || "", this._fileDownloadProxy, this._authKey, this._fileDNList), videoFormat: t3.videoFormat, videoSecond: parseInt(t3.videoSecond, 10), videoSize: t3.videoSize, videoUrl: co2(t3.videoUrl, this._fileDownloadProxy, this._authKey, this._fileDNList), videoDownloadFlag: 2, videoUUID: t3.videoUUID, thumbUUID: t3.thumbUUID, thumbFormat: t3.thumbFormat, thumbWidth: t3.thumbWidth, snapshotWidth: t3.thumbWidth, thumbHeight: t3.thumbHeight, snapshotHeight: t3.thumbHeight, thumbSize: t3.thumbSize, snapshotSize: t3.thumbSize, thumbDownloadFlag: 2, thumbUrl: co2(t3.thumbUrl, this._fileDownloadProxy, this._authKey, this._fileDNList), snapshotUrl: co2(t3.thumbUrl, this._fileDownloadProxy, this._authKey, this._fileDNList) };
    }, [{ key: "updatePercent", value: function(e4) {
      this._percent = e4, 1 < this._percent && (this._percent = 1);
    } }, { key: "updateVideoUrl", value: function(e4) {
      e4 && (this.content.remoteVideoUrl = co2(e4, this._fileDownloadProxy, this._authKey, this._fileDNList));
    } }, { key: "updateSnapshotInfo", value: function(e4) {
      var t3 = e4.snapshotUrl, n3 = e4.snapshotWidth, e4 = e4.snapshotHeight;
      S2(t3) || (this.content.thumbUrl = this.content.snapshotUrl = t3), S2(n3) || (this.content.thumbWidth = this.content.snapshotWidth = Number(n3)), S2(e4) || (this.content.thumbHeight = this.content.snapshotHeight = Number(e4));
    } }, { key: "sendable", value: function() {
      return "" !== this.content.remoteVideoUrl;
    } }]), To2 = e3(function e4(t3) {
      p3(this, e4), this.type = R2.MSG_LOCATION;
      var n3 = t3.description, o3 = t3.longitude, t3 = t3.latitude;
      this.content = { description: n3, longitude: o3, latitude: t3 };
    }, [{ key: "sendable", value: function() {
      return true;
    } }]), Do2 = e3(function e4(t3, n3, o3, i4) {
      var a4, s4;
      p3(this, e4), this.from = t3.from, this.messageSender = t3.from, this.time = t3.time, this.messageSequence = t3.sequence, this.clientSequence = t3.clientSequence || t3.sequence, this.messageRandom = t3.random, this.cloudCustomData = t3.cloudCustomData || "", this.clientTime = t3.clientTime || void 0, t3.ID ? (this.ID = t3.ID || "", this.nick = t3.nick || "", this.avatar = t3.avatar || "", t3.messageBody ? this.messageBody = JSON.parse(JSON.stringify(t3.messageBody)) : this.messageBody = [{ type: t3.type, payload: t3.payload }], t3.conversationType ? t3.conversationType.startsWith(R2.CONV_C2C) ? this.receiverUserID = t3.to : t3.conversationType.startsWith(R2.CONV_GROUP) && (this.receiverGroupID = t3.to) : t3.receiverGroupID ? this.receiverGroupID = t3.receiverGroupID : t3.receiverUserID && (this.receiverUserID = t3.receiverUserID), this.messageReceiver = t3.to || t3.messageReceiver) : (this.nick = t3.nick || "", this.avatar = t3.avatar || "", this.messageBody = [], a4 = t3.elements[0].type, s4 = t3.elements[0].content, this._patchRichMediaPayload(a4, s4), this._updateRichMediaDownloadUrl(a4, s4, n3, o3, i4), a4 === R2.MSG_MERGER ? this.messageBody.push({ type: a4, payload: new Eo2(s4, n3, o3, i4).content }) : this.messageBody.push({ type: a4, payload: s4 }), t3.groupID && (this.receiverGroupID = t3.groupID, this.messageReceiver = t3.groupID), t3.to && (this.receiverUserID = t3.to, this.messageReceiver = t3.to), this.ID = "".concat(t3.tinyID, "-").concat(t3.clientTime, "-").concat(t3.random));
    }, [{ key: "_patchRichMediaPayload", value: function(e4, t3) {
      e4 === R2.MSG_IMAGE ? t3.imageInfoArray.forEach(function(e5) {
        !e5.imageUrl && e5.url && (e5.imageUrl = e5.url, e5.sizeType = e5.type, 1 === e5.type ? e5.type = 0 : 3 === e5.type && (e5.type = 1));
      }) : e4 === R2.MSG_VIDEO ? !t3.remoteVideoUrl && t3.videoUrl && (t3.remoteVideoUrl = t3.videoUrl) : e4 === R2.MSG_AUDIO ? !t3.remoteAudioUrl && t3.url && (t3.remoteAudioUrl = t3.url) : e4 === R2.MSG_FILE && !t3.fileUrl && t3.url && (t3.fileUrl = t3.url, t3.url = void 0);
    } }, { key: "_updateRichMediaDownloadUrl", value: function(e4, t3, n3, o3, i4) {
      (n3 || o3) && (e4 === R2.MSG_IMAGE ? t3.imageInfoArray.forEach(function(e5) {
        e5.imageUrl = co2(e5.imageUrl, n3, o3, i4), e5.url = co2(e5.url, n3, o3, i4);
      }) : e4 === R2.MSG_VIDEO ? (t3.remoteVideoUrl = co2(t3.remoteVideoUrl, n3, o3, i4), t3.videoUrl = co2(t3.videoUrl, n3, o3, i4), t3.thumbUrl = co2(t3.thumbUrl, n3, o3, i4), t3.snapshotUrl = co2(t3.thumbUrl, n3, o3, i4), t3.snapshotHeight = t3.thumbHeight, t3.snapshotWidth = t3.thumbWidth) : e4 === R2.MSG_AUDIO ? (t3.remoteAudioUrl = co2(t3.remoteAudioUrl, n3, o3, i4), t3.url = co2(t3.url, n3, o3, i4)) : e4 === R2.MSG_FILE && (t3.fileUrl = co2(t3.fileUrl, n3, o3, i4)));
    } }]), Eo2 = e3(function e4(t3, n3, o3, i4) {
      var a4, s4, r3, c4, u3, l3, d4;
      p3(this, e4), this.type = R2.MSG_MERGER, this.content = { downloadKey: "", pbDownloadKey: "", messageList: [], title: "", abstractList: [], compatibleText: "", version: 0, layersOverLimit: false }, t3.downloadKey ? (s4 = t3.downloadKey, r3 = t3.pbDownloadKey, c4 = t3.title, u3 = t3.abstractList, l3 = t3.compatibleText, a4 = t3.version, this.content.downloadKey = s4, this.content.pbDownloadKey = r3, this.content.title = c4, this.content.abstractList = u3, this.content.compatibleText = l3, this.content.version = a4 || 0) : S2(t3.messageList) ? 1 === t3.layersOverLimit && (this.content.layersOverLimit = true) : (s4 = t3.messageList, r3 = t3.title, c4 = t3.abstractList, u3 = t3.compatibleText, l3 = t3.version, d4 = [], s4.forEach(function(e5) {
        S2(e5) || (e5 = new Do2(e5, n3, o3, i4), d4.push(e5));
      }), this.content.messageList = d4, this.content.title = r3, this.content.abstractList = c4, this.content.compatibleText = u3, this.content.version = l3 || 0);
    }, [{ key: "sendable", value: function() {
      return !S2(this.content.messageList) || !S2(this.content.downloadKey);
    } }]), Lo2 = { 1: R2.MSG_PRIORITY_HIGH, 2: R2.MSG_PRIORITY_NORMAL, 3: R2.MSG_PRIORITY_LOW, 4: R2.MSG_PRIORITY_LOWEST }, So2 = e3(function e4(t3) {
      p3(this, e4), this.ID = "", this.conversationID = t3.conversationID || null, this.conversationType = t3.conversationType || R2.CONV_C2C, this.conversationSubType = t3.conversationSubType, this.time = t3.time || Math.ceil(Date.now() / 1e3), this.sequence = t3.sequence || 0, this.clientSequence = t3.clientSequence || t3.sequence || 0, this.random = t3.random || 0 === t3.random ? t3.random : mt3(), this.priority = this._computePriority(t3.priority), this.nick = t3.nick || "", this.avatar = t3.avatar || "", this.isPeerRead = false, this.nameCard = "", this.hasRiskContent = sn2(t3.checkResult), this._elements = [], this.isPlaceMessage = t3.isPlaceMessage || 0, this.isRevoked = 2 === t3.isPlaceMessage || 8 === t3.msgFlagBits, this.from = t3.from || null, this.to = t3.to || null, this.flow = "", this.isSystemMessage = t3.isSystemMessage || false, this.protocol = t3.protocol || "JSON", this.isResend = false, this.isRead = false, this.status = t3.status || Pn2, this._onlineOnlyFlag = false, this._groupAtInfoList = [], this._relayFlag = false, this.atUserList = [], this.cloudCustomData = t3.cloudCustomData || "", this.isDeleted = false, this.isModified = !!t3.messageVersion, this._isExcludedFromUnreadCount = !(!t3.messageControlInfo || 1 !== t3.messageControlInfo.excludedFromUnreadCount), this._isExcludedFromLastMessage = !(!t3.messageControlInfo || 1 !== t3.messageControlInfo.excludedFromLastMessage), this.clientTime = t3.clientTime || He2() || 0, this.senderTinyID = t3.senderTinyID || t3.tinyID || "", this.readReceiptInfo = t3.readReceiptInfo || { readCount: void 0, unreadCount: void 0, isPeerRead: void 0, timestamp: 0 }, this.needReadReceipt = true === t3.needReadReceipt || 1 === t3.needReadReceipt, this.version = t3.messageVersion || 0, this.isBroadcastMessage = t3.isBroadcastMessage || false, this._receiverList = t3.receiverList || void 0, this.isSupportExtension = true === t3.isSupportExtension || 1 === t3.isSupportExtension, this._cmConfigID = t3.customModerationConfigurationID, this.revoker = t3.revokerInfo && t3.revokerInfo.revoker || "", this.revokerInfo = t3.revokerInfo || { userID: "", nick: "", avatar: "" }, this.revokeReason = t3.revokeReason || "", this.reInitialize(t3.currentUser), this.extractGroupInfo(t3.groupProfile || null), this.handleGroupAtInfo(t3), this.initC2CReadReceiptInfo(t3);
    }, [{ key: "elements", get: function() {
      return this._elements;
    } }, { key: "getElements", value: function() {
      return this._elements;
    } }, { key: "extractGroupInfo", value: function(e4) {
      null !== e4 && (C2(e4.nick) && (this.nick = e4.nick), C2(e4.avatar) && (this.avatar = e4.avatar), e4 = e4.messageFromAccountExtraInformation, m3(e4)) && C2(e4.nameCard) && (this.nameCard = e4.nameCard);
    } }, { key: "handleGroupAtInfo", value: function(e4) {
      var t3 = this;
      e4.payload && e4.payload.atUserList && e4.payload.atUserList.forEach(function(e5) {
        e5 !== R2.MSG_AT_ALL ? (t3._groupAtInfoList.push({ groupAtAllFlag: 0, groupAtUserID: e5 }), t3.atUserList.push(e5)) : (t3._groupAtInfoList.push({ groupAtAllFlag: 1 }), t3.atUserList.push(R2.MSG_AT_ALL));
      }), O2(e4.groupAtInfo) && e4.groupAtInfo.forEach(function(e5) {
        0 === e5.groupAtAllFlag ? t3.atUserList.push(e5.groupAtUserID) : 1 === e5.groupAtAllFlag && t3.atUserList.push(R2.MSG_AT_ALL);
      });
    } }, { key: "getGroupAtInfoList", value: function() {
      return this._groupAtInfoList;
    } }, { key: "_initProxy", value: function() {
      this._elements[0] && (this.payload = this._elements[0].content, this.type = this._elements[0].type);
    } }, { key: "reInitialize", value: function(e4) {
      e4 && (this.status = this.from ? Pn2 : Gn2, !this.from) && (this.from = e4), this._initFlow(e4), this._initSequence(e4), this._concatConversationID(e4), this.generateMessageID();
    } }, { key: "isSendable", value: function() {
      return 0 !== this._elements.length && (true === this._relayFlag || "function" == typeof this._elements[0].sendable && this._elements[0].sendable());
    } }, { key: "_initTo", value: function(e4) {
      this.conversationType === R2.CONV_GROUP && (this.to = e4.groupID);
    } }, { key: "_initSequence", value: function(e4) {
      var t3, n3, o3;
      0 === this.clientSequence && e4 && (this.clientSequence = !!(e4 = e4) && (void 0 === kt2[e4] && (o3 = /* @__PURE__ */ new Date(), t3 = "3".concat(o3.getHours()).slice(-2), n3 = "0".concat(o3.getMinutes()).slice(-2), o3 = "0".concat(o3.getSeconds()).slice(-2), kt2[e4] = parseInt([t3, n3, o3, "0001"].join("")), o3 = n3 = t3 = null, M2.l("autoIncrementIndex start index:".concat(kt2[e4]))), kt2[e4]++)), 0 === this.sequence && this.conversationType === R2.CONV_C2C && (this.sequence = this.clientSequence);
    } }, { key: "generateMessageID", value: function() {
      this.from === R2.CONV_SYSTEM && (this.senderTinyID = "144115198244471703"), this.ID = "".concat(this.senderTinyID, "-").concat(this.clientTime, "-").concat(this.random);
    } }, { key: "_initFlow", value: function(e4) {
      "" !== e4 && (e4 === this.from ? (this.flow = "out", this.isRead = true) : this.flow = "in");
    } }, { key: "_concatConversationID", value: function(e4) {
      var t3 = this.to, n3 = this.conversationType;
      n3 !== R2.CONV_SYSTEM ? (e4 = n3 === R2.CONV_C2C ? e4 === this.from ? t3 : this.from : this.to, this.conversationID = e4 ? "".concat(n3).concat(e4) : null) : this.conversationID = R2.CONV_SYSTEM;
    } }, { key: "isElement", value: function(e4) {
      return e4 instanceof ao2 || e4 instanceof _o2 || e4 instanceof ho2 || e4 instanceof go2 || e4 instanceof Mo2 || e4 instanceof Co2 || e4 instanceof mo2 || e4 instanceof Io2 || e4 instanceof yo2 || e4 instanceof To2 || e4 instanceof Eo2;
    } }, { key: "setElement", value: function(e4, t3, n3, o3) {
      var i4 = this;
      if (this.isElement(e4))
        this._elements = [e4];
      else {
        var a4 = function(e5) {
          if (e5.type && e5.content)
            switch (e5.type) {
              case R2.MSG_TEXT:
                i4.setTextElement(e5.content);
                break;
              case R2.MSG_IMAGE:
                i4.setImageElement(e5.content, t3, n3, o3);
                break;
              case R2.MSG_AUDIO:
                i4.setAudioElement(e5.content, t3, n3, o3);
                break;
              case R2.MSG_FILE:
                i4.setFileElement(e5.content, t3, n3, o3);
                break;
              case R2.MSG_VIDEO:
                i4.setVideoElement(e5.content, t3, n3, o3);
                break;
              case R2.MSG_CUSTOM:
                i4.setCustomElement(e5.content);
                break;
              case R2.MSG_LOCATION:
                i4.setLocationElement(e5.content);
                break;
              case R2.MSG_GRP_TIP:
                i4.setGroupTipElement(e5.content);
                break;
              case R2.MSG_GRP_SYS_NOTICE:
                i4.setGroupSystemNoticeElement(e5.content);
                break;
              case R2.MSG_FACE:
                i4.setFaceElement(e5.content);
                break;
              case R2.MSG_MERGER:
                i4.setMergerElement(e5.content, t3, n3, o3);
            }
        };
        if (O2(e4))
          for (var s4 = 0; s4 < e4.length; s4++)
            a4(e4[s4]);
        else
          a4(e4);
      }
      this._initProxy();
    } }, { key: "clearElement", value: function() {
      this._elements.length = 0;
    } }, { key: "setTextElement", value: function(e4) {
      e4 = "string" == typeof e4 ? e4 : e4.text, e4 = new ao2({ text: e4 });
      this._elements.push(e4);
    } }, { key: "setImageElement", value: function(e4, t3, n3, o3) {
      e4 = new _o2(e4, t3, n3, o3);
      this._elements.push(e4);
    } }, { key: "setAudioElement", value: function(e4, t3, n3, o3) {
      e4 = new go2(e4, t3, n3, o3);
      this._elements.push(e4);
    } }, { key: "setFileElement", value: function(e4, t3, n3, o3) {
      e4 = new Mo2(e4, t3, n3, o3);
      this._elements.push(e4);
    } }, { key: "setVideoElement", value: function(e4, t3, n3, o3) {
      e4 = new Co2(e4, t3, n3, o3);
      this._elements.push(e4);
    } }, { key: "setLocationElement", value: function(e4) {
      e4 = new To2(e4);
      this._elements.push(e4);
    } }, { key: "setCustomElement", value: function(e4) {
      e4 = new yo2(e4);
      this._elements.push(e4);
    } }, { key: "setGroupTipElement", value: function(e4) {
      var t3, n3 = {}, o3 = e4.operationType;
      S2(e4.memberInfoList) ? e4.operatorInfo && (n3 = e4.operatorInfo) : o3 !== R2.GRP_TIP_MBR_JOIN && o3 !== R2.GRP_TIP_MBR_KICKED_OUT && o3 !== R2.GRP_TIP_MBR_SET_ADMIN && o3 !== R2.GRP_TIP_MBR_CANCELED_ADMIN || (n3 = e4.memberInfoList[0]), S2(e4.memberExtraInfo) || (t3 = e4.memberExtraInfo.reason, e4.msgMemberInfo.forEach(function(e5) {
        e5.reason = t3;
      }));
      o3 = n3.nick, n3 = n3.avatar, C2(o3) && (this.nick = o3), C2(n3) && (this.avatar = n3), o3 = new mo2(e4);
      this._elements.push(o3);
    } }, { key: "setGroupSystemNoticeElement", value: function(e4) {
      e4 = new Io2(e4);
      this._elements.push(e4);
    } }, { key: "setFaceElement", value: function(e4) {
      e4 = new ho2(e4);
      this._elements.push(e4);
    } }, { key: "setMergerElement", value: function(e4, t3, n3, o3) {
      e4 = new Eo2(e4, t3, n3, o3);
      this._elements.push(e4);
    } }, { key: "setIsRead", value: function(e4) {
      this.isRead = e4;
    } }, { key: "setRelayFlag", value: function(e4) {
      this._relayFlag = e4;
    } }, { key: "_computePriority", value: function(e4) {
      if (!N2(e4)) {
        if (C2(e4) && -1 !== Object.values(Lo2).indexOf(e4))
          return e4;
        if (A2(e4)) {
          e4 = "" + e4;
          if (-1 !== Object.keys(Lo2).indexOf(e4))
            return Lo2[e4];
        }
      }
      return R2.MSG_PRIORITY_NORMAL;
    } }, { key: "setNickAndAvatar", value: function(e4) {
      var t3 = e4.nick, e4 = e4.avatar;
      C2(t3) && (this.nick = t3), C2(e4) && (this.avatar = e4);
    } }, { key: "setNameCard", value: function(e4) {
      C2(e4) && (this.nameCard = e4);
    } }, { key: "initC2CReadReceiptInfo", value: function(e4) {
      var t3 = e4.readReceiptSentByPeer, e4 = e4.timestamp, e4 = void 0 === e4 ? 0 : e4;
      this.conversationType === R2.CONV_C2C && true === this.needReadReceipt && (this.readReceiptInfo.isPeerRead = 1 === (void 0 === t3 ? void 0 : t3), this.readReceiptInfo.timestamp = e4);
    } }]), ko2 = ["sound", "FCMChannelID"], Ro2 = ["ignoreIOSBadge", "disableVoipPush", "enableIOSBackgroundNotification"], Ao2 = { HonorImportance: { range: ["LOW", "NORMAL"], defaultValue: void 0 }, MeizuNotifyType: { range: [0, 1], defaultValue: void 0 } }, Oo2 = { enableIOSBackgroundNotification: { range: [true, false], defaultValue: false }, interruptionLevel: { range: ["passive", "active", "time-sensitive", "critical"], defaultValue: "active" } };
    function No2(e4, t3) {
      for (var n3 in t3) {
        var o3, i4;
        Object.prototype.hasOwnProperty.call(t3, n3) && (o3 = (i4 = t3[n3]).range, i4 = i4.defaultValue, e4[n3] = o3.includes(e4[n3]) ? e4[n3] : i4);
      }
      return e4;
    }
    function Go2(e4) {
      if (m3(e4))
        return { pushFlag: true === e4.disablePush ? 1 : 0, title: e4.title || "", desc: e4.description || "", ext: e4.extension || "", apnsInfo: (n3 = (t3 = e4).apnsInfo, o3 = void 0 !== (o3 = t3.ignoreIOSBadge) && o3, t3 = t3.disableVoipPush, i4 = (n3 = No2(void 0 === n3 ? {} : n3, Oo2)).ignoreIOSBadge, a4 = n3.disableVoipPush, s4 = n3.enableIOSBackgroundNotification, n3 = W2(n3, Ro2), i4 = true === i4 || true === o3 ? 1 : 0, o3 = void 0, N2(t3) || (o3 = false === t3 ? 1 : 0), N2(a4) || (o3 = false === a4 ? 1 : 0), y2(y2({}, n3), {}, { badgeMode: i4, isVoipPush: o3, contentAvailable: s4 ? 1 : 0 })), androidInfo: (a4 = void 0 === (a4 = (t3 = e4).androidInfo) ? {} : a4, t3 = t3.androidOPPOChannelID, t3 = a4.OPPOChannelID || (void 0 === t3 ? "" : t3), a4 = No2(a4, Ao2), n3 = void 0 === (n3 = a4.sound) ? "" : n3, i4 = void 0 === (i4 = a4.FCMChannelID) ? "" : i4, y2(y2({}, W2(a4, ko2)), {}, { Sound: -1 === (n3 = (a4 = n3).lastIndexOf(".")) ? a4 : a4.slice(0, n3), OPPOChannelID: t3, GoogleChannelID: i4 })) };
      var t3, n3, o3, i4, a4, s4;
    }
    t2(bo2, c3);
    var Po2 = e3(bo2, [{ key: "onNewMessage", value: function(e4) {
      var t3 = e4.dataList, n3 = e4.isInstantMessage, o3 = e4.C2CRemainingUnreadList, i4 = e4.C2CPairUnreadList, e4 = e4.isSyncingEnded, t3 = (n3 || M2.l("".concat(this._n, ".onNewMessage C2CPairUnreadList:"), i4, "C2CRemainingUnreadList:", o3), this._assembly({ dataList: t3, C2CRemainingUnreadList: o3, C2CPairUnreadList: i4, isInstantMessage: n3 })), o3 = t3.conversationOptionsList, i4 = t3.messageList, t3 = t3.isUnreadC2CMessage, a4 = At2(i4), a4 = (0 < a4.length && this.emitOEvt(h3.MESSAGE_MODIFIED, a4), this.get(11).onNewMessage({ conversationOptionsList: o3, isInstantMessage: n3, isUnreadC2CMessage: t3, isSyncingEnded: e4 }), Nt2(i4));
      n3 && 0 < a4.length && this.emitOEvt(h3.MESSAGE_RECEIVED, a4), i4.length = 0;
    } }, { key: "_assembly", value: function(e4) {
      for (var t3 = e4.dataList, n3 = e4.C2CRemainingUnreadList, o3 = e4.C2CPairUnreadList, i4 = e4.isInstantMessage, a4 = null, s4 = [], r3 = [], c4 = {}, u3 = this.get(26), l3 = false, d4 = this.get(11), p4 = this.get(4), e4 = this.get(17), _3 = this.getFileDownloadProxy(), h4 = this.getDownloadFileAuthKey(), g3 = e4.getFileDNList(), f4 = 0, m4 = t3.length; f4 < m4; f4++)
        if (this._isC2CNotice(t3[f4]))
          this._noticeFromUnreadDBList.push(t3[f4].eventArray[0].c2CNotifyMsgArray[0]);
        else {
          var v4 = t3[f4], I3 = (v4.currentUser = this.getMyUserID(), v4.conversationType = R2.CONV_C2C, v4.isSystemMessage = !!v4.isSystemMessage, (N2(v4.nick) || N2(v4.avatar)) && (l3 = true), (a4 = new So2(v4)).setElement(v4.elements, _3, h4, g3), a4.setNickAndAvatar({ nick: v4.nick, avatar: v4.avatar }), a4.conversationID);
          if (i4) {
            if (this._msgFromUnreadDBMap.get(a4.ID))
              continue;
            var M3, y3, C3 = false, T3 = (a4.from !== this.getMyUserID() ? (y3 = d4.getLatestMessageSentByPeer(I3)) && (M3 = y3.nick, y3 = y3.avatar, l3 ? a4.setNickAndAvatar({ nick: M3, avatar: y3 }) : M3 === a4.nick && y3 === a4.avatar || (C3 = true)) : (M3 = d4.getLatestMessageSentByMe(I3)) && (y3 = M3.nick, T3 = M3.avatar, y3 === a4.nick && T3 === a4.avatar || (d4.modifyMessageSentByMe({ conversationID: I3, latestNick: a4.nick, latestAvatar: a4.avatar }), p4.mockOnNickAvatarModified(a4.nick, a4.avatar))), 1 === t3[f4].isModified);
            if (d4.isMessageSentByCurrentInstance(a4) ? a4.isModified = T3 : T3 = false, 0 === v4.msgLifeTime)
              a4._onlineOnlyFlag = true, d4.isMessageSentByCurrentInstance(a4) || r3.push(a4);
            else {
              if (!d4.pushIntoMessageList(r3, a4, T3))
                continue;
              C3 && (d4.modifyMessageSentByPeer({ conversationID: I3, latestNick: a4.nick, latestAvatar: a4.avatar }), d4.updateUserProfileSpecifiedKey({ conversationID: I3, nick: a4.nick, avatar: a4.avatar }));
            }
            i4 && 0 < a4.clientTime && u3.addMessageDelay(a4.clientTime);
          } else
            this._msgFromUnreadDBMap.set(a4.ID, a4);
          if (0 !== v4.msgLifeTime) {
            if (false === a4._onlineOnlyFlag) {
              C3 = d4.getLastMessageTime(I3);
              if (A2(C3) && a4.time < C3)
                continue;
              i4 && (N2(c4[I3]) ? (v4 = 0, "in" !== a4.flow || a4._isExcludedFromUnreadCount || (v4 = 1), c4[I3] = s4.push({ conversationID: I3, unreadCount: v4, type: a4.conversationType, subType: a4.conversationSubType, lastMessage: a4._isExcludedFromLastMessage ? "" : a4 }) - 1) : (v4 = c4[I3], s4[v4].type = a4.conversationType, s4[v4].subType = a4.conversationSubType, s4[v4].lastMessage = a4._isExcludedFromLastMessage ? "" : a4, "in" !== a4.flow || a4._isExcludedFromUnreadCount || s4[v4].unreadCount++));
            }
          } else
            a4._onlineOnlyFlag = true;
        }
      this._handleNoticeFromUnreadDB();
      var D3 = false;
      if (O2(o3) && 0 < o3.length)
        for (var E3 = 0, L3 = o3.length; E3 < L3; E3++)
          !function(t4) {
            if (o3[t4].from === R2.CONV_SYSTEM)
              return;
            D3 = true;
            var e5 = s4.find(function(e6) {
              return e6.conversationID === "".concat(R2.CONV_C2C).concat(o3[t4].from);
            });
            e5 ? e5.unreadCount = o3[t4].unreadCount : s4.push({ conversationID: "".concat(R2.CONV_C2C).concat(o3[t4].from), unreadCount: o3[t4].unreadCount, type: R2.CONV_C2C });
          }(E3);
      if (O2(n3))
        for (var S3 = 0, k3 = n3.length; S3 < k3; S3++)
          !function(t4) {
            s4.find(function(e5) {
              return e5.conversationID === "".concat(R2.CONV_C2C).concat(n3[t4].from);
            }) || s4.push({ conversationID: "".concat(R2.CONV_C2C).concat(n3[t4].from), type: R2.CONV_C2C, lastMsgTime: n3[t4].lastMsgTime });
          }(S3);
      return { conversationOptionsList: s4, messageList: r3, isUnreadC2CMessage: D3 };
    } }, { key: "getMessageListFromUnreadDB", value: function() {
      return d3(this._msgFromUnreadDBMap.values());
    } }, { key: "_isC2CNotice", value: function(e4) {
      e4 = e4.eventArray;
      return !(!O2(e4) || 10 !== e4[0].event);
    } }, { key: "_handleNoticeFromUnreadDB", value: function() {
      var t3, e4 = this._noticeFromUnreadDBList.length;
      0 !== e4 && (M2.l("".concat(this._n, "._handleNoticeFromUnreadDB count:").concat(e4)), t3 = [], this._noticeFromUnreadDBList.forEach(function(e5) {
        e5.hasOwnProperty("c2cMessageRevokedNotify") && t3.push(e5);
      }), this.onMsgRevoked({ dataList: t3 }), this._noticeFromUnreadDBList.length = 0, t3.length = 0);
    } }, { key: "onMsgRevoked", value: function(e4, t3) {
      var a4, s4 = this, r3 = this.get(11), c4 = [];
      e4.dataList.forEach(function(e5) {
        e5.c2cMessageRevokedNotify && (e5 = e5.c2cMessageRevokedNotify.revokedInfos, N2(e5) || e5.forEach(function(e6) {
          var t4 = s4.getMyUserID() === e6.from ? "".concat(R2.CONV_C2C).concat(e6.to) : "".concat(R2.CONV_C2C).concat(e6.from);
          a4 = r3.revoke(t4, e6.sequence, e6.random);
          var n3, o3 = e6.revokerInfo && e6.revokerInfo.revoker, i4 = e6.revokerInfo && e6.revokerInfo.reason || "";
          a4 ? n3 = a4 : (n3 = { conversationID: t4, sequence: e6.sequence }, e6.tinyID && e6.clientTime && e6.random && (n3.ID = "".concat(e6.tinyID, "-").concat(e6.clientTime, "-").concat(e6.random)), e6.time && (n3.time = e6.time)), n3 && (n3.revoker = o3, n3.revokeReason = i4, n3.revokerInfo = { userID: o3, nick: "", avatar: "" }, c4.push(n3));
        }));
      }), 0 !== c4.length && (M2.l("".concat(this._n, ".onMsgRevoked count:").concat(c4.length, " updateUnreadCount:").concat(t3)), r3.onMessageRevoked(c4, t3), r3.updateRevokerInfo(c4).then(function(e5) {
        s4.emitOEvt(h3.MESSAGE_REVOKED, e5);
      }));
    } }, { key: "onMsgReadReceipt", value: function(e4) {
      var i4 = this;
      e4.dataList.forEach(function(e5) {
        var o3;
        S2(e5.c2cMessageReadReceipt) || (o3 = e5.c2cMessageReadReceipt.to, e5.c2cMessageReadReceipt.uinPairReadArray.forEach(function(e6) {
          var e6 = e6.peerReadTime, t3 = (M2.l("".concat(i4._n, ".onMsgReadReceipt to:").concat(o3, " peerReadTime:").concat(e6)), "".concat(R2.CONV_C2C).concat(o3)), n3 = i4.get(11);
          n3.recordPeerReadTime(t3, e6), n3.updateMsgIsPeerReadProp(t3, e6);
        }));
      });
    } }, { key: "onMsgReadNotice", value: function(e4) {
      var o3 = this;
      e4.dataList.forEach(function(e5) {
        var n3;
        S2(e5.c2cMessageReadNotice) || (n3 = o3.get(11), e5.c2cMessageReadNotice.uinPairReadArray.forEach(function(e6) {
          var t3 = e6.from, e6 = e6.peerReadTime, t3 = (M2.l("".concat(o3._n, ".onMsgReadNotice from:").concat(t3, " lastReadTime:").concat(e6)), "".concat(R2.CONV_C2C).concat(t3));
          n3.updateIsReadAfterReadReport({ conversationID: t3, lastMessageTime: e6 }), n3.updateUnreadCount(t3);
        }));
      });
    } }, { key: "onMsgModified", value: function(e4) {
      M2.l("".concat(this._n, ".onMsgModified options:"), e4);
      var t3 = this.get(11);
      e4.dataList.forEach(function(e5) {
        t3.onMessageModified(y2(y2({}, e5), {}, { conversationType: R2.CONV_C2C }));
      });
    } }, { key: "onReadReceiptList", value: function(e4) {
      M2.l("".concat(this._n, ".onReadReceiptList options:"), e4), this.get(11).updateReadReceiptInfo(e4.dataList);
    } }, { key: "sendMessage", value: function(e4, t3) {
      e4 = this._createC2CMessagePack(e4, t3);
      return this.req(e4);
    } }, { key: "_createC2CMessagePack", value: function(e4, t3) {
      var n3 = null, o3 = (t3 && (t3.offlinePushInfo && (n3 = t3.offlinePushInfo), true === t3.onlineUserOnly) && (n3 ? n3.disablePush = true : n3 = { disablePush: true }), ""), i4 = (C2(e4.cloudCustomData) && 0 < e4.cloudCustomData.length && (o3 = e4.cloudCustomData), []), a4 = (m3(t3) && m3(t3.messageControlInfo) && (a4 = (r3 = t3.messageControlInfo).excludedFromUnreadCount, s4 = r3.excludedFromLastMessage, r3 = r3.excludedFromContentModeration, true === a4 && i4.push("NoUnread"), true === s4 && i4.push("NoLastMsg"), true === r3) && i4.push("NoMsgCheck"), this.isOnlineMessage(e4, t3) ? 0 : void 0), s4 = JSON.parse(JSON.stringify(e4.getElements())), r3 = this.get(17).getFileDNList();
      return { P: G2.SEND_C2C_MSG, data: { fromAccount: this.getMyUserID(), toAccount: e4.to, msgBody: uo2(e4.type, s4, r3), cloudCustomData: o3, msgSeq: e4.sequence, msgRandom: e4.random, msgLifeTime: a4, nick: e4.nick, avatar: e4.avatar, offlinePushInfo: Go2(n3), messageControlInfo: 0 !== a4 ? i4 : void 0, clientTime: e4.clientTime, needReadReceipt: true === e4.needReadReceipt ? 1 : 0, isSupportExtension: true === e4.isSupportExtension ? 1 : 0, isRelayMessage: true === e4._relayFlag ? 1 : 0, cmConfigID: e4._cmConfigID, forbidCallbackControl: Ot2(t3) } };
    } }, { key: "isOnlineMessage", value: function(e4, t3) {
      return !(!t3 || true !== t3.onlineUserOnly);
    } }, { key: "revokeMessage", value: function(e4) {
      return this.req({ P: G2.REVOKE_C2C_MSG, data: { msgInfo: { fromAccount: e4.from, toAccount: e4.to, msgSeq: e4.sequence, msgRandom: e4.random, msgTimeStamp: e4.time } } });
    } }, { key: "deleteMessage", value: function(e4) {
      var t3 = e4.to, e4 = e4.keyList;
      return M2.l("".concat(this._n, ".deleteMessage toAccount:").concat(t3, " count:").concat(e4.length)), this.req({ P: G2.DEL_C2C_MSG, data: { fromAccount: this.getMyUserID(), to: t3, keyList: e4 } });
    } }, { key: "modifyRemoteMessage", value: function(e4) {
      var t3 = e4.from, n3 = e4.to, o3 = e4.version, o3 = void 0 === o3 ? 0 : o3, i4 = e4.sequence, a4 = e4.random, s4 = e4.time, r3 = e4.payload, c4 = e4.type, u3 = e4.cloudCustomData, e4 = e4._elements, l3 = void 0;
      return Qt2(c4) && (1 < e4.length && e4.splice(0, 1, { type: c4, content: r3 }), l3 = e4), this.req({ P: G2.MODIFY_C2C_MSG, data: { from: t3, to: n3, version: o3, sequence: i4, random: a4, time: s4, elements: l3, cloudCustomData: u3 } });
    } }, { key: "setMessageRead", value: function(e4) {
      var t3 = this, n3 = e4.conversationID, o3 = e4.lastMessageTime, i4 = "".concat(this._n, ".").concat("setMessageRead"), e4 = "convID:".concat(n3, " lastMessageTime:").concat(o3), a4 = (M2.l("".concat(i4, " ").concat(e4)), A2(o3) || this.warn("DoNotModifyLastTime"), new P2("setMessageRead"));
      return a4.setMessage(e4), this.req({ P: G2.SET_C2C_MSG_READ, data: { C2CMsgReaded: { cookie: "", C2CMsgReadedItem: [{ toAccount: n3.replace("C2C", ""), lastMessageTime: o3, receipt: 1 }] } } }).then(function() {
        a4.end(), M2.l("".concat(i4, " ok"));
        var e5 = t3.get(11);
        return e5.updateIsReadAfterReadReport({ conversationID: n3, lastMessageTime: o3 }), e5.updateUnreadCount(n3), T2();
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.l("".concat(i4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getRoamingMessage", value: function(e4) {
      var s4 = this, r3 = "".concat(this._n, ".").concat("getRoamingMessage"), t3 = e4.peerAccount, c4 = e4.conversationID, n3 = e4.count, o3 = e4.lastMessageTime, e4 = e4.messageKey, u3 = "peerAccount:".concat(t3, " count:").concat(n3 || 15, " lastMessageTime:").concat(o3 || 0, " messageKey:").concat(e4), l3 = (M2.l("".concat(r3, " ").concat(u3)), new P2("getRoamingMessage"));
      return this.req({ P: G2.GET_C2C_ROAMING_MSG, data: { peerAccount: t3, count: n3 || 15, lastMessageTime: o3 || 0, messageKey: e4 } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.complete, n4 = e5.messageList, o4 = e5.messageKey, e5 = e5.lastMessageTime, i4 = (N2(n4) ? M2.l("".concat(r3, " ok. complete:").concat(t4, " but messageList is undefined!")) : M2.l("".concat(r3, " ok. complete:").concat(t4, " count:").concat(n4.length)), l3.setMessage("".concat(u3, " complete:").concat(t4, " length:").concat(n4.length)).end(), s4.get(11)), t4 = 1 === t4, a4 = (t4 && i4.setCompleted(c4), []), n4 = i4.onRoamingMessage(n4, c4, true, a4), o4 = (i4.modifyMessageList(c4), i4.updateIsRead(c4), i4.updateRoamingMsgKeyAndTime(c4, o4, e5), i4.getPeerReadTime(c4)), o4 = (M2.l("".concat(r3, " update isPeerRead property. convID:").concat(c4, " peerReadTime:").concat(o4)), o4 ? i4.updateMsgIsPeerReadProp(c4, o4) : (e5 = c4.replace(R2.CONV_C2C, ""), s4.getRemotePeerReadTime([e5]).then(function() {
          i4.updateMsgIsPeerReadProp(c4, i4.getPeerReadTime(c4));
        })), "");
        return 0 < n4.length ? o4 = n4[0].ID : (e5 = i4.getLocalOldestMessage(c4)) && (o4 = e5.ID), M2.l("".concat(r3, " nextReqID:").concat(o4, " storedMsgCount:").concat(n4.length)), { nextReqID: o4, storedMessageList: n4, assembledMessageList: a4, isPullingCompleted: t4 };
      }).catch(function(e5) {
        return l3.setMessage(u3).setError(e5).end(), M2.w("".concat(r3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getRoamingMessagesHopping", value: function(e4) {
      var a4 = this, s4 = "".concat(this._n, ".").concat("getRoamingMessagesHopping"), t3 = e4.peerAccount, n3 = e4.time, n3 = void 0 === n3 ? 0 : n3, o3 = e4.count, r3 = e4.direction, c4 = "".concat(R2.CONV_C2C).concat(t3), u3 = "peerAccount:".concat(t3, " count:").concat(o3, " time:").concat(n3, " direction:").concat(r3), l3 = (M2.l("".concat(s4, " ").concat(u3)), new P2("getRoamingMessagesHopping"));
      return this.req({ P: G2.GET_C2C_ROAMING_MSG, data: { peerAccount: t3, count: o3 + 1, lastMessageTime: n3, direction: r3 } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.complete, n4 = e5.messageList, n4 = void 0 === n4 ? [] : n4, e5 = e5.lastMessageTime, o4 = "complete:".concat(t4, " count:").concat(n4.length), i4 = (M2.l("".concat(s4, " ok. ").concat(o4)), l3.setMessage("".concat(u3, " ").concat(o4)).end(), 1 !== t4 && (1 === r3 ? n4.pop() : n4.shift()), a4.get(11)), o4 = i4.onRoamingMessage(n4, c4, false), n4 = (a4._modifyMessageList(c4, o4), a4._computeResult({ complete: t4, lastMessageTime: e5, resultList: o4 })), t4 = (i4.storeHoppingMessageList(n4.messageList), i4.getPeerReadTime(c4));
        return M2.l("".concat(s4, " update isPeerRead property. convID:").concat(c4, " peerReadTime:").concat(t4)), t4 ? i4.updateMsgIsPeerReadProp(c4, t4) : (e5 = c4.replace(R2.CONV_C2C, ""), a4.getRemotePeerReadTime([e5]).then(function() {
          i4.updateMsgIsPeerReadProp(c4, i4.getPeerReadTime(c4));
        })), T2(n4);
      }).catch(function(e5) {
        return l3.setMessage(u3).setError(e5).end(), M2.w("".concat(s4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_computeResult", value: function(e4) {
      var t3 = e4.complete, t3 = void 0 === t3 ? 0 : t3, n3 = e4.lastMessageTime, e4 = e4.resultList, e4 = { messageList: d3(void 0 === e4 ? [] : e4), isCompleted: false, nextMessageTime: "" };
      return 1 === t3 ? e4.isCompleted = true : e4.nextMessageTime = n3, e4;
    } }, { key: "_modifyMessageList", value: function(e4, t3) {
      e4 = this.get(11).getLocalConversation(e4);
      if (e4)
        for (var n3 = e4.userProfile.nick, o3 = e4.userProfile.avatar, e4 = this.get(4).getNickAndAvatarByUserID(this.getMyUserID()), i4 = e4.nick, a4 = e4.avatar, s4 = t3.length - 1; 0 <= s4; s4--) {
          var r3 = t3[s4];
          "in" === r3.flow && (r3.nick !== n3 && r3.setNickAndAvatar({ nick: n3 }), r3.avatar !== o3) && r3.setNickAndAvatar({ avatar: o3 }), "out" === r3.flow && (r3.nick !== i4 && r3.setNickAndAvatar({ nick: i4 }), r3.avatar !== a4) && r3.setNickAndAvatar({ avatar: a4 });
        }
    } }, { key: "getRemotePeerReadTime", value: function(a4) {
      var s4, r3 = this, c4 = "".concat(this._n, ".").concat("getRemotePeerReadTime");
      return S2(a4) ? Promise.resolve() : (s4 = new P2("getRemotePeerReadTime"), M2.l("".concat(c4, " userIDList:").concat(a4)), this.req({ P: G2.GET_C2C_PEER_READ_TIME, data: { userIDList: a4 } }).then(function(e4) {
        var t3 = e4.data.peerReadTimeList;
        M2.l("".concat(c4, " ok. peerReadTimeList:").concat(t3));
        for (var n3 = "", o3 = r3.get(11), i4 = 0; i4 < a4.length; i4++)
          n3 += "".concat(a4[i4], "-").concat(t3[i4], " "), 0 < t3[i4] && o3.recordPeerReadTime("".concat(R2.CONV_C2C).concat(a4[i4]), t3[i4]);
        s4.setMessage(n3).end();
      }).catch(function(e4) {
        s4.setError(e4).end(), M2.w("".concat(c4, " failed. error:"), e4);
      }));
    } }, { key: "sendReadReceipt", value: function(e4) {
      var t3, n3 = e4[0].conversationID.replace(R2.CONV_C2C, ""), o3 = new P2("sendReadReceipt"), i4 = (o3.setMessage("peerAccount:".concat(n3)), this.getMyUserID()), e4 = e4.filter(function(e5) {
        return e5.from !== i4 && true === e5.needReadReceipt;
      }).map(function(e5) {
        return { fromAccount: e5.from, toAccount: e5.to, sequence: e5.sequence, random: e5.random, time: e5.time, clientTime: e5.clientTime };
      });
      return 0 === e4.length ? E2({ code: k2.READ_RECEIPT_MSG_LIST_EMPTY }) : (t3 = "".concat(this._n, ".").concat("sendReadReceipt"), M2.l("".concat(t3, ". peerAccount:").concat(n3, " length:").concat(e4.length)), this.req({ P: G2.SEND_C2C_READ_RECEIPT, data: { peerAccount: n3, messageInfoList: e4 } }).then(function(e5) {
        return o3.end(), M2.l("".concat(t3, " ok")), T2();
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.w("".concat(t3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "getReadReceiptList", value: function(e4) {
      var t3 = e4[0].conversationID.replace(R2.CONV_C2C, "");
      return M2.l("".concat(this._n, ".getReadReceiptList peerAccount:").concat(t3, " msgCount:").concat(e4.length)), D2({ messageList: e4 });
    } }, { key: "getMessageExtensions", value: function(e4, t3) {
      return M2.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t3)), this.req({ P: G2.GET_C2C_MSG_EXT, data: { from: e4.from, to: e4.to, messageKey: this.getMessageKey(e4), startSequence: t3 } });
    } }, { key: "modifyMsgExts", value: function(e4, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1;
      return M2.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n3)), this.req({ P: G2.MODIFY_C2C_MSG_EXT, data: { from: e4.from, to: e4.to, messageKey: this.getMessageKey(e4), extensionList: t3, operateType: n3 } });
    } }, { key: "getMessageKey", value: function(e4) {
      var t3 = e4.clientSequence, n3 = e4.random, e4 = e4.time;
      return "".concat(t3, "_").concat(n3, "_").concat(e4);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._msgFromUnreadDBMap.clear(), this._noticeFromUnreadDBList.length = 0;
    } }]), U2 = { A2KEY_AND_TINYID_UPDATED: "_inner".concat(1), CLOUD_CONFIG: "_inner".concat(2), PROFILE_UPDATED: "_inner".concat(3), CONV_SYNC_COMPLETED: "_inner".concat(4), C2C_UNREAD_HANDLE_COMPLETED: "_inner".concat(5) }, Uo2 = e3(function e4(t3) {
      p3(this, e4), this._convM = t3, this._map = /* @__PURE__ */ new Map(), this._n = "MsgListHandler", this._latestMsgSentByPeerMap = /* @__PURE__ */ new Map(), this._latestMsgSentByMeMap = /* @__PURE__ */ new Map(), this._hoppingMsgMap = /* @__PURE__ */ new Map(), this.TOPIC_MSG_LIMIT = 1e3, this._convM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e4 = this._convM.getCloudConfig("topic_msg_limit");
      N2(e4) || (this.TOPIC_MSG_LIMIT = Number(e4)), M2.l("".concat(this._n, "._onCloudConfig topicMsgLimit:").concat(this.TOPIC_MSG_LIMIT));
    } }, { key: "onCheckTimer", value: function(e4) {
      if (e4 % 20 == 0 && 0 < this._map.size) {
        var t3, n3 = F2(this._map);
        try {
          for (n3.s(); !(t3 = n3.n()).done; ) {
            var o3 = j2(t3.value, 2), i4 = o3[0], a4 = o3[1];
            i4.includes(it3) && a4.size >= this.TOPIC_MSG_LIMIT && this._convM.clearMemMsg(i4, true);
          }
        } catch (e5) {
          n3.e(e5);
        } finally {
          n3.f();
        }
      }
    } }, { key: "pushIn", value: function(e4) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], n3 = e4.conversationID, o3 = true, i4 = (this._map.has(n3) || this._map.set(n3, /* @__PURE__ */ new Map()), this._getUniqueIDOfMsg(e4));
      if (this._map.get(n3).has(i4)) {
        var a4 = this._map.get(n3).get(i4);
        if (!t3 || true === a4.isModified)
          return false;
      }
      return this._map.get(n3).set(i4, e4), this._setLatestMsgSentByPeer(n3, e4), this._setLatestMsgSentByMe(n3, e4), o3;
    } }, { key: "unshift", value: function(e4, t3) {
      var n3;
      if (O2(e4) ? 0 < e4.length && (n3 = e4[0].conversationID, this._unshiftMultipleMsgs(e4, t3)) : (n3 = e4.conversationID, this._unshiftSingleMsg(e4, t3)), n3) {
        var o3 = Array.from(this._map.get(n3).values()), e4 = o3.length;
        if (0 !== e4) {
          for (var i4 = e4 - 1; 0 <= i4; i4--)
            if ("out" === o3[i4].flow) {
              this._setLatestMsgSentByMe(n3, o3[i4]);
              break;
            }
          if (n3.startsWith(R2.CONV_C2C)) {
            for (var a4 = e4 - 1; 0 <= a4; a4--)
              if ("in" === o3[a4].flow) {
                this._setLatestMsgSentByPeer(n3, o3[a4]);
                break;
              }
          }
        }
      }
    } }, { key: "_unshiftSingleMsg", value: function(e4, t3) {
      var n3, o3, i4 = e4.conversationID, a4 = this._getUniqueIDOfMsg(e4);
      this._map.has(i4) ? (n3 = this._map.get(i4), o3 = Array.from(n3), n3.has(a4) || (o3.unshift([a4, e4]), this._map.set(i4, new Map(o3)), t3.push(e4))) : (this._map.set(i4, /* @__PURE__ */ new Map()), this._map.get(i4).set(a4, e4), t3.push(e4));
    } }, { key: "_unshiftMultipleMsgs", value: function(e4, t3) {
      for (var n3 = e4.length, o3 = [], i4 = e4[0].conversationID, a4 = this._map.get(i4), s4 = this._map.has(i4) ? Array.from(a4) : [], r3 = 0; r3 < n3; r3++) {
        var c4 = this._getUniqueIDOfMsg(e4[r3]);
        a4 && a4.has(c4) || (o3.push([c4, e4[r3]]), t3.push(e4[r3]));
      }
      this._map.set(i4, new Map(o3.concat(s4)));
    } }, { key: "remove", value: function(e4) {
      var t3 = e4.conversationID, e4 = this._getUniqueIDOfMsg(e4);
      this._map.has(t3) && this._map.get(t3).delete(e4);
    } }, { key: "revoke", value: function(e4, t3, n3) {
      var o3;
      return this._map.has(e4) ? (o3 = this._map.get(e4), this._updateMsgIsRevoked(o3, t3, n3)) : this._hoppingMsgMap.has(e4) ? (o3 = this._hoppingMsgMap.get(e4), this._updateMsgIsRevoked(o3, t3, n3)) : null;
    } }, { key: "_updateMsgIsRevoked", value: function(e4, t3, n3) {
      var o3, i4 = F2(e4);
      try {
        for (i4.s(); !(o3 = i4.n()).done; ) {
          var a4 = j2(o3.value, 2)[1];
          if (a4.sequence === t3 && (N2(n3) || a4.random === n3))
            return a4.isRevoked || (a4.isRevoked = true), a4;
        }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
    } }, { key: "removeByConvID", value: function(e4) {
      var t3 = this._map.has(e4);
      M2.l("".concat(this._n, ".removeByConvID convID:").concat(e4, " has:").concat(t3)), t3 && (this._map.delete(e4), this._latestMsgSentByPeerMap.delete(e4), this._latestMsgSentByMeMap.delete(e4));
    } }, { key: "findMessage", value: function(e4) {
      return this._findMsg(e4, this._map) || this._findMsg(e4, this._hoppingMsgMap);
    } }, { key: "_findMsg", value: function(e4, t3) {
      var n3, o3 = null, i4 = F2(t3);
      try {
        for (i4.s(); !(n3 = i4.n()).done; )
          for (var a4 = d3(j2(n3.value, 2)[1].values()), s4 = a4.length, r3 = 0; r3 < s4; r3++)
            if (a4[r3].ID === e4) {
              o3 = a4[r3];
              break;
            }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
      return o3;
    } }, { key: "updateMsgIsPeerReadProp", value: function(e4, t3) {
      var n3, o3 = [];
      return this._map.has(e4) ? (n3 = this._map.get(e4), o3 = this._updateMsgIsPeerReadProp(n3, t3)) : this._hoppingMsgMap.has(e4) && (n3 = this._hoppingMsgMap.get(e4), o3 = this._updateMsgIsPeerReadProp(n3, t3)), M2.l("".concat(this._n, ".updateMsgIsPeerReadProp convID:").concat(e4, " peerReadTime:").concat(t3, " count:").concat(o3.length)), o3;
    } }, { key: "_updateMsgIsPeerReadProp", value: function(e4, t3) {
      var n3, o3 = [], i4 = F2(e4);
      try {
        for (i4.s(); !(n3 = i4.n()).done; ) {
          var a4 = j2(n3.value, 2)[1];
          a4.time <= t3 && !a4.isPeerRead && "out" === a4.flow && (a4.isPeerRead = true, o3.push(a4));
        }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
      return o3;
    } }, { key: "updateMsgIsModifiedProp", value: function(e4) {
      var t3 = e4.conversationID;
      this._map.has(t3) && (e4 = this._getUniqueIDOfMsg(e4), t3 = this._map.get(t3).get(e4)) && (t3.isModified = true);
    } }, { key: "hasLocalMsgList", value: function(e4) {
      return this._map.has(e4);
    } }, { key: "getLocalMsgList", value: function(e4) {
      return this.hasLocalMsgList(e4) ? d3(this._map.get(e4).values()) : [];
    } }, { key: "getLocalMaxSeq", value: function(e4) {
      return this.hasLocalMsgList(e4) ? (e4 = d3(this._map.get(e4).values()).map(function(e5) {
        return e5.sequence;
      }), Math.max.apply(Math, d3(e4))) : 0;
    } }, { key: "getLocalMaxTime", value: function(e4) {
      return this.hasLocalMsgList(e4) ? (e4 = d3(this._map.get(e4).values()).map(function(e5) {
        return e5.time;
      }), Math.max.apply(Math, d3(e4))) : 0;
    } }, { key: "hasLocalMsg", value: function(e4, t3) {
      for (var n3 = false, o3 = this.getLocalMsgList(e4), i4 = o3.length, a4 = 0; a4 < i4; a4++)
        o3[a4].ID === t3 && (n3 = true);
      return n3;
    } }, { key: "getLocalMsg", value: function(e4, t3) {
      for (var n3 = null, o3 = this.getLocalMsgList(e4), i4 = o3.length, a4 = 0; a4 < i4; a4++)
        if (o3[a4].ID === t3) {
          n3 = o3[a4];
          break;
        }
      return n3;
    } }, { key: "getLocalLastMsg", value: function(e4) {
      for (var t3 = this.getLocalMsgList(e4), n3 = void 0, o3 = t3.length - 1; 0 <= o3; o3--)
        if (t3[o3].status === Pn2) {
          n3 = t3[o3];
          break;
        }
      return n3;
    } }, { key: "getLocalSecondLastMsg", value: function(e4) {
      e4 = this.getLocalMsgList(e4);
      return e4[e4.length - 2];
    } }, { key: "getLocalOldestMsg", value: function(e4) {
      return this.getLocalMsgList(e4)[0];
    } }, { key: "_setLatestMsgSentByPeer", value: function(e4, t3) {
      e4.startsWith(R2.CONV_C2C) && "in" === t3.flow && this._latestMsgSentByPeerMap.set(e4, t3);
    } }, { key: "_setLatestMsgSentByMe", value: function(e4, t3) {
      "out" === t3.flow && this._latestMsgSentByMeMap.set(e4, t3);
    } }, { key: "getLatestMsgSentByPeer", value: function(e4) {
      return this._latestMsgSentByPeerMap.get(e4);
    } }, { key: "getLatestMsgSentByMe", value: function(e4) {
      return this._latestMsgSentByMeMap.get(e4);
    } }, { key: "modifyMsgSentByPeer", value: function(e4) {
      var t3 = e4.conversationID, n3 = e4.latestNick, o3 = e4.latestAvatar, e4 = this._map.get(t3);
      if (!S2(e4)) {
        var i4 = Array.from(e4.values()), e4 = i4.length;
        if (0 !== e4) {
          for (var a4 = null, s4 = 0, r3 = false, c4 = e4 - 1; 0 <= c4; c4--)
            "in" === i4[c4].flow && ((a4 = i4[c4]).nick !== n3 && (a4.setNickAndAvatar({ nick: n3 }), r3 = true), a4.avatar !== o3 && (a4.setNickAndAvatar({ avatar: o3 }), r3 = true), r3) && (s4 += 1);
          M2.l("".concat(this._n, ".modifyMsgSentByPeer convID:").concat(t3, " count:").concat(s4));
        }
      }
    } }, { key: "modifyMsgSentByMe", value: function(e4) {
      var t3 = e4.conversationID, n3 = e4.latestNick, o3 = e4.latestAvatar, e4 = this._map.get(t3);
      if (!S2(e4)) {
        var i4 = Array.from(e4.values()), e4 = i4.length;
        if (0 !== e4) {
          for (var a4 = null, s4 = 0, r3 = false, c4 = e4 - 1; 0 <= c4; c4--)
            "out" === i4[c4].flow && ((a4 = i4[c4]).nick !== n3 && (a4.setNickAndAvatar({ nick: n3 }), r3 = true), a4.avatar !== o3 && (a4.setNickAndAvatar({ avatar: o3 }), r3 = true), r3) && (s4 += 1);
          M2.l("".concat(this._n, ".modifyMsgSentByMe convID:").concat(t3, " count:").concat(s4));
        }
      }
    } }, { key: "getTopicConvIDList", value: function(t3) {
      return d3(this._map.keys()).filter(function(e4) {
        return e4.startsWith("".concat(R2.CONV_GROUP).concat(t3));
      });
    } }, { key: "onMsgModified", value: function(e4, t3) {
      var n3, o3, i4, a4;
      return (this._map.has(e4) || this._hoppingMsgMap.has(e4)) && (n3 = "".concat(this._n, ".onMsgModified"), i4 = this._getUniqueIDOfMsg(t3), a4 = !!(o3 = this._getTargetMsg(e4, i4)), M2.l("".concat(n3, " convID:").concat(e4, " uniqueID:").concat(i4, " has:").concat(a4)), a4) ? (e4 = t3.messageVersion, i4 = t3.elements, a4 = t3.cloudCustomData, t3 = t3.checkResult, M2.l("".concat(n3, " localVersion:").concat(o3.version, " remoteVersion:").concat(e4)), o3.version < e4 ? (o3.version = e4, o3._elements = JSON.parse(JSON.stringify(i4)), o3.payload = o3._elements[0].content, o3.type = o3._elements[0].type, o3.cloudCustomData = a4, o3.isModified = true, o3.hasRiskContent = sn2(t3), { isUpdated: true, message: o3 }) : { isUpdated: false, message: o3 }) : { isUpdated: false, message: null };
    } }, { key: "_getUniqueIDOfMsg", value: function(e4) {
      var t3 = e4.from, n3 = e4.to, o3 = e4.random, i4 = e4.sequence, e4 = e4.time;
      return "".concat(t3, "-").concat(n3, "-").concat(o3, "-").concat(i4, "-").concat(e4);
    } }, { key: "_getTargetMsg", value: function(e4, t3) {
      if (this._map.has(e4))
        return this._map.get(e4).get(t3);
      var n3 = void 0;
      if (this._hoppingMsgMap.has(e4)) {
        for (var o3 = d3(this._hoppingMsgMap.get(e4).values()), i4 = 0; i4 < o3.length; i4++)
          if (this._getUniqueIDOfMsg(o3[i4]) === t3) {
            n3 = o3[i4];
            break;
          }
      }
      return n3;
    } }, { key: "storeHoppingMsgList", value: function(e4) {
      if (0 !== e4.length) {
        var t3 = e4[0].conversationID, n3 = e4.length;
        this._hoppingMsgMap.has(t3) || this._hoppingMsgMap.set(t3, /* @__PURE__ */ new Map());
        for (var o3 = this._hoppingMsgMap.get(t3), i4 = 0; i4 < n3; i4++) {
          var a4 = e4[i4];
          o3.has(a4.ID) || o3.set(a4.ID, a4);
        }
      }
    } }, { key: "getHoppingMsg", value: function(e4, t3) {
      if (this._hoppingMsgMap.has(e4))
        return this._hoppingMsgMap.get(e4).get(t3);
    } }, { key: "reset", value: function() {
      this._map.clear(), this._latestMsgSentByPeerMap.clear(), this._latestMsgSentByMeMap.clear(), this._hoppingMsgMap.clear();
    } }]);
    function bo2(e4) {
      return p3(this, bo2), (e4 = i3(this, bo2, [e4]))._n = "C2CModule", e4._msgFromUnreadDBMap = /* @__PURE__ */ new Map(), e4._noticeFromUnreadDBList = [], e4;
    }
    function wo2(e4) {
      this.mixin(e4);
    }
    wo2.mixin = function(e4) {
      e4 = e4.prototype || e4;
      e4._isReady = false, e4.ready = function(e5) {
        if (e5)
          return this._isReady ? void (1 < arguments.length && void 0 !== arguments[1] && arguments[1] ? e5.call(this) : setTimeout(e5, 1)) : (this._readyQueue = this._readyQueue || [], void this._readyQueue.push(e5));
      }, e4.triggerReady = function() {
        var t3 = this;
        this._isReady = true, setTimeout(function() {
          var e5 = t3._readyQueue;
          t3._readyQueue = [], e5 && 0 < e5.length && e5.forEach(function(e6) {
            e6.call(this);
          }, t3);
        }, 1);
      }, e4.resetReady = function() {
        this._isReady = false, this._readyQueue = [];
      }, e4.isReady = function() {
        return this._isReady;
      };
    };
    function Fo2(e4, t3, n3) {
      return N2(e4) ? { lastTime: 0, lastSequence: 0, fromAccount: "", messageForShow: "", payload: null, type: "", isRevoked: false, cloudCustomData: "", onlineOnlyFlag: false, nick: "", nameCard: "", version: 0, isPeerRead: false, revoker: null } : n3 && e4.ID || e4 instanceof So2 ? { lastTime: e4.time || 0, lastSequence: e4.sequence || 0, fromAccount: e4.from || "", messageForShow: Zt2(e4.type, e4.payload, t3), payload: e4.payload || null, type: e4.type || null, isRevoked: e4.isRevoked || false, cloudCustomData: e4.cloudCustomData || "", onlineOnlyFlag: e4._onlineOnlyFlag || false, nick: e4.nick || "", nameCard: e4.nameCard || "", version: e4.version || 0, isPeerRead: e4.isPeerRead || false, revoker: e4.revoker || null } : y2(y2({}, e4), {}, { messageForShow: Zt2(e4.type, e4.payload, t3) });
    }
    function qo2(e4, t3) {
      return S2(e4) ? { lastTime: 0, lastSequence: 0, fromAccount: "", payload: null, type: "", messageForShow: "", nick: "", avatar: "", version: 0, cloudCustomData: "", isRevoked: false, revoker: null } : { lastTime: e4.time || 0, lastSequence: e4.sequence || 0, fromAccount: e4.from || "", payload: e4.payload || null, type: e4.type || "", messageForShow: Zt2(e4.type, e4.payload, t3), nick: e4.nick || "", avatar: e4.avatar || "", version: e4.version || 0, cloudCustomData: e4.cloudCustomData || "", isRevoked: e4.isRevoked || false, revoker: e4.revoker || null };
    }
    function xo2(e4) {
      var t3 = String(e4).replace(/[=]+$/, ""), n3 = "";
      if (t3.length % 4 == 1)
        return "";
      for (var o3, i4, a4 = 0, s4 = 0; i4 = t3.charAt(s4++); ~i4 && (o3 = a4 % 4 ? 64 * o3 + i4 : i4, a4++ % 4) && (n3 += String.fromCharCode(255 & o3 >> (-2 * a4 & 6))))
        i4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i4);
      try {
        return decodeURIComponent(escape(n3));
      } catch (e5) {
        return "";
      }
    }
    var Vo = ["jpg", "jpeg", "gif", "png", "bmp", "image", "webp"], Bo2 = ["mp4", "quicktime", "mov"], Ho = e3(function e4(t3) {
      var n3 = this;
      p3(this, e4), S2(t3) || (this.userID = t3.userID || "", this.nick = t3.nick || "", this.gender = t3.gender || "", this.birthday = t3.birthday || 0, this.location = t3.location || "", this.selfSignature = t3.selfSignature || "", this.allowType = t3.allowType || R2.ALLOW_TYPE_ALLOW_ANY, this.language = t3.language || 0, this.avatar = t3.avatar || "", this.messageSettings = t3.messageSettings || 0, this.adminForbidType = t3.adminForbidType || R2.FORBID_TYPE_NONE, this.level = t3.level || 0, this.role = t3.role || 0, this.lastUpdatedTime = 0, this.profileCustomField = [], S2(t3.profileCustomField)) || t3.profileCustomField.forEach(function(e5) {
        n3.profileCustomField.push({ key: e5.key, value: e5.value });
      });
    }, [{ key: "validate", value: function(e4) {
      var t3, n3 = true, o3 = "";
      if (S2(e4))
        return { valid: false, tips: "empty options" };
      if (e4.profileCustomField)
        for (var i4 = e4.profileCustomField.length, a4 = null, s4 = 0; s4 < i4; s4++) {
          if (a4 = e4.profileCustomField[s4], !C2(a4.key) || -1 === a4.key.indexOf("Tag_Profile_Custom"))
            return { valid: false, tips: "The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom" };
          if (!C2(a4.value))
            return { valid: false, tips: "The type of values of the custom profile key-value pairs (which is profileCustomField) must be String" };
        }
      for (t3 in e4)
        if (Object.prototype.hasOwnProperty.call(e4, t3)) {
          if ("profileCustomField" === t3)
            continue;
          if (S2(e4[t3]) && !C2(e4[t3]) && !A2(e4[t3])) {
            o3 = "key:" + t3 + ", invalid value:" + e4[t3], n3 = false;
            continue;
          }
          switch (t3) {
            case "nick":
              C2(e4[t3]) || (n3 = !(o3 = "nick must be a string")), 500 < ft3(e4[t3]) && (o3 = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(ft3(e4[t3]), " bytes"), n3 = false);
              break;
            case "gender":
              It2(Qe3, e4.gender) || (o3 = "key:gender, invalid value:" + e4.gender, n3 = false);
              break;
            case "birthday":
              A2(e4.birthday) || (n3 = !(o3 = "birthday must be a number"));
              break;
            case "location":
              C2(e4.location) || (n3 = !(o3 = "location must be a string"));
              break;
            case "selfSignature":
              C2(e4.selfSignature) || (n3 = !(o3 = "selfSignature must be a string"));
              break;
            case "allowType":
              It2(et3, e4.allowType) || (o3 = "key:allowType, invalid value:" + e4.allowType, n3 = false);
              break;
            case "language":
              A2(e4.language) || (n3 = !(o3 = "language must be a number"));
              break;
            case "avatar":
              C2(e4.avatar) || (n3 = !(o3 = "avatar must be a string"));
              break;
            case "messageSettings":
              0 !== e4.messageSettings && 1 !== e4.messageSettings && (n3 = !(o3 = "messageSettings must be 0 or 1"));
              break;
            case "adminForbidType":
              It2($e3, e4.adminForbidType) || (o3 = "key:adminForbidType, invalid value:" + e4.adminForbidType, n3 = false);
              break;
            case "level":
              A2(e4.level) || (n3 = !(o3 = "level must be a number"));
              break;
            case "role":
              A2(e4.role) || (n3 = !(o3 = "role must be a number"));
              break;
            default:
              o3 = "unknown key:" + t3 + "  " + e4[t3], n3 = false;
          }
        }
      return { valid: n3, tips: o3 };
    } }]), Ko = e3(function e4(t3) {
      p3(this, e4), this.MAX_LENGTH = t3, this.map = /* @__PURE__ */ new Map();
    }, [{ key: "set", value: function(e4) {
      var t3;
      this.map.size >= this.MAX_LENGTH && (t3 = this.map.entries().next().value[0], this.map.delete(t3)), this.map.set(e4, 1);
    } }, { key: "has", value: function(e4) {
      return this.map.has(e4);
    } }, { key: "delete", value: function(e4) {
      this.has(e4) && this.map.delete(e4);
    } }, { key: "reset", value: function() {
      this.map.clear();
    } }]), Wo = ["groupID", "name", "avatar", "type", "introduction", "notification", "ownerID", "selfInfo", "createTime", "infoSequence", "lastInfoTime", "lastMessage", "nextMessageSeq", "memberNum", "maxMemberNum", "memberList", "joinOption", "groupCustomField", "muteAllMembers", "isSupportTopic", "inviteOption", "_lastRevokedTime"], Yo = e3(function e4(t3) {
      p3(this, e4), this.groupID = "", this.name = "", this.avatar = "", this.type = "", this.introduction = "", this.notification = "", this.ownerID = "", this.createTime = "", this.infoSequence = "", this.lastInfoTime = "", this.selfInfo = { messageRemindType: "", joinTime: "", nameCard: "", role: "", userID: "", memberCustomField: void 0, readedSequence: 0, excludedUnreadSequenceList: void 0 }, this.lastMessage = { lastTime: "", lastSequence: "", fromAccount: "", messageForShow: "" }, this.nextMessageSeq = "", this.memberNum = "", this.memberCount = "", this.maxMemberNum = "", this.maxMemberCount = "", this.joinOption = "", this.inviteOption = "", this.groupCustomField = [], this.muteAllMembers = false, this.isSupportTopic = false, this._lastRevokedTime = 0, this._initGroup(t3);
    }, [{ key: "memberNum", get: function() {
      return this.memberCount;
    }, set: function(e4) {
    } }, { key: "maxMemberNum", get: function() {
      return this.maxMemberCount;
    }, set: function(e4) {
    } }, { key: "_initGroup", value: function(e4) {
      for (var t3 in e4)
        Wo.indexOf(t3) < 0 || ("selfInfo" !== t3 ? ("memberNum" === t3 && (this.memberCount = e4[t3]), "maxMemberNum" === t3 && (this.maxMemberCount = e4[t3]), "isSupportTopic" !== t3 ? this[t3] = e4[t3] : this.isSupportTopic = 1 === e4[t3]) : this.updateSelfInfo(e4[t3]));
    } }, { key: "updateGroup", value: function(e4) {
      var t3 = this, e4 = (e4.appid = void 0, e4.grossTopicNextMsgSeq = void 0, e4.selfInfo && (e4.selfInfo.grossTopicReadSeq = void 0), JSON.parse(JSON.stringify(e4)));
      e4.lastMsgTime && (this.lastMessage.lastTime = e4.lastMsgTime), N2(e4.muteAllMembers) || ("On" === e4.muteAllMembers ? e4.muteAllMembers = true : e4.muteAllMembers = false), e4.groupCustomField && Rt2(this.groupCustomField, e4.groupCustomField), N2(e4.memberNum) || (this.memberCount = e4.memberNum), N2(e4.maxMemberNum) || (this.maxMemberCount = e4.maxMemberNum), N2(e4.isSupportTopic) || (this.isSupportTopic = A2(e4.isSupportTopic) ? 1 === e4.isSupportTopic : e4.isSupportTopic), ht3(this, e4, ["members", "errorCode", "lastMsgTime", "groupCustomField", "memberNum", "maxMemberNum", "isSupportTopic"]), O2(e4.members) && 0 < e4.members.length && e4.members.forEach(function(e5) {
        e5.userID === t3.selfInfo.userID && ht3(t3.selfInfo, e5, ["sequence"]);
      });
    } }, { key: "updateSelfInfo", value: function(e4) {
      e4 = { nameCard: e4.nameCard, joinTime: e4.joinTime, role: e4.role, messageRemindType: e4.messageRemindType, readedSequence: e4.readedSequence, excludedUnreadSequenceList: e4.excludedUnreadSequenceList };
      ht3(this.selfInfo, y2({}, e4), [], ["", null, void 0, 0, NaN]);
    } }, { key: "setSelfNameCard", value: function(e4) {
      this.selfInfo.nameCard = e4;
    } }]), jo2 = e3(function e4(t3, n3) {
      var o3 = 2 < arguments.length && void 0 !== arguments[2] && arguments[2];
      p3(this, e4), this.conversationID = t3.conversationID || "", this.unreadCount = t3.unreadCount || 0, this.type = t3.type || "", this.lastMessage = Fo2(t3.lastMessage, n3, o3), t3.lastMsgTime && (this.lastMessage.lastTime = t3.lastMsgTime), this._isInfoCompleted = false, this.peerReadTime = t3.peerReadTime || 0, this.groupAtInfoList = [], this.remark = t3.remark || "", this.isPinned = t3.isPinned || false, this.messageRemindType = t3.messageRemindType, this.markList = t3.markList || [], this.customData = t3.customData || "", this.conversationGroupList = t3.conversationGroupList || [], this.draftText = t3.draftText || "", this._initProfile(t3), this.subType = this.groupProfile ? this.groupProfile.type : "";
    }, [{ key: "toAccount", get: function() {
      return this.conversationID.startsWith(R2.CONV_C2C) ? this.conversationID.replace(R2.CONV_C2C, "") : this.conversationID.startsWith(R2.CONV_GROUP) ? this.conversationID.replace(R2.CONV_GROUP, "") : "";
    } }, { key: "_initProfile", value: function(t3) {
      var n3 = this;
      Object.keys(t3).forEach(function(e4) {
        switch (e4) {
          case "userProfile":
            n3.userProfile = t3.userProfile;
            break;
          case "groupProfile":
            n3.groupProfile = t3.groupProfile;
        }
      }), N2(this.userProfile) && this.type === R2.CONV_C2C ? this.userProfile = new Ho({ userID: t3.conversationID.replace("C2C", "") }) : N2(this.groupProfile) && this.type === R2.CONV_GROUP && (this.groupProfile = new Yo({ groupID: t3.conversationID.replace("GROUP", "") }));
    } }, { key: "updateUnreadCount", value: function(e4) {
      var t3 = e4.nextUnreadCount, n3 = e4.isFromGetConversations, e4 = e4.isUnreadC2CMessage;
      N2(t3) || (Gt2(this.subType) ? this.unreadCount = 0 : n3 && this.type === R2.CONV_GROUP || n3 && this.type === R2.CONV_TOPIC || e4 && this.type === R2.CONV_C2C ? this.unreadCount = t3 : this.unreadCount = this.unreadCount + t3);
    } }, { key: "updateLastMessage", value: function(e4) {
      this.lastMessage = Fo2(e4);
    } }, { key: "updateGroupAtInfoList", value: function(e4) {
      var t3;
      this._isNeedMergeGroupAtInfo(e4) || (-1 !== (t3 = (b2(t3 = e4.groupAtType) || B2(t3) || X3(t3) || H2()).slice(0)).indexOf(R2.CONV_AT_ME) && -1 !== t3.indexOf(R2.CONV_AT_ALL) && (t3 = [R2.CONV_AT_ALL_AT_ME]), t3 = { from: e4.from, groupID: e4.groupID, topicID: e4.topicID, messageSequence: e4.sequence, atTypeArray: t3, __random: e4.__random, __sequence: e4.__sequence }, this.groupAtInfoList.push(t3));
    } }, { key: "_isNeedMergeGroupAtInfo", value: function(t3) {
      var n3, e4 = t3.groupID, o3 = t3.sequence;
      return !!Pt2({ groupID: e4 }) && (n3 = false, this.groupAtInfoList.forEach(function(e5) {
        e5.messageSequence === o3 && (-1 < e5.atTypeArray.indexOf(R2.CONV_AT_ME) && -1 < t3.groupAtType.indexOf(R2.CONV_AT_ALL) && (e5.atTypeArray = [R2.CONV_AT_ALL_AT_ME]), -1 < e5.atTypeArray.indexOf(R2.CONV_AT_ALL) && -1 < t3.groupAtType.indexOf(R2.CONV_AT_ME) && (e5.atTypeArray = [R2.CONV_AT_ALL_AT_ME], e5.__random = t3.__random, e5.__sequence = t3.__sequence), n3 = true);
      }), n3);
    } }, { key: "clearGroupAtInfoList", value: function() {
      this.groupAtInfoList.length = 0;
    } }, { key: "reduceUnreadCount", value: function() {
      return 1 <= this.unreadCount && (--this.unreadCount, true);
    } }, { key: "isLastMessageRevoked", value: function(e4) {
      var t3 = e4.sequence, e4 = e4.time;
      return this.type === R2.CONV_C2C && t3 === this.lastMessage.lastSequence && e4 === this.lastMessage.lastTime || this.type === R2.CONV_GROUP && t3 === this.lastMessage.lastSequence;
    } }, { key: "setLastMessageRevoked", value: function(e4) {
      this.lastMessage.isRevoked = e4;
    } }, { key: "setLastMessageRevoker", value: function(e4) {
      this.lastMessage.revoker = e4;
    } }, { key: "setDraftText", value: function(e4) {
      this.draftText = e4;
    } }]), Jo = q2(q2(q2({}, R2.MSG_REMIND_ACPT_AND_NOTE, 0), R2.MSG_REMIND_DISCARD, 1), R2.MSG_REMIND_ACPT_NOT_NOTE, 2), zo = e3(function e4(t3) {
      p3(this, e4), this._convM = t3, this._n = "MsgRemindHandler";
    }, [{ key: "onAllRcvMsgOptNotify", value: function(e4) {
      e4 = this._handleResult(e4);
      this._convM.emitOEvt(h3.ALL_RECEIVE_MESSAGE_OPT_UPDATED, e4);
    } }, { key: "getC2CMsgRemindType", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".getC2CMsgRemindType");
      return this._convM.req({ P: G2.GET_C2C_PEER_MUTE_NOTIFICATIONS, data: { toAccount: this._convM.getMyUserID(), userIDList: t3 } }).then(function(e4) {
        M2.l("".concat(o3, " ok. userIDList:").concat(t3));
        e4 = e4.data.muteFlagList;
        n3._convM.onC2CMsgRemindTypeFetched(e4);
      }).catch(function(e4) {
        M2.e("".concat(o3, " failed. error:"), e4);
      });
    } }, { key: "set", value: function(e4) {
      return e4.groupID ? this._setGroupMsgRemindType(e4) : O2(e4.userIDList) ? this._setC2CMsgRemindType(e4) : void 0;
    } }, { key: "_setGroupMsgRemindType", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("_setGroupMsgRemindType"), e4 = t3.groupID, i4 = t3.messageRemindType, a4 = "groupID:".concat(e4, " messageRemindType:").concat(i4), s4 = new P2("_setGroupMsgRemindType"), r3 = (s4.setMessage(a4), this._get(7));
      return r3 ? r3.modifyGroupMemberInfo({ groupID: e4, messageRemindType: i4, userID: this._convM.getMyUserID() }).then(function() {
        s4.end(), M2.l("".concat(o3, " ok. ").concat(a4));
        var e5 = n3.onGroupMsgRemindTypeUpdated(t3);
        return n3._convM.onTotalUnreadCountUpdate(), T2(e5);
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      }) : E2({ code: k2.NO_MODULE });
    } }, { key: "onGroupMsgRemindTypeUpdated", value: function(e4) {
      var t3, n3, o3 = e4.groupID, e4 = e4.messageRemindType, i4 = (M2.l("".concat(this._n, ".onGroupMsgRemindTypeUpdated groupID:").concat(o3, " messageRemindType:").concat(e4)), this._get(7).getLocalGroupProfile(o3));
      return i4 && (i4.selfInfo.messageRemindType = e4), Ut2(o3) ? (t3 = Xt2(n3 = o3), (n3 = this._get(10).getLocalTopic(t3, n3)) && n3.updateSelfInfo({ messageRemindType: e4 }) && this._convM.emitOEvt(h3.TOPIC_UPDATED, { groupID: t3, topic: n3 }), { topic: n3 }) : (this._convM.patchMsgRemindType({ ID: o3, isC2CConversation: false, messageRemindType: e4 }) && this._emitConvUpdate(), { group: i4 });
    } }, { key: "_setC2CMsgRemindType", value: function(e4) {
      var i4 = this, a4 = "".concat(this._n, ".").concat("_setC2CMsgRemindType"), t3 = e4.userIDList, s4 = e4.messageRemindType, r3 = t3.slice(0, 30), e4 = Jo[s4] || 0, c4 = "userIDList:".concat(r3, " messageRemindType:").concat(s4), u3 = new P2("_setC2CMsgRemindType");
      return u3.setMessage(c4), this._convM.req({ P: G2.SET_C2C_PEER_MUTE_NOTIFICATIONS, data: { userIDList: r3, muteFlag: e4 } }).then(function(e5) {
        u3.end();
        var e5 = e5.data.errorList, t4 = [], n3 = [], e5 = (O2(e5) && e5.forEach(function(e6) {
          t4.push(e6.userID), n3.push({ userID: e6.userID, code: e6.errorCode });
        }), r3.filter(function(e6) {
          return -1 === t4.indexOf(e6);
        })), o3 = (M2.l("".concat(a4, " ok. ").concat(c4, " successUserIDList:").concat(e5, " failureUserIDList:").concat(JSON.stringify(n3))), 0);
        return e5.forEach(function(e6) {
          i4._convM.patchMsgRemindType({ ID: e6, isC2CConversation: true, messageRemindType: s4 }) && (o3 += 1);
        }), 1 <= o3 && i4._emitConvUpdate(), r3.length = t4.length = 0, i4._convM.onTotalUnreadCountUpdate(), D2({ successUserIDList: e5.map(function(e6) {
          return { userID: e6 };
        }), failureUserIDList: n3 });
      }).catch(function(e5) {
        return u3.setError(e5).end(), M2.e("".concat(a4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_get", value: function(e4) {
      return this._convM.get(e4);
    } }, { key: "_emitConvUpdate", value: function() {
      this._convM.emitConvUpdate(true, false);
    } }, { key: "setAllRcvMsgOpt", value: function(e4) {
      var t3 = "".concat(this._n, ".").concat("setAllRcvMsgOpt"), n3 = e4.messageRemindType, n3 = void 0 === n3 ? R2.MSG_REMIND_ACPT_NOT_NOTE : n3, o3 = e4.isRepeated, o3 = void 0 === o3 || o3, i4 = this._calcStartAndEndTime(e4), a4 = i4.startTime, a4 = void 0 === a4 ? 0 : a4, i4 = i4.endTime, i4 = void 0 === i4 ? 0 : i4, e4 = JSON.stringify(e4), s4 = new P2("setAllRcvMsgOpt");
      return s4.setMessage(e4), M2.l("".concat(t3, " options:").concat(e4)), this._convM.req({ P: G2.SET_ALL_RECEIVE_MSG_OPT, data: { messageRemindType: Jo[n3], startTime: a4, endTime: i4, isRepeated: o3 ? 1 : 0 } }).then(function(e5) {
        return s4.end(), M2.l("".concat(t3, " ok.")), T2(e5);
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_calcStartAndEndTime", value: function(e4) {
      var t3 = e4.startHour, t3 = void 0 === t3 ? 0 : t3, n3 = e4.startMinute, n3 = void 0 === n3 ? 0 : n3, o3 = e4.startSecond, o3 = void 0 === o3 ? 0 : o3, i4 = e4.duration, i4 = void 0 === i4 ? 0 : i4, e4 = e4.isRepeated, e4 = void 0 === e4 || e4, a4 = /* @__PURE__ */ new Date(), s4 = a4.getFullYear(), r3 = a4.getMonth(), a4 = a4.getDate(), s4 = Math.round(new Date(s4, r3, a4, t3, n3, o3).getTime() / 1e3);
      return { startTime: s4, endTime: e4 && 86400 <= i4 ? s4 + 86400 : s4 + i4 };
    } }, { key: "getAllRcvMsgOpt", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("getAllRcvMsgOpt"), o3 = new P2("getAllRcvMsgOpt");
      return this._convM.req({ P: G2.GET_ALL_RECEIVE_MSG_OPT, data: { toAccount: this._convM.getMyUserID() } }).then(function(e4) {
        e4 = e4.data, o3.setMessage(JSON.stringify(e4)).end(), M2.l("".concat(n3, " ok. data:").concat(JSON.stringify(e4))), e4 = t3._handleResult(e4);
        return T2(e4);
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_handleResult", value: function(e4) {
      var t3 = e4.messageRemindType, n3 = e4.startTime, o3 = e4.endTime, e4 = e4.isRepeated, i4 = R2.MSG_REMIND_ACPT_AND_NOTE;
      return 1 === t3 && (i4 = R2.MSG_REMIND_DISCARD), { messageRemindType: i4 = 2 === t3 ? R2.MSG_REMIND_ACPT_NOT_NOTE : i4, startTime: n3, endTime: o3, isRepeated: 1 === e4 };
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }]), Xo = e3(function e4(t3) {
      p3(this, e4), this._convM = t3, this._n = "ConvGroupHandler", this._convGroupMap = /* @__PURE__ */ new Map(), this._startIndex = 0, this._pagingStatus = bn2;
    }, [{ key: "setConvCustomData", value: function(e4) {
      var i4 = this, a4 = "".concat(this._n, ".").concat("setConvCustomData"), t3 = e4.conversationIDList, s4 = e4.customData, r3 = (M2.l("".concat(a4, " options:"), e4), new P2("setConvCustomData")), n3 = (r3.setMessage(JSON.stringify(e4)), { fromAccount: this._getMyUserID(), itemList: [] }), c4 = [], u3 = [];
      return t3.forEach(function(e5) {
        var t4;
        return i4._hasLocalConv(e5) ? bt3(e5) || wt2(e5) ? (t4 = { operationType: 2, contactItem: void 0, customMark: s4 }, bt3(e5) ? t4.contactItem = { type: 1, toAccount: e5.replace(R2.CONV_C2C, "") } : wt2(e5) && (t4.contactItem = { type: 2, groupID: e5.replace(R2.CONV_GROUP, "") }), void n3.itemList.push(t4)) : (i4._onConvIDInvalid(u3, e5), true) : (i4._onConvNotFound(u3, e5), true);
      }), u3.length === t3.length ? D2({ successConversationIDList: c4, failureConversationIDList: u3 }) : this._convM.req({ P: G2.SET_CONV_CUSTOM_DATA, data: n3 }).then(function(e5) {
        r3.end(), M2.l("".concat(a4, " ok"));
        var t4, n4, o3, e5 = e5.data.resultItem;
        return O2(e5) && (o3 = false, e5.forEach(function(e6) {
          t4 = i4._concatConvID(e6.contactItem), 0 === e6.resultCode ? (c4.push(t4), (n4 = i4._getLocalConv(t4)) && n4.customData !== s4 && (n4.customData = s4, o3 = true)) : u3.push({ conversationID: t4, code: e6.resultCode, message: e6.resultInfo });
        }), true === o3) && i4._emitConvUpdate(), T2({ successConversationIDList: c4, failureConversationIDList: u3 });
      }).catch(function(e5) {
        return r3.setError(e5).end(), M2.e("".concat(a4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "markConv", value: function(e4) {
      var t3, n3, a4, s4, r3, o3, i4, c4, u3, l3, d4 = this;
      return this._convM.canIUse(g2.CONV_MARK) ? (t3 = "".concat(this._n, ".").concat("markConv"), n3 = e4.conversationIDList, a4 = e4.markType, s4 = e4.enableMark, M2.l("".concat(t3, " options:"), e4), r3 = new P2("markConv"), o3 = void r3.setMessage(JSON.stringify(e4)), i4 = void 0, e4 = this._getFlagBit(a4), true === s4 ? i4 = [e4] : o3 = [e4], c4 = { fromAccount: this._getMyUserID(), itemList: [] }, u3 = [], l3 = [], n3.forEach(function(e5) {
        var t4;
        return d4._hasLocalConv(e5) ? bt3(e5) || wt2(e5) ? (t4 = { operationType: 1, contactItem: void 0, clearMark: o3, setMark: i4 }, bt3(e5) ? t4.contactItem = { type: 1, toAccount: e5.replace(R2.CONV_C2C, "") } : wt2(e5) && (t4.contactItem = { type: 2, groupID: e5.replace(R2.CONV_GROUP, "") }), void c4.itemList.push(t4)) : (d4._onConvIDInvalid(l3, e5), true) : (d4._onConvNotFound(l3, e5), true);
      }), l3.length === n3.length ? D2({ successConversationIDList: u3, failureConversationIDList: l3 }) : this._convM.req({ P: G2.MARK_CONV, data: c4 }).then(function(e5) {
        r3.end(), M2.l("".concat(t3, " ok"));
        var n4, o4, i5, e5 = e5.data.resultItem;
        return O2(e5) && (i5 = false, e5.forEach(function(e6) {
          var t4;
          n4 = d4._concatConvID(e6.contactItem), 0 === e6.resultCode ? (u3.push(n4), (o4 = d4._getLocalConv(n4)) && (t4 = o4.markList.indexOf(a4), true === s4 ? -1 === t4 && (o4.markList.push(a4), i5 = true) : -1 !== t4 && (o4.markList.splice(t4, 1), i5 = true))) : l3.push({ conversationID: n4, code: e6.resultCode, message: e6.resultInfo });
        }), true === i5) && d4._emitConvUpdate(), T2({ successConversationIDList: u3, failureConversationIDList: l3 });
      }).catch(function(e5) {
        return r3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._convM.noUse("markConv");
    } }, { key: "getLocalConvGroupList", value: function() {
      var e4 = this;
      return M2.l("".concat(this._n, ".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)), this._pagingStatus === qn2 ? this.getRemoteConvGroupList().then(function() {
        return T2(d3(e4._convGroupMap.values()));
      }) : D2(d3(this._convGroupMap.values()));
    } }, { key: "searchConvGroupAndMark", value: function(e4, t3) {
      var n3 = this, o3 = "".concat(this._n, ".searchConvGroupAndMark"), i4 = [];
      return e4.forEach(function(e5) {
        1 === t3 ? i4.push({ type: 1, toAccount: e5 }) : 2 === t3 && i4.push({ type: 2, groupID: e5 });
      }), M2.l("".concat(o3, " type:").concat(t3, " list:"), e4), this._convM.req({ P: G2.SEARCH_CONV_GRP_MARK, data: { fromAccount: this._getMyUserID(), contactItem: i4 } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.contactItem, e5 = e5.groupItem;
        M2.l("".concat(o3, " ok. contactItem:"), t4, "groupItem:", e5), n3._fillConvGroupMap(e5), n3._handleContactItem(t4), n3._emitConvUpdate();
      }).catch(function(e5) {
        M2.w("".concat(o3, " failed. error:"), e5);
      });
    } }, { key: "_fillConvGroupMap", value: function(e4) {
      var n3 = this;
      O2(e4) && e4.forEach(function(e5) {
        var t3 = e5.convGroupID, e5 = e5.groupName;
        n3._convGroupMap.set(t3, e5);
      });
    } }, { key: "_handleContactItem", value: function(e4) {
      var a4, s4 = this;
      O2(e4) && e4.forEach(function(e5) {
        var t3 = [], n3 = e5.standardMark, o3 = e5.customData, i4 = e5.convGroupIDList;
        O2(i4) && i4.forEach(function(e6) {
          s4._convGroupMap.has(e6) && t3.push(s4._convGroupMap.get(e6));
        }), a4 = s4._concatConvID(e5), (a4 = s4._getLocalConv(a4)) && (a4.markList = $t2(n3), a4.customData = o3 || "", a4.conversationGroupList = [].concat(t3));
      });
    } }, { key: "getRemoteConvGroupList", value: function() {
      var i4 = this, a4 = "".concat(this._n, ".getRemoteConvGroupList");
      return this._pagingStatus = wn2, this._convM.req({ P: G2.GET_CONV_GRP_LIST, data: { fromAccount: this._getMyUserID(), startIndex: this._startIndex } }).then(function(e4) {
        var e4 = e4.data, t3 = e4.completeFlag, n3 = e4.contactItem, o3 = e4.nextStartIndex, o3 = void 0 === o3 ? 0 : o3, e4 = e4.groupItem;
        if (i4._startIndex = o3, M2.l("".concat(a4, " completeFlag:").concat(t3, " nextStartIndex:").concat(o3, ", groupItem:"), e4, "contactItem:", n3), i4._fillConvGroupMap(e4), i4._handleContactItem(n3), 0 === t3)
          return i4.getRemoteConvGroupList();
        1 === t3 && (i4._pagingStatus = Fn2, i4._emitConvUpdate(), i4._emitConvGroupListUpdate());
      }).catch(function(e4) {
        i4._pagingStatus = qn2, M2.w("".concat(a4, " failed. error:"), e4);
      });
    } }, { key: "createConvGroup", value: function(e4) {
      var a4, s4, r3, t3, c4, u3, l3 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (a4 = "".concat(this._n, ".").concat("createConvGroup"), M2.l("".concat(a4, " options:"), e4), (s4 = new P2("createConvGroup")).setMessage(JSON.stringify(e4)), r3 = e4.groupName, e4 = e4.conversationIDList, t3 = { fromAccount: this._getMyUserID(), itemList: [{ groupName: r3, contactItem: [] }] }, c4 = [], u3 = [], e4.forEach(function(e5) {
        return l3._hasLocalConv(e5) ? bt3(e5) || wt2(e5) ? void (bt3(e5) ? t3.itemList[0].contactItem.push({ type: 1, toAccount: e5.replace(R2.CONV_C2C, "") }) : wt2(e5) && t3.itemList[0].contactItem.push({ type: 2, groupID: e5.replace(R2.CONV_GROUP, "") })) : (l3._onConvIDInvalid(u3, e5), true) : (l3._onConvNotFound(u3, e5), true);
      }), u3.length === e4.length ? D2({ successConversationIDList: c4, failureConversationIDList: u3 }) : this._convM.req({ P: G2.CREATE_CONV_GRP, data: t3 }).then(function(e5) {
        s4.end(), M2.l("".concat(a4, " ok"));
        var t4, n3, o3, e5 = e5.data.groupResultItem[0], i4 = e5.groupItem, e5 = e5.resultItem;
        return m3(i4) && (l3._convGroupMap.set(i4.convGroupID, i4.groupName), l3._emitConvGroupListUpdate()), O2(e5) && (o3 = false, e5.forEach(function(e6) {
          t4 = l3._concatConvID(e6.contactItem), 0 === e6.resultCode ? (c4.push(t4), (n3 = l3._getLocalConv(t4)) && -1 === n3.conversationGroupList.indexOf(r3) && (n3.conversationGroupList.push(r3), o3 = true)) : u3.push({ conversationID: t4, code: e6.resultCode, message: e6.resultInfo });
        }), true === o3) && (l3._emitConvUpdate(), l3._emitConvGroupListUpdate()), T2({ successConversationIDList: c4, failureConversationIDList: u3 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(a4, " failed. error:"), e5), E2(e5);
      })) : this._convM.noUse("createConvGroup");
    } }, { key: "deleteConvGroup", value: function(n3) {
      var o3, i4, a4 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (o3 = "".concat(this._n, ".").concat("deleteConvGroup"), M2.l("".concat(o3, " groupName:").concat(n3)), (i4 = new P2("deleteConvGroup")).setMessage(n3), this._convM.req({ P: G2.DEL_CONV_GRP, data: { fromAccount: this._getMyUserID(), groupName: [n3] } }).then(function(e4) {
        i4.end(), M2.l("".concat(o3, " ok"));
        var t3, e4 = e4.data.groupItem;
        O2(e4) && (t3 = false, e4.forEach(function(e5) {
          a4._convGroupMap.has(e5.convGroupID) && (a4._convGroupMap.delete(e5.convGroupID), t3 = true);
        }), true === t3) && a4._emitConvGroupListUpdate(), a4._eraseFromConversationGroupList([n3]);
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      })) : this._convM.noUse("deleteConvGroup");
    } }, { key: "renameConvGroup", value: function(e4) {
      var i4, a4, s4, r3, c4 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (i4 = "".concat(this._n, ".").concat("renameConvGroup"), M2.l("".concat(i4, " options:"), e4), (a4 = new P2("renameConvGroup")).setMessage(JSON.stringify(e4)), s4 = e4.oldName, r3 = e4.newName, this._convM.req({ P: G2.RENAME_CONV_GRP, data: { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 1, oldName: s4, newName: r3 } } }).then(function(e5) {
        a4.end(), M2.l("".concat(i4, " ok"));
        e5 = e5.data.updateGroupResult.convGroupID;
        c4._convGroupMap.set(e5, r3), c4._emitConvGroupListUpdate();
        var t3, n3, e5 = c4._convM.getLocalConvList(), o3 = false;
        e5.forEach(function(e6) {
          t3 = e6.conversationGroupList, -1 !== (n3 = t3.indexOf(s4)) && (t3.splice(n3, 1, r3), o3 = true);
        }), true === o3 && c4._emitConvUpdate();
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : this._convM.noUse("renameConvGroup");
    } }, { key: "addConvsToGroup", value: function(e4) {
      var i4, a4, t3, s4, n3, r3, c4, u3 = this;
      return this._convM.canIUse(g2.CONV_GROUP) ? (i4 = "".concat(this._n, ".").concat("addConvsToGroup"), M2.l("".concat(i4, " options:"), e4), (a4 = new P2("addConvsToGroup")).setMessage(JSON.stringify(e4)), t3 = e4.conversationIDList, s4 = e4.groupName, n3 = { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 2, groupName: s4, updateItem: [] } }, r3 = [], c4 = [], t3.forEach(function(e5) {
        return u3._hasLocalConv(e5) ? bt3(e5) || wt2(e5) ? void (bt3(e5) ? n3.updateGroup.updateItem.push({ operationType: 1, contactItem: { type: 1, toAccount: e5.replace(R2.CONV_C2C, "") } }) : wt2(e5) && n3.updateGroup.updateItem.push({ operationType: 1, contactItem: { type: 2, groupID: e5.replace(R2.CONV_GROUP, "") } })) : (u3._onConvIDInvalid(c4, e5), true) : (u3._onConvNotFound(c4, e5), true);
      }), c4.length === t3.length ? D2({ successConversationIDList: r3, failureConversationIDList: c4 }) : this._convM.req({ P: G2.ADD_CONV_TO_GRP, data: n3 }).then(function(e5) {
        a4.end(), M2.l("".concat(i4, " ok"));
        var t4, n4, o3, e5 = e5.data.updateGroupResult.contactResultItem;
        return O2(e5) && (o3 = false, e5.forEach(function(e6) {
          t4 = u3._concatConvID(e6.contactItem), 0 === e6.resultCode ? (n4 = u3._getLocalConv(t4)) && -1 === n4.conversationGroupList.indexOf(s4) && (n4.conversationGroupList.push(s4), r3.push(t4), o3 = true) : c4.push({ conversationID: t4, code: e6.resultCode, message: e6.resultInfo });
        }), true === o3) && (u3._emitConvUpdate(), u3._emitConvInGroupUpdate(s4)), T2({ successConversationIDList: r3, failureConversationIDList: c4 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : this._convM.noUse("addConvsToGroup");
    } }, { key: "deleteConvsFromGroup", value: function(e4) {
      var t3, a4, n3, s4, o3, r3, c4, u3 = this, i4 = "deleteConvsFromGroup";
      return this._convM.canIUse(g2.CONV_GROUP) ? (t3 = "".concat(this._n, ".").concat(i4), M2.l("".concat(t3, " options:"), e4), (a4 = new P2(i4)).setMessage(JSON.stringify(e4)), n3 = e4.conversationIDList, s4 = e4.groupName, o3 = { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 2, groupName: s4, updateItem: [] } }, r3 = [], c4 = [], n3.forEach(function(e5) {
        return u3._hasLocalConv(e5) ? bt3(e5) || wt2(e5) ? void (bt3(e5) ? o3.updateGroup.updateItem.push({ operationType: 2, contactItem: { type: 1, toAccount: e5.replace(R2.CONV_C2C, "") } }) : wt2(e5) && o3.updateGroup.updateItem.push({ operationType: 2, contactItem: { type: 2, groupID: e5.replace(R2.CONV_GROUP, "") } })) : (u3._onConvIDInvalid(c4, e5), true) : (u3._onConvNotFound(c4, e5), true);
      }), c4.length === n3.length ? D2({ successConversationIDList: r3, failureConversationIDList: c4 }) : this._convM.req({ P: G2.DEL_CONV_FROM_GRP, data: o3 }).then(function(e5) {
        a4.end(), M2.l("".concat(t3, " ok"));
        var n4, o4, i5, e5 = e5.data.updateGroupResult.contactResultItem;
        return O2(e5) && (i5 = false, e5.forEach(function(e6) {
          var t4;
          n4 = u3._concatConvID(e6.contactItem), 0 === e6.resultCode ? (o4 = u3._getLocalConv(n4)) && -1 !== (t4 = o4.conversationGroupList.indexOf(s4)) && (o4.conversationGroupList.splice(t4, 1), r3.push(n4), i5 = true) : c4.push({ conversationID: n4, code: e6.resultCode, message: e6.resultInfo });
        }), true === i5) && (u3._emitConvUpdate(), u3._emitConvInGroupUpdate(s4)), T2({ successConversationIDList: r3, failureConversationIDList: c4 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._convM.noUse(i4);
    } }, { key: "onConvMarkUpdated", value: function(e4) {
      var i4, a4, s4 = this;
      S2(e4) || (M2.l("".concat(this._n, ".onConvMarkUpdated markItemList:"), e4), a4 = false, e4.forEach(function(e5) {
        var t3 = e5.recentContactItem, n3 = e5.optType, o3 = e5.standardMark, e5 = e5.customMark;
        i4 = s4._concatConvID(t3), (i4 = s4._getLocalConv(i4)) && (1 === n3 ? a4 = s4._diffStandardMark(i4, o3) : 2 === n3 ? a4 = s4._diffCustomMark(i4, e5) : 3 === n3 && (t3 = s4._diffStandardMark(i4, o3), n3 = s4._diffCustomMark(i4, e5), a4 = t3 || n3));
      }), true === a4 && this._emitConvUpdate());
    } }, { key: "_diffStandardMark", value: function(e4, t3) {
      var t3 = $t2(t3), n3 = false;
      return true !== function(e5, t4) {
        if (e5 !== t4) {
          if (!e5 || !t4)
            return false;
          if (e5.length !== t4.length)
            return false;
          for (var n4 = 0, o3 = e5.length; n4 < o3; n4++)
            if (e5[n4] !== t4[n4])
              return false;
        }
        return true;
      }(e4.markList, t3) && (e4.markList = t3, n3 = true), n3;
    } }, { key: "_diffCustomMark", value: function(e4, t3) {
      var n3 = false;
      return e4.customData !== t3 && void 0 !== t3 && (e4.customData = t3, n3 = true), n3;
    } }, { key: "onConvGroupCreated", value: function(e4) {
      var a4 = this, s4 = (M2.l("".concat(this._n, ".onConvGroupCreated resultList:"), e4), false), r3 = false;
      O2(e4) && (e4.forEach(function(e5) {
        var t3 = e5.msgGroupItem, n3 = t3.groupID, o3 = t3.groupName;
        a4._convGroupMap.get(n3) !== o3 && (a4._convGroupMap.set(n3, o3), r3 = true);
        var i4, t3 = e5.msgRecentContactItem;
        O2(t3) && t3.forEach(function(e6) {
          i4 = a4._concatConvID(e6), (i4 = a4._getLocalConv(i4)) && -1 === i4.conversationGroupList.indexOf(o3) && (i4.conversationGroupList.push(o3), s4 = true);
        });
      }), true === s4 && this._emitConvUpdate(), true === r3) && this._emitConvGroupListUpdate();
    } }, { key: "onConvGroupDeleted", value: function(e4) {
      var n3, o3 = this, i4 = (M2.l("".concat(this._n, ".onConvGroupDeleted groupItemList:"), e4), []);
      O2(e4) && (n3 = false, e4.forEach(function(e5) {
        var t3 = e5.groupID, e5 = e5.groupName;
        o3._convGroupMap.has(t3) && (o3._convGroupMap.delete(t3), n3 = true, i4.push(e5));
      }), true === n3) && this._emitConvGroupListUpdate(), this._eraseFromConversationGroupList(i4);
    } }, { key: "_eraseFromConversationGroupList", value: function(t3) {
      S2(t3) || (this._convM.getLocalConvList().forEach(function(e4) {
        e4.conversationGroupList = e4.conversationGroupList.filter(function(e5) {
          return !t3.includes(e5);
        });
      }), this._emitConvUpdate());
    } }, { key: "onConvGroupNameUpdated", value: function(e4) {
      M2.l("".concat(this._n, ".onConvGroupNameUpdated options:"), e4);
      var t3, n3, o3, i4 = e4.groupID, a4 = e4.groupName, s4 = e4.oldGroupName;
      this._convGroupMap.get(i4) !== a4 && (this._convGroupMap.set(i4, a4), this._emitConvGroupListUpdate(), e4 = this._convM.getLocalConvList(), o3 = false, e4.forEach(function(e5) {
        t3 = e5.conversationGroupList, -1 !== (n3 = t3.indexOf(s4)) && (t3.splice(n3, 1, a4), o3 = true);
      }), true === o3) && this._emitConvUpdate();
    } }, { key: "onConvInGroupUpdated", value: function(e4) {
      var n3, o3, i4, a4 = this, s4 = (M2.l("".concat(this._n, ".onConvInGroupUpdated options:"), e4), e4.oldGroupName), e4 = e4.recentContactUpdateGroupItem;
      O2(e4) && (i4 = false, e4.forEach(function(e5) {
        var t3 = e5.contactOptType, e5 = e5.recentContactItem;
        n3 = a4._concatConvID(e5), (n3 = a4._getLocalConv(n3)) && (o3 = n3.conversationGroupList.indexOf(s4), 1 === t3 ? -1 === o3 && (n3.conversationGroupList.push(s4), i4 = true) : 2 === t3 && -1 !== o3 && (n3.conversationGroupList.splice(o3, 1), i4 = true));
      }), true === i4) && (this._emitConvUpdate(), this._emitConvInGroupUpdate(s4));
    } }, { key: "onConvAddedToOrDeletedFromGroup", value: function(e4) {
      var n3, o3, i4 = this, t3 = (M2.l("".concat(this._n, ".onConvAddedToOrDeletedFromGroup options:"), e4), e4.msgRecentContactItem), e4 = e4.msgRecentContactUpdateContactItem, t3 = this._concatConvID(t3), a4 = this._getLocalConv(t3);
      a4 && O2(e4) && (o3 = false, e4.forEach(function(e5) {
        var t4 = e5.groupOptType, e5 = e5.recentContactGroupItem.groupName;
        n3 = a4.conversationGroupList.indexOf(e5), 1 === t4 ? -1 === n3 && (a4.conversationGroupList.push(e5), o3 = true) : 2 === t4 && -1 !== n3 && (a4.conversationGroupList.splice(n3, 1), o3 = true), true === o3 && i4._emitConvInGroupUpdate(e5);
      }), true === o3) && this._emitConvUpdate();
    } }, { key: "onConvGroupListSynced", value: function(e4) {
      O2(e4) && 0 !== e4.length && (M2.l("".concat(this._n, ".onConvGroupListSynced groupItem:"), e4), this._fillConvGroupMap(e4));
    } }, { key: "getConvGroupListByID", value: function(e4) {
      var t3, n3 = this;
      if (!S2(e4))
        return t3 = [], e4.forEach(function(e5) {
          n3._convGroupMap.has(e5) && t3.push(n3._convGroupMap.get(e5));
        }), t3;
    } }, { key: "_onConvNotFound", value: function(e4, t3) {
      e4.push({ conversationID: t3, code: k2.CONV_NOT_FOUND, message: this._convM.getErrMsg(k2.CONV_NOT_FOUND) });
    } }, { key: "_onConvIDInvalid", value: function(e4, t3) {
      e4.push({ conversationID: t3, code: k2.INVALID_CONV_ID, message: this._convM.getErrMsg(k2.INVALID_CONV_ID) });
    } }, { key: "_getFlagBit", value: function(e4) {
      for (var t3 = e4.toString(2), n3 = t3.length, o3 = n3 - 1; 0 <= o3; o3--)
        if ("1" === t3[o3])
          return n3 - o3 - 1;
    } }, { key: "_concatConvID", value: function(e4) {
      var t3, n3 = e4.type, o3 = e4.to, i4 = e4.groupID, e4 = e4.userID;
      return 1 === n3 ? N2(e4) ? N2(o3) || (t3 = "".concat(R2.CONV_C2C).concat(o3)) : t3 = "".concat(R2.CONV_C2C).concat(e4) : 2 === n3 && (t3 = "".concat(R2.CONV_GROUP).concat(i4)), t3;
    } }, { key: "_getMyUserID", value: function() {
      return this._convM.getMyUserID();
    } }, { key: "_getLocalConv", value: function(e4) {
      return this._convM.getLocalConversation(e4);
    } }, { key: "_hasLocalConv", value: function(e4) {
      return this._convM.hasLocalConversation(e4);
    } }, { key: "_emitConvUpdate", value: function() {
      this._convM.emitConvUpdate(true, false);
    } }, { key: "_emitConvGroupListUpdate", value: function() {
      this._convM.emitOEvt(h3.CONVERSATION_GROUP_LIST_UPDATED, d3(this._convGroupMap.values()));
    } }, { key: "_emitConvInGroupUpdate", value: function(t3) {
      var e4 = { groupName: t3, conversationList: [] }, n3 = this._convM.getLocalConvList();
      e4.conversationList = n3.filter(function(e5) {
        return e5.conversationGroupList.includes(t3);
      }), this._convM.emitOEvt(h3.CONVERSATION_IN_GROUP_UPDATED, e4);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._convGroupMap.clear(), this._startIndex = 0, this._pagingStatus = bn2;
    } }]), Zo = (t2(Li2, c3), e3(Li2, [{ key: "_initListeners", value: function() {
      var e4 = this.getIEmitInst();
      e4.on(U2.A2KEY_AND_TINYID_UPDATED, this._init, this), e4.on(U2.PROFILE_UPDATED, this._onProfileUpdated, this), e4.on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    } }, { key: "_init", value: function() {
      var e4 = this, t3 = (M2.l("".concat(this._n, "._init")), this.get(13).getItem("conversationMap")), n3 = this.isIntl(), o3 = this.isUsingChatCore();
      if (t3) {
        for (var i4 = t3.length, a4 = 0; a4 < i4; a4++) {
          var s4 = t3[a4];
          if (s4) {
            if (this._isNonExistentAccount(s4.conversationID))
              continue;
            if (s4.groupProfile && Gt2(s4.groupProfile.type))
              continue;
          }
          this._convMap.set(s4.conversationID, new jo2(t3[a4], n3, o3));
        }
        this.emitConvUpdate(true, false);
      }
      this.ready(function() {
        0 < e4._tmpGroupList.length && (e4.updateConvGroupProfile(e4._tmpGroupList), e4._tmpGroupList.length = 0);
      }), this.syncConvList();
    } }, { key: "_isNonExistentAccount", value: function(e4) {
      var t3;
      return "@TLS#ERROR" === (t3 = e4.startsWith(R2.CONV_C2C) ? e4.replace(R2.CONV_C2C, "") : t3) || "@TLS#NOT_FOUND" === t3;
    } }, { key: "onCheckTimer", value: function(e4) {
      this.isLoggedIn() && this._msgListHandler.onCheckTimer(e4);
    } }, { key: "onMessageSent", value: function(e4) {
      this._onSendOrRcvMsg({ conversationOptionsList: e4.conversationOptionsList, isInstantMessage: true });
    } }, { key: "onNewMessage", value: function(e4) {
      this._onSendOrRcvMsg(e4);
    } }, { key: "_onSendOrRcvMsg", value: function(e4) {
      var t3 = this, n3 = e4.conversationOptionsList, o3 = e4.isInstantMessage, o3 = void 0 === o3 || o3, i4 = e4.isUnreadC2CMessage, i4 = void 0 !== i4 && i4, a4 = e4.updateUnreadCount, a4 = void 0 === a4 || a4, s4 = e4.isSyncingEnded, s4 = void 0 !== s4 && s4;
      this._isReady ? 0 !== n3.length ? (true === o3 && this._checkNewConv(n3), this._updateLocalConvList({ conversationOptionsList: n3, isInstantMessage: o3, isUnreadC2CMessage: i4, isFromGetConversations: false, updateUnreadCount: a4 }), o3 || (this._convIDFromUnreadDBMap = new Map([].concat(d3(this._convIDFromUnreadDBMap), d3(n3.map(function(e5) {
        return [e5.conversationID, 1];
      })))), this._diffAndDeleteConv(), s4 && this.emitIEvt(U2.C2C_UNREAD_HANDLE_COMPLETED)), 0 < n3.filter(function(e5) {
        return !t3._isConvNeedShow(e5.conversationID);
      }).length || this.emitConvUpdate()) : s4 && this.emitIEvt(U2.C2C_UNREAD_HANDLE_COMPLETED) : this.ready(function() {
        t3._onSendOrRcvMsg(e4);
      });
    } }, { key: "updateConvGroupProfile", value: function(e4) {
      var n3, o3 = this;
      O2(e4) && 0 === e4.length || (0 !== this._convMap.size ? (n3 = false, e4.forEach(function(e5) {
        var t3 = "".concat(R2.CONV_GROUP).concat(e5.groupID);
        o3._convMap.has(t3) && (n3 = true, (t3 = o3._convMap.get(t3)).groupProfile = JSON.parse(JSON.stringify(e5)), t3.lastMessage.lastSequence < e5.nextMessageSeq && (t3.lastMessage.lastSequence = e5.nextMessageSeq - 1), t3.subType || (t3.subType = e5.type));
      }), n3 && this.emitConvUpdate(true, false)) : this._tmpGroupList = e4);
    } }, { key: "onMessageRevoked", value: function(e4, t3) {
      var n3, o3, i4, a4 = this;
      0 !== e4.length && (n3 = null, o3 = false, i4 = [], e4.forEach(function(e5) {
        (n3 = a4._convMap.get(e5.conversationID)) && (t3 && n3.reduceUnreadCount() && (o3 = n3.type !== R2.CONV_TOPIC), n3.type === R2.CONV_TOPIC ? i4.push(e5) : n3.isLastMessageRevoked({ sequence: e5.sequence, time: e5.time }) && (n3.setLastMessageRevoked(true), n3.setLastMessageRevoker(e5.revoker), o3 = true));
      }), this.get(10).onMessageRevoked(i4), o3) && this.emitConvUpdate(true, false);
    } }, { key: "updateRevokerInfo", value: function(u3) {
      for (var e4 = /* @__PURE__ */ new Set(), t3 = 0; t3 < u3.length; t3++) {
        var n3 = u3[t3].revoker;
        e4.add(n3);
      }
      var o3 = d3(e4), i4 = this.get(4);
      return new Promise(function(c4) {
        i4.getUserProfile({ userIDList: o3 }).then(function(e5) {
          e5 = e5.data;
          if (!O2(e5) || 0 === e5.length)
            return c4(u3);
          var t4, n4 = {}, o4 = F2(e5);
          try {
            for (o4.s(); !(t4 = o4.n()).done; ) {
              var i5 = t4.value, a4 = i5.userID, s4 = i5.nick, r3 = i5.avatar;
              n4[a4] = { nick: s4, avatar: r3 };
            }
          } catch (e6) {
            o4.e(e6);
          } finally {
            o4.f();
          }
          u3.forEach(function(e6) {
            var t5 = e6.revoker;
            n4[t5] && (e6.revokerInfo.nick = n4[t5].nick || "", e6.revokerInfo.avatar = n4[t5].avatar || "");
          }), c4(u3);
        }).catch(function() {
          c4(u3);
        });
      });
    } }, { key: "isLastMessageRevoked", value: function(e4) {
      var t3 = false, n3 = e4.conversationID, o3 = e4.sequence, i4 = e4.time, a4 = this._convMap.get(n3);
      return a4 && (t3 = a4.type === R2.CONV_TOPIC ? this.get(10).isLastMessageRevoked({ topicID: n3.replace(R2.CONV_GROUP, ""), sequence: o3 }) : a4.isLastMessageRevoked({ sequence: o3, time: i4 })), M2.l("".concat(this._n, ".isLastMessageRevoked options:"), e4, "ret:".concat(t3)), t3;
    } }, { key: "onMessageDeleted", value: function(e4) {
      var t3 = this;
      if (0 !== e4.length) {
        var n3 = null;
        e4.forEach(function(e5) {
          (n3 = t3._msgListHandler.getLocalMsg(e5.conversationID, e5.ID)) && (n3.isDeleted = true), e5 !== n3 && (e5.isDeleted = true);
        });
        for (var e4 = e4[0].conversationID, o3 = this._msgListHandler.getLocalMsgList(e4), i4 = {}, a4 = o3.length - 1; 0 <= a4; a4--)
          if (!o3[a4].isDeleted) {
            i4 = o3[a4];
            break;
          }
        var s4, r3 = this._convMap.get(e4);
        r3 && (s4 = false, r3.lastMessage.lastSequence === i4.sequence && r3.lastMessage.lastTime === i4.time || (S2(i4) && (i4 = void 0), r3.updateLastMessage(i4), r3.type !== R2.CONV_TOPIC && (s4 = true), M2.l("".concat(this._n, ".onMessageDeleted. update convID:").concat(e4, " with lastMessage:"), r3.lastMessage)), e4.startsWith(R2.CONV_C2C) && this.updateUnreadCount(e4), s4) && this.emitConvUpdate(true, false);
      }
    } }, { key: "onMessageModified", value: function(e4) {
      var t3 = "".concat(this._n, ".onMessageModified"), n3 = e4.conversationType, o3 = e4.from, i4 = e4.to, a4 = e4.time, s4 = e4.sequence, r3 = e4.elements, c4 = e4.cloudCustomData, u3 = e4.messageVersion, l3 = this.getMyUserID(), d4 = "".concat(n3).concat(i4), l3 = (i4 === l3 && n3 === R2.CONV_C2C && (d4 = "".concat(n3).concat(o3)), this._msgListHandler.onMsgModified(d4, e4)), n3 = l3.isUpdated, l3 = l3.message, p4 = (true === n3 && this.emitOEvt(h3.MESSAGE_MODIFIED, [l3]), this._isTopicConv(d4));
      return null === l3 ? M2.l("".concat(t3, " message is null! options:"), e4) : M2.l("".concat(t3, " isUpdated:").concat(n3, " isTopicMessage:").concat(p4, " from:").concat(o3, " to:").concat(i4, " sequence:").concat(l3.sequence, " time:").concat(l3.time)), p4 ? this.get(10).onMessageModified(e4) : (n3 = this._convMap.get(d4)) && (o3 = n3.lastMessage) && o3.lastTime === a4 && o3.lastSequence === s4 && o3.version !== u3 && (M2.l("".concat(t3, " convID:").concat(d4, " lastMessage updated")), o3.type = r3[0].type, o3.payload = r3[0].content, o3.messageForShow = Zt2(o3.type, o3.payload, this.isIntl()), o3.cloudCustomData = c4, o3.version = u3, this.emitConvUpdate(true, false)), l3;
    } }, { key: "onNewGroupAtTips", value: function(e4) {
      var t3 = this, e4 = e4.dataList, n3 = null;
      e4.forEach(function(e5) {
        e5.groupAtTips ? n3 = e5.groupAtTips : e5.elements ? n3 = y2(y2({}, e5.elements), {}, { sync: true }) : e5.groupAtType && (n3 = y2(y2({}, e5), {}, { sync: true })), n3.__random = e5.random, n3.__sequence = e5.clientSequence, t3._tmpGroupAtTipsList.push(n3);
      }), M2.l("".concat(this._n, ".onNewGroupAtTips isReady:").concat(this._isReady), this._tmpGroupAtTipsList), this._isReady && this._handleGroupAtTipsList();
    } }, { key: "_handleGroupAtTipsList", value: function() {
      var a4, s4 = this;
      0 !== this._tmpGroupAtTipsList.length && (a4 = false, this._tmpGroupAtTipsList.forEach(function(e4) {
        var t3 = e4.groupID, n3 = e4.from, o3 = e4.topicID, o3 = void 0 === o3 ? void 0 : o3, i4 = e4.sync, i4 = void 0 !== i4 && i4;
        n3 !== s4.getMyUserID() && (N2(o3) ? (n3 = s4._convMap.get("".concat(R2.CONV_GROUP).concat(t3))) && (n3.updateGroupAtInfoList(e4), a4 = true) : ((t3 = s4._convMap.get("".concat(R2.CONV_GROUP).concat(o3))) && (t3.updateGroupAtInfoList(e4), s4.get(10).onAtInfoUpdated({ topicID: o3, groupAtInfoList: t3.groupAtInfoList })), S2(t3) && i4 && (s4.updateTopicConversation([{ conversationID: "".concat(R2.CONV_GROUP).concat(o3), type: R2.CONV_TOPIC }]), s4._convMap.get("".concat(R2.CONV_GROUP).concat(o3)).updateGroupAtInfoList(e4))));
      }), a4 && this.emitConvUpdate(true, false), this._tmpGroupAtTipsList.length = 0);
    } }, { key: "_checkNewConv", value: function(e4) {
      var t3 = this, n3 = [], o3 = [];
      e4.forEach(function(e5) {
        t3._convMap.has(e5.conversationID) || (e5.type === R2.CONV_C2C ? n3.push(e5.conversationID.replace(R2.CONV_C2C, "")) : e5.type === R2.CONV_GROUP && o3.push(e5.conversationID.replace(R2.CONV_GROUP, "")));
      }), 0 < n3.length && (this._onNewC2CConv(n3), n3 = null), 0 < o3.length && (this._onNewGroupConv(o3), o3 = null);
    } }, { key: "_onNewC2CConv", value: function(e4) {
      var t3 = this.get(6);
      return Promise.all([t3.getRemotePeerReadTime(e4), this._msgRemindHandler.getC2CMsgRemindType(e4), this._convGroupHandler.searchConvGroupAndMark(e4, 1)]);
    } }, { key: "_onNewGroupConv", value: function(e4) {
      var t3 = this.get(7);
      return t3 ? Promise.all([t3.getMsgRemindType(e4), this._convGroupHandler.searchConvGroupAndMark(e4, 2)]) : Promise.resolve();
    } }, { key: "_setStorageConvList", value: function() {
      var e4 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t3 = this.getLocalConvList().filter(function(e5) {
        return e5.type === R2.CONV_C2C || e5.type === R2.CONV_GROUP && e5.lastMessage.type !== R2.MSG_GRP_TIP;
      }).slice(0, 20).map(function(e5) {
        return { conversationID: e5.conversationID, type: e5.type, subType: e5.subType, lastMessage: e5.lastMessage, groupProfile: e5.groupProfile, userProfile: e5.userProfile };
      });
      this.get(13).setItem("conversationMap", t3, e4);
    } }, { key: "emitConvUpdate", value: function() {
      var e4 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n3 = this.getLocalConvList();
      t3 && (t3 = this.get(7)) && t3.updateGroupLastMessage(n3), e4 && (this.get(12).isPartialUpdatedConvs() ? (this._diffConvMap(this._convMapForDiff, this._convMap), 0 < this._partialUpdatedConvMap.size && (this.emitOEvt(h3.CONVERSATION_LIST_UPDATED), this.onTotalUnreadCountUpdate(), this._convMapForDiff.clear(), this._convMapForDiff = gt3(this._convMap, true)), 0 === this._convMapForDiff.size && (this._convMapForDiff = gt3(this._convMap, true))) : (this.emitOEvt(h3.CONVERSATION_LIST_UPDATED), this.onTotalUnreadCountUpdate()));
    } }, { key: "_diffConvMap", value: function(e4, t3) {
      var n3, o3 = F2(t3);
      try {
        for (o3.s(); !(n3 = o3.n()).done; ) {
          var i4 = j2(n3.value, 2), a4 = i4[0], s4 = i4[1];
          e4.has(a4) && JSON.stringify(s4) === e4.get(a4) || this._partialUpdatedConvMap.set(a4, s4);
        }
      } catch (e5) {
        o3.e(e5);
      } finally {
        o3.f();
      }
    } }, { key: "getPartialUpdatedConvs", value: function() {
      var e4 = d3(gt3(this._partialUpdatedConvMap, false).values());
      return this._partialUpdatedConvMap.clear(), e4;
    } }, { key: "getLocalConvList", value: function() {
      var t3 = this;
      return d3(this._convMap.values()).filter(function(e4) {
        return t3._isConvNeedShow(e4.conversationID);
      });
    } }, { key: "getLocalConversation", value: function(e4) {
      return this._convMap.get(e4);
    } }, { key: "hasLocalConversation", value: function(e4) {
      return this._convMap.has(e4);
    } }, { key: "getLocalOldestMessage", value: function(e4) {
      return this._msgListHandler.getLocalOldestMsg(e4);
    } }, { key: "syncConvList", value: function() {
      var o3 = this, e4 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], i4 = "syncConvList", a4 = new P2(i4);
      return this._pagingStatus === bn2 && this._convMap.clear(), this._pagingGetConvList(e4).then(function(e5) {
        var t3 = on2(o3._pagingGetCostList), n3 = nn2(o3._pagingGetCostList), n3 = (o3._pagingGetCostList.length = 0, o3._pagingStatus = Fn2, o3._diffAndDeleteConv(), o3.emitConvUpdate(true, false), o3._setStorageConvList(), o3._handleC2CPeerReadTime(), o3.emitIEvt(U2.CONV_SYNC_COMPLETED), "count:".concat(o3._convMap.size, " sum:").concat(n3, " avg:").concat(t3));
        return M2.l("".concat(o3._n, ".").concat(i4, ". ").concat(n3)), a4.setMessage(n3).end(), e5;
      }).catch(function(e5) {
        return o3._pagingStatus = qn2, a4.setMessage(o3._pagingTs).setError(e5).end(), E2(e5);
      });
    } }, { key: "_diffAndDeleteConv", value: function() {
      var n3, o3 = this;
      this._isSyncCompleted() && (n3 = [], this._convMap.forEach(function(e4, t3) {
        !o3._pagingConvIDMap.has(t3) && o3._convIDFromUnreadDBMap.has(t3) && (o3._convMap.delete(t3), n3.push(t3));
      }), M2.l("".concat(this._n, "._diffAndDeleteConv list:").concat(n3)), n3 = null);
    } }, { key: "_pagingGetConvList", value: function() {
      var r3 = this, e4 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], c4 = "".concat(this._n, "._pagingGetConvList"), u3 = (M2.l("".concat(c4, " incrementalPullFlag:").concat(e4, " ts:").concat(this._pagingTs, " startIdx:").concat(this._pagingStartIdx) + " pinnedTs:".concat(this._pagingPinnedTs, " pinnedStartIdx:").concat(this._pagingPinnedStartIdx)), Date.now());
      return this._pagingStatus = wn2, this.req({ P: G2.PAGING_GET_CONV_LIST, data: { fromAccount: this.getMyUserID(), timeStamp: e4 ? this._pagingTs : 0, startIndex: e4 ? this._pagingStartIdx : 0, pinnedTimeStamp: e4 ? this._pagingPinnedTs : 0, pinnedStartIndex: e4 ? this._pagingPinnedStartIdx : 0, orderType: 1 } }).then(function(e5) {
        var e5 = e5.data, t3 = e5.completeFlag, n3 = e5.conversations, n3 = void 0 === n3 ? [] : n3, o3 = e5.timeStamp, i4 = e5.startIndex, a4 = e5.pinnedTimeStamp, s4 = e5.pinnedStartIndex, e5 = e5.groupItem;
        if (r3._pagingGetCostList.push(an2(u3, false)), M2.l("".concat(c4, " ok. completeFlag:").concat(t3, " count:").concat(n3.length, " cost:").concat(an2(u3))), r3._convGroupHandler.onConvGroupListSynced(e5), 0 < n3.length && (e5 = r3._getConvOptions(n3), r3._pagingConvIDMap = new Map([].concat(d3(r3._pagingConvIDMap), d3(e5.map(function(e6) {
          return [e6.conversationID, 1];
        })))), r3._updateLocalConvList({ conversationOptionsList: e5, isFromGetConversations: true, updateUnreadCount: true }), r3.isLoggedIn()) && r3.emitConvUpdate(), !r3._isReady) {
          if (!r3.isLoggedIn())
            return D2();
          r3.triggerReady();
        }
        return r3._pagingTs = o3, r3._pagingStartIdx = i4, r3._pagingPinnedTs = a4, r3._pagingPinnedStartIdx = s4, 1 !== t3 ? r3._pagingGetConvList() : (r3._handleGroupAtTipsList(), r3._convGroupHandler.getRemoteConvGroupList(), D2());
      }).catch(function(e5) {
        throw !r3.isLoggedIn() || r3._isReady || (M2.w("".concat(c4, " failed. error:"), e5), r3.triggerReady()), e5;
      });
    } }, { key: "_updateLocalConvList", value: function(e4) {
      var t3 = e4.isFromGetConversations, n3 = Date.now(), e4 = this._getTmpConvListMapping(e4).newConvList;
      this._convMap = new Map(this._sortConvList(d3(this._convMap))), t3 || this._updateUserOrGroupProfile(e4), M2.l("".concat(this._n, "._updateLocalConvList cost:").concat(an2(n3)));
    } }, { key: "_getTmpConvListMapping", value: function(e4) {
      for (var t3 = e4.conversationOptionsList, n3 = e4.isFromGetConversations, o3 = e4.isInstantMessage, i4 = e4.isUnreadC2CMessage, a4 = void 0 !== i4 && i4, s4 = e4.updateUnreadCount, r3 = [], c4 = [], u3 = this.get(7), l3 = this.get(8), d4 = this.isIntl(), p4 = this.isUsingChatCore(), _3 = 0, h4 = t3.length; _3 < h4; _3++) {
        var g3 = new jo2(t3[_3], d4, p4), f4 = g3.conversationID, m4 = g3.type;
        if (!this._isNonExistentAccount(f4)) {
          if (this._convMap.has(f4)) {
            var v4 = this._convMap.get(f4);
            if (n3 && m4 !== R2.CONV_TOPIC) {
              this._convMap.set(f4, g3), m4 === R2.CONV_C2C ? g3.unreadCount = v4.unreadCount : m4 === R2.CONV_GROUP && (g3.groupProfile = JSON.parse(JSON.stringify(v4.groupProfile)));
              continue;
            }
            var I3 = ["unreadCount", "allowType", "adminForbidType", "payload"], M3 = (false === o3 && I3.push("lastMessage"), "boolean" == typeof o3 && I3.push("isPinned"), t3[_3].lastMessage), y3 = !N2(M3);
            y3 || t3[_3].type === R2.CONV_TOPIC || this._onLastMsgNotExist(t3[_3]), N2(o3) && y3 && null === v4.lastMessage.payload && (v4.lastMessage.payload = M3.payload), S2(v4.lastMessage.revoker) || (v4.lastMessage.revoker = null), ht3(v4, g3, I3, [null, void 0, "", 0, NaN]), true === s4 && v4.updateUnreadCount({ nextUnreadCount: g3.unreadCount, isFromGetConversations: n3, isUnreadC2CMessage: a4 }), o3 && y3 && (M3.payload && (v4.lastMessage.payload = M3.payload), v4.type === R2.CONV_GROUP) && (v4.lastMessage.nameCard = M3.nameCard, v4.lastMessage.nick = M3.nick), y3 && v4.lastMessage.cloudCustomData !== M3.cloudCustomData && (v4.lastMessage.cloudCustomData = M3.cloudCustomData || "");
          } else
            m4 === R2.CONV_GROUP && u3 ? (I3 = g3.groupProfile.groupID, (y3 = u3.getLocalGroupProfile(I3)) && (g3.groupProfile = y3, true === s4) && g3.updateUnreadCount({ nextUnreadCount: 0 })) : m4 === R2.CONV_C2C && (v4 = f4.replace(R2.CONV_C2C, ""), l3) && l3.isMyFriend(v4) && (g3.remark = l3.getFriendRemark(v4)), r3.push(g3), this._convMap.set(f4, g3);
          this._convMap.get(f4).type === R2.CONV_TOPIC && c4.push(this._convMap.get(f4));
        }
      }
      for (var C3 = this.get(10), T3 = 0, D3 = c4.length; T3 < D3; T3++) {
        var E3 = c4[T3], L3 = E3.conversationID, E3 = E3.groupAtInfoList;
        S2(E3) || C3.onAtInfoUpdated({ topicID: L3.replace(R2.CONV_GROUP, ""), groupAtInfoList: E3 });
      }
      return { newConvList: r3 };
    } }, { key: "_onLastMsgNotExist", value: function(e4) {
      new P2("lastMsgNotExist").setMessage(JSON.stringify(e4)).end();
    } }, { key: "_sortConvList", value: function(e4) {
      var t3 = [], n3 = [], o3 = [], i4 = [];
      return e4.forEach(function(e5) {
        (true === e5[1].isPinned ? S2(e5[1].lastMessage.lastTime) ? n3 : t3 : S2(e5[1].lastMessage.lastTime) ? i4 : o3).push(e5);
      }), t3.sort(function(e5, t4) {
        return t4[1].lastMessage.lastTime - e5[1].lastMessage.lastTime;
      }).concat(n3).concat(o3.sort(function(e5, t4) {
        return t4[1].lastMessage.lastTime - e5[1].lastMessage.lastTime;
      })).concat(i4);
    } }, { key: "_sortConvListAndEmitEvent", value: function() {
      this._convMap = new Map(this._sortConvList(d3(this._convMap))), this.emitConvUpdate(true, false);
    } }, { key: "_updateUserOrGroupProfile", value: function(e4) {
      var n3, o3, t3, i4, a4 = this;
      0 !== e4.length && (n3 = [], o3 = [], t3 = this.get(4), i4 = this.get(7), e4.forEach(function(e5) {
        var t4;
        e5.type === R2.CONV_C2C ? n3.push(e5.toAccount) : e5.type === R2.CONV_GROUP && (t4 = e5.toAccount, i4.hasLocalGroup(t4) ? e5.groupProfile = i4.getLocalGroupProfile(t4) : o3.push(t4));
      }), M2.l("".concat(this._n, "._updateUserOrGroupProfile userIDList:").concat(n3, " groupIDList:").concat(o3)), 0 < n3.length && t3.getUserProfile({ userIDList: n3 }).then(function(e5) {
        e5 = e5.data;
        O2(e5) ? e5.forEach(function(e6) {
          a4._doUpdateUserProfile("".concat(R2.CONV_C2C).concat(e6.userID), e6);
        }) : a4._doUpdateUserProfile("".concat(R2.CONV_C2C).concat(e5.userID), e5);
      }), 0 < o3.length) && i4.getGroupProfileAdvance({ groupIDList: o3, responseFilter: { groupBaseInfoFilter: ["Type", "Name", "FaceUrl"] } }).then(function(e5) {
        var e5 = e5.data.successGroupList, n4 = false;
        e5.forEach(function(e6) {
          var t4 = "".concat(R2.CONV_GROUP).concat(e6.groupID);
          a4._convMap.has(t4) && (t4 = a4._convMap.get(t4), ht3(t4.groupProfile, e6, [], [null, void 0, "", 0, NaN]), !t4.subType && e6.type && (t4.subType = e6.type), n4 = true);
        }), n4 && a4.emitConvUpdate();
      });
    } }, { key: "_doUpdateUserProfile", value: function(e4, t3) {
      this.hasLocalConversation(e4) && (this.getLocalConversation(e4).userProfile = t3, this.emitConvUpdate());
    } }, { key: "_getConvOptions", value: function(e4) {
      var n3 = this, o3 = [], e4 = e4.filter(function(e5) {
        var t3 = e5.type, e5 = e5.userID;
        return 1 === t3 && !n3._isNonExistentAccount(e5) || 2 === t3;
      }), i4 = this.getMyUserID(), e4 = e4.map(function(e5) {
        var t3;
        return N2(e5.lastMsg) && (e5.lastMsg = { elements: [] }), 1 === e5.type ? (t3 = { userID: e5.userID, nick: e5.peerNick, avatar: e5.peerAvatar }, o3.push(t3), { conversationID: "".concat(R2.CONV_C2C).concat(e5.userID), type: R2.CONV_C2C, lastMessage: { lastTime: e5.time, lastSequence: e5.sequence, fromAccount: e5.lastC2CMsgFromAccount, type: e5.lastMsg.elements[0] ? e5.lastMsg.elements[0].type : null, payload: e5.lastMsg.elements[0] ? n3._amendLayersOverLimitProp(e5.lastMsg.elements[0].content, e5.lastMsg.elements[0].type) : null, cloudCustomData: e5.lastMsg.cloudCustomData || "", isRevoked: 8 === e5.lastMessageFlag, onlineOnlyFlag: false, nick: "", nameCard: "", version: 0, isPeerRead: e5.lastC2CMsgFromAccount === i4 && e5.time <= e5.c2cPeerReadTime, revoker: e5.lastMsg.revokerInfo ? e5.lastMsg.revokerInfo.revoker : null }, unreadCount: 0, userProfile: new Ho(t3), peerReadTime: e5.c2cPeerReadTime, isPinned: 1 === e5.isPinned, customData: e5.customMark || "", markList: $t2(e5.standardMark), conversationGroupList: n3._convGroupHandler.getConvGroupListByID(e5.contactGroupId), remark: e5.friendRemark || "", messageRemindType: n3._transMsgRemindType(e5.messageRemindType) }) : { conversationID: "".concat(R2.CONV_GROUP).concat(e5.groupID), type: R2.CONV_GROUP, lastMessage: y2(y2({ lastTime: e5.time, lastSequence: e5.sequence, fromAccount: e5.msgGroupFromAccount }, n3._patchTypeAndPayload(e5)), {}, { cloudCustomData: e5.lastMsg.cloudCustomData || "", isRevoked: 2 === e5.lastMessageFlag, onlineOnlyFlag: false, nick: e5.senderNick || "", nameCard: e5.senderNameCard || "", revoker: e5.lastMsg.revokerInfo ? e5.lastMsg.revokerInfo.revoker : null }), groupProfile: new Yo({ groupID: e5.groupID, name: e5.groupNick, avatar: e5.groupImage, type: e5.groupType, nextMessageSeq: e5.nextMessageSeq }), unreadCount: n3._computeGroupUnreadCount(e5), peerReadTime: 0, isPinned: 1 === e5.isPinned, version: 0, customData: e5.customMark || "", markList: $t2(e5.standardMark), conversationGroupList: n3._convGroupHandler.getConvGroupListByID(e5.contactGroupId), messageRemindType: n3._transMsgRemindType(e5.messageRemindType) };
      });
      return 0 < o3.length && this.get(4).onConvProfileUpdated(o3), e4;
    } }, { key: "_transMsgRemindType", value: function(e4) {
      var t3 = "";
      return 0 === e4 ? t3 = R2.MSG_REMIND_ACPT_AND_NOTE : 1 === e4 ? t3 = R2.MSG_REMIND_DISCARD : 2 === e4 ? t3 = R2.MSG_REMIND_ACPT_NOT_NOTE : 3 === e4 && (t3 = R2.NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT), t3;
    } }, { key: "_computeGroupUnreadCount", value: function(e4) {
      var t3 = e4.unreadCount, e4 = e4.noUnreadCount, t3 = (void 0 === t3 ? 0 : t3) - (void 0 === e4 ? 0 : e4);
      return 0 < t3 ? t3 : 0;
    } }, { key: "_patchTypeAndPayload", value: function(e4) {
      var e4 = e4.lastMsg, t3 = e4.event, n3 = e4.elements, n3 = void 0 === n3 ? [] : n3, e4 = e4.groupTips, e4 = void 0 === e4 ? {} : e4;
      return N2(void 0 === t3 ? void 0 : t3) || S2(e4) ? { type: n3[0] ? n3[0].type : null, payload: n3[0] ? this._amendLayersOverLimitProp(n3[0].content, n3[0].type) : null } : ((t3 = new So2(e4)).setElement({ type: R2.MSG_GRP_TIP, content: y2(y2({}, e4.elements), {}, { groupProfile: e4.groupProfile }) }), n3 = JSON.parse(JSON.stringify(t3.payload)), t3 = null, { type: R2.MSG_GRP_TIP, payload: n3 });
    } }, { key: "_amendLayersOverLimitProp", value: function(e4, t3) {
      var n3 = this.getFileDownloadProxy(), o3 = this.getDownloadFileAuthKey(), i4 = this.get(17).getFileDNList(), a4 = e4.layersOverLimit, s4 = null;
      return t3 === R2.MSG_IMAGE && (s4 = new _o2(e4, n3, o3, i4)), t3 === R2.MSG_VIDEO && (s4 = new Co2(e4, n3, o3, i4)), t3 === R2.MSG_SOUND && (s4 = new go2(e4, n3, o3, i4)), t3 === R2.MSG_FILE && ((s4 = new Mo2(e4, n3, o3, i4)).content.url = void 0), 0 === a4 ? e4.layersOverLimit = false : 1 === a4 && (e4.layersOverLimit = true), s4 && Object.assign(e4, s4.content), e4;
    } }, { key: "getLocalMessageList", value: function(e4) {
      return this._msgListHandler.getLocalMsgList(e4);
    } }, { key: "deleteLocalMessage", value: function(e4) {
      e4 instanceof So2 && this._msgListHandler.remove(e4);
    } }, { key: "onConvDeleted", value: function(e4) {
      O2(e4) && (e4 = e4.map(function(e5) {
        var t3 = e5.type, n3 = e5.userID, e5 = e5.groupID;
        return 1 === t3 ? "".concat(R2.CONV_C2C).concat(n3) : 2 === t3 ? "".concat(R2.CONV_GROUP).concat(e5) : void 0;
      }), M2.l("".concat(this._n, ".onConvDeleted convIDList:").concat(e4)), this.deleteLocalConvList(e4));
    } }, { key: "onConvPinnedStatus", value: function(e4, i4) {
      var a4, s4 = this;
      O2(e4) && (a4 = false, e4.forEach(function(e5) {
        var t3, n3 = e5.type, o3 = e5.userID, e5 = e5.groupID;
        1 === n3 ? t3 = s4.getLocalConversation("".concat(R2.CONV_C2C).concat(o3)) : 2 === n3 && (t3 = s4.getLocalConversation("".concat(R2.CONV_GROUP).concat(e5))), t3 && (M2.l("".concat(s4._n, ".onConvPinnedStatus convID:").concat(t3.conversationID, " localPinned:").concat(t3.isPinned, " remotePinned:").concat(i4)), i4 ? t3.isPinned || (t3.isPinned = true, a4 = true) : t3.isPinned && (t3.isPinned = false, a4 = true));
      }), a4) && this._sortConvListAndEmitEvent();
    } }, { key: "getMessageList", value: function(e4) {
      var r3 = this, c4 = e4.conversationID, t3 = e4.nextReqMessageID, e4 = e4.count, u3 = "".concat(this._n, ".getMessageList"), n3 = this.getLocalConversation(c4), o3 = "";
      if (n3 && n3.groupProfile && (o3 = n3.groupProfile.type), Gt2(o3))
        return M2.l("".concat(u3, " not available in ").concat(o3, ". convID:").concat(c4)), D2({ messageList: [], nextReqMessageID: "", isCompleted: true });
      (N2(e4) || 15 < e4) && (e4 = 15), t3 || this._isMeInCommunity(c4) || this.clearMemMsg(c4);
      var l3 = this._computeRemainingCount({ conversationID: c4, nextReqMessageID: t3 }), n3 = this._completedMap.has(c4);
      if (M2.l("".concat(u3, " convID:").concat(c4, " isEverCleared:").concat(this._isEverCleared(c4), " nextReqMessageID:").concat(t3) + " remainingCount:".concat(l3, " count:").concat(e4, " isCompleted:").concat(n3)), this._needGetHistory({ conversationID: c4, remainingCount: l3, count: e4 }))
        return this.getHistoryMessages({ conversationID: c4, nextReqMessageID: t3, count: 20 }).then(function(e5) {
          var t4 = e5.nextReqID, n4 = e5.storedMessageList, o4 = e5.assembledMessageList, e5 = e5.isPullingCompleted, i4 = r3._completedMap.has(c4), a4 = n4, s4 = (0 < l3 && (a4 = r3._msgListHandler.getLocalMsgList(c4).slice(0, n4.length + l3)), { nextReqMessageID: void 0, messageList: void 0, isCompleted: void 0 }), n4 = (r3._isEverCleared(c4) ? (s4.nextReqMessageID = t4, s4.messageList = o4, s4.isCompleted = e5) : (s4.nextReqMessageID = i4 ? "" : t4, s4.messageList = a4, s4.isCompleted = i4), s4.messageList.filter(function(e6) {
            return e6.isRevoked;
          }) || []), o4 = s4.messageList.map(function(e6) {
            return e6.sequence;
          });
          return M2.l("".concat(u3, " ret.nextReqMessageID:").concat(s4.nextReqMessageID, " ret.isCompleted:").concat(s4.isCompleted, " sequenceList:"), o4), O2(n4) && 0 !== n4.length ? r3.updateRevokerInfo(n4).then(function(e6) {
            return e6.forEach(function(t5) {
              var n5 = t5.revokerInfo;
              s4.messageList = s4.messageList.map(function(e7) {
                return e7.ID === t5.ID && n5 && (e7.revokeReason = n5.reason || "", e7.revokerInfo = { userID: n5.revoker || e7.revoker, nick: n5.nick, avatar: n5.avatar }), e7;
              });
            }), T2(s4);
          }) : T2(s4);
        });
      this.modifyMessageList(c4);
      o3 = this._getMsgListFromMem({ conversationID: c4, nextReqMessageID: t3, count: e4 });
      return D2(o3);
    } }, { key: "_isEverCleared", value: function(e4) {
      return this._everClearedMap.has(e4);
    } }, { key: "_getMsgListFromMem", value: function(e4) {
      var t3 = e4.conversationID, n3 = e4.nextReqMessageID, e4 = e4.count, o3 = "".concat(this._n, "._getMsgListFromMem"), i4 = this._msgListHandler.getLocalMsgList(t3), a4 = i4.length, s4 = bt3(t3), r3 = 0, c4 = { isCompleted: false, nextReqMessageID: "", messageList: [] }, e4 = (n3 ? (r3 = s4 ? i4.findIndex(function(e5) {
        return e5.ID === n3;
      }) : i4.findIndex(function(e5) {
        return e5.sequence + "" === n3;
      })) > e4 ? (c4.messageList = i4.slice(r3 - e4, r3), c4.nextReqMessageID = s4 ? i4[r3 - e4].ID : i4[r3 - e4].sequence + "") : (c4.messageList = i4.slice(0, r3), c4.isCompleted = true) : e4 < a4 ? (c4.messageList = i4.slice(r3 = a4 - e4, a4), c4.nextReqMessageID = s4 ? i4[r3].ID : i4[r3].sequence + "") : (c4.messageList = i4.slice(0, a4), c4.isCompleted = true), c4.messageList.map(function(e5) {
        return e5.sequence;
      }));
      return M2.l("".concat(o3, " convID:").concat(t3) + " ret.nextReqMessageID:".concat(c4.nextReqMessageID, " ret.isCompleted:").concat(c4.isCompleted, " sequenceList:").concat(e4)), c4;
    } }, { key: "getMessageListHopping", value: function(e4) {
      var t3, n3, o3 = e4.conversationID, i4 = e4.sequence, a4 = e4.time, s4 = e4.count, e4 = e4.direction, e4 = void 0 === e4 ? 0 : e4;
      return (N2(s4) || 15 < s4) && (s4 = 15), o3.startsWith(R2.CONV_C2C) ? (t3 = this.get(6), n3 = o3.replace(R2.CONV_C2C, ""), t3.getRoamingMessagesHopping({ peerAccount: n3, time: a4, count: s4, direction: e4 })) : o3.startsWith(R2.CONV_GROUP) ? (t3 = this.get(7), n3 = o3.replace(R2.CONV_GROUP, ""), t3.getRoamingMessagesHopping({ groupID: n3, sequence: i4, count: s4, direction: e4 })) : void 0;
    } }, { key: "_computeRemainingCount", value: function(e4) {
      var t3, n3 = e4.conversationID, o3 = e4.nextReqMessageID, e4 = this._msgListHandler.getLocalMsgList(n3), i4 = e4.length;
      return M2.l("".concat(this._n, "._computeRemainingCount convID:").concat(n3, " nextReqMessageID:").concat(o3, " length:").concat(i4)), o3 ? (t3 = 0, bt3(n3) ? t3 = e4.findIndex(function(e5) {
        return e5.ID === o3;
      }) : wt2(n3) && (t3 = -1 !== o3.indexOf("-") ? e4.findIndex(function(e5) {
        return e5.ID === o3;
      }) : e4.findIndex(function(e5) {
        return e5.sequence + "" === o3;
      })), -1 === t3 ? 0 : t3) : i4;
    } }, { key: "_needGetHistory", value: function(e4) {
      var t3 = e4.conversationID, n3 = e4.remainingCount, e4 = e4.count, o3 = this.getLocalConversation(t3), i4 = "";
      return o3 && o3.groupProfile && (i4 = o3.groupProfile.type), !(Ft2(t3) || Gt2(i4) || !this._isEverCleared(t3) && (o3 = n3 <= e4 && !this._completedMap.has(t3), M2.l("".concat(this._n, "._needGetHistory convID:").concat(t3, " ret:").concat(o3)), !o3));
    } }, { key: "_isTopicConv", value: function(e4) {
      e4 = e4.replace(R2.CONV_GROUP, "");
      return Ut2(e4);
    } }, { key: "getHistoryMessages", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3 = e4.conversationID, c4 = e4.count, e4 = e4.nextReqMessageID;
      return r3 === R2.CONV_SYSTEM ? D2() : (c4 = 20 < c4 ? 20 : 15, t3 = null, bt3(r3) ? (s4 = 0, n3 = "", o3 = false, a4 = this._roamingMsgKeyAndTimeMap.has(r3), e4 && (o3 = true, a4 ? (s4 = this._roamingMsgKeyAndTimeMap.get(r3).lastMessageTime, n3 = this._roamingMsgKeyAndTimeMap.get(r3).messageKey) : (i4 = this._msgListHandler.findMessage(e4)) && (s4 = i4.time, M2.l("".concat(this._n, ".getHistoryMessages convID:").concat(r3, " isRelayInfoExisted:").concat(a4, " lastMessageTime:").concat(s4)))), (t3 = this.get(6)).getRoamingMessage({ conversationID: r3, peerAccount: r3.replace(R2.CONV_C2C, ""), count: c4, lastMessageTime: o3 ? s4 : 0, messageKey: o3 ? n3 : "" })) : wt2(r3) ? (t3 = this.get(7)) ? (i4 = r3.replace(R2.CONV_GROUP, ""), a4 = null, this._convMap.has(r3) && !Ut2(i4) && (a4 = this._convMap.get(r3).lastMessage), s4 = 0, e4 ? s4 = Number(e4) : a4 && (s4 = a4.lastSequence), t3.getRoamingMessage({ conversationID: r3, groupID: i4, count: c4, sequence: s4 })) : E2({ code: k2.NO_MODULE }) : D2());
    } }, { key: "patchConvLastMessage", value: function(e4) {
      var t3, n3, o3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], i4 = this.getLocalConversation(e4);
      i4 && (t3 = (n3 = i4.lastMessage).messageForShow, n3 = n3.payload, S2(t3) || S2(n3) || o3) && 0 !== (t3 = this._msgListHandler.getLocalMsgList(e4)).length && (n3 = t3[t3.length - 1], M2.l("".concat(this._n, ".patchConvLastMessage bForceUpdate:").concat(o3, " convID:").concat(e4, " payload:"), n3.payload), i4.updateLastMessage(n3));
    } }, { key: "onRoamingMessage", value: function() {
      for (var e4, t3, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [], o3 = 1 < arguments.length ? arguments[1] : void 0, i4 = !(2 < arguments.length && void 0 !== arguments[2]) || arguments[2], a4 = 3 < arguments.length ? arguments[3] : void 0, s4 = o3.startsWith(R2.CONV_C2C) ? R2.CONV_C2C : R2.CONV_GROUP, r3 = null, c4 = [], o3 = [], u3 = 0, l3 = n3.length, d4 = s4 === R2.CONV_GROUP, p4 = this.getFileDownloadProxy(), _3 = this.getDownloadFileAuthKey(), h4 = O2(a4), g3 = this.get(17).getFileDNList(), f4 = function() {
        d4 ? --u3 : ++u3;
      }, m4 = function() {
        return d4 ? l3 <= u3 : u3 < l3;
      }, u3 = d4 ? n3.length - 1 : 0, l3 = d4 ? 0 : n3.length; m4(); f4())
        1 !== n3[u3].isPlaceMessage && ((r3 = new So2(n3[u3])).to = n3[u3].to, s4 !== R2.CONV_GROUP || N2(n3[u3].topicID) || (r3.to = n3[u3].topicID), r3.isSystemMessage = !!n3[u3].isSystemMessage, r3.conversationType = s4, e4 = 4 === n3[u3].event ? { type: R2.MSG_GRP_TIP, content: y2(y2({}, n3[u3].elements), {}, { groupProfile: n3[u3].groupProfile }) } : n3[u3].elements, d4 || r3.setNickAndAvatar({ nick: n3[u3].nick, avatar: n3[u3].avatar }), S2(e4) ? ((t3 = new P2("emptyMessageBody")).setMessage("from:".concat(r3.from, " to:").concat(r3.to, " sequence:").concat(r3.sequence, " event:").concat(n3[u3].event)), t3.setLevel("warning").end()) : (r3.setElement(e4, p4, _3, g3), r3.reInitialize(this.getMyUserID()), c4.push(r3), h4 && a4.push(r3)));
      return f4 = m4 = null, i4 ? (this._msgListHandler.unshift(c4, o3), c4 = null, o3) : c4;
    } }, { key: "findMessage", value: function(e4) {
      return this._msgListHandler.findMessage(e4);
    } }, { key: "_isMeInCommunity", value: function(e4) {
      var t3 = true;
      return this._isTopicConv(e4) && (e4 = Xt2(e4.replace(R2.CONV_GROUP, "")), this.get(7).hasLocalGroup(e4) || (t3 = false, M2.l("".concat(this._n, "._isMeInCommunity groupID:").concat(e4, " ret:").concat(t3)))), t3;
    } }, { key: "deleteTopicRoamingInfo", value: function(e4) {
      var t3 = this;
      Pt2({ groupID: e4 }) && this._msgListHandler.getTopicConvIDList(e4).forEach(function(e5) {
        t3.clearMemMsg(e5);
      });
    } }, { key: "deleteGroupRoamingInfo", value: function(e4) {
      e4 = "".concat(R2.CONV_GROUP).concat(e4);
      0 < this._msgListHandler.getLocalMsgList(e4).length && this.clearMemMsg(e4);
    } }, { key: "setMessageRead", value: function(e4) {
      var t3 = e4.conversationID, n3 = this.getLocalConversation(t3), e4 = "".concat(this._n, ".setMessageRead");
      if (M2.l("".concat(e4, " convID:").concat(t3, " unreadCount:").concat(n3 ? n3.unreadCount : 0)), !n3)
        return D2();
      if (n3.type !== R2.CONV_GROUP && n3.type !== R2.CONV_TOPIC || S2(n3.groupAtInfoList) || this.deleteGroupAtTips(t3), 0 === n3.unreadCount)
        return D2();
      var o3 = this._msgListHandler.getLocalLastMsg(t3), i4 = n3.lastMessage.lastTime, a4 = this._msgListHandler.getLocalMaxTime(t3), a4 = (i4 < a4 && (M2.l("".concat(e4, " update lastMessageTime from ").concat(i4, " to ").concat(a4)), i4 = a4), this._msgListHandler.getLocalMaxSeq(t3)), s4 = n3.lastMessage.lastSequence, r3 = (s4 < a4 && (M2.l("".concat(e4, " update lastMessageSeq from ").concat(s4, " to ").concat(a4)), s4 = a4), n3.type === R2.CONV_TOPIC && N2(o3) && (e4 = this.get(10), o3 = Xt2(a4 = t3.replace(R2.CONV_GROUP, "")), e4 = e4.getLocalTopic(o3, a4)) && (s4 = e4.nextMessageSeq - 1), null);
      switch (n3.type) {
        case R2.CONV_C2C:
          return (r3 = this.get(6)) ? r3.setMessageRead({ conversationID: t3, lastMessageTime: i4 }) : E2({ code: k2.NO_MODULE });
        case R2.CONV_GROUP:
        case R2.CONV_TOPIC:
          return (r3 = this.get(7)) ? r3.setMessageRead({ conversationID: t3, lastMessageSeq: s4 }) : E2({ code: k2.NO_MODULE });
        case R2.CONV_SYSTEM:
          return n3.unreadCount = 0, this.emitConvUpdate(true, false), D2();
        default:
          return D2();
      }
    } }, { key: "setAllMessageRead", value: function() {
      var t3, n3 = this, o3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, e4 = "setAllMessageRead", i4 = "".concat(this._n, ".").concat(e4), a4 = (o3.scope || (o3.scope = R2.READ_ALL_MSG), M2.l("".concat(i4, " options:"), o3), this._createSetAllMessageReadPack(o3));
      return 0 === a4.readAllC2CMessage && 0 === a4.groupMessageReadInfoList.length ? D2() : (t3 = new P2(e4), this.req({ P: G2.SET_ALL_MSG_READ, data: a4 }).then(function(e5) {
        e5 = e5.data, e5 = n3._handleAllMsgRead(e5);
        return t3.setMessage("scope:".concat(o3.scope, " failureGroups:").concat(JSON.stringify(e5))).end(), D2();
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.w("".concat(i4, " failed. error:"), e5), E2({ code: e5 && e5.code ? e5.code : k2.MSG_UNREAD_ALL_FAIL, message: e5 && e5.message ? e5.message : void 0 });
      }));
    } }, { key: "setConvCustomData", value: function(e4) {
      return this._convGroupHandler.setConvCustomData(e4);
    } }, { key: "markConv", value: function(e4) {
      return this._convGroupHandler.markConv(e4);
    } }, { key: "getConvGroupList", value: function() {
      return this._convGroupHandler.getLocalConvGroupList();
    } }, { key: "createConvGroup", value: function(e4) {
      return this._convGroupHandler.createConvGroup(e4);
    } }, { key: "deleteConvGroup", value: function(e4) {
      return this._convGroupHandler.deleteConvGroup(e4);
    } }, { key: "renameConvGroup", value: function(e4) {
      return this._convGroupHandler.renameConvGroup(e4);
    } }, { key: "addConvsToGroup", value: function(e4) {
      return this._convGroupHandler.addConvsToGroup(e4);
    } }, { key: "deleteConvsFromGroup", value: function(e4) {
      return this._convGroupHandler.deleteConvsFromGroup(e4);
    } }, { key: "onConvMarkUpdated", value: function(e4) {
      this._convGroupHandler.onConvMarkUpdated(e4);
    } }, { key: "onConvGroupCreated", value: function(e4) {
      this._convGroupHandler.onConvGroupCreated(e4);
    } }, { key: "onConvGroupDeleted", value: function(e4) {
      this._convGroupHandler.onConvGroupDeleted(e4);
    } }, { key: "onConvGroupNameUpdated", value: function(e4) {
      this._convGroupHandler.onConvGroupNameUpdated(e4);
    } }, { key: "onConvInGroupUpdated", value: function(e4) {
      this._convGroupHandler.onConvInGroupUpdated(e4);
    } }, { key: "onConvAddedToOrDeletedFromGroup", value: function(e4) {
      this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e4);
    } }, { key: "_getConvLastMessageSeq", value: function(e4) {
      var t3 = this._msgListHandler.getLocalLastMsg(e4.conversationID), e4 = e4.lastMessage.lastSequence;
      return e4 = t3 && e4 < t3.sequence ? t3.sequence : e4;
    } }, { key: "_getConvLastMessageTime", value: function(e4) {
      var t3 = this._msgListHandler.getLocalLastMsg(e4.conversationID), e4 = e4.lastMessage.lastTime;
      return e4 = t3 && e4 < t3.time ? t3.time : e4;
    } }, { key: "_createSetAllMessageReadPack", value: function(e4) {
      var t3, n3 = { readAllC2CMessage: 0, groupMessageReadInfoList: [] }, o3 = e4.scope, i4 = F2(this._convMap);
      try {
        for (i4.s(); !(t3 = i4.n()).done; ) {
          var a4, s4 = j2(t3.value, 2)[1];
          if (0 < s4.unreadCount)
            if (s4.type === R2.CONV_C2C && 0 === n3.readAllC2CMessage) {
              if (o3 === R2.READ_ALL_MSG)
                n3.readAllC2CMessage = 1;
              else if (o3 === R2.READ_ALL_C2C_MSG) {
                n3.readAllC2CMessage = 1;
                break;
              }
            } else
              s4.type !== R2.CONV_GROUP || o3 !== R2.READ_ALL_GROUP_MSG && o3 !== R2.READ_ALL_MSG || (a4 = this._getConvLastMessageSeq(s4), n3.groupMessageReadInfoList.push({ groupID: s4.groupProfile.groupID, messageSequence: a4 }));
        }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
      return n3;
    } }, { key: "onPushedAllMessageRead", value: function(e4) {
      this._handleAllMsgRead(e4);
    } }, { key: "_handleAllMsgRead", value: function(e4) {
      var t3 = e4.groupMessageReadInfoList, e4 = e4.readAllC2CMessage, t3 = this._parseGroupReadInfo(t3);
      return 1 <= this._updateAllConvUnreadCount({ readAllC2CMessage: e4 }) && this.emitConvUpdate(true, false), t3;
    } }, { key: "_parseGroupReadInfo", value: function(e4) {
      var t3 = [];
      if (e4 && e4.length)
        for (var n3 = 0, o3 = e4.length; n3 < o3; n3++) {
          var i4 = e4[n3], a4 = i4.groupID, s4 = i4.sequence, r3 = i4.retCode, i4 = i4.lastMessageSeq;
          N2(r3) ? this._remoteGroupReadSeqMap.set(a4, i4) : (this._remoteGroupReadSeqMap.set(a4, s4), 0 !== r3 && t3.push("".concat(a4, "-").concat(s4, "-").concat(r3)));
        }
      return t3;
    } }, { key: "_updateAllConvUnreadCount", value: function(e4) {
      var t3, n3 = e4.readAllC2CMessage, o3 = 0, i4 = F2(this._convMap);
      try {
        for (i4.s(); !(t3 = i4.n()).done; ) {
          var a4, s4, r3, c4, u3 = j2(t3.value, 2), l3 = u3[0], d4 = u3[1];
          1 <= d4.unreadCount && (1 === n3 && d4.type === R2.CONV_C2C ? (a4 = this._getConvLastMessageTime(d4), this.updateIsReadAfterReadReport({ conversationID: l3, lastMessageTime: a4 })) : d4.type === R2.CONV_GROUP && (s4 = l3.replace(R2.CONV_GROUP, ""), this._remoteGroupReadSeqMap.has(s4)) && (r3 = this._remoteGroupReadSeqMap.get(s4), c4 = this._getConvLastMessageSeq(d4), this.updateIsReadAfterReadReport({ conversationID: l3, remoteReadSequence: r3 }), r3 <= c4) && this._remoteGroupReadSeqMap.delete(s4), this.updateUnreadCount(l3, false)) && (o3 += 1);
        }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
      return o3;
    } }, { key: "isRemoteRead", value: function(e4) {
      var t3, n3 = e4.conversationID, e4 = e4.sequence, o3 = n3.replace(R2.CONV_GROUP, ""), i4 = false;
      return this._remoteGroupReadSeqMap.has(o3) && (e4 <= (t3 = this._remoteGroupReadSeqMap.get(o3)) && (i4 = true, M2.l("".concat(this._n, ".isRemoteRead convID:").concat(n3, " msgSeq:").concat(e4, " remoteReadSeq:").concat(t3))), t3 + 10 <= e4) && this._remoteGroupReadSeqMap.delete(o3), i4;
    } }, { key: "updateIsReadAfterReadReport", value: function(e4) {
      var t3 = e4.conversationID, n3 = e4.lastMessageSeq, o3 = e4.lastMessageTime, i4 = this._msgListHandler.getLocalMsgList(t3);
      if (0 !== i4.length) {
        for (var a4, s4 = i4.length - 1; 0 <= s4; s4--)
          if (a4 = i4[s4], !(o3 && a4.time > o3 || n3 && a4.sequence > n3)) {
            if ("in" === a4.flow && a4.isRead)
              break;
            a4.setIsRead(true);
          }
      }
    } }, { key: "updateUnreadCount", value: function(e4) {
      var t3, n3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], o3 = false, i4 = this.getLocalConversation(e4), a4 = this._msgListHandler.getLocalMsgList(e4);
      if (i4)
        return (t3 = i4.unreadCount) !== (a4 = a4.filter(function(e5) {
          return !e5.isRead && !e5._onlineOnlyFlag && !e5.isDeleted;
        }).length) && (i4.unreadCount = a4, o3 = true, M2.l("".concat(this._n, ".updateUnreadCount from ").concat(t3, " to ").concat(a4, ", convID:").concat(e4)), true === n3) && this.emitConvUpdate(true, false), o3 && i4.type === R2.CONV_TOPIC && (t3 = i4.unreadCount, a4 = this.get(10), n3 = e4.replace(R2.CONV_GROUP, ""), a4.onUnreadCountUpdatedFromConv(n3, t3)), o3;
    } }, { key: "clearGroupAtInfoList", value: function(e4) {
      var t3, n3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], o3 = this.getLocalConversation(e4);
      o3 && 0 < o3.groupAtInfoList.length && (o3.clearGroupAtInfoList(), M2.l("".concat(this._n, ".clearGroupAtInfoList convID:").concat(e4)), o3.type === R2.CONV_TOPIC && (o3 = o3.groupAtInfoList, t3 = this.get(10), e4 = e4.replace(R2.CONV_GROUP, ""), t3.onAtInfoUpdated({ topicID: e4, groupAtInfoList: o3 })), true === n3) && this.emitConvUpdate(true, false);
    } }, { key: "updateReadReceiptInfo", value: function(e4) {
      var a4, s4, o3, r3 = this, t3 = e4.userID, i4 = void 0 === t3 ? void 0 : t3, t3 = e4.groupID, c4 = void 0 === t3 ? void 0 : t3, t3 = e4.readReceiptList, e4 = e4.timestamp, u3 = void 0 === e4 ? 0 : e4;
      S2(t3) || (a4 = [], N2(i4) ? N2(c4) || (s4 = "".concat(R2.CONV_GROUP).concat(c4), t3.forEach(function(e5) {
        var t4 = e5.tinyID, n3 = e5.clientTime, o4 = e5.random, i5 = e5.readCount, e5 = e5.unreadCount, t4 = "".concat(t4, "-").concat(n3, "-").concat(o4), n3 = r3._msgListHandler.getLocalMsg(s4, t4) || r3._msgListHandler.getHoppingMsg(s4, t4), o4 = { groupID: c4, messageID: t4, readCount: 0, unreadCount: 0 };
        n3 && (A2(i5) && (n3.readReceiptInfo.readCount = i5, o4.readCount = i5), A2(e5) && (n3.readReceiptInfo.unreadCount = e5, o4.unreadCount = e5), a4.push(o4));
      })) : (o3 = "".concat(R2.CONV_C2C).concat(i4), t3.forEach(function(e5) {
        var t4 = e5.tinyID, n3 = e5.clientTime, e5 = e5.random, t4 = "".concat(t4, "-").concat(n3, "-").concat(e5), n3 = r3._msgListHandler.getLocalMsg(o3, t4) || r3._msgListHandler.getHoppingMsg(o3, t4);
        n3 && !n3.readReceiptInfo.isPeerRead && (n3.readReceiptInfo.isPeerRead = true, n3.readReceiptInfo.timestamp = u3, a4.push({ userID: i4, messageID: t4, isPeerRead: true, timestamp: u3 }));
      })), 0 < a4.length && this.emitOEvt(h3.MESSAGE_READ_RECEIPT_RECEIVED, a4));
    } }, { key: "updateIsRead", value: function(e4) {
      var t3 = this.getLocalConversation(e4), n3 = this.getLocalMessageList(e4);
      if (t3 && 0 !== n3.length && !Ft2(t3.type)) {
        for (var o3 = [], i4 = 0, a4 = n3.length; i4 < a4; i4++)
          "in" !== n3[i4].flow ? "out" !== n3[i4].flow || n3[i4].isRead || n3[i4].setIsRead(true) : o3.push(n3[i4]);
        var s4 = 0;
        s4 = t3.type === R2.CONV_C2C ? (e4 = o3.slice(-t3.unreadCount).filter(function(e5) {
          return e5.isRevoked;
        }).length, o3.length - t3.unreadCount - e4) : o3.length - t3.unreadCount;
        for (var r3 = 0; r3 < s4 && !o3[r3].isRead; r3++)
          o3[r3].setIsRead(true);
      }
    } }, { key: "deleteGroupAtTips", value: function(e4) {
      var t3, n3, o3, i4 = this, a4 = "".concat(this._n, ".deleteGroupAtTips"), s4 = (M2.l("".concat(a4)), this._convMap.get(e4));
      return !s4 || 0 === (t3 = s4.groupAtInfoList).length ? Promise.resolve() : (s4 = void 0, e4.startsWith(R2.CONV_GROUP) && (s4 = e4.replace(R2.CONV_GROUP, "")), n3 = d3(t3), (Pt2({ groupID: s4 }) || Ut2(s4)) && 0 === (n3 = t3.filter(function(e5) {
        return !e5.atTypeArray.includes(R2.CONV_AT_ALL);
      })).length ? (this.clearGroupAtInfoList(e4, false), Promise.resolve()) : (o3 = this.getMyUserID(), this.req({ P: G2.DEL_GROUP_AT_TIPS, data: { messageListToDelete: n3.map(function(e5) {
        return { from: e5.from, to: o3, messageSeq: e5.__sequence, messageRandom: e5.__random, groupID: N2(e5.topicID) ? e5.groupID : e5.topicID };
      }) } }).then(function() {
        return M2.l("".concat(a4, " ok. count:").concat(t3.length)), i4.clearGroupAtInfoList(e4, false), Promise.resolve();
      }).catch(function(e5) {
        return M2.e("".concat(a4, " failed. error:"), e5), E2(e5);
      })));
    } }, { key: "appendToMessageList", value: function(e4) {
      return this._msgListHandler.pushIn(e4);
    } }, { key: "setMessageRandom", value: function(e4) {
      this._sll.set(e4.random);
    } }, { key: "deleteMessageRandom", value: function(e4) {
      this._sll.delete(e4.random);
    } }, { key: "pushIntoMessageList", value: function(e4, t3, n3) {
      return !(!this._msgListHandler.pushIn(t3, n3) || this._sll.has(t3.random) && !n3 || (e4.push(t3), 0));
    } }, { key: "revoke", value: function(e4, t3, n3) {
      return this._msgListHandler.revoke(e4, t3, n3);
    } }, { key: "getPeerReadTime", value: function(e4) {
      return this._peerReadTimeMap.get(e4);
    } }, { key: "recordPeerReadTime", value: function(e4, t3) {
      (!this._peerReadTimeMap.has(e4) || this._peerReadTimeMap.get(e4) < t3) && this._peerReadTimeMap.set(e4, t3);
    } }, { key: "updateMsgIsPeerReadProp", value: function(e4, t3) {
      var n3;
      e4.startsWith(R2.CONV_C2C) && 0 < t3 && (0 < (n3 = this._msgListHandler.updateMsgIsPeerReadProp(e4, t3)).length && this.emitOEvt(h3.MESSAGE_READ_BY_PEER, n3), this._convMap.has(e4)) && !S2(n3 = this._convMap.get(e4).lastMessage) && n3.fromAccount === this.getMyUserID() && n3.lastTime <= t3 && !n3.isPeerRead && (n3.isPeerRead = true, this.emitConvUpdate(true, false));
    } }, { key: "updateMsgIsModifiedProp", value: function(e4) {
      this._msgListHandler.updateMsgIsModifiedProp(e4);
    } }, { key: "setCompleted", value: function(e4) {
      M2.l("".concat(this._n, ".setCompleted convID:").concat(e4)), this._completedMap.set(e4, true);
    } }, { key: "updateRoamingMsgKeyAndTime", value: function(e4, t3, n3) {
      this._roamingMsgKeyAndTimeMap.set(e4, { messageKey: t3, lastMessageTime: n3 });
    } }, { key: "getConvList", value: function(t3) {
      var n3, o3 = this, i4 = "".concat(this._n, ".").concat("getConvList"), e4 = "pagingStatus:".concat(this._pagingStatus, ", local conversation count:").concat(this._convMap.size, ", options:").concat(JSON.stringify(t3));
      return M2.l("".concat(i4, ". ").concat(e4)), this._pagingStatus === qn2 ? ((n3 = new P2("getConvList")).setMessage(e4), this.syncConvList().then(function() {
        n3.end();
        var e5 = o3._getConvList(t3);
        return T2({ conversationList: e5, isSyncCompleted: o3._isSyncCompleted() });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : (e4 = this._getConvList(t3), M2.l("".concat(i4, ". returned conversation count:").concat(e4.length)), D2({ conversationList: e4, isSyncCompleted: this._isSyncCompleted() }));
    } }, { key: "_getConvList", value: function(t3) {
      var n3, o3, i4, a4, s4, r3 = this;
      return N2(t3) ? this.getLocalConvList() : O2(t3) ? 0 === t3.length ? [] : this.getLocalConvList().filter(function(e4) {
        return t3.includes(e4.conversationID);
      }) : m3(t3) ? (n3 = t3.type, o3 = t3.markType, i4 = t3.groupName, a4 = t3.hasUnreadCount, s4 = t3.hasGroupAtInfo, this.getLocalConvList().filter(function(e4) {
        return r3._filterType(e4, n3) && r3._filterMarkType(e4, o3) && r3._filterGroupName(e4, i4) && r3._filterUnreadCount(e4, a4) && r3._filterGroupAtInfo(e4, s4);
      })) : [];
    } }, { key: "_filterType", value: function(e4, t3) {
      return t3 !== R2.CONV_C2C && t3 !== R2.CONV_GROUP || e4.type === t3;
    } }, { key: "_filterGroupName", value: function(e4, t3) {
      return !C2(t3) || ("" === t3 ? 0 === e4.conversationGroupList.length : e4.conversationGroupList.includes(t3));
    } }, { key: "_filterMarkType", value: function(e4, t3) {
      return !A2(t3) || (0 === t3 ? 0 === e4.markList.length : e4.markList.includes(t3));
    } }, { key: "_filterUnreadCount", value: function(e4, t3) {
      var n3 = true;
      return true === t3 ? n3 = 1 <= e4.unreadCount : false === t3 && (n3 = 0 === e4.unreadCount), n3;
    } }, { key: "_filterGroupAtInfo", value: function(e4, t3) {
      var n3 = true;
      return true === t3 ? n3 = 1 <= e4.groupAtInfoList.length : false === t3 && (n3 = 0 === e4.groupAtInfoList.length), n3;
    } }, { key: "_handleC2CPeerReadTime", value: function() {
      var e4, t3 = F2(this._convMap);
      try {
        for (t3.s(); !(e4 = t3.n()).done; ) {
          var n3 = j2(e4.value, 2), o3 = n3[0], i4 = n3[1];
          i4.type === R2.CONV_C2C && this.recordPeerReadTime(o3, i4.peerReadTime);
        }
      } catch (e5) {
        t3.e(e5);
      } finally {
        t3.f();
      }
    } }, { key: "_isPagingGetGroupListCompleted", value: function() {
      var e4 = this.get(7);
      return !e4 || e4.isPagingGetCompleted();
    } }, { key: "_getLocalGroupCount", value: function() {
      var e4 = this.get(7);
      return e4 ? e4.getLocalGroupList().length : 0;
    } }, { key: "_hasLocalGroup", value: function(e4) {
      var t3 = this.get(7);
      return !!t3 && t3.hasLocalGroup(e4.replace(R2.CONV_GROUP, ""));
    } }, { key: "getConversationProfile", value: function(o3) {
      var i4, a4 = this, s4 = false;
      if (this._convMap.has(o3) ? i4 = this._convMap.get(o3) : (i4 = new jo2({ conversationID: o3, type: bt3(o3) ? R2.CONV_C2C : R2.CONV_GROUP }, this.isIntl(), this.isUsingChatCore()), s4 = true), i4._isInfoCompleted || i4.type === R2.CONV_SYSTEM)
        return D2({ conversation: i4 });
      if (wt2(o3)) {
        if (!this.get(7))
          return E2({ code: k2.NO_MODULE });
        if (!this._hasLocalGroup(o3))
          return D2({ conversation: i4 });
      }
      var r3 = "".concat(this._n, ".").concat("getConversationProfile"), c4 = new P2("getConversationProfile");
      return M2.l("".concat(r3, ". convID:").concat(o3, " remark:").concat(i4.remark, " lastMessage:"), i4.lastMessage), this._getUserOrGroupProfile(i4).then(function(e4) {
        c4.setMessage("convID:".concat(o3, " unreadCount:").concat(e4.data.conversation.unreadCount)).end();
        var t3, n3 = a4.get(8);
        if (n3 && i4.type === R2.CONV_C2C && (t3 = o3.replace(R2.CONV_C2C, ""), n3.isMyFriend(t3)) && (n3 = n3.getFriendRemark(t3), i4.remark !== n3) && (i4.remark = n3, M2.l("".concat(r3, ". convID:").concat(o3, " patch remark:").concat(i4.remark))), M2.l("".concat(r3, " ok. isNewConv:").concat(s4, " convID:").concat(o3)), s4) {
          if (i4.type === R2.CONV_C2C)
            return a4._onNewC2CConv([o3.replace(R2.CONV_C2C, "")]).then(function() {
              return D2({ conversation: i4 });
            });
          if (i4.type === R2.CONV_GROUP)
            return a4._onNewGroupConv([o3.replace(R2.CONV_GROUP, "")]).then(function() {
              return D2({ conversation: i4 });
            });
        }
        return e4;
      }).catch(function(e4) {
        return c4.setError(e4).setMessage("convID:".concat(o3)).end(), M2.e("".concat(r3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_getUserOrGroupProfile", value: function(t3) {
      var n3 = this;
      return t3.type === R2.CONV_C2C ? this.get(4).getUserProfile({ userIDList: [t3.toAccount] }).then(function(e4) {
        e4 = e4.data;
        return 0 === e4.length ? E2({ code: k2.USER_OR_GRP_NOT_FOUND }) : (t3.userProfile = e4[0], t3._isInfoCompleted = true, n3._insertConvAfterTopmost(t3), D2({ conversation: t3 }));
      }) : this.get(7).getGroupProfile({ groupID: t3.toAccount }).then(function(e4) {
        return t3.groupProfile = e4.data.group, t3._isInfoCompleted = true, n3._insertConvAfterTopmost(t3), D2({ conversation: t3 });
      });
    } }, { key: "_insertConvAfterTopmost", value: function(e4) {
      var t3, n3;
      e4 instanceof jo2 && !this._convMap.has(e4.conversationID) && (n3 = (t3 = d3(this._convMap)).findIndex(function(e5) {
        return false === e5[1].isPinned;
      }), t3.splice(n3, 0, [e4.conversationID, e4]), this._convMap = new Map(t3), this._setStorageConvList(), this.emitConvUpdate(true, false));
    } }, { key: "_onProfileUpdated", value: function(e4) {
      var n3 = this;
      e4.data.forEach(function(e5) {
        var t3 = e5.userID;
        t3 === n3.getMyUserID() ? n3._onMyProfileModified({ latestNick: e5.nick, latestAvatar: e5.avatar }) : (t3 = n3._convMap.get("".concat(R2.CONV_C2C).concat(t3))) && (t3.userProfile = e5);
      });
    } }, { key: "_onCloudConfig", value: function(e4) {
      "0" === this.getCloudConfig("pull_on_invite") && (this._bPullOnInvite = false), M2.l("".concat(this._n, "._onCloudConfig bPullOnInvite:").concat(this._bPullOnInvite));
    } }, { key: "disableMsgPullOnInvite", value: function() {
      this._bPullOnInvite = false;
    } }, { key: "_isSyncCompleted", value: function() {
      return this._pagingStatus === Fn2;
    } }, { key: "_errorLog", value: function(e4, t3, n3, o3) {
      var i4 = new Error("Params validate failed."), a4 = "".concat(this.getErrMsg("API_REFER")).concat(e4);
      throw M2.w("[".concat(e4, "] | ").concat(t3, " | ").concat(this.getErrMsg(n3, o3), ", ").concat(a4)), M2.e("[".concat(e4, "] Invalid ").concat(t3, ": type check failed for ").concat(t3, ".")), i4;
    } }, { key: "_isValidConvID", value: function(e4) {
      return bt3(e4) || wt2(e4) || Ft2(e4);
    } }, { key: "deleteConversation", value: function(e4) {
      var t3 = this, n3 = "deleteConversation";
      return C2(e4) || ut3(e4) || this._errorLog(n3, "options", "StringOrObjectRequiredLog"), C2(e4) ? (this._isValidConvID(e4) || this._errorLog(n3, "options", "InvalidConversationID", e4), M2.l("".concat(this._n, ".").concat(n3, " convID:").concat(e4)), this.deleteConvList({ conversationIDList: [e4], flag: 1 })) : (O2(e4.conversationIDList) || this._errorLog(n3, "conversationIDList", "ArrayRequiredLog"), 0 === e4.conversationIDList.length && this._errorLog(n3, "conversationIDList", "NonEmptyArrayLog"), e4.conversationIDList.forEach(function(e5) {
        t3._isValidConvID(e5) || t3._errorLog(n3, "conversationIDList", "InvalidConversationID", e5);
      }), "clearHistoryMessage" in e4 && "boolean" != typeof e4.clearHistoryMessage && this._errorLog(n3, "clearHistoryMessage", "BooleanRequiredLog"), 100 < e4.conversationIDList.length && (e4.conversationIDList = e4.conversationIDList.slice(0, 100)), this.deleteConvList(e4));
    } }, { key: "deleteConvList", value: function(e4) {
      var t3 = e4.conversationIDList, t3 = void 0 === t3 ? [] : t3, n3 = e4.clearHistoryMessage, n3 = void 0 === n3 || n3, e4 = e4.flag, o3 = void 0 === e4 ? 0 : e4, i4 = "".concat(this._n, ".").concat("deleteConvList"), e4 = "convIDList:".concat(t3, " clearHistoryMessage:").concat(n3), a4 = (M2.l("".concat(i4, " ").concat(e4)), new P2("deleteConvList"));
      return a4.setMessage(e4), Promise.all([this.rmLocalOnlyConvList(t3), this.rmLocalAndRemoteConvList(t3, n3)]).then(function(e5) {
        a4.end();
        e5 = [].concat(d3(e5[0]), d3(e5[1]));
        return 0 === e5.length ? E2(new L2({ code: k2.CONV_NOT_FOUND })) : (M2.l("".concat(i4, " ok")), D2(1 === o3 ? { conversationID: e5[0] } : { conversationIDList: e5 }));
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "rmLocalOnlyConvList", value: function(e4) {
      var n3 = this;
      return e4.filter(function(e5) {
        var t3;
        return !!n3._convMap.has(e5) && ((t3 = n3.getLocalConversation(e5).type) !== R2.CONV_GROUP || n3._hasLocalGroup(e5) ? t3 === R2.CONV_SYSTEM && (n3.get(7).deleteGroupSystemNotice({ messageList: n3._msgListHandler.getLocalMsgList(e5) }), n3.deleteLocalConv(e5), true) : (n3.deleteLocalConv(e5), true));
      });
    } }, { key: "rmLocalAndRemoteConvList", value: function(e4, t3) {
      var n3 = this, o3 = { fromAccount: this.getMyUserID(), conversationList: [], clearHistoryMessage: t3 ? 1 : 0 };
      return e4.forEach(function(e5) {
        var t4;
        n3._convMap.has(e5) && ((t4 = n3.getLocalConversation(e5).type) === R2.CONV_C2C ? o3.conversationList.push({ toAccount: e5.replace(t4, ""), type: 1 }) : t4 === R2.CONV_GROUP && n3._hasLocalGroup(e5) && o3.conversationList.push({ toGroupID: e5.replace(t4, ""), type: 2 }));
      }), 0 === o3.conversationList.length ? [] : this.req({ P: G2.DEL_CONV, data: o3 }).then(function(e5) {
        var t4 = [];
        return 0 < e5.data.resultList.length && e5.data.resultList.map(function(e6) {
          0 === e6.code && (e6 = 1 === e6.type ? "".concat(R2.CONV_C2C).concat(e6.to) : "".concat(R2.CONV_GROUP).concat(e6.groupID), t4.push(e6));
        }), n3.deleteLocalConvList(t4), t4;
      });
    } }, { key: "setConvDraft", value: function(e4) {
      var t3 = e4.conversationID, e4 = e4.draftText, n3 = "".concat(this._n, ".").concat("setConvDraft");
      return M2.l("".concat(n3, " convID:").concat(t3, " draftText:").concat(e4)), this._convMap.has(t3) ? ((n3 = this._convMap.get(t3)).setDraftText(e4), this.emitConvUpdate(), D2({ code: 0, conversation: n3 })) : E2({ code: k2.CONV_NOT_FOUND });
    } }, { key: "clearHistoryMessage", value: function(t3) {
      var n3 = this, e4 = { fromAccount: this.getMyUserID(), toAccount: void 0, type: void 0, toGroupID: void 0 };
      if (!this._convMap.has(t3))
        return E2({ code: k2.CONV_NOT_FOUND });
      var o3 = this._convMap.get(t3).type;
      if (o3 === R2.CONV_C2C)
        e4.type = 1, e4.toAccount = t3.replace(R2.CONV_C2C, "");
      else {
        if (o3 !== R2.CONV_GROUP)
          return o3 === R2.CONV_SYSTEM ? (this.get(7).deleteGroupSystemNotice({ messageList: this._msgListHandler.getLocalMsgList(t3) }), D2({ conversationID: t3 })) : E2({ code: k2.CONV_UN_RECORDED_TYPE });
        e4.type = 2, e4.toGroupID = t3.replace(R2.CONV_GROUP, "");
      }
      var i4 = "".concat(this._n, ".").concat("clearHistoryMessage"), a4 = new P2("clearHistoryMessage");
      return a4.setMessage("convID:".concat(t3)), M2.l("".concat(i4, ". convID:").concat(t3)), this.setMessageRead({ conversationID: t3 }).then(function() {
        return n3.req({ P: G2.CLEAR_HISTORY_MSG, data: e4 });
      }).then(function() {
        a4.end(), M2.l("".concat(i4, " ok")), n3.clearMemMsg(t3);
        var e5 = n3.getLocalConversation(t3);
        return e5 && (e5.updateLastMessage(), n3._sortConvListAndEmitEvent()), D2({ conversationID: t3 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "pinConversation", value: function(e4) {
      var t3, n3, o3, i4 = this, a4 = e4.conversationID, s4 = e4.isPinned, r3 = this.getLocalConversation(a4);
      return r3 && r3.isPinned === s4 ? D2({ conversationID: a4 }) : Ft2(a4) ? (r3 && (r3.isPinned = s4), this._sortConvListAndEmitEvent(), D2({ conversationID: a4 })) : (e4 = null, bt3(a4) ? e4 = { type: 1, toAccount: a4.replace(R2.CONV_C2C, "") } : wt2(a4) && (e4 = { type: 2, groupID: a4.replace(R2.CONV_GROUP, "") }), null === e4 ? E2({ code: k2.INVALID_CONV_ID }) : (t3 = "".concat(this._n, ".").concat("pinConversation"), n3 = "convID:".concat(a4, " isPinned:").concat(s4), (o3 = new P2("pinConversation")).setMessage(n3), M2.l("".concat(t3, ". ").concat(n3)), this.req({ P: G2.PIN_CONV, data: { fromAccount: this.getMyUserID(), operationType: true === s4 ? 1 : 2, itemList: [e4] } }).then(function() {
        return o3.end(), M2.l("".concat(t3, " ok")), r3 ? r3.isPinned !== s4 && (r3.isPinned = s4) : i4._convMap.set(a4, new jo2({ conversationID: a4, type: bt3(a4) ? R2.CONV_C2C : R2.CONV_GROUP, isPinned: s4 }, i4.isIntl(), i4.isUsingChatCore())), i4._sortConvListAndEmitEvent(), T2({ conversationID: a4 });
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })));
    } }, { key: "setMessageRemindType", value: function(e4) {
      return this._msgRemindHandler.set(e4);
    } }, { key: "patchMsgRemindType", value: function(e4) {
      var t3 = e4.ID, n3 = e4.isC2CConversation, o3 = e4.messageRemindType, i4 = false, n3 = this.getLocalConversation("".concat(n3 ? R2.CONV_C2C : R2.CONV_GROUP).concat(t3));
      return n3 && n3.messageRemindType !== o3 && (n3.messageRemindType = o3, i4 = true), M2.l("".concat(this._n, ".patchMsgRemindType options:"), e4, "ret:".concat(i4)), i4;
    } }, { key: "onC2CMsgRemindTypeFetched", value: function(e4) {
      var n3, o3 = this;
      O2(e4) && 0 < e4.length && (n3 = 0, e4.forEach(function(e5) {
        var t3 = e5.userID, e5 = e5.muteFlag, e5 = o3._transMsgRemindType(e5);
        true === o3.patchMsgRemindType({ ID: t3, isC2CConversation: true, messageRemindType: e5 }) && (n3 += 1);
      }), M2.l("".concat(this._n, ".onC2CMsgRemindTypeFetched updateCount:").concat(n3)), 1 <= n3) && this.emitConvUpdate(true, false);
    } }, { key: "onC2CMsgRemindTypeSynced", value: function(e4) {
      var n3 = this, o3 = "".concat(this._n, ".onC2CMsgRemindTypeSynced");
      e4.dataList.forEach(function(e5) {
        var t3;
        S2(e5.muteNotificationsSync) || (t3 = (e5 = e5.muteNotificationsSync).to, e5 = e5.muteFlag, e5 = n3._transMsgRemindType(e5), n3.patchMsgRemindType({ ID: t3, isC2CConversation: !(t3 = 0), messageRemindType: e5 }) && (t3 += 1), M2.l("".concat(o3, " updateCount:").concat(t3)), 1 <= t3 && n3.emitConvUpdate(true, false));
      });
    } }, { key: "onGroupMsgRemindTypeUpdated", value: function(e4) {
      this._msgRemindHandler.onGroupMsgRemindTypeUpdated(e4);
    } }, { key: "deleteLocalConv", value: function(e4) {
      var t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n3 = this._convMap.has(e4);
      M2.l("".concat(this._n, ".deleteLocalConv convID:").concat(e4, " has:").concat(n3)), n3 && (this._convMap.delete(e4), this._convMapForDiff.delete(e4), this.clearMemMsg(e4), this._setStorageConvList(true), t3) && (n3 = !this._isTopicConv(e4), this.emitConvUpdate(n3, false));
    } }, { key: "pullMsgOnInvite", value: function(e4) {
      var t3, n3, o3, i4, a4, s4 = this.get(7);
      s4 && (t3 = "".concat(this._n, ".pullMsgOnInvite"), M2.l("".concat(t3, " flag:").concat(this._bPullOnInvite)), this._bPullOnInvite) && (a4 = this.getLocalLastMessage(e4), n3 = this.getLocalSecondLastMessage(e4), i4 = o3 = 1, a4 && (o3 = a4.sequence), n3 && (i4 = n3.sequence), a4 = s4.getGroupRemoteLastSeq(e4.replace(R2.CONV_GROUP, "")), M2.l("".concat(t3, " convID:").concat(e4, " localLastSeq:").concat(o3, " localSecondLastSeq:").concat(i4, " remoteLastSeq:").concat(a4)), this.clearMemMsg(e4), 1 < o3 - i4 ? this._recursiveGetMsgList([], e4, false, o3, i4) : 1 < a4 - o3 && this._recursiveGetMsgList([], e4, true, a4, o3));
    } }, { key: "_recursiveGetMsgList", value: function(i4, a4, s4, r3, c4, e4) {
      var u3 = this;
      this.getMessageList({ conversationID: a4, nextReqMessageID: e4 }).then(function(e5) {
        var e5 = e5.data, t3 = e5.messageList, n3 = e5.isCompleted, e5 = e5.nextReqMessageID, o3 = t3.filter(function(e6) {
          return s4 ? e6.sequence > c4 && e6.sequence <= r3 : e6.sequence > c4 && e6.sequence < r3;
        });
        i4.unshift.apply(i4, d3(o3)), !n3 && 0 < t3.length && t3[0].sequence > c4 && i4.length < 60 ? u3._recursiveGetMsgList(i4, a4, s4, r3, c4, e5) : u3._emitMsgReceived(a4, i4);
      });
    } }, { key: "_emitMsgReceived", value: function(e4, t3) {
      var n3, o3, i4 = this;
      0 < t3.length && (t3 = t3.filter(function(t4, e5, n4) {
        return e5 === n4.findIndex(function(e6) {
          return e6.sequence === t4.sequence;
        });
      }), n3 = this.hasLocalConversation(e4), o3 = t3.map(function(e5) {
        return e5.sequence;
      }), M2.l("".concat(this._n, "._emitMsgReceived convID:").concat(e4, " has:").concat(n3, " count:").concat(o3.length, " sequenceList:"), o3), this.emitOEvt(h3.MESSAGE_RECEIVED, t3), n3 ? this.patchConvLastMessage(e4, true) : this.getConversationProfile(e4).then(function() {
        i4.patchConvLastMessage(e4, true);
      }));
    } }, { key: "deleteLocalConvList", value: function(e4) {
      var t3 = this, n3 = false;
      e4.forEach(function(e5) {
        t3._convMap.has(e5) && (t3.deleteLocalConv(e5, false), n3 = true);
      }), M2.l("".concat(this._n, ".deleteLocalConvList convID:").concat(e4, " isConvIDExisted:").concat(n3)), n3 && this.emitConvUpdate(true, false);
    } }, { key: "isMessageSentByCurrentInstance", value: function(e4) {
      return !(!this._msgListHandler.hasLocalMsg(e4.conversationID, e4.ID) && !this._sll.has(e4.random));
    } }, { key: "modifyMessageList", value: function(e4) {
      var t3, n3;
      e4.startsWith(R2.CONV_C2C) && this._convMap.has(e4) && (n3 = this._convMap.get(e4), t3 = Date.now(), this._msgListHandler.modifyMsgSentByPeer({ conversationID: e4, latestNick: n3.userProfile.nick, latestAvatar: n3.userProfile.avatar }), n3 = this.get(4).getNickAndAvatarByUserID(this.getMyUserID()), this._msgListHandler.modifyMsgSentByMe({ conversationID: e4, latestNick: n3.nick, latestAvatar: n3.avatar }), M2.l("".concat(this._n, ".modifyMessageList convID:").concat(e4, " cost:").concat(an2(t3))));
    } }, { key: "updateUserProfileSpecifiedKey", value: function(e4) {
      M2.l("".concat(this._n, ".updateUserProfileSpecifiedKey options:"), e4);
      var t3 = e4.conversationID, n3 = e4.nick, e4 = e4.avatar;
      this._convMap.has(t3) && (t3 = this._convMap.get(t3).userProfile, C2(n3) && t3.nick !== n3 && (t3.nick = n3), C2(e4) && t3.avatar !== e4 && (t3.avatar = e4), this.emitConvUpdate(true, false));
    } }, { key: "_onMyProfileModified", value: function(t3) {
      var n3 = this, e4 = this.getLocalConvList(), o3 = Date.now();
      e4.forEach(function(e5) {
        n3.modifyMessageSentByMe(y2({ conversationID: e5.conversationID }, t3));
      }), M2.l("".concat(this._n, "._onMyProfileModified. modify all messages sent by me, cost:").concat(an2(o3)));
    } }, { key: "modifyMessageSentByMe", value: function(e4) {
      this._msgListHandler.modifyMsgSentByMe(e4);
    } }, { key: "getLatestMessageSentByMe", value: function(e4) {
      return this._msgListHandler.getLatestMsgSentByMe(e4);
    } }, { key: "modifyMessageSentByPeer", value: function(e4) {
      this._msgListHandler.modifyMsgSentByPeer(e4);
    } }, { key: "getLatestMessageSentByPeer", value: function(e4) {
      return this._msgListHandler.getLatestMsgSentByPeer(e4);
    } }, { key: "pushIntoNoticeResult", value: function(e4, t3) {
      return !(!this._msgListHandler.pushIn(t3) || this._sll.has(t3.random) || (e4.push(t3), 0));
    } }, { key: "getLocalLastMessage", value: function(e4) {
      return this._msgListHandler.getLocalLastMsg(e4);
    } }, { key: "getLocalSecondLastMessage", value: function(e4) {
      return this._msgListHandler.getLocalSecondLastMsg(e4);
    } }, { key: "checkAndPatchRemark", value: function() {
      var e4, n3, o3 = this.get(8);
      0 !== this._convMap.size && o3 && 0 !== (e4 = d3(this._convMap.values()).filter(function(e5) {
        return e5.type === R2.CONV_C2C;
      })).length && (n3 = 0, e4.forEach(function(e5) {
        var t3 = e5.conversationID.replace(R2.CONV_C2C, "");
        o3.isMyFriend(t3) && (t3 = o3.getFriendRemark(t3), e5.remark !== t3) && (e5.remark = t3, n3 += 1);
      }), M2.l("".concat(this._n, ".checkAndPatchRemark. c2cConvCount:").concat(e4.length, " patchedCount:").concat(n3)), 0 < n3) && this.emitConvUpdate(true, false);
    } }, { key: "updateTopicConversation", value: function(e4) {
      this._updateLocalConvList({ conversationOptionsList: e4, isFromGetConversations: true, updateUnreadCount: true });
    } }, { key: "sendReadReceipt", value: function(e4) {
      var t3 = e4[0], n3 = null;
      return t3.conversationType === R2.CONV_C2C ? n3 = this._m.get(6) : t3.conversationType === R2.CONV_GROUP && (n3 = this._m.get(7)), n3 ? n3.sendReadReceipt(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getReadReceiptList", value: function(e4) {
      var t3 = e4[0], n3 = null;
      return t3.conversationType === R2.CONV_C2C ? n3 = this._m.get(6) : t3.conversationType === R2.CONV_GROUP && (n3 = this._m.get(7)), n3 ? n3.getReadReceiptList(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getLastMessageTime", value: function(e4) {
      e4 = this.getLocalConversation(e4);
      return e4 ? e4.lastMessage.lastTime : 0;
    } }, { key: "getTotalUnreadCount", value: function() {
      var e4 = this.getLocalConvList(), t3 = 0;
      return e4.forEach(function(e5) {
        e5.type === R2.CONV_SYSTEM || "" !== e5.messageRemindType && e5.messageRemindType !== R2.MSG_REMIND_ACPT_AND_NOTE || (t3 += e5.unreadCount);
      }), t3;
    } }, { key: "onTotalUnreadCountUpdate", value: function() {
      var e4 = this.getTotalUnreadCount();
      this._convTotalUnreadCount !== e4 && (M2.l("".concat(this._n, ".onTotalUnreadCountUpdate from ").concat(this._convTotalUnreadCount, " to ").concat(e4)), this._convTotalUnreadCount = e4, this.emitOEvt(h3.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED));
    } }, { key: "_isConvNeedShow", value: function(e4) {
      var t3, n3, e4 = this.getLocalConversation(e4);
      return !(!N2(e4) && (t3 = e4.type === R2.CONV_TOPIC, n3 = e4.type === R2.CONV_GROUP && e4.groupProfile.type === R2.GRP_ROOM, e4 = e4.type === R2.CONV_GROUP && e4.groupProfile.type === R2.GRP_LIVE, t3 || n3 || e4));
    } }, { key: "setAllRcvMsgOpt", value: function(e4) {
      return this._msgRemindHandler.setAllRcvMsgOpt(e4);
    } }, { key: "getAllRcvMsgOpt", value: function() {
      return this._msgRemindHandler.getAllRcvMsgOpt();
    } }, { key: "onAllRcvMsgOptNotify", value: function(e4) {
      this._msgRemindHandler.onAllRcvMsgOptNotify(e4);
    } }, { key: "clearUnreadCount", value: function(e4) {
      e4 = this.getLocalConversation(e4);
      e4 && 0 < e4.unreadCount && (e4.unreadCount = 0, this.emitConvUpdate(true, false));
    } }, { key: "storeHoppingMessageList", value: function(e4) {
      this._msgListHandler.storeHoppingMsgList(e4);
    } }, { key: "clearMemMsg", value: function(e4) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1];
      M2.l("".concat(this._n, ".clearMemMsg convID:").concat(e4, " isOverLimit:").concat(t3)), this._msgListHandler.removeByConvID(e4), this._completedMap.delete(e4), this._roamingMsgKeyAndTimeMap.delete(e4), this._everClearedMap.set(e4, 1);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._setStorageConvList(true), this._pagingStatus = bn2, this._msgListHandler.reset(), this._msgRemindHandler.reset(), this._roamingMsgKeyAndTimeMap.clear(), this._sll.reset(), this._peerReadTimeMap.clear(), this._completedMap.clear(), this._convMap.clear(), this._pagingTs = 0, this._pagingStartIdx = 0, this._pagingPinnedTs = 0, this._pagingPinnedStartIdx = 0, this._remoteGroupReadSeqMap.clear(), this._convTotalUnreadCount = 0, this._pagingGetCostList.length = 0, this._pagingConvIDMap.clear(), this._convIDFromUnreadDBMap.clear(), this._pagingGetCostList.length = 0, this._convMapForDiff.clear(), this._partialUpdatedConvMap.clear(), this._everClearedMap.clear(), this._bPullOnInvite = true, this._convGroupHandler.reset(), this.resetReady();
    } }])), Qo = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "GroupTipsHandler", this._cachedGroupTipsMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4;
    }, [{ key: "onCheckTimer", value: function(e4) {
      e4 % 1 == 0 && 0 < this._cachedGroupTipsMap.size && this._check();
    } }, { key: "_check", value: function() {
      var i4 = this;
      this._cachedGroupTipsMap.forEach(function(e4, t3) {
        var n3 = i4._checkCountMap.get(t3), o3 = i4._grpM.hasLocalGroup(t3);
        M2.l("".concat(i4._n, "._check groupID:").concat(t3, " hasLocalGroup:").concat(o3, " checkCount:").concat(n3)), o3 ? (i4._notifyCachedGroupTips(t3), i4._checkCountMap.delete(t3), i4._grpM.deleteUnjoinedAVChatRoom(t3)) : n3 >= i4.MAX_CHECK_COUNT ? (i4._deleteCachedGroupTips(t3), i4._checkCountMap.delete(t3)) : i4._checkCountMap.set(t3, ++n3);
      });
    } }, { key: "onNewGroupTips", value: function(e4) {
      M2.l("".concat(this._n, ".onNewGroupTips options:").concat(JSON.stringify(e4.dataList)));
      var e4 = this._assembly(e4), t3 = e4.eventDataList, n3 = e4.result, e4 = e4.AVChatRoomMessageList;
      0 < e4.length && this._grpM.onAVChatRoomMessage(e4), 0 < n3.length && (this._grpM.emitOEvt(h3.MESSAGE_RECEIVED, n3), this._handleTips(n3)), 0 < t3.length && (this._grpM.updateNextMessageSeq(t3), this._grpM.get(11).onNewMessage({ conversationOptionsList: t3, isInstantMessage: true }));
    } }, { key: "_assembly", value: function(e4) {
      for (var t3 = e4.event, n3 = e4.dataList, o3 = null, i4 = [], a4 = [], s4 = {}, r3 = [], c4 = 0, u3 = n3.length; c4 < u3; c4++) {
        var l3 = yt3(n3[c4]);
        if (6 === t3) {
          if (this._grpM.isGroupAttributesUpdatedNotice(l3))
            continue;
          if (this._grpM.isGroupCountersNotice(l3))
            continue;
        }
        var d4 = l3.groupProfile, p4 = d4.groupID, _3 = d4.communityType, _3 = void 0 === _3 ? 0 : _3, h4 = d4.topicID, h4 = void 0 === h4 ? void 0 : h4, g3 = d4.invisible, d4 = d4.groupType, d4 = void 0 === d4 ? void 0 : d4, f4 = void 0, m4 = this._grpM.isMessageFromTopic(_3, h4), v4 = (m4 && (f4 = R2.CONV_TOPIC, l3.to = h4), this._grpM.hasLocalGroup(p4));
        if (v4 || !this._grpM.isUnjoinedAVChatRoom(p4))
          if (v4 || m4)
            if (this._grpM.isMessageFromOrToAVChatroom(p4))
              l3.event = t3, r3.push(l3);
            else if (l3.currentUser = this._grpM.getMyUserID(), l3.conversationType = R2.CONV_GROUP, (o3 = new So2(l3)).setElement({ type: R2.MSG_GRP_TIP, content: y2(y2({}, l3.elements), {}, { groupProfile: l3.groupProfile }) }), o3.isSystemMessage = false, 1 !== g3) {
              var v4 = this._grpM.get(11), m4 = o3, g3 = m4.conversationID, m4 = m4.sequence;
              if (6 === t3)
                o3._onlineOnlyFlag = true, a4.push(o3);
              else if (!v4.pushIntoNoticeResult(a4, o3))
                continue;
              this._grpM.isMessageFromCommunityOfTopic(_3, h4) || 6 === t3 && v4.getLocalConversation(g3) || (6 !== t3 && this._qualityStat(o3), _3 = v4.isRemoteRead({ conversationID: g3, sequence: m4 }), N2(s4[g3]) ? (h4 = 0, "in" !== o3.flow || o3._isExcludedFromUnreadCount || o3._onlineOnlyFlag || _3 || (h4 = 1), s4[g3] = i4.push({ conversationID: g3, unreadCount: h4, type: N2(f4) ? o3.conversationType : f4, subType: o3.conversationSubType, lastMessage: o3._isExcludedFromLastMessage ? "" : o3 }) - 1) : (i4[v4 = s4[g3]].type = o3.conversationType, i4[v4].subType = o3.conversationSubType, i4[v4].lastMessage = o3._isExcludedFromLastMessage ? "" : o3, "in" !== o3.flow || o3._isExcludedFromUnreadCount || o3._onlineOnlyFlag || _3 || i4[v4].unreadCount++));
            } else
              this._qualityStat(o3);
          else
            this._cacheAndCompare({ groupID: p4, event: t3, item: l3, groupType: d4 });
      }
      return { eventDataList: i4, result: a4, AVChatRoomMessageList: r3 };
    } }, { key: "_qualityStat", value: function(e4) {
      this._grpM.get(26).addMessageSequence({ key: Qn2, message: e4 });
    } }, { key: "_handleTips", value: function(e4) {
      var t3 = this;
      e4.forEach(function(e5) {
        switch (e5.payload.operationType) {
          case 1:
            t3._onNewMemberComeIn(e5);
            break;
          case 2:
            t3._onMemberQuit(e5);
            break;
          case 3:
            t3._onMemberKickedOut(e5);
            break;
          case 4:
            t3._onMemberSetAdmin(e5);
            break;
          case 5:
            t3._onMemberCancelledAdmin(e5);
            break;
          case 6:
            t3._onGroupProfileModified(e5);
            break;
          case 7:
            t3._onMemberInfoModified(e5);
            break;
          case 8:
            t3._onTopicProfileUpdated(e5);
            break;
          default:
            M2.w("".concat(t3._n, "._handleTips unknown operationType:").concat(e5.payload.operationType));
        }
      });
    } }, { key: "_onNewMemberComeIn", value: function(e4) {
      var e4 = e4.payload, t3 = e4.memberNum, e4 = e4.groupProfile.groupID, e4 = this._grpM.getLocalGroupProfile(e4);
      e4 && A2(t3) && e4.memberCount !== t3 && (e4.memberCount = t3, this._updateConvGroupProfile(e4));
    } }, { key: "_onMemberQuit", value: function(e4) {
      var t3 = e4.payload, n3 = t3.memberNum, t3 = t3.groupProfile.groupID, o3 = this._grpM.getLocalGroupProfile(t3);
      o3 && A2(n3) && o3.memberCount !== n3 && (o3.memberCount = n3, this._updateConvGroupProfile(o3)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(t3, e4.payload.userIDList);
    } }, { key: "_onMemberKickedOut", value: function(e4) {
      var t3 = e4.payload, n3 = t3.memberNum, t3 = t3.groupProfile.groupID, o3 = this._grpM.getLocalGroupProfile(t3);
      o3 && A2(n3) && o3.memberCount !== n3 && (o3.memberCount = n3, this._updateConvGroupProfile(o3)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(t3, e4.payload.userIDList);
    } }, { key: "_updateConvGroupProfile", value: function(e4) {
      this._grpM.get(11).updateConvGroupProfile([e4]);
    } }, { key: "_onMemberSetAdmin", value: function(e4) {
      var t3 = e4.payload.groupProfile.groupID, e4 = e4.payload.userIDList, n3 = this._grpM.getGroupMemberHandler();
      e4.forEach(function(e5) {
        e5 = n3.getLocalGroupMemberInfo(t3, e5);
        e5 && e5.updateRole(R2.GRP_MBR_ROLE_ADMIN);
      });
    } }, { key: "_onMemberCancelledAdmin", value: function(e4) {
      var t3 = e4.payload.groupProfile.groupID, e4 = e4.payload.userIDList, n3 = this._grpM.getGroupMemberHandler();
      e4.forEach(function(e5) {
        e5 = n3.getLocalGroupMemberInfo(t3, e5);
        e5 && e5.updateRole(R2.GRP_MBR_ROLE_MEMBER);
      });
    } }, { key: "_onGroupProfileModified", value: function(e4) {
      var t3 = this, e4 = e4.payload, n3 = e4.newGroupProfile, o3 = e4.groupProfile, i4 = e4.operatorInfo, e4 = o3.groupID, a4 = this._grpM.getLocalGroupProfile(e4), o3 = (Object.keys(n3).forEach(function(e5) {
        switch (e5) {
          case "ownerID":
            t3._ownerChanged(a4, n3);
            break;
          case "groupName":
            a4.name = n3[e5];
            break;
          default:
            a4[e5] = n3[e5];
        }
      }), N2(i4) || Object.keys(i4).forEach(function(e5) {
        var t4;
        "nameCard" === e5 ? a4.updateSelfInfo({ nameCard: i4[e5] }) : "role" === e5 && (t4 = "", 400 === i4[e5] ? t4 = R2.GRP_MBR_ROLE_OWNER : 300 === i4[e5] ? t4 = R2.GRP_MBR_ROLE_ADMIN : 200 === i4[e5] && (t4 = R2.GRP_MBR_ROLE_MEMBER), a4.updateSelfInfo({ role: t4 }));
      }), !a4.isSupportTopic);
      this._grpM.emitGroupListUpdate(true, o3);
    } }, { key: "_ownerChanged", value: function(e4, t3) {
      var e4 = e4.groupID, n3 = this._grpM.getLocalGroupProfile(e4), o3 = this._grpM.getMyUserID();
      o3 === t3.ownerID && (n3.updateGroup({ selfInfo: { role: R2.GRP_MBR_ROLE_OWNER } }), n3 = (t3 = this._grpM.getGroupMemberHandler()).getLocalGroupMemberInfo(e4, o3), o3 = this._grpM.getLocalGroupProfile(e4).ownerID, t3 = t3.getLocalGroupMemberInfo(e4, o3), n3 && n3.updateRole(R2.GRP_MBR_ROLE_OWNER), t3) && t3.updateRole(R2.GRP_MBR_ROLE_MEMBER);
    } }, { key: "_onMemberInfoModified", value: function(e4) {
      var t3 = e4.to, n3 = e4.payload, o3 = n3.groupProfile, n3 = n3.memberList, i4 = o3.groupID, a4 = (Ut2(t3) && this._updateTopicMuteTime(e4), this._grpM.getGroupMemberHandler());
      n3.forEach(function(e5) {
        var t4 = a4.getLocalGroupMemberInfo(i4, e5.userID);
        t4 && A2(e5.muteTime) && t4.updateMuteUntil(e5.muteTime);
      });
    } }, { key: "_updateTopicMuteTime", value: function(e4) {
      var t3 = e4.to, e4 = e4.payload, n3 = e4.groupProfile, e4 = e4.memberList, o3 = void 0 === e4 ? [] : e4, e4 = this._grpM.get(10), n3 = n3.groupID, i4 = e4.getLocalTopic(n3, t3);
      if (i4) {
        for (var a4 = false, s4 = 0; s4 < o3.length; s4++) {
          var r3 = o3[s4];
          if (r3.userID === this._grpM.getMyUserID() && 0 <= r3.muteTime) {
            i4.updateSelfInfo({ muteTime: r3.muteTime }), a4 = true;
            break;
          }
        }
        a4 && this._grpM.emitOEvt(h3.TOPIC_UPDATED, { groupID: n3, topic: i4 });
      }
    } }, { key: "_onTopicProfileUpdated", value: function(e4) {
      var t3 = e4.payload, n3 = t3.groupProfile.groupID, t3 = t3.newTopicInfo;
      this._grpM.get(10).onTopicProfileUpdated(y2({ groupID: n3, topicID: e4.to }, t3));
    } }, { key: "_cacheGroupTips", value: function(e4, t3) {
      this._cachedGroupTipsMap.has(e4) || this._cachedGroupTipsMap.set(e4, []), this._cachedGroupTipsMap.get(e4).push(t3);
    } }, { key: "_deleteCachedGroupTips", value: function(e4) {
      this._cachedGroupTipsMap.has(e4) && this._cachedGroupTipsMap.delete(e4);
    } }, { key: "_notifyCachedGroupTips", value: function(e4, t3) {
      var n3 = this, o3 = this._cachedGroupTipsMap.get(e4) || [];
      M2.l("".concat(this._n, "._notifyCachedGroupTips groupID:").concat(e4, " groupType:").concat(t3, " count:").concat(o3.length)), o3.forEach(function(e5) {
        n3.onNewGroupTips(e5);
      }), this._deleteCachedGroupTips(e4);
    } }, { key: "_cacheAndCompare", value: function(e4) {
      var t3 = e4.groupID, n3 = e4.event, o3 = e4.item, e4 = e4.groupType, n3 = (M2.l("".concat(this._n, "._cacheAndCompare groupID:").concat(t3, " groupType:").concat(e4)), this._cacheGroupTips(t3, { event: n3, dataList: [o3] }), { groupID: t3, type: e4 });
      e4 === R2.GRP_AVCHATROOM ? this._grpM.hasLocalGroup(t3) ? this._notifyCachedGroupTips(t3, e4) : this._grpM.setUnjoinedAVChatRoom(t3) : (this._grpM.updateGroupMap([n3]), this._notifyCachedGroupTips(t3, e4)), this._checkCountMap.has(t3) || this._checkCountMap.set(t3, 0);
    } }, { key: "reset", value: function() {
      this._cachedGroupTipsMap.clear(), this._checkCountMap.clear();
    } }]), $o = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "CommonGroupHandler", this.tempConversationList = null, this._cachedGroupMessageMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4, this.PAGING_GRP_COUNT_LIMIT = 200, this._pagingStatus = bn2, this._pagingGetCostList = [], t3.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, this.syncGroupList, this);
    }, [{ key: "onCheckTimer", value: function(e4) {
      e4 % 1 == 0 && 0 < this._cachedGroupMessageMap.size && this._check();
    } }, { key: "_check", value: function() {
      var i4 = this;
      this._cachedGroupMessageMap.forEach(function(e4, t3) {
        var n3 = i4._checkCountMap.get(t3), o3 = i4._grpM.hasLocalGroup(t3);
        M2.l("".concat(i4._n, "._check groupID:").concat(t3, " hasLocalGroup:").concat(o3, " checkCount:").concat(n3)), o3 ? (i4._notifyCachedGroupMessage(t3), i4._checkCountMap.delete(t3), i4._grpM.deleteUnjoinedAVChatRoom(t3)) : n3 >= i4.MAX_CHECK_COUNT ? (i4._deleteCachedGroupMessage(t3), i4._checkCountMap.delete(t3)) : i4._checkCountMap.set(t3, ++n3);
      });
    } }, { key: "updateLastMsg", value: function(e4) {
      var t3 = "".concat(this._n, ".updateLastMsg");
      if (0 !== this._grpM.getGroupMap().size) {
        for (var n3, o3, i4, a4, s4 = false, r3 = e4.length, c4 = 0; c4 < r3; c4++)
          (n3 = e4[c4]).type === R2.CONV_GROUP && 0 !== n3.lastMessage.lastSequence && null !== n3.lastMessage.payload && (o3 = n3.conversationID.split(/^GROUP/)[1], o3 = this._grpM.getLocalGroupProfile(o3)) && (i4 = o3.lastMessage, a4 = n3.lastMessage, JSON.stringify(i4) !== JSON.stringify(a4)) && (o3.lastMessage = y2({}, n3.lastMessage), s4 = true);
        M2.l("".concat(t3, " convCount:").concat(r3, " groupCount:").concat(this._grpM.getLocalGroupList().length, " isUpdated:").concat(s4)), s4 && (this._grpM.sortLocalGroupList(), this._grpM.emitGroupListUpdate(true, false));
      } else
        this.tempConversationList = e4;
    } }, { key: "onNewMessage", value: function(e4) {
      var t3 = this._assembly(e4), n3 = t3.conversationOptionsList, o3 = t3.messageList, t3 = t3.AVChatRoomMessageList, t3 = (0 < t3.length && this._grpM.onAVChatRoomMessage(t3), At2(o3)), t3 = (0 < t3.length && this._grpM.emitOEvt(h3.MESSAGE_MODIFIED, t3), 0 < n3.length && (this._grpM.get(11).onNewMessage({ conversationOptionsList: n3, isInstantMessage: false !== e4.isInstantMessage, updateUnreadCount: false !== e4.updateUnreadCount }), this._grpM.updateNextMessageSeq(n3)), Nt2(o3));
      0 < t3.length && this._grpM.emitOEvt(h3.MESSAGE_RECEIVED, t3), o3.length = 0;
    } }, { key: "_assembly", value: function(e4) {
      var t3 = e4.dataList, n3 = e4.event, o3 = e4.isInstantMessage, i4 = null, a4 = [], s4 = [], r3 = [], c4 = {}, u3 = this._grpM.getFileDownloadProxy(), l3 = this._grpM.getDownloadFileAuthKey(), d4 = this._grpM.get(17).getFileDNList(), p4 = t3.length;
      1 < p4 && t3.sort(function(e5, t4) {
        return e5.sequence - t4.sequence;
      });
      for (var _3 = this._grpM.get(11), h4 = this._grpM.get(4), g3 = 0; g3 < p4; g3++) {
        var f4, m4 = yt3(t3[g3]), v4 = m4.groupProfile, I3 = v4.groupID, M3 = v4.communityType, M3 = void 0 === M3 ? 0 : M3, y3 = v4.topicID, y3 = void 0 === y3 ? void 0 : y3, C3 = v4.invisible, v4 = v4.groupType, v4 = void 0 === v4 ? void 0 : v4, T3 = void 0, D3 = this._grpM.isMessageFromTopic(M3, y3), E3 = (D3 && (T3 = R2.CONV_TOPIC, m4.to = y3), this._grpM.hasLocalGroup(I3));
        !E3 && this._grpM.isUnjoinedAVChatRoom(I3) || (E3 || D3 ? this._grpM.isMessageFromOrToAVChatroom(I3) ? (m4.event = n3, r3.push(m4)) : (m4.currentUser = this._grpM.getMyUserID(), m4.conversationType = R2.CONV_GROUP, m4.isSystemMessage = !!m4.isSystemMessage, (i4 = new So2(m4)).setElement(m4.elements, u3, l3, d4), 1 !== C3 ? (E3 = 1 === t3[g3].isModified, _3.isMessageSentByCurrentInstance(i4) ? i4.isModified = E3 : E3 = false, 1 === m4.onlineOnlyFlag ? (i4._onlineOnlyFlag = true, _3.isMessageSentByCurrentInstance(i4) || s4.push(i4)) : this._grpM.isMessageFromCommunityOfTopic(M3, y3) ? s4.push(i4) : (i4.from === this._grpM.getMyUserID() && (D3 = _3.getLatestMessageSentByMe(i4.conversationID)) && (C3 = D3.nick, M3 = D3.avatar, C3 === i4.nick && M3 === i4.avatar || (_3.modifyMessageSentByMe({ conversationID: f4, latestNick: i4.nick, latestAvatar: i4.avatar }), h4.mockOnNickAvatarModified(i4.nick, i4.avatar))), _3.pushIntoMessageList(s4, i4, E3) && (this._qualityStat(o3, i4), f4 = (y3 = i4).conversationID, D3 = y3.sequence, C3 = _3.isRemoteRead({ conversationID: f4, sequence: D3 }), N2(c4[f4]) ? (M3 = 0, "in" !== i4.flow || i4._isExcludedFromUnreadCount || C3 || (M3 = 1), c4[f4] = a4.push({ conversationID: f4, unreadCount: M3, type: N2(T3) ? i4.conversationType : T3, subType: i4.conversationSubType, lastMessage: i4._isExcludedFromLastMessage ? "" : i4 }) - 1) : (a4[E3 = c4[f4]].type = N2(T3) ? i4.conversationType : T3, a4[E3].subType = i4.conversationSubType, a4[E3].lastMessage = i4._isExcludedFromLastMessage ? "" : i4, "in" !== i4.flow || i4._isExcludedFromUnreadCount || C3 || a4[E3].unreadCount++)))) : this._qualityStat(o3, i4)) : this._cacheAndCompare({ groupID: I3, event: n3, item: m4, groupType: v4 }));
      }
      return { conversationOptionsList: a4, messageList: s4, AVChatRoomMessageList: r3 };
    } }, { key: "_qualityStat", value: function(e4, t3) {
      var n3 = this._grpM.get(26);
      n3.addMessageSequence({ key: Qn2, message: t3 }), e4 && 0 < t3.clientTime && n3.addMessageDelay(t3.clientTime);
    } }, { key: "onMsgRevoked", value: function(e4, t3) {
      var n3 = this, u3 = this._grpM.get(11), l3 = [], d4 = [];
      e4.dataList.forEach(function(e5) {
        var t4 = e5.elements.revokedInfos, s4 = e5.revokerInfo, r3 = e5.groupProfile, c4 = false;
        r3 && (c4 = Pt2({ groupID: r3.groupID }) || !S2(r3.topicID)), N2(t4) || t4.forEach(function(e6) {
          var t5, n4 = S2(e6.topicID) ? "GROUP".concat(e6.groupID) : "GROUP".concat(e6.topicID), o3 = u3.getLocalConversation(n4), i4 = e6.revokerInfo && e6.revokerInfo.revoker || s4 && s4.revoker, a4 = s4 && s4.reason || "";
          o3 && Gt2(o3.type) ? t5 = { conversationID: n4, sequence: e6.sequence, ID: "".concat(e6.tinyID, "-").concat(e6.clientTime, "-").concat(e6.random) } : (o3 = u3.revoke(n4, e6.sequence, e6.random)) ? t5 = o3 : (t5 = { conversationID: n4, sequence: e6.sequence }, e6.tinyID && e6.clientTime && e6.random && (t5.ID = "".concat(e6.tinyID, "-").concat(e6.clientTime, "-").concat(e6.random)), e6.time && (t5.time = e6.time)), t5 && (t5.revoker = i4, t5.revokeReason = a4, t5.revokerInfo = { userID: i4, nick: "", avatar: "" }, (c4 ? (t5.revokerInfo.nick = r3.nick, t5.revokerInfo.avatar = r3.avatar, l3) : d4).push(t5));
        });
      }), 0 === d4.length && 0 === l3.length || (u3.onMessageRevoked([].concat(l3, d4), t3), 0 < l3.length && this._grpM.emitOEvt(h3.MESSAGE_REVOKED, l3), 0 < d4.length && u3.updateRevokerInfo(d4).then(function(e5) {
        n3._grpM.emitOEvt(h3.MESSAGE_REVOKED, e5);
      }));
    } }, { key: "_groupListTreeShaking", value: function(e4) {
      for (var n3 = new Map(d3(this._grpM.getGroupMap())), t3 = 0, o3 = e4.length; t3 < o3; t3++)
        n3.delete(e4[t3].groupID);
      this._grpM.hasJoinedAVChatRoom() && this._grpM.getJoinedAVChatRoom().forEach(function(e5) {
        n3.delete(e5);
      }), this._grpM.getGroupMap().forEach(function(e5, t4) {
        e5.isSupportTopic && n3.delete(t4);
      });
      for (var i4 = d3(n3.keys()), a4 = 0, s4 = i4.length; a4 < s4; a4++)
        this._grpM.deleteGroup(i4[a4]);
    } }, { key: "syncGroupList", value: function() {
      var o3, i4, a4 = this, e4 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t3 = (this._pagingStatus === bn2 && this._grpM.clearGroupMap(), d3(re3)), n3 = this.PAGING_GRP_COUNT_LIMIT, s4 = [];
      return true === e4 ? this._pagingGetGroupListWithTopic({ limit: n3, offset: 0, groupBaseInfoFilter: t3, groupList: s4 }) : (e4 = "syncGroupList", o3 = "".concat(this._n, ".").concat(e4), i4 = new P2(e4), this._pagingGetGroupList({ limit: n3, offset: 0, groupBaseInfoFilter: t3, groupList: s4 }).then(function() {
        var e5 = on2(a4._pagingGetCostList), t4 = nn2(a4._pagingGetCostList), n4 = (a4._pagingGetCostList.length = 0, a4._pagingStatus = Fn2, a4._groupListTreeShaking(s4), a4._grpM.updateGroupMap(s4), a4._grpM.getLocalGroupList().length), n4 = "count:".concat(n4, " sum:").concat(t4, " avg:").concat(e5);
        return M2.l("".concat(o3, " ok. ").concat(n4)), i4.setMessage(n4).end(), a4.tempConversationList && (a4.updateLastMsg(a4.tempConversationList), a4.tempConversationList = null), a4._grpM.emitGroupListUpdate(true, true), T2({ groupList: a4._grpM.getLocalGroupList() });
      }).catch(function(e5) {
        return a4._pagingStatus = qn2, i4.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "getGroupList", value: function() {
      var e4, t3 = this, n3 = "".concat(this._n, ".").concat("getGroupList");
      return M2.l("".concat(n3, " pagingStatus:").concat(this._pagingStatus)), this._pagingStatus === qn2 || this._pagingStatus === bn2 ? this.syncGroupList().then(function() {
        var e5 = t3._grpM.getLocalGroupList();
        return T2({ groupList: e5, isSyncCompleted: t3.isPagingGetCompleted() });
      }).catch(function(e5) {
        return M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      }) : (e4 = this._grpM.getLocalGroupList(), M2.l("".concat(n3, ". returned group count:").concat(e4.length)), D2({ groupList: e4, isSyncCompleted: this.isPagingGetCompleted() }));
    } }, { key: "isPagingGetCompleted", value: function() {
      return this._pagingStatus === Fn2;
    } }, { key: "_pagingGetGroupList", value: function(e4) {
      var o3 = this, i4 = "".concat(this._n, ".").concat("_pagingGetGroupList"), t3 = e4.isCommunityRelay, a4 = void 0 !== t3 && t3, s4 = e4.limit, r3 = e4.offset, c4 = e4.groupBaseInfoFilter, u3 = e4.groupList, t3 = void 0, l3 = (a4 && (t3 = R2.GRP_COMMUNITY, c4.push("AtInfoList")), Date.now());
      return this._grpM.req({ P: G2.GET_GRP_LIST, data: { type: t3, memberAccount: this._grpM.getMyUserID(), limit: s4, offset: r3, responseFilter: { groupBaseInfoFilter: c4, selfInfoFilter: ["Role", "JoinTime", "MsgFlag", "MsgSeq"] } } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.groups, t4 = void 0 === t4 ? [] : t4, e5 = e5.totalCount, t4 = (u3.push.apply(u3, d3(t4)), o3._handleGroupAtInfoWithoutTopic(a4, t4), r3 + s4), n3 = !(t4 < e5), e5 = "offset:".concat(r3, " limit:").concat(s4, " total:").concat(e5, " isCompleted:").concat(n3, " ") + "current:".concat(u3.length, " isCommunityRelay:").concat(a4);
        return o3._pagingGetCostList.push(an2(l3, false)), M2.l("".concat(i4, " ok. ").concat(e5, " cost:").concat(an2(l3))), a4 || n3 ? !a4 && n3 ? (M2.l("".concat(i4, " start to get community list")), r3 = 0, o3._pagingGetGroupList({ limit: s4, offset: r3, groupBaseInfoFilter: c4, groupList: u3, isCommunityRelay: true })) : a4 && !n3 ? (r3 = t4, o3._pagingGetGroupList({ limit: s4, offset: r3, groupBaseInfoFilter: c4, groupList: u3, isCommunityRelay: true })) : T2({ groupList: u3 }) : (r3 = t4, o3._pagingGetGroupList({ limit: s4, offset: r3, groupBaseInfoFilter: c4, groupList: u3 }));
      }).catch(function(e5) {
        return 10018 === e5.code ? (M2.w("".concat(o3.logPrefix, " response size exceeds the limit, request count:").concat(s4)), s4 = 50, o3._pagingGetGroupList({ limit: s4, offset: r3, groupBaseInfoFilter: c4, groupList: u3, isCommunityRelay: a4 })) : a4 ? (11e3 === e5.code && M2.l("".concat(i4, " ok. community unavailable")), D2({ groupList: u3 })) : E2(e5);
      });
    } }, { key: "_pagingGetGroupListWithTopic", value: function(e4) {
      var o3 = this, i4 = "".concat(this._n, "._pagingGetGroupListWithTopic"), a4 = e4.limit, s4 = e4.offset, r3 = e4.groupBaseInfoFilter, c4 = e4.groupList, u3 = Date.now();
      return this._grpM.req({ P: G2.GET_GRP_LIST, data: { type: R2.GRP_COMMUNITY, memberAccount: this._grpM.getMyUserID(), limit: a4, offset: s4, responseFilter: { groupBaseInfoFilter: r3, selfInfoFilter: d3(ce3) }, isSupportTopic: 1, needAppDefineData: 1 } }).then(function(e5) {
        var e5 = e5.data, t3 = e5.groups, e5 = e5.totalCount, t3 = (c4.push.apply(c4, d3(void 0 === t3 ? [] : t3)), s4 + a4), n3 = !(t3 < e5);
        if (M2.l("".concat(i4, " ok. offset:").concat(s4, " limit:").concat(a4, " totalCount:").concat(e5, " isCompleted:").concat(n3, " currentCount:").concat(c4.length, " cost:").concat(an2(u3))), !n3)
          return s4 = t3, o3._pagingGetGroupListWithTopic({ limit: a4, offset: s4, groupBaseInfoFilter: r3, groupList: c4 });
        o3._grpM.updateGroupMap(c4), o3._grpM.emitGroupListUpdate(true, false);
        e5 = o3._grpM.getLocalGroupList().filter(function(e6) {
          return true === e6.isSupportTopic;
        });
        return T2({ groupList: e5 });
      }).catch(function(e5) {
        return 10018 === e5.code ? (M2.w("".concat(o3.logPrefix, " response size exceeds the limit, request count:").concat(a4)), a4 = 50, o3._pagingGetGroupListWithTopic({ limit: a4, offset: s4, groupBaseInfoFilter: r3, groupList: c4 })) : E2(e5);
      });
    } }, { key: "_cacheGroupMessage", value: function(e4, t3) {
      this._cachedGroupMessageMap.has(e4) || this._cachedGroupMessageMap.set(e4, []), this._cachedGroupMessageMap.get(e4).push(t3);
    } }, { key: "_deleteCachedGroupMessage", value: function(e4) {
      this._cachedGroupMessageMap.has(e4) && this._cachedGroupMessageMap.delete(e4);
    } }, { key: "_notifyCachedGroupMessage", value: function(e4, t3) {
      var n3 = this, o3 = this._cachedGroupMessageMap.get(e4) || [];
      M2.l("".concat(this._n, "._notifyCachedGroupMessage groupID:").concat(e4, " groupType:").concat(t3, " count:").concat(o3.length)), o3.forEach(function(e5) {
        n3.onNewMessage(e5);
      }), this._deleteCachedGroupMessage(e4);
    } }, { key: "_cacheAndCompare", value: function(e4) {
      var t3 = e4.groupID, n3 = e4.event, o3 = e4.item, e4 = e4.groupType, n3 = (M2.l("".concat(this._n, "._cacheAndCompare groupID:").concat(t3, " groupType:").concat(e4)), this._cacheGroupMessage(t3, { event: n3, dataList: [o3] }), { groupID: t3, type: e4 });
      e4 === R2.GRP_AVCHATROOM ? this._grpM.hasLocalGroup(t3) ? this._notifyCachedGroupMessage(t3, e4) : this._grpM.setUnjoinedAVChatRoom(t3) : (this._grpM.updateGroupMap([n3]), this._notifyCachedGroupMessage(t3, e4)), this._checkCountMap.has(t3) || this._checkCountMap.set(t3, 0);
    } }, { key: "_handleGroupAtInfoWithoutTopic", value: function(e4, t3) {
      var o3 = this;
      e4 && 0 !== t3.length && t3.forEach(function(e5) {
        var t4 = e5.groupID, e5 = e5.groupAtInfoList, n3 = [];
        N2(e5) || (e5.forEach(function(e6) {
          n3.push(y2(y2({}, e6), {}, { groupID: t4 }));
        }), o3._grpM.get(11).onNewGroupAtTips({ dataList: n3 }));
      });
    } }, { key: "setPagingGroupCount", value: function(e4) {
      N2(e4) || (this.PAGING_GRP_COUNT_LIMIT = parseInt(e4, 10));
    } }, { key: "reset", value: function() {
      this.PAGING_GRP_COUNT_LIMIT = 200, this._cachedGroupMessageMap.clear(), this._checkCountMap.clear(), this._pagingStatus = bn2, this._pagingGetCostList = [];
    } }]), ei2 = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "GroupAttributesHandler", this._groupAttributesMap = /* @__PURE__ */ new Map(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e4 = this._grpM.getCloudConfig("grp_attr_cache_time");
      N2(e4) || (this.CACHE_EXPIRE_TIME = Number(e4));
    } }, { key: "updateLocalMainSequenceOnReconnected", value: function() {
      this._groupAttributesMap.forEach(function(e4) {
        e4.localMainSequence = 0;
      });
    } }, { key: "isGroupAttributesUpdatedNotice", value: function(e4) {
      var t3 = e4.to, e4 = e4.elements.newGroupProfile, n3 = !N2(e4) && !S2(e4.groupAttributeOption);
      return n3 && this._onGroupAttributesUpdated({ groupID: t3, groupAttributeOption: e4.groupAttributeOption }), n3;
    } }, { key: "_onGroupAttributesUpdated", value: function(e4) {
      var t3, n3 = this, o3 = e4.groupID, e4 = e4.groupAttributeOption, i4 = e4.mainSequence, a4 = e4.isWithChangedAttributeInfo, s4 = e4.groupAttributeList, s4 = void 0 === s4 ? [] : s4, e4 = e4.operationType;
      M2.l("".concat(this._n, ".onGroupAttributesUpdated. ") + "groupID:".concat(o3, " isWithChangedAttributeInfo:").concat(a4, " operationType:").concat(e4)), N2(e4) || (this._groupAttributesCopy = this._getCachedAttributes({ groupID: o3 }), 0 != (t3 = i4 - this._getLocalGroupAttributes(o3).localMainSequence) && (1 === a4 && 1 == t3 ? (this._refreshCachedGroupAttributes({ groupID: o3, remoteMainSequence: i4, groupAttributeList: s4, operationType: e4 }), this._emitGroupAttributesUpdated(o3)) : this._hasLocalGroupAttributes(o3) && (a4 = this._getLocalGroupAttributes(o3).avChatRoomKey, this._getGroupAttributes({ groupID: o3, avChatRoomKey: a4 }).then(function() {
        n3._emitGroupAttributesUpdated(o3);
      }))));
    } }, { key: "initGroupAttributesCache", value: function(e4) {
      var t3 = e4.groupID, e4 = e4.avChatRoomKey, e4 = void 0 === e4 ? void 0 : e4;
      this._groupAttributesMap.set(t3, { lastUpdateTime: 0, localMainSequence: 0, remoteMainSequence: 0, attributes: /* @__PURE__ */ new Map(), avChatRoomKey: e4 }), M2.l("".concat(this._n, ".initGroupAttributesCache groupID:").concat(t3, " avChatRoomKey:").concat(e4));
    } }, { key: "initGroupAttributes", value: function(e4) {
      var n3 = this, o3 = e4.groupID, i4 = e4.groupAttributes, e4 = this._getLocalGroupAttributes(o3), t3 = e4.remoteMainSequence, e4 = e4.avChatRoomKey, a4 = new P2("initGroupAttributes");
      return a4.setMessage("groupID:".concat(o3, " avChatRoomKey:").concat(e4, " mainSequence:").concat(t3)), this._grpM.req({ P: G2.SET_GRP_ATTR, data: { groupID: o3, avChatRoomKey: e4, mainSequence: t3, groupAttributeList: this._transformGroupAttributes(i4) } }).then(function(e5) {
        M2.l("".concat(n3._n, ".").concat("initGroupAttributes", " ok. groupID:").concat(o3));
        var e5 = e5.data, t4 = e5.mainSequence, e5 = d3(e5.groupAttributeList);
        return e5.forEach(function(e6) {
          e6.value = i4[e6.key];
        }), n3._groupAttributesCopy = n3._getCachedAttributes({ groupID: o3 }), n3._refreshCachedGroupAttributes({ groupID: o3, remoteMainSequence: t4, groupAttributeList: e5, operationType: 1 }), n3._emitGroupAttributesUpdated(o3), a4.end(), T2({ groupAttributes: i4 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), E2(e5);
      });
    } }, { key: "setGroupAttributes", value: function(e4) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("setGroupAttributes"), i4 = e4.groupID, a4 = e4.groupAttributes, e4 = this._getLocalGroupAttributes(i4), t3 = e4.remoteMainSequence, s4 = e4.avChatRoomKey, r3 = e4.attributes, e4 = this._transformGroupAttributes(a4), c4 = (e4.forEach(function(e5) {
        var t4 = e5.key;
        e5.sequence = 0, r3.has(t4) && (e5.sequence = r3.get(t4).sequence);
      }), new P2("setGroupAttributes"));
      return c4.setMessage("groupID:".concat(i4, " groupAttributes:").concat(JSON.stringify(a4))), M2.l("".concat(o3, ". groupID:").concat(i4, " mainSequence:").concat(t3)), this._grpM.req({ P: G2.MODIFY_GRP_ATTR, data: { groupID: i4, avChatRoomKey: s4, mainSequence: t3, groupAttributeList: e4 } }).then(function(e5) {
        M2.l("".concat(o3, " ok."));
        var e5 = e5.data, t4 = e5.mainSequence, e5 = d3(e5.groupAttributeList);
        return e5.forEach(function(e6) {
          e6.value = a4[e6.key];
        }), n3._groupAttributesCopy = n3._getCachedAttributes({ groupID: i4 }), n3._refreshCachedGroupAttributes({ groupID: i4, remoteMainSequence: t4, groupAttributeList: e5, operationType: 2 }), n3._emitGroupAttributesUpdated(i4), c4.end(), T2({ groupAttributes: a4 });
      }).catch(function(e5) {
        return c4.setError(e5).end(), E2(e5);
      });
    } }, { key: "deleteGroupAttributes", value: function(e4) {
      var t3 = this, n3 = e4.groupID, e4 = e4.keyList, e4 = void 0 === e4 ? [] : e4, o3 = this._getLocalGroupAttributes(n3), i4 = o3.remoteMainSequence, a4 = o3.avChatRoomKey, s4 = o3.attributes, r3 = d3(s4.keys()), o3 = G2.CLEAR_GRP_ATTR, c4 = 3, a4 = { groupID: n3, avChatRoomKey: a4, mainSequence: i4 }, u3 = [], l3 = (0 < e4.length && (r3 = [], o3 = G2.DEL_GRP_ATTR, c4 = 4, e4.forEach(function(e5) {
        var t4 = 0;
        s4.has(e5) && (t4 = s4.get(e5).sequence, r3.push(e5)), u3.push({ key: e5, sequence: t4 });
      }), a4.groupAttributeList = u3), new P2("deleteGroupAttributes"));
      return l3.setMessage("groupID:".concat(n3, " mainSequence:").concat(i4, " keyList:").concat(e4, " proto:").concat(o3)), this._grpM.req({ P: o3, data: a4 }).then(function(e5) {
        M2.l("".concat(t3._n, ".").concat("deleteGroupAttributes", " ok. groupID:").concat(n3));
        e5 = e5.data.mainSequence;
        return t3._groupAttributesCopy = t3._getCachedAttributes({ groupID: n3 }), t3._refreshCachedGroupAttributes({ groupID: n3, remoteMainSequence: e5, groupAttributeList: u3, operationType: c4 }), t3._emitGroupAttributesUpdated(n3), l3.end(), T2({ keyList: r3 });
      }).catch(function(e5) {
        return l3.setError(e5).end(), E2(e5);
      });
    } }, { key: "getGroupAttributes", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("getGroupAttributes"), i4 = t3.groupID, e4 = this._getLocalGroupAttributes(i4), a4 = e4.avChatRoomKey, s4 = e4.lastUpdateTime, r3 = e4.localMainSequence, e4 = e4.remoteMainSequence, c4 = new P2("getGroupAttributes");
      if (c4.setMessage("groupID:".concat(i4, " localMainSequence:").concat(r3, " remoteMainSequence:").concat(e4, " keyList:").concat(t3.keyList)), Date.now() - s4 >= this.CACHE_EXPIRE_TIME || r3 < e4)
        return this._getGroupAttributes({ groupID: i4, avChatRoomKey: a4 }).then(function(e5) {
          c4.setMoreMessage("get attributes from remote. count:".concat(e5.length)).end(), M2.l("".concat(o3, " from remote. groupID:").concat(i4));
          e5 = n3._getCachedAttributes(t3);
          return T2({ groupAttributes: e5 });
        }).catch(function(e5) {
          return c4.setError(e5).end(), E2(e5);
        });
      c4.setMoreMessage("get attributes from cache").end(), M2.l("".concat(o3, " from cache. groupID:").concat(i4));
      s4 = this._getCachedAttributes(t3);
      return D2({ groupAttributes: s4 });
    } }, { key: "_getGroupAttributes", value: function(o3) {
      var i4 = this, e4 = 0;
      return N2(o3.avChatRoomKey) || (e4 = 1), this._grpM.req({ P: G2.GET_GRP_ATTR, data: y2(y2({}, o3), {}, { groupType: e4 }) }).then(function(e5) {
        M2.l("".concat(i4._n, "._getGroupAttributes ok. groupID:").concat(o3.groupID));
        var e5 = e5.data, t3 = e5.mainSequence, e5 = e5.groupAttributeList, n3 = d3(e5);
        return N2(t3) || i4._refreshCachedGroupAttributes({ groupID: o3.groupID, remoteMainSequence: t3, groupAttributeList: n3, operationType: 5 }), e5;
      }).catch(function(e5) {
        return E2(e5);
      });
    } }, { key: "_refreshCachedGroupAttributes", value: function(e4) {
      var t3 = e4.groupID, n3 = e4.remoteMainSequence, o3 = e4.groupAttributeList, e4 = e4.operationType;
      if (this._hasLocalGroupAttributes(t3)) {
        var i4 = this._getLocalGroupAttributes(t3), a4 = i4.localMainSequence;
        if (5 === e4 || n3 - a4 == 1)
          i4.remoteMainSequence = n3, i4.localMainSequence = n3, i4.lastUpdateTime = Date.now(), this._updateCachedAttributes({ groupAttributes: i4, groupAttributeList: o3, operationType: e4 });
        else {
          if (a4 === n3)
            return;
          i4.remoteMainSequence = n3;
        }
        this._groupAttributesMap.set(t3, i4);
        o3 = "operationType:".concat(e4, " localMainSequence:").concat(a4, " remoteMainSequence:").concat(n3);
        M2.l("".concat(this._n, "._refreshCachedGroupAttributes. ").concat(o3));
      }
    } }, { key: "_getCachedAttributes", value: function(e4) {
      var t3 = e4.groupID, e4 = e4.keyList, e4 = void 0 === e4 ? [] : e4, n3 = {};
      if (this._hasLocalGroupAttributes(t3)) {
        var o3 = this._getLocalGroupAttributes(t3).attributes;
        if (0 < e4.length)
          e4.forEach(function(e5) {
            o3.has(e5) && (n3[e5] = o3.get(e5).value);
          });
        else {
          var i4, a4 = F2(o3.keys());
          try {
            for (a4.s(); !(i4 = a4.n()).done; ) {
              var s4 = i4.value;
              n3[s4] = o3.get(s4).value;
            }
          } catch (e5) {
            a4.e(e5);
          } finally {
            a4.f();
          }
        }
      }
      return n3;
    } }, { key: "_updateCachedAttributes", value: function(e4) {
      var o3 = e4.groupAttributes, t3 = e4.groupAttributeList, e4 = e4.operationType;
      3 !== e4 ? 4 !== e4 ? (1 === e4 && o3.attributes.clear(), t3.forEach(function(e5) {
        var t4 = e5.key, n3 = e5.value, e5 = e5.sequence;
        o3.attributes.set(t4, { value: n3, sequence: e5 });
      })) : t3.forEach(function(e5) {
        o3.attributes.delete(e5.key);
      }) : o3.attributes.clear();
    } }, { key: "_hasLocalGroupAttributes", value: function(e4) {
      return this._groupAttributesMap.has(e4);
    } }, { key: "_getLocalGroupAttributes", value: function(e4) {
      return this._hasLocalGroupAttributes(e4) || this.initGroupAttributesCache({ groupID: e4 }), this._groupAttributesMap.get(e4);
    } }, { key: "_transformGroupAttributes", value: function(t3) {
      var n3 = [];
      return Object.keys(t3).forEach(function(e4) {
        n3.push({ key: e4, value: t3[e4] });
      }), n3;
    } }, { key: "_emitGroupAttributesUpdated", value: function(e4) {
      var t3 = this._getCachedAttributes({ groupID: e4 }), n3 = this._computeAttrChangedInfo(t3), o3 = n3.updatedKeyList, n3 = n3.deletedKeyList;
      M2.l("".concat(this._n, "._emitGroupAttributesUpdated update:").concat(o3.length, ", delete:").concat(n3.length)), 0 === o3.length && 0 === n3.length || this._grpM.emitOEvt(h3.GROUP_ATTRIBUTES_UPDATED, { groupID: e4, groupAttributes: t3, updatedKeyList: o3, deletedKeyList: n3 });
    } }, { key: "_computeAttrChangedInfo", value: function(t3) {
      var n3 = this, o3 = [], i4 = [];
      return Object.keys(t3).forEach(function(e4) {
        t3[e4] !== n3._groupAttributesCopy[e4] && o3.push(e4);
      }), Object.keys(this._groupAttributesCopy).forEach(function(e4) {
        N2(t3[e4]) && i4.push(e4);
      }), this._groupAttributesCopy = {}, { updatedKeyList: o3, deletedKeyList: i4 };
    } }, { key: "deleteLocalGroupAttributes", value: function(e4) {
      this._hasLocalGroupAttributes(e4) && this._groupAttributesMap.delete(e4);
    } }, { key: "reset", value: function() {
      this._groupAttributesMap.clear(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4;
    } }]), ti2 = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "GroupCountersHandler", this._groupCountersMap = /* @__PURE__ */ new Map(), this.EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e4 = this._grpM.getCloudConfig("grp_counter_expire_time");
      N2(e4) || (this.EXPIRE_TIME = Number(e4));
    } }, { key: "isGroupCountersNotice", value: function(e4) {
      var t3 = e4.to, e4 = e4.elements.groupCounterInfo, n3 = false;
      return S2(e4) || (this._onGroupCountersUpdated({ groupID: t3, groupCounterInfo: e4 }), n3 = true), n3;
    } }, { key: "_onGroupCountersUpdated", value: function(e4) {
      var o3 = this, i4 = e4.groupID;
      e4.groupCounterInfo.forEach(function(e5) {
        var t3 = e5.type, n3 = e5.groupCounterSeq, e5 = e5.counterList, e5 = void 0 === e5 ? [] : e5;
        0 !== t3 && 2 !== t3 || (o3._updateLocalGroupCounters({ groupID: i4, groupCounterSeq: n3, counterList: e5 }), e5.forEach(function(e6) {
          o3._grpM.emitOEvt(h3.GROUP_COUNTER_UPDATED, { groupID: i4, key: e6.key, value: e6.value });
        })), 1 === t3 && o3._deleteLocalGroupCounters({ groupID: i4, groupCounterSeq: n3, counterList: e5 });
      }), M2.l("".concat(this._n, "._onGroupCountersUpdated groupID:").concat(i4));
    } }, { key: "initGroupCountersCache", value: function(e4) {
      var t3 = e4.groupID, e4 = e4.avChatRoomKey;
      this._groupCountersMap.set(t3, { lastUpdateTime: 0, groupCounterSeq: 0, counters: /* @__PURE__ */ new Map(), avChatRoomKey: e4 }), M2.l("".concat(this._n, ".initGroupCountersCache groupID:").concat(t3, " avChatRoomKey:").concat(e4));
    } }, { key: "setGroupCounters", value: function(e4) {
      var t3, n3, o3, i4, a4;
      return this._grpM.canIUse(g2.GRP_COUNTER) ? (t3 = "".concat(this._n, ".").concat("setGroupCounters"), n3 = e4.groupID, e4 = e4.counters, e4 = this._convertObjectToList(e4), o3 = this._getLocalGroupCounters(n3).avChatRoomKey, i4 = "groupID:".concat(n3, " count:").concat(e4.length), (a4 = new P2("setGroupCounters")).setMessage("".concat(i4)), M2.l("".concat(t3, ". ").concat(i4)), this._updateGroupCounters({ groupID: n3, counterList: e4, avChatRoomKey: o3, mode: "Set" }).then(function(e5) {
        return a4.end(), M2.l("".concat(t3, " ok.")), T2({ counters: e5 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._grpM.noUse("setGroupCounters");
    } }, { key: "increaseGroupCounter", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3 = "increaseGroupCounter";
      return this._grpM.canIUse(g2.GRP_COUNTER) ? (t3 = "".concat(this._n, ".").concat(r3), n3 = e4.groupID, o3 = e4.key, e4 = e4.value, i4 = this._getLocalGroupCounters(n3).avChatRoomKey, a4 = "groupID:".concat(n3, " key:").concat(o3, " value:").concat(e4), (s4 = new P2(r3)).setMessage("".concat(a4)), M2.l("".concat(t3, ". ").concat(a4)), this._updateGroupCounters({ groupID: n3, counterList: [{ key: o3, value: e4 }], avChatRoomKey: i4, mode: "Increase" }).then(function(e5) {
        return s4.end(), M2.l("".concat(t3, " ok.")), T2({ counters: e5 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._grpM.noUse(r3);
    } }, { key: "decreaseGroupCounter", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3 = "decreaseGroupCounter";
      return this._grpM.canIUse(g2.GRP_COUNTER) ? (t3 = "".concat(this._n, ".").concat(r3), n3 = e4.groupID, o3 = e4.key, e4 = e4.value, i4 = this._getLocalGroupCounters(n3).avChatRoomKey, a4 = "groupID:".concat(n3, " key:").concat(o3, " value:").concat(e4), (s4 = new P2(r3)).setMessage("".concat(a4)), M2.l("".concat(t3, ". ").concat(a4)), this._updateGroupCounters({ groupID: n3, counterList: [{ key: o3, value: e4 }], avChatRoomKey: i4, mode: "Decrease" }).then(function(e5) {
        return s4.end(), M2.l("".concat(t3, " ok.")), T2({ counters: e5 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._grpM.noUse(r3);
    } }, { key: "getGroupCounters", value: function(e4) {
      var t3 = this;
      if (!this._grpM.canIUse(g2.GRP_COUNTER))
        return this._grpM.noUse("getGroupCounters");
      var n3 = "".concat(this._n, ".").concat("getGroupCounters"), o3 = e4.groupID, e4 = e4.keyList, i4 = void 0 === e4 ? [] : e4, e4 = this._getLocalGroupCounters(o3), a4 = e4.avChatRoomKey, e4 = e4.lastUpdateTime, s4 = new P2("getGroupCounters");
      if (s4.setMessage("groupID:".concat(o3)), Date.now() - e4 >= this.EXPIRE_TIME)
        return this._getRemoteGroupCounters({ groupID: o3, avChatRoomKey: a4 }).then(function(e5) {
          s4.setMoreMessage("from remote. count:".concat(e5.length)).end(), M2.l("".concat(n3, " from remote. groupID:").concat(o3));
          e5 = t3._getLocalCounters(o3, i4);
          return T2({ counters: e5 });
        }).catch(function(e5) {
          return s4.setError(e5).end(), E2(e5);
        });
      s4.setMoreMessage("from cache").end(), M2.l("".concat(n3, " from cache. groupID:").concat(o3));
      e4 = this._getLocalCounters(o3, i4);
      return D2({ counters: e4 });
    } }, { key: "_getRemoteGroupCounters", value: function(n3) {
      var o3 = this;
      return this._grpM.req({ P: G2.GET_GRP_COUNTER, data: y2({}, n3) }).then(function(e4) {
        var e4 = e4.data, t3 = e4.counterList, t3 = void 0 === t3 ? [] : t3, e4 = e4.groupCounterSeq;
        return o3._updateLocalGroupCounters({ groupID: n3.groupID, counterList: t3, groupCounterSeq: e4 }), M2.l("".concat(o3._n, "._getRemoteGroupCounters ok. groupID:").concat(n3.groupID)), t3;
      }).catch(function(e4) {
        return E2(e4);
      });
    } }, { key: "_convertObjectToList", value: function(t3) {
      var n3 = [];
      return Object.keys(t3).forEach(function(e4) {
        n3.push({ key: e4, value: t3[e4] });
      }), n3;
    } }, { key: "_updateGroupCounters", value: function(e4) {
      var t3 = "".concat(this._n, "._updateGroupCounters"), n3 = e4.groupID, o3 = e4.avChatRoomKey, i4 = e4.mode;
      return M2.l("".concat(t3, ". groupID:").concat(n3, " avChatRoomKey:").concat(o3, " mode:").concat(i4)), this._grpM.req({ P: G2.UPDATE_GRP_COUNTER, data: y2({}, e4) }).then(function(e5) {
        M2.l("".concat(t3, " ok."));
        var e5 = e5.data.counterList, n4 = {};
        return (void 0 === e5 ? [] : e5).forEach(function(e6) {
          var t4 = e6.key, e6 = e6.value;
          n4[t4] = e6;
        }), n4;
      }).catch(function(e5) {
        return E2(e5);
      });
    } }, { key: "_hasLocalGroupCounters", value: function(e4) {
      return this._groupCountersMap.has(e4);
    } }, { key: "_getLocalGroupCounters", value: function(e4) {
      return this._hasLocalGroupCounters(e4) || this.initGroupCountersCache({ groupID: e4 }), this._groupCountersMap.get(e4);
    } }, { key: "_updateLocalGroupCounters", value: function(e4) {
      var n3, t3, o3, i4 = e4.groupID, a4 = e4.counterList, a4 = void 0 === a4 ? [] : a4, e4 = e4.groupCounterSeq;
      this._hasLocalGroupCounters(i4) && (o3 = this._getLocalGroupCounters(i4), n3 = o3.counters, t3 = o3.avChatRoomKey, o3 = o3.groupCounterSeq, 0 < e4 && e4 < o3 || (a4.forEach(function(e5) {
        var t4 = e5.key, e5 = e5.value;
        n3.set(t4, e5);
      }), this._groupCountersMap.set(i4, { lastUpdateTime: Date.now(), groupCounterSeq: e4, counters: n3, avChatRoomKey: t3 })));
    } }, { key: "_deleteLocalGroupCounters", value: function(e4) {
      var t3, n3, o3 = e4.groupID, i4 = e4.counterList, i4 = void 0 === i4 ? [] : i4, e4 = e4.groupCounterSeq;
      this._hasLocalGroupCounters(o3) && (n3 = this._getLocalGroupCounters(o3), t3 = n3.counters, n3 = n3.avChatRoomKey, i4.forEach(function(e5) {
        t3.delete(e5.key);
      }), this._groupCountersMap.set(o3, { lastUpdateTime: Date.now(), groupCounterSeq: e4, counters: t3, avChatRoomKey: n3 }));
    } }, { key: "_getLocalCounters", value: function(e4, t3) {
      var n3 = {};
      if (this._hasLocalGroupCounters(e4)) {
        var o3 = this._getLocalGroupCounters(e4).counters;
        if (0 < t3.length)
          t3.forEach(function(e5) {
            o3.has(e5) && (n3[e5] = o3.get(e5));
          });
        else {
          var i4, a4 = F2(o3.keys());
          try {
            for (a4.s(); !(i4 = a4.n()).done; ) {
              var s4 = i4.value;
              n3[s4] = o3.get(s4);
            }
          } catch (e5) {
            a4.e(e5);
          } finally {
            a4.f();
          }
        }
      }
      return n3;
    } }, { key: "reset", value: function() {
      this._groupCountersMap.clear(), this.EXPIRE_TIME = 3e4;
    } }]), ni2 = e3(function e4(t3) {
      p3(this, e4);
      var n3 = t3.manager, o3 = t3.groupID, i4 = t3.onInit, a4 = t3.onSuccess, t3 = t3.onFail;
      this._n = "Polling", this._manager = n3, this._grpM = n3._grpM, this._onInit = i4, this._onSuccess = a4, this._onFail = t3, this._groupID = o3, this._timeoutID = -1, this._isRunning = false, this._proto = G2.AV_POLLING;
    }, [{ key: "start", value: function() {
      var e4 = this._grpM.isLoggedIn();
      e4 || (this._proto = G2.AV_NOAUTH_POLLING), M2.l("".concat(this._n, ".start pollingInterval:").concat(this._manager.getPollingInterval(), " isLoggedIn:").concat(e4)), this._isRunning = true, this._request();
    } }, { key: "isRunning", value: function() {
      return this._isRunning;
    } }, { key: "_request", value: function() {
      var t3 = this, e4 = this._onInit(this._groupID);
      this._grpM.req({ P: this._proto, data: e4 }).then(function(e5) {
        t3._onSuccess(t3._groupID, e5), t3.isRunning() && (-1 < t3._timeoutID && clearTimeout(t3._timeoutID), t3._timeoutID = setTimeout(t3._request.bind(t3), t3._manager.getPollingInterval()));
      }).catch(function(e5) {
        t3._onFail(t3._groupID, e5), t3.isRunning() && (-1 < t3._timeoutID && clearTimeout(t3._timeoutID), t3._timeoutID = setTimeout(t3._request.bind(t3), t3._manager.MAX_POLLING_INTERVAL));
      });
    } }, { key: "stop", value: function() {
      M2.l("".concat(this._n, ".stop")), -1 < this._timeoutID && (clearTimeout(this._timeoutID), this._timeoutID = -1), this._isRunning = false;
    } }, { key: "getPollingTimerID", value: function() {
      return this._timeoutID;
    } }]), oi2 = { 3: true, 4: true, 5: true, 6: true, 17: true, 20: true, 21: true, 100: true }, ii2 = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "AVChatRoomHandler", this._joinedGroupMap = /* @__PURE__ */ new Map(), this._pollingRequestInfoMap = /* @__PURE__ */ new Map(), this._pollingInstanceMap = /* @__PURE__ */ new Map(), this._seqSll = new Ko(200), this._IDSll = new Ko(100), this._reportMessageStackedCount = 0, this._onlineMemberCountMap = /* @__PURE__ */ new Map(), this.DEFAULT_EXPIRE_TIME = 60, this.DEFAULT_POLLING_INTERVAL = 300, this.MAX_POLLING_INTERVAL = 2e3, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0, this._startBroadcastSeq = 1, this._broadcastMessageIDMap = /* @__PURE__ */ new Map(), this.DEFAULT_POLLING_SIMPLIFIED_MSG = 0;
    }, [{ key: "hasJoinedAVChatRoom", value: function() {
      var e4 = [];
      return 0 < (e4 = 0 < this._joinedGroupMap.size ? d3(this._joinedGroupMap.values()).filter(function(e5) {
        return e5.type === R2.GRP_AVCHATROOM;
      }) : e4).length;
    } }, { key: "getJoinedLiveList", value: function() {
      var e4 = [];
      return e4 = 0 < this._joinedGroupMap.size ? d3(this._joinedGroupMap.values()).filter(function(e5) {
        return e5.type === R2.GRP_LIVE;
      }) : e4;
    } }, { key: "checkJoinedAVChatRoomByID", value: function(e4) {
      return this._joinedGroupMap.has(e4);
    } }, { key: "getJoinedAVChatRoom", value: function() {
      return 0 < this._joinedGroupMap.size ? d3(this._joinedGroupMap.keys()) : [];
    } }, { key: "_updatedata", value: function(e4) {
      var t3 = this._pollingRequestInfoMap.get(e4);
      return e4 === d3(this._pollingInstanceMap.keys())[0] ? y2(y2({}, t3), {}, { startBroadcastSeq: this._startBroadcastSeq, simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG }) : y2(y2({}, t3), {}, { simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG });
    } }, { key: "_handleSuccess", value: function(e4, t3) {
      var n3, o3 = t3.data, i4 = o3.key, a4 = o3.nextSeq, s4 = o3.rspMsgList, r3 = o3.errorCode, c4 = o3.nextBroadcastSeq, o3 = o3.broadcastMessageList;
      0 !== r3 ? (r3 = this._pollingRequestInfoMap.get(e4), n3 = new P2("longPollingAVError"), r3 = r3 ? "".concat(r3.key, "-").concat(r3.startSeq) : "requestInfo is undefined", n3.setMessage("".concat(e4, "-").concat(r3, "-").concat(t3.errorInfo)).setCode(t3.errorCode).end(true)) : this.checkJoinedAVChatRoomByID(e4) && (C2(i4) && A2(a4) && this._pollingRequestInfoMap.set(e4, { key: i4, startSeq: a4 }), A2(c4) && c4 > this._startBroadcastSeq && (this._startBroadcastSeq = c4), O2(s4) && 0 < s4.length ? (s4.forEach(function(e5) {
        e5.to = e5.groupID;
      }), this.onMessage(s4, e4)) : (this._pollingNoMessageCount += 1, this._pollingNoMessageCount === this.DEFAULT_POLLING_NO_MESSAGE_COUNT && (this._pollingInterval = this.DEFAULT_POLLING_INTERVAL + this.DEFAULT_POLLING_INTERVAL_PLUS)), this._onBroadcastMessage(o3));
    } }, { key: "_handleFailure", value: function(e4, t3) {
    } }, { key: "onMessage", value: function(e4, t3) {
      if (O2(e4) && 0 !== e4.length) {
        var n3 = "".concat(this._n, ".onMessage"), o3 = (t3 && (n3 += " groupID:".concat(t3)), 0 !== this._pollingNoMessageCount && (this._pollingNoMessageCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL), null), i4 = [], a4 = this._get(11), s4 = this._get(26), r3 = e4.length, c4 = (1 < r3 && e4.sort(function(e5, t4) {
          return e5.sequence - t4.sequence;
        }), this._get(12).isUnlimitedAVChatRoom()), u3 = false;
        M2.getLevel() <= 0 && (t3 = e4.map(function(e5) {
          return e5.sequence;
        }), M2.l("".concat(n3, " count:").concat(t3.length, " sequenceList:").concat(t3)), t3.length = 0);
        for (var l3 = 0; l3 < r3; l3++) {
          var d4 = this.restoreMessageFromSimplified(e4[l3]);
          if (oi2[d4.event]) {
            if (6 === d4.event) {
              if (this._grpM.isGroupAttributesUpdatedNotice(d4))
                continue;
              if (this._grpM.isGroupCountersNotice(d4))
                continue;
            }
            if (20 !== d4.event)
              if (21 !== d4.event)
                if (100 !== d4.event) {
                  var o3 = this.packMessage(d4, d4.event), p4 = 1 === d4.isModified, u3 = 1 === d4.isHistoryMessage;
                  if (!c4) {
                    if (this._seqSll.has(o3.sequence))
                      continue;
                    this._seqSll.set(o3.sequence);
                  }
                  var _3 = this._IDSll.has(o3.ID);
                  _3 ? M2.w("".concat(n3, " ID:").concat(o3.ID, " has:").concat(_3)) : (this._IDSll.set(o3.ID), _3 = false, !u3 && this._isMessageSentByCurrentInstance(o3) ? p4 && (_3 = true, o3.isModified = p4, a4.updateMsgIsModifiedProp(o3)) : _3 = true, _3 && (o3.conversationType === R2.CONV_SYSTEM && 5 === o3.payload.operationType && this._onGroupDismissed(o3.payload.groupProfile.groupID), u3 || o3.conversationType === R2.CONV_SYSTEM || (p4 = o3.conversationID.replace(R2.CONV_GROUP, ""), this._pollingInstanceMap.has(p4) ? this._grpM.isLoggedIn() && s4.addMessageSequence({ key: eo2, message: o3 }) : (o3.type !== R2.MSG_GRP_TIP && 0 < o3.clientTime && s4.addMessageDelay(o3.clientTime), s4.addMessageSequence({ key: $n2, message: o3 }))), i4.push(o3)));
                } else
                  this.onRoomCustomData(d4);
              else
                this._get(34).onMessageReactionNotify({ event: 21, dataList: d4.elements.messageReactionNotifyList });
            else
              this.handleMessageRevokedNotice(d4);
          } else
            M2.w("".concat(n3, ". unknown event:").concat(d4.event));
        }
        0 !== i4.length && (0 < (t3 = At2(i4)).length && this._grpM.emitOEvt(h3.MESSAGE_MODIFIED, t3), u3 || 0 < (t3 = this.packConversationOption(i4)).length && a4.onNewMessage({ conversationOptionsList: t3, isInstantMessage: true }), this._checkMessageStacked(i4), 0 < (t3 = Nt2(i4)).length && this._grpM.emitOEvt(h3.MESSAGE_RECEIVED, t3), i4.length = 0);
      }
    } }, { key: "handleMessageRevokedNotice", value: function(e4) {
      var t3 = this, i4 = e4.groupID, n3 = e4.elements.revokeMsgList, a4 = e4.revokerInfo, s4 = [];
      n3.forEach(function(e5) {
        var t4 = e5.tinyID, n4 = e5.clientTime, o3 = e5.random, e5 = e5.sequence, t4 = { conversationID: "".concat(R2.CONV_GROUP).concat(i4), ID: "".concat(t4, "-").concat(n4, "-").concat(o3), revoker: a4.revoker, revokeReason: a4.reason || "", revokerInfo: { userID: a4.revoker, nick: "", avatar: "" }, sequence: e5 };
        s4.push(t4);
      }), 0 !== s4.length && this._get(11).updateRevokerInfo(s4).then(function(e5) {
        t3._grpM.emitOEvt(h3.MESSAGE_REVOKED, e5);
      });
    } }, { key: "isBroadcastOrNormal", value: function(e4) {
      return 3 === e4 || 17 === e4;
    } }, { key: "isGroupTip", value: function(e4) {
      return 4 === e4 || 6 === e4;
    } }, { key: "isGroupSystemNotice", value: function(e4) {
      return 5 === e4;
    } }, { key: "restoreGroupTipElements", value: function() {
      var e4 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t3 = e4.operatorInfo, t3 = void 0 === t3 ? {} : t3, n3 = e4.operatorID, o3 = e4.userIDList, o3 = void 0 === o3 ? [] : o3, i4 = e4.operationType, i4 = (A2(e4.groupJoinType) || 1 !== i4 && 2 !== i4 || (e4.groupJoinType = 2 === i4 ? 0 : 1), t3.userID), a4 = t3.avatar, t3 = t3.nick, n3 = (e4.operatorInfo = { userID: void 0 === i4 ? n3 : i4, avatar: void 0 === a4 ? "" : a4, nick: void 0 === t3 ? "" : t3 }, o3.map(function(e5) {
        return { userID: e5 };
      }));
      return e4.memberInfoList = e4.memberInfoList || n3, e4;
    } }, { key: "restoreMessageFromSimplified", value: function(n3) {
      var e4, t3, o3, i4 = n3.event;
      return this.isBroadcastOrNormal(i4) && (n3.cloudCustomData = n3.cloudCustomData || "", n3.elements = n3.elements.map(function(e5) {
        var t4;
        return e5.type === R2.MSG_CUSTOM && (t4 = e5.content, e5.content = y2({ data: "", description: "", extension: "" }, void 0 === t4 ? {} : t4)), e5;
      })), (this.isGroupTip(i4) || this.isGroupSystemNotice(i4)) && (n3.from = n3.from || "@TIM#SYSTEM"), this.isGroupTip(i4) && (n3.elements = this.restoreGroupTipElements(n3.elements), t3 = (o3 = void 0 === (o3 = n3.elements) ? {} : o3).operationType, e4 = o3.operatorInfo, 1 === t3) && (t3 = [{ userID: (void 0 === e4 ? {} : e4).userID }], o3.memberInfoList = o3.memberInfoList || t3), this.isGroupSystemNotice(i4) && (o3 = (e4 = n3.elements).memberInfoList, t3 = e4.operatorInfo, n3.elements.memberInfoList = y2({ userID: n3.elements.operatorID, avatar: "", nick: "" }, o3 = o3 || (void 0 === t3 ? {} : t3)), n3.elements = y2({ authentication: "", remarkInfo: "", messageKey: 1e3 * n3.time }, n3.elements), i4 = Object.keys(n3.elements).filter(function(e5) {
        return "operatorInfo" !== e5;
      }).reduce(function(e5, t4) {
        return y2(y2({}, e5), {}, q2({}, t4, n3.elements[t4]));
      }, {}), n3.elements = i4), n3;
    } }, { key: "_onGroupDismissed", value: function(e4) {
      M2.l("".concat(this._n, "._onGroupDismissed groupID:").concat(e4)), this._grpM.deleteLocalGroupAndConversation(e4), this.reset(e4);
    } }, { key: "_checkMessageStacked", value: function(e4) {
      var t3 = "MessageStacked", e4 = e4.length;
      100 <= e4 && (this._grpM.warn(t3, e4), this._reportMessageStackedCount < 5) && (new P2(t3).setMessage("count:".concat(e4, " groupID:").concat(d3(this._joinedGroupMap.keys()))).setLevel("warning").end(), this._reportMessageStackedCount += 1);
    } }, { key: "_isMessageSentByCurrentInstance", value: function(e4) {
      return !!this._get(11).isMessageSentByCurrentInstance(e4);
    } }, { key: "packMessage", value: function(e4, t3) {
      e4.currentUser = this._grpM.getMyUserID(), e4.conversationType = 5 === t3 ? R2.CONV_SYSTEM : R2.CONV_GROUP, e4.isSystemMessage = !!e4.isSystemMessage;
      var n3 = new So2(e4), e4 = this.packElements(e4, t3), t3 = this._grpM.getFileDownloadProxy(), o3 = this._grpM.getDownloadFileAuthKey(), i4 = this._get(17).getFileDNList();
      return n3.setElement(e4, t3, o3, i4), n3;
    } }, { key: "packElements", value: function(e4, t3) {
      return 4 === t3 || 6 === t3 ? (this._updateMemberCountByGroupTips(e4), { type: R2.MSG_GRP_TIP, content: y2(y2({}, e4.elements), {}, { groupProfile: e4.groupProfile }) }) : 5 === t3 ? { type: R2.MSG_GRP_SYS_NOTICE, content: y2(y2({}, e4.elements), {}, { groupProfile: y2(y2({}, e4.groupProfile), {}, { groupID: e4.groupID }) }) } : e4.elements;
    } }, { key: "packConversationOption", value: function(e4) {
      for (var t3 = /* @__PURE__ */ new Map(), n3 = 0; n3 < e4.length; n3++) {
        var o3, i4 = e4[n3], a4 = i4.conversationID;
        t3.has(a4) ? "in" === ((o3 = t3.get(a4)).lastMessage = i4).flow && o3.unreadCount++ : t3.set(a4, { conversationID: i4.conversationID, unreadCount: "out" === i4.flow ? 0 : 1, type: i4.conversationType, subType: i4.conversationSubType, lastMessage: i4 });
      }
      return d3(t3.values());
    } }, { key: "_updateMemberCountByGroupTips", value: function(e4) {
      var t3, n3, o3, i4 = e4.groupProfile.groupID, e4 = e4.elements.onlineMemberInfo, e4 = void 0 === e4 ? void 0 : e4;
      S2(e4) || (t3 = void 0 === (t3 = e4.onlineMemberNum) ? 0 : t3, e4 = void 0 === (e4 = e4.expireTime) ? this.DEFAULT_EXPIRE_TIME : e4, n3 = this._onlineMemberCountMap.get(i4) || {}, o3 = Date.now(), S2(n3) ? Object.assign(n3, { lastReqTime: 0, lastSyncTime: 0, latestUpdateTime: o3, memberCount: t3, expireTime: e4 }) : (n3.latestUpdateTime = o3, n3.memberCount = t3), this._onlineMemberCountMap.set(i4, n3));
    } }, { key: "_onBroadcastMessage", value: function(e4) {
      if (!S2(e4)) {
        for (var t3 = [], n3 = e4.length, o3 = null, i4 = 0; i4 < n3; i4++) {
          var a4 = this.restoreMessageFromSimplified(e4[i4]);
          oi2[a4.event] ? ((o3 = this.packMessage(a4, a4.event)).isBroadcastMessage = true, this._broadcastMessageIDMap.has(o3.ID) || (t3.push(o3), this._broadcastMessageIDMap.set(o3.ID, 1))) : M2.w("".concat(this._n, "._onBroadcastMessage unknown event:").concat(a4.event));
        }
        0 < t3.length && this._grpM.emitOEvt(h3.MESSAGE_RECEIVED, t3);
      }
    } }, { key: "start", value: function(e4) {
      var t3;
      this._pollingInstanceMap.has(e4) ? (t3 = this._pollingInstanceMap.get(e4)).isRunning() || t3.start() : ((t3 = new ni2({ manager: this, groupID: e4, onInit: this._updatedata.bind(this), onSuccess: this._handleSuccess.bind(this), onFail: this._handleFailure.bind(this) })).start(), this._pollingInstanceMap.set(e4, t3), M2.l("".concat(this._n, ".start groupID:").concat(e4)));
    } }, { key: "handleJoinResult", value: function(o3) {
      var i4 = this;
      return this._preCheck(o3.group).then(function() {
        var e4 = o3.longPollingKey, t3 = o3.group, n3 = t3.groupID;
        return i4._joinedGroupMap.set(n3, t3), i4._grpM.updateGroupMap([t3]), i4._grpM.deleteUnjoinedAVChatRoom(n3), i4._grpM.emitGroupListUpdate(true, false), N2(e4) ? D2({ status: nt3, group: t3 }) : Promise.resolve();
      });
    } }, { key: "startRunLoop", value: function(i4) {
      var a4 = this;
      return this.handleJoinResult(i4).then(function() {
        var e4 = i4.longPollingKey, t3 = i4.group, n3 = i4.startSeq, o3 = t3.groupID;
        return a4._pollingRequestInfoMap.set(o3, { key: e4, startSeq: void 0 === n3 ? 0 : n3 }), a4.start(o3), a4._grpM.isLoggedIn() ? D2({ status: nt3, group: t3 }) : D2({ status: nt3 });
      });
    } }, { key: "_preCheck", value: function(e4) {
      if (!this._get(12).isUnlimitedAVChatRoom() && this.hasJoinedAVChatRoom() && e4.type !== R2.GRP_LIVE) {
        var e4 = j2(this._joinedGroupMap.entries().next().value, 2), t3 = e4[0], e4 = e4[1];
        if (this._grpM.isLoggedIn() && e4.selfInfo.role !== R2.GRP_MBR_ROLE_OWNER && e4.ownerID !== this._grpM.getMyUserID())
          return this._grpM.quitGroup(t3);
        this._grpM.deleteLocalGroupAndConversation(t3), this.reset(t3);
      }
      return Promise.resolve();
    } }, { key: "joinWithoutAuth", value: function(e4) {
      var n3 = this, o3 = e4.groupID, i4 = "".concat(this._n, ".").concat("joinWithoutAuth"), a4 = new P2("joinWithoutAuth");
      return this._grpM.req({ P: G2.APPLY_JOIN_GRP_NOAUTH, data: e4 }).then(function(e5) {
        e5 = e5.data.longPollingKey;
        if (a4.setMessage("groupID:".concat(o3, " longPollingKey:").concat(e5)).end(true), N2(e5))
          return E2({ code: k2.CANNOT_JOIN_NON_AV_WITHOUT_LOGIN });
        M2.l("".concat(i4, " ok. groupID:").concat(o3)), n3._get(11).setCompleted("".concat(R2.CONV_GROUP).concat(o3));
        var t3 = new Yo({ groupID: o3 });
        return n3.startRunLoop({ group: t3, longPollingKey: e5 }), T2({ status: nt3 });
      }).catch(function(e5) {
        return M2.e("".concat(i4, " failed. groupID:").concat(o3, " error:"), e5), a4.setError(e5).setMessage("groupID:".concat(o3)).end(true), E2(e5);
      }).finally(function() {
        n3._grpM.get(14).reportAtOnce();
      });
    } }, { key: "getGroupOnlineMemberCount", value: function(e4) {
      var t3 = this._onlineMemberCountMap.get(e4) || {}, n3 = Date.now();
      return S2(t3) || n3 - t3.lastSyncTime > 1e3 * t3.expireTime && 1e4 < n3 - t3.latestUpdateTime && 3e3 < n3 - t3.lastReqTime ? (t3.lastReqTime = n3, this._onlineMemberCountMap.set(e4, t3), this._getGroupOnlineMemberCount(e4).then(function(e5) {
        return T2({ memberCount: e5.memberCount });
      }).catch(function(e5) {
        return E2(e5);
      })) : D2({ memberCount: t3.memberCount });
    } }, { key: "_getGroupOnlineMemberCount", value: function(i4) {
      var a4 = this, s4 = "".concat(this._n, ".").concat("_getGroupOnlineMemberCount"), t3 = new P2("_getGroupOnlineMemberCount");
      return this._grpM.requestOnlineCount(i4).then(function(e4) {
        var t4 = a4._onlineMemberCountMap.get(i4) || {}, e4 = e4.data, n3 = e4.memberCount, n3 = void 0 === n3 ? 0 : n3, e4 = e4.expireTime, e4 = void 0 === e4 ? a4.DEFAULT_EXPIRE_TIME : e4, o3 = (M2.l("".concat(s4, " ok. groupID:").concat(i4, " memberCount:").concat(n3, " expireTime:").concat(e4)), Date.now());
        return S2(t4) && (t4.lastReqTime = o3), a4._onlineMemberCountMap.set(i4, Object.assign(t4, { lastSyncTime: o3, latestUpdateTime: o3, memberCount: n3, expireTime: e4 })), { memberCount: n3 };
      }).catch(function(e4) {
        return M2.w("".concat(s4, " failed. error:"), e4), t3.setCode(e4.code).setMessage("groupID:".concat(i4, " error:").concat(JSON.stringify(e4))).end(), Promise.reject(e4);
      });
    } }, { key: "_get", value: function(e4) {
      return this._grpM.get(e4);
    } }, { key: "setPollingInterval", value: function(e4) {
      N2(e4) || (A2(e4) ? this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = e4 : this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = parseInt(e4, 10));
    } }, { key: "setPollingIntervalPlus", value: function(e4) {
      N2(e4) || (A2(e4) ? this.DEFAULT_POLLING_INTERVAL_PLUS = e4 : this.DEFAULT_POLLING_INTERVAL_PLUS = parseInt(e4, 10));
    } }, { key: "setPollingNoMessageCount", value: function(e4) {
      N2(e4) || (A2(e4) ? this.DEFAULT_POLLING_NO_MESSAGE_COUNT = e4 : this.DEFAULT_POLLING_NO_MESSAGE_COUNT = parseInt(e4, 10));
    } }, { key: "setPollingSimplifiedMessage", value: function(e4) {
      N2(e4) || "0" !== e4 && "1" !== e4 || (this.DEFAULT_POLLING_SIMPLIFIED_MSG = parseInt(e4, 10));
    } }, { key: "getPollingInterval", value: function() {
      return this._pollingInterval;
    } }, { key: "onAVChatRoomMemberBanned", value: function(e4) {
      e4 = e4.payload.groupProfile.groupID;
      M2.l("".concat(this._n, ".onAVChatRoomMemberBanned groupID:").concat(e4)), this._grpM.deleteLocalGroupAndConversation(e4), this.reset(e4);
    } }, { key: "restartPolling", value: function() {
      M2.l("".concat(this._n, ".restartPolling count:").concat(this._pollingInstanceMap.size));
      var e4, t3 = F2(this._pollingInstanceMap.values());
      try {
        for (t3.s(); !(e4 = t3.n()).done; ) {
          var n3 = e4.value;
          n3.stop(), n3.start();
        }
      } catch (e5) {
        t3.e(e5);
      } finally {
        t3.f();
      }
    } }, { key: "getPollingTimerID", value: function(e4) {
      var t3;
      return this._pollingInstanceMap.has(e4) ? (t3 = this._pollingInstanceMap.get(e4).getPollingTimerID(), M2.l("".concat(this._n, ".getPollingTimerID groupID:").concat(e4, " timerID:").concat(t3)), t3) : -1;
    } }, { key: "hasPollingInstance", value: function(e4) {
      return this._pollingInstanceMap.has(e4);
    } }, { key: "onRoomCustomData", value: function(e4) {
      var t3 = e4.groupID, n3 = e4.sequence, o3 = e4.time, e4 = e4.elements, e4 = e4 && e4.content;
      this._get(30).onRoomCustomDataReceived(e4), M2.l("".concat(this._n, ".onRoomCustomData groupID:").concat(t3, " sequence:").concat(n3, " time:").concat(o3, " data:").concat(e4));
    } }, { key: "reset", value: function(e4) {
      if (e4) {
        M2.l("".concat(this._n, ".reset groupID:").concat(e4));
        var t3 = this._pollingInstanceMap.get(e4);
        t3 && t3.stop(), this._pollingInstanceMap.delete(e4), this._joinedGroupMap.delete(e4), this._pollingRequestInfoMap.delete(e4), this._onlineMemberCountMap.delete(e4);
      } else {
        M2.l("".concat(this._n, ".reset all"));
        var n3, o3 = F2(this._pollingInstanceMap.values());
        try {
          for (o3.s(); !(n3 = o3.n()).done; )
            n3.value.stop();
        } catch (e5) {
          o3.e(e5);
        } finally {
          o3.f();
        }
        this._pollingInstanceMap.clear(), this._joinedGroupMap.clear(), this._pollingRequestInfoMap.clear(), this._onlineMemberCountMap.clear(), this._broadcastMessageIDMap.clear();
      }
      this._seqSll.reset(), this._IDSll.reset(), this._reportMessageStackedCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = 300, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0;
    } }]), ai2 = e3(function e4(t3) {
      p3(this, e4), this.userID = "", this.avatar = "", this.nick = "", this.role = "", this.joinTime = "", this.lastSendMsgTime = "", this.nameCard = "", this.muteUntil = 0, this.memberCustomField = [], this.isOnline = false, this.updateMember(t3);
    }, [{ key: "updateMember", value: function(e4) {
      N2(e4.onlineStatus) || (this.isOnline = "Online" === e4.onlineStatus);
      var t3 = [null, void 0, "", 0, NaN];
      e4.memberCustomField && Rt2(this.memberCustomField, e4.memberCustomField), ht3(this, e4, ["memberCustomField", "marks", "onlineStatus"], t3);
    } }, { key: "updateRole", value: function(e4) {
      ["Owner", "Admin", "Member"].indexOf(e4) < 0 || (this.role = e4);
    } }, { key: "updateMuteUntil", value: function(e4) {
      N2(e4) || (this.muteUntil = Math.floor((Date.now() + 1e3 * e4) / 1e3));
    } }, { key: "updateNameCard", value: function(e4) {
      N2(e4) || (this.nameCard = e4);
    } }, { key: "updateMemberCustomField", value: function(e4) {
      e4 && Rt2(this.memberCustomField, e4);
    } }]), si2 = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "GroupMemberHandler", this.groupMemberListMap = /* @__PURE__ */ new Map(), this.DEFAULT_MEMBER_INFO_FILTER = ["Role", "JoinTime", "NameCard", "ShutUpUntil", "OnlineStatus"], this._grpM.getIEmitInst().on(U2.PROFILE_UPDATED, this._onProfileUpdated, this);
    }, [{ key: "_onProfileUpdated", value: function(e4) {
      for (var n3 = this, o3 = e4.data, i4 = 0; i4 < o3.length; i4++)
        !function() {
          var t3 = o3[i4];
          n3.groupMemberListMap.forEach(function(e5) {
            e5.has(t3.userID) && e5.get(t3.userID).updateMember({ nick: t3.nick, avatar: t3.avatar });
          });
        }();
    } }, { key: "deleteGroupMemberList", value: function(e4) {
      this.groupMemberListMap.delete(e4);
    } }, { key: "getGroupMemberList", value: function(e4) {
      var t3, o3 = this, i4 = e4.groupID, n3 = e4.role, n3 = void 0 === n3 ? void 0 : n3, a4 = e4.offset, s4 = void 0 === a4 ? 0 : a4, a4 = e4.count, r3 = void 0 === a4 ? 15 : a4, a4 = e4.filter, e4 = void 0 === a4 ? void 0 : a4, c4 = "".concat(this._n, ".").concat("getGroupMemberList"), a4 = this._grpM.hasLocalGroup(i4);
      if (M2.l("".concat(c4, " groupID:").concat(i4, " role:").concat(n3, " offset:").concat(s4, " count:").concat(r3, " hasLocalGroup:").concat(a4)), !a4)
        return D2({ memberList: [], offset: 0 });
      if (this._grpM.getLocalGroupProfile(i4).type === R2.GRP_AVCHATROOM) {
        if (this._grpM.canIUse(g2.AV_MBR_LIST))
          return this._getAVChatRoomMemberList({ groupID: i4, offset: s4, filter: e4 });
        this._grpM.warn("LiveOnlineMember");
      }
      n3 !== R2.GRP_MBR_ROLE_ADMIN && n3 !== R2.GRP_MBR_ROLE_OWNER && n3 !== R2.GRP_MBR_ROLE_MEMBER || (t3 = n3);
      var u3 = new P2("getGroupMemberList"), l3 = 0, a4 = { groupID: i4, limit: 100 < r3 ? 100 : r3, memberRoleFilter: t3 ? [t3] : void 0, memberInfoFilter: this.DEFAULT_MEMBER_INFO_FILTER }, d4 = (Pt2({ groupID: i4 }) ? a4.next = "".concat(s4) : l3 = (a4.offset = s4) + r3, []);
      return this._grpM.req({ P: G2.GET_GRP_MBR_LIST, data: a4 }).then(function(e5) {
        var e5 = e5.data, t4 = e5.members, n4 = e5.memberNum, e5 = e5.next, e5 = void 0 === e5 ? void 0 : e5;
        return N2(e5) || (l3 = S2(e5) ? 0 : e5), O2(t4) && 0 !== t4.length ? (o3._grpM.hasLocalGroup(i4) && (o3._grpM.getLocalGroupProfile(i4).memberNum = n4), d4 = o3._updateLocalGroupMemberMap(i4, t4), o3._grpM.get(4).getUserProfile({ userIDList: t4.map(function(e6) {
          return e6.userID;
        }), tagList: [f3.NICK, f3.AVATAR] })) : (l3 = 0, Promise.resolve([]));
      }).then(function(e5) {
        var e5 = e5.data;
        return O2(e5) && 0 !== e5.length ? (e5 = e5.map(function(e6) {
          return { userID: e6.userID, nick: e6.nick, avatar: e6.avatar };
        }), o3._updateLocalGroupMemberMap(i4, e5), d4.length < r3 && (l3 = 0), u3.setMessage("groupID:".concat(i4, " offset:").concat(s4, " count:").concat(r3)).end(), M2.l("".concat(c4, " ok.")), T2({ memberList: d4, offset: l3 })) : D2({ memberList: [], offset: l3 });
      }).catch(function(e5) {
        return u3.setError(e5).end(), M2.e("".concat(c4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_getAVChatRoomMemberList", value: function(e4) {
      var n3 = this, o3 = e4.groupID, t3 = e4.offset, e4 = e4.filter, i4 = "".concat(this._n, ".").concat("_getAVChatRoomMemberList"), a4 = new P2("_getAVChatRoomMemberList");
      return a4.setMessage("groupID:".concat(o3, " offset:").concat(t3, " filter:").concat(e4)), this._grpM.req({ P: G2.GET_AV_MBR_LIST, data: { groupID: o3, offset: t3, filter: e4 } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.memberList, t4 = void 0 === t4 ? [] : t4, e5 = e5.offset, e5 = void 0 === e5 ? 0 : e5, t4 = (a4.end(), M2.l("".concat(i4, " ok. member count:").concat(t4.length, ", next request timestamp:").concat(e5)), t4.map(function(e6) {
          return y2(y2({}, e6), {}, { onlineStatus: "Online" });
        })), t4 = n3._updateLocalGroupMemberMap(o3, t4);
        return T2({ memberList: t4, offset: e5 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getGroupMemberProfile", value: function(e4) {
      var t3, n3 = this, o3 = "getGroupMemberProfile", i4 = "".concat(this._n, ".").concat(o3), a4 = "groupID:".concat(e4.groupID), s4 = (5 < e4.userIDList.length ? a4 += " userIDList.length:".concat(e4.userIDList.length) : a4 += " userIDList:".concat(e4.userIDList), M2.l("".concat(i4, " ").concat(a4)), 50 < e4.userIDList.length && (e4.userIDList = e4.userIDList.slice(0, 50)), e4.groupID), r3 = e4.userIDList, i4 = this._grpM.getLocalGroupProfile(s4);
      return i4 && Gt2(i4.type) ? E2({ code: i4 = k2.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(i4, o3) }) : ((t3 = new P2(o3)).setMessage(a4), this._getGroupMemberProfileAdvance(y2(y2({}, e4), {}, { userIDList: r3 })).then(function(e5) {
        e5 = e5.data.members;
        return O2(e5) && 0 !== e5.length ? (n3._updateLocalGroupMemberMap(s4, e5), n3._grpM.get(4).getUserProfile({ userIDList: e5.map(function(e6) {
          return e6.userID;
        }), tagList: [f3.NICK, f3.AVATAR] })) : D2([]);
      }).then(function(e5) {
        e5 = e5.data.map(function(e6) {
          return { userID: e6.userID, nick: e6.nick, avatar: e6.avatar };
        }), n3._updateLocalGroupMemberMap(s4, e5), e5 = r3.filter(function(e6) {
          return n3.hasLocalGroupMember(s4, e6);
        }).map(function(e6) {
          return n3.getLocalGroupMemberInfo(s4, e6);
        });
        return t3.end(), T2({ memberList: e5 });
      }));
    } }, { key: "addGroupMember", value: function(a4) {
      var s4 = this, r3 = "".concat(this._n, ".").concat("addGroupMember"), e4 = a4.groupID, c4 = this._grpM.getLocalGroupProfile(e4), t3 = c4.type, u3 = new P2("addGroupMember");
      return u3.setMessage("groupID:".concat(e4, " groupType:").concat(t3)), Gt2(t3) ? (t3 = new L2({ code: k2.CANNOT_ADD_MEMBER_IN_AV }), u3.setError(t3).end(), E2(t3)) : (a4.userIDList = a4.userIDList.map(function(e5) {
        return { userID: e5 };
      }), M2.l("".concat(r3, " groupID:").concat(e4)), this._grpM.req({ P: G2.ADD_GRP_MBR, data: a4 }).then(function(e5) {
        var e5 = e5.data.members, t4 = (M2.l("".concat(r3, " ok")), e5.filter(function(e6) {
          return 1 === e6.result;
        }).map(function(e6) {
          return e6.userID;
        })), n3 = e5.filter(function(e6) {
          return 0 === e6.result;
        }).map(function(e6) {
          return e6.userID;
        }), o3 = e5.filter(function(e6) {
          return 2 === e6.result;
        }).map(function(e6) {
          return e6.userID;
        }), e5 = e5.filter(function(e6) {
          return 4 === e6.result;
        }).map(function(e6) {
          return e6.userID;
        }), i4 = "groupID:".concat(a4.groupID, ", ") + "successUserIDList:".concat(t4, ", ") + "failureUserIDList:".concat(n3, ", ") + "existedUserIDList:".concat(o3, ", ") + "overLimitUserIDList:".concat(e5);
        return u3.setMoreMessage(i4).end(), 0 === t4.length ? T2({ successUserIDList: t4, failureUserIDList: n3, existedUserIDList: o3, overLimitUserIDList: e5 }) : (s4._updateConvGroupProfile(c4), T2({ successUserIDList: t4, failureUserIDList: n3, existedUserIDList: o3, overLimitUserIDList: e5, group: c4 }));
      }).catch(function(e5) {
        return u3.setError(e5).end(), M2.e("".concat(r3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "deleteGroupMember", value: function(e4) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("deleteGroupMember"), a4 = e4.groupID, s4 = e4.userIDList, r3 = this._grpM.getLocalGroupProfile(a4);
      return N2(r3) ? E2({ code: k2.CANNOT_FIND_GRP }) : Gt2(r3.type) ? this._grpM.canIUse(g2.AV_BAN_MBR) ? this._banAVChatRoomMember(e4) : this._grpM.noUse("deleteGroupMember") : (t3 = "groupID:".concat(a4, " ").concat(5 < s4.length ? "userIDList.length:".concat(s4.length) : "userIDList:".concat(s4)), M2.l("".concat(i4, " groupID:").concat(a4, " userIDList:"), s4), (n3 = new P2("deleteGroupMember")).setMessage(t3), this._grpM.req({ P: G2.DEL_GRP_MBR, data: e4 }).then(function() {
        return n3.end(), M2.l("".concat(i4, " ok")), o3._updateConvGroupProfile(r3), o3.deleteLocalGroupMembers(a4, s4), T2({ group: r3, userIDList: s4 });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "_updateConvGroupProfile", value: function(e4) {
      this._grpM.get(11).updateConvGroupProfile([e4]);
    } }, { key: "_banAVChatRoomMember", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_banAVChatRoomMember"), o3 = e4.groupID, i4 = e4.userIDList, a4 = "groupID:".concat(o3, " ").concat(5 < i4.length ? "userIDList.length:".concat(i4.length) : "userIDList:".concat(i4)), s4 = new P2("_banAVChatRoomMember"), r3 = (s4.setMessage(a4), M2.l("".concat(n3, " groupID:").concat(o3, " userIDList:"), i4), this._grpM.getLocalGroupProfile(o3));
      return N2(e4.duration) || 0 === e4.duration ? E2({ code: k2.BAN_DURATION_INVALID }) : this._grpM.req({ P: G2.BAN_AV_MBR, data: e4 }).then(function() {
        return s4.end(), M2.l("".concat(n3, " ok")), t3.deleteLocalGroupMembers(o3, i4), T2({ group: r3, userIDList: i4 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "setGroupMemberMuteTime", value: function(e4) {
      var t3, n3, o3 = this, i4 = e4.groupID, a4 = e4.userID, e4 = e4.muteTime, s4 = "".concat(this._n, ".").concat("setGroupMemberMuteTime");
      return a4 === this._grpM.getMyUserID() ? E2({ code: k2.CANNOT_MUTE_SELF }) : (t3 = "groupID:".concat(i4, " userID:").concat(a4, " muteTime:").concat(e4), M2.l("".concat(s4, " ").concat(t3)), (n3 = new P2("setGroupMemberMuteTime")).setMessage(t3), this.modifyGroupMemberInfo({ groupID: i4, userID: a4, muteTime: e4 }).then(function(e5) {
        n3.end(), M2.l("".concat(s4, " ok"));
        var t4 = o3._grpM.getLocalGroupProfile(i4);
        return T2({ group: t4, member: e5 });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(s4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "setGroupMemberRole", value: function(e4) {
      var t3, n3, o3 = "".concat(this._n, ".").concat("setGroupMemberRole"), i4 = e4.groupID, a4 = e4.userID, e4 = e4.role, s4 = "groupID:".concat(i4, " userID:").concat(a4, " role:").concat(e4), r3 = this._grpM.getLocalGroupProfile(i4);
      return r3 && r3.selfInfo.role !== R2.GRP_MBR_ROLE_OWNER ? E2({ code: k2.NOT_OWNER }) : (t3 = [R2.GRP_MBR_ROLE_ADMIN, R2.GRP_MBR_ROLE_MEMBER], Pt2({ groupID: i4 }) && t3.push(R2.GRP_MBR_ROLE_CUSTOM), t3.indexOf(e4) < 0 ? E2({ code: k2.INVALID_MEMBER_ROLE }) : a4 === this._grpM.getMyUserID() ? E2({ code: k2.CANNOT_SET_SELF_MEMBER_ROLE }) : ((n3 = new P2("setGroupMemberRole")).setMessage(s4), M2.l("".concat(o3, " ").concat(s4)), this.modifyGroupMemberInfo({ groupID: i4, userID: a4, role: e4 }).then(function(e5) {
        return n3.end(), M2.l("".concat(o3, " ok")), T2({ group: r3, member: e5 });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      })));
    } }, { key: "_filterProfanity", value: function(e4, t3) {
      var n3, o3 = this._grpM.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e4], "group_member_profile")).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e4] = o3, true));
    } }, { key: "setGroupMemberNameCard", value: function(e4) {
      var n3, o3, i4, t3, a4, s4 = this, r3 = "setGroupMemberNameCard", c4 = "".concat(this._n, ".").concat(r3);
      return e4.nameCard && false === this._filterProfanity("nameCard", e4) ? E2({ code: k2.PROFANITY_FOUND }) : (n3 = e4.groupID, t3 = e4.userID, o3 = void 0 === t3 ? this._grpM.getMyUserID() : t3, i4 = e4.nameCard, t3 = "groupID:".concat(n3, " userID:").concat(o3, " nameCard:").concat(i4), M2.l("".concat(c4, " ").concat(t3)), (e4 = this._grpM.getLocalGroupProfile(n3)) && Gt2(e4.type) ? E2({ code: e4 = k2.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(e4, r3) }) : ((a4 = new P2(r3)).setMessage(t3), this.modifyGroupMemberInfo({ groupID: n3, userID: o3, nameCard: i4 }).then(function(e5) {
        M2.l("".concat(c4, " ok")), a4.end();
        var t4 = s4._grpM.getLocalGroupProfile(n3);
        return o3 === s4._grpM.getMyUserID() && t4 && t4.setSelfNameCard(i4), T2({ group: t4, member: e5 });
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(c4, " failed. error:"), e5), E2(e5);
      })));
    } }, { key: "setGroupMemberCustomField", value: function(e4) {
      var n3, o3 = this, t3 = "setGroupMemberCustomField", i4 = "".concat(this._n, ".").concat(t3), a4 = e4.groupID, s4 = e4.userID, s4 = void 0 === s4 ? this._grpM.getMyUserID() : s4, e4 = e4.memberCustomField, r3 = "groupID:".concat(a4, " userID:").concat(s4, " memberCustomField:").concat(JSON.stringify(e4)), c4 = (M2.l("".concat(i4, " ").concat(r3)), this._grpM.getLocalGroupProfile(a4));
      return c4 && Gt2(c4.type) ? E2({ code: c4 = k2.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(c4, t3) }) : ((n3 = new P2(t3)).setMessage(r3), this.modifyGroupMemberInfo({ groupID: a4, userID: s4, memberCustomField: e4 }).then(function(e5) {
        n3.end(), M2.l("".concat(i4, " ok"));
        var t4 = o3._grpM.getLocalGroupProfile(a4);
        return T2({ group: t4, member: e5 });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "modifyGroupMemberInfo", value: function(t3) {
      var n3 = this, o3 = t3.groupID, i4 = t3.userID, e4 = void 0;
      return Ut2(o3) && (o3 = Xt2(e4 = o3)), this._grpM.req({ P: G2.MODIFY_GRP_MBR_INFO, data: y2(y2({}, t3), {}, { groupID: o3, topicID: e4 }) }).then(function() {
        var e5;
        return n3.hasLocalGroupMember(o3, i4) ? (e5 = n3.getLocalGroupMemberInfo(o3, i4), N2(t3.muteTime) || e5.updateMuteUntil(t3.muteTime), N2(t3.role) || e5.updateRole(t3.role), N2(t3.nameCard) || e5.updateNameCard(t3.nameCard), N2(t3.memberCustomField) || e5.updateMemberCustomField(t3.memberCustomField), e5) : (e5 = n3._grpM.getLocalGroupProfile(o3)) && !Gt2(e5.type) ? n3.getGroupMemberProfile({ groupID: o3, userIDList: [i4] }).then(function(e6) {
          return j2(e6.data.memberList, 1)[0];
        }) : void 0;
      });
    } }, { key: "markGroupMemberList", value: function(e4) {
      var o3 = "".concat(this._n, ".").concat("markGroupMemberList"), t3 = e4.groupID, n3 = e4.markType, i4 = e4.enableMark, e4 = e4.userIDList, a4 = void 0 === e4 ? [] : e4, e4 = "groupID:".concat(t3, " markType:").concat(n3, " enableMark:").concat(i4, " userIDList count:").concat(a4.length), s4 = (M2.l("".concat(o3, " ").concat(e4)), 2), r3 = [], i4 = (true === i4 && (s4 = 1), d3(a4)), c4 = (500 < a4.length && (i4 = a4.slice(0, 500), M2.w("".concat(o3, " ").concat(tn2(500)))), i4.forEach(function(e5) {
        r3.push({ userID: e5, markType: [n3] });
      }), i4 = null, new P2("markGroupMemberList"));
      return c4.setMessage(e4), this._grpM.req({ P: G2.MARK_AV_MBR_INFO, data: { groupID: t3, operationType: s4, memberList: r3 } }).then(function(e5) {
        var e5 = e5.data.memberList, e5 = void 0 === e5 ? [] : e5, t4 = [], n4 = [], e5 = (e5.length === a4.length ? t4.push.apply(t4, d3(a4)) : (e5.forEach(function(e6) {
          t4.push(e6.userID);
        }), a4.forEach(function(e6) {
          t4.includes(e6) || n4.push(e6);
        })), "success count:".concat(t4.length, " fail count:").concat(n4.length));
        return c4.setMessage(e5).end(), M2.l("".concat(o3, " ok. ").concat(e5)), T2({ successUserIDList: t4, failureUserIDList: n4 });
      }).catch(function(e5) {
        return c4.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_getGroupMemberProfileAdvance", value: function(e4) {
      return this._grpM.req({ P: G2.GET_GRP_MBR_PROFILE, data: y2(y2({}, e4), {}, { memberInfoFilter: e4.memberInfoFilter || this.DEFAULT_MEMBER_INFO_FILTER }) });
    } }, { key: "_updateLocalGroupMemberMap", value: function(t3, e4) {
      var n3 = this;
      return O2(e4) && 0 !== e4.length ? e4.map(function(e5) {
        return n3.hasLocalGroupMember(t3, e5.userID) ? n3.getLocalGroupMemberInfo(t3, e5.userID).updateMember(e5) : n3.setLocalGroupMember(t3, new ai2(e5)), n3.getLocalGroupMemberInfo(t3, e5.userID);
      }) : [];
    } }, { key: "deleteLocalGroupMembers", value: function(e4, t3) {
      var n3 = this.groupMemberListMap.get(e4);
      n3 && t3.forEach(function(e5) {
        n3.delete(e5);
      });
    } }, { key: "getLocalGroupMemberInfo", value: function(e4, t3) {
      return this.groupMemberListMap.has(e4) ? this.groupMemberListMap.get(e4).get(t3) : null;
    } }, { key: "setLocalGroupMember", value: function(e4, t3) {
      this.groupMemberListMap.has(e4) ? this.groupMemberListMap.get(e4).set(t3.userID, t3) : (t3 = (/* @__PURE__ */ new Map()).set(t3.userID, t3), this.groupMemberListMap.set(e4, t3));
    } }, { key: "getLocalGroupMemberList", value: function(e4) {
      return this.groupMemberListMap.get(e4);
    } }, { key: "hasLocalGroupMember", value: function(e4, t3) {
      return this.groupMemberListMap.has(e4) && this.groupMemberListMap.get(e4).has(t3);
    } }, { key: "hasLocalGroupMemberMap", value: function(e4) {
      return this.groupMemberListMap.has(e4);
    } }, { key: "reset", value: function() {
      this.groupMemberListMap.clear();
    } }]), ri2 = [17, 18, 20], ci2 = e3(function e4(t3) {
      p3(this, e4), this._grpM = t3, this._n = "GroupSystemNoticeHandler", this.pendencyMap = /* @__PURE__ */ new Map();
    }, [{ key: "onNewGroupSystemNotice", value: function(e4) {
      var t3 = e4.dataList, n3 = e4.isSyncingEnded, e4 = e4.isInstantMessage, t3 = (M2.d("".concat(this._n, ".onReceiveSystemNotice count:").concat(t3.length)), this._assembly({ notifiesList: t3, isInstantMessage: e4 })), o3 = t3.eventDataList, t3 = t3.result;
      0 < o3.length && (this._grpM.get(11).onNewMessage({ conversationOptionsList: o3, isInstantMessage: e4 }), this._onReceivedGroupSystemNotice({ result: t3, isInstantMessage: e4 })), e4 ? 0 < t3.length && this._grpM.emitOEvt(h3.MESSAGE_RECEIVED, t3) : true === n3 && this._clearGroupSystemNotice();
    } }, { key: "_assembly", value: function(e4) {
      for (var t3 = e4.notifiesList, n3 = e4.isInstantMessage, o3 = null, i4 = t3.length, a4 = 0, s4 = [], r3 = { conversationID: R2.CONV_SYSTEM, unreadCount: 0, type: R2.CONV_SYSTEM, subType: null, lastMessage: null }, a4 = 0; a4 < i4; a4++) {
        var c4 = t3[a4], u3 = c4.groupProfile, l3 = u3.communityType, u3 = u3.topicID, u3 = void 0 === u3 ? void 0 : u3, d4 = c4.elements, p4 = d4.topicIDList, p4 = void 0 === p4 ? void 0 : p4, d4 = d4.operationType;
        if (!(2 !== (void 0 === l3 ? 0 : l3) || S2(u3) && S2(p4))) {
          if (ri2.includes(d4)) {
            this._handleTopicSystemNotice(c4);
            continue;
          }
          S2(u3) || (c4.to = u3);
        }
        15 !== c4.elements.operationType && (c4.currentUser = this._grpM.getMyUserID(), c4.conversationType = R2.CONV_SYSTEM, c4.conversationID = R2.CONV_SYSTEM, (o3 = new So2(c4)).setElement({ type: R2.MSG_GRP_SYS_NOTICE, content: y2(y2({}, c4.elements), {}, { groupProfile: y2({}, c4.groupProfile) }) }), o3.isSystemMessage = true, (1 === o3.sequence && 1 === o3.random || 2 === o3.sequence && 2 === o3.random) && (o3.sequence = mt3(), o3.random = mt3(), o3.generateMessageID(), M2.l("".concat(this._n, "._assembly regenerate ID:").concat(o3.ID))), this._grpM.get(11).pushIntoNoticeResult(s4, o3)) && (n3 ? r3.unreadCount++ : o3.setIsRead(true), r3.subType = o3.conversationSubType);
      }
      return r3.lastMessage = s4[s4.length - 1], { eventDataList: 0 < s4.length ? [r3] : [], result: s4 };
    } }, { key: "_clearGroupSystemNotice", value: function() {
      var a4 = this;
      this._getPendencyList().then(function(e4) {
        e4.forEach(function(e5) {
          a4.pendencyMap.set("".concat(e5.from, "_").concat(e5.groupID, "_").concat(e5.to), e5);
        });
        var e4 = a4._grpM.get(11).getLocalMessageList(R2.CONV_SYSTEM), i4 = [];
        e4.forEach(function(e5) {
          var t3 = e5.payload, n3 = t3.operatorID, o3 = t3.operationType, t3 = t3.groupProfile;
          1 === o3 && (o3 = "".concat(n3, "_").concat(t3.groupID, "_").concat(t3.to), n3 = a4.pendencyMap.get(o3)) && A2(n3.handled) && 0 !== n3.handled && i4.push(e5);
        }), a4.deleteGroupSystemNotice({ messageList: i4 });
      });
    } }, { key: "deleteGroupSystemNotice", value: function(e4) {
      var n3 = this, o3 = "".concat(this._n, ".deleteGroupSystemNotice");
      return O2(e4.messageList) && 0 !== e4.messageList.length ? (M2.l("".concat(o3, " ") + e4.messageList.map(function(e5) {
        return e5.ID;
      })), this._grpM.req({ P: G2.DEL_GRP_SYSTEM_NOTICE, data: { messageListToDelete: e4.messageList.map(function(e5) {
        return { from: R2.CONV_SYSTEM, messageSeq: e5.clientSequence, messageRandom: e5.random };
      }) } }).then(function() {
        M2.l("".concat(o3, " ok"));
        var t3 = n3._grpM.get(11);
        return e4.messageList.forEach(function(e5) {
          t3.deleteLocalMessage(e5);
        }), T2();
      }).catch(function(e5) {
        return M2.e("".concat(o3, " error:"), e5), E2(e5);
      })) : D2();
    } }, { key: "_getPendencyList", value: function() {
      var n3 = this, e4 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t3 = e4.type, o3 = e4.startTime, e4 = e4.limit;
      return this._grpM.req({ P: G2.GET_GRP_PENDENCY, data: { type: void 0 === t3 ? void 0 : t3, startTime: void 0 === o3 ? 0 : o3, limit: void 0 === e4 ? 20 : e4, handleAccount: this._grpM.getMyUserID() } }).then(function(e5) {
        var t4 = e5.data.pendencyList;
        return 0 !== e5.data.nextStartTime ? n3._getPendencyList({ startTime: e5.data.nextStartTime }).then(function(e6) {
          return [].concat(d3(t4), d3(e6));
        }) : t4;
      });
    } }, { key: "getGroupApplicationList", value: function() {
      var n3 = this;
      return this._getPendencyList().then(function(t3) {
        return n3._getPendencyList({ type: R2.GRP_COMMUNITY }).then(function(e4) {
          return t3.push.apply(t3, d3(e4)), n3._handlePendencyResult(t3);
        }).catch(function(e4) {
          return n3._handlePendencyResult(t3);
        });
      });
    } }, { key: "_handlePendencyResult", value: function(e4) {
      var t3 = this, n3 = [];
      return e4.forEach(function(e5) {
        t3.pendencyMap.set("".concat(e5.from, "_").concat(e5.groupID, "_").concat(e5.to), e5), 0 === e5.handled && n3.push({ applicant: e5.from, applicantNick: e5.fromUserNickName, groupName: e5.groupName, groupID: e5.groupID, authentication: e5.authentication, messageKey: e5.time, applicationType: e5.applicationType, userID: e5.userID, note: e5.note });
      }), D2({ applicationList: n3 });
    } }, { key: "_onReceivedGroupSystemNotice", value: function(e4) {
      var t3 = this, n3 = e4.result;
      e4.isInstantMessage && n3.forEach(function(e5) {
        switch (e5.payload.operationType) {
          case 1:
            break;
          case 2:
            t3._onApplyJoinGroup(e5);
            break;
          case 3:
            break;
          case 4:
            t3._onMemberKicked(e5);
            break;
          case 5:
            t3._onGroupDismissed(e5);
            break;
          case 6:
            break;
          case 7:
            t3._onInviteGroup(e5);
            break;
          case 8:
            t3._onQuitGroup(e5);
            break;
          case 9:
            t3._onSetManager(e5);
            break;
          case 10:
            t3._onDeleteManager(e5);
            break;
          case 11:
          case 12:
          case 15:
            break;
          case 20:
            t3._onMessageRemindTypeSynced(e5);
            break;
          case 21:
            t3._grpM.onAVChatRoomMemberBanned(e5);
        }
      });
    } }, { key: "_onApplyJoinGroup", value: function(e4) {
      var t3 = this, e4 = e4.payload.groupProfile, n3 = e4.groupID, e4 = e4.groupType, o3 = this._grpM.hasLocalGroup(n3);
      M2.l("".concat(this._n, "._onApplyJoinGroup groupID:").concat(n3, " groupType:").concat(e4, " hasGroup:").concat(o3)), o3 || Gt2(e4) || this._grpM.getGroupProfile({ groupID: n3 }).then(function(e5) {
        var e5 = e5.data.group;
        e5 && (t3._grpM.updateGroupMap([e5]), e5 = !e5.isSupportTopic, t3._grpM.emitGroupListUpdate(true, e5));
      });
    } }, { key: "_onMemberKicked", value: function(e4) {
      e4 = e4.payload.groupProfile.groupID;
      this._grpM.hasLocalGroup(e4) && this._grpM.deleteLocalGroupAndConversation(e4);
    } }, { key: "_onGroupDismissed", value: function(e4) {
      var e4 = e4.payload.groupProfile.groupID, t3 = (this._grpM.hasLocalGroup(e4) && this._grpM.deleteLocalGroupAndConversation(e4), this._grpM._AVChatRoomHandler);
      t3 && t3.checkJoinedAVChatRoomByID(e4) && t3.reset(e4);
    } }, { key: "_onInviteGroup", value: function(e4) {
      var t3 = this, n3 = e4.payload.groupProfile.groupID, e4 = this._grpM.hasLocalGroup(n3);
      M2.l("".concat(this._n, "._onInviteGroup groupID:").concat(n3, " hasGroup:").concat(e4)), this._grpM.getGroupProfile({ groupID: n3 }).then(function() {
        t3._grpM.emitGroupListUpdate(), t3._grpM.get(11).pullMsgOnInvite("".concat(R2.CONV_GROUP).concat(n3));
      });
    } }, { key: "_onQuitGroup", value: function(e4) {
      var e4 = e4.payload.groupProfile, t3 = e4.groupID, e4 = e4.groupType, n3 = this._grpM.hasLocalGroup(t3);
      M2.l("".concat(this._n, "._onQuitGroup groupID:").concat(t3, " groupType:").concat(e4, " hasGroup:").concat(n3)), n3 && this._grpM.deleteLocalGroupAndConversation(t3);
    } }, { key: "_onSetManager", value: function(e4) {
      var e4 = e4.payload.groupProfile, t3 = e4.to, e4 = e4.groupID, e4 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e4, t3);
      e4 && e4.updateRole(R2.GRP_MBR_ROLE_ADMIN);
    } }, { key: "_onDeleteManager", value: function(e4) {
      var e4 = e4.payload.groupProfile, t3 = e4.to, e4 = e4.groupID, e4 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e4, t3);
      e4 && e4.updateRole(R2.GRP_MBR_ROLE_MEMBER);
    } }, { key: "_onMessageRemindTypeSynced", value: function(e4) {
      var t3 = e4.payload.groupProfile.groupID, e4 = e4.payload.messageRemindType;
      this._grpM.get(11).onGroupMsgRemindTypeUpdated({ groupID: t3, messageRemindType: e4 });
    } }, { key: "_handleTopicSystemNotice", value: function(e4) {
      var t3 = e4.groupProfile, n3 = t3.groupID, t3 = t3.topicID, e4 = e4.elements, o3 = e4.operationType, i4 = e4.topicIDList, e4 = e4.messageRemindType, a4 = this._grpM.get(10);
      17 === o3 ? a4.onTopicCreated({ groupID: n3, topicID: t3 }) : 18 === o3 ? a4.onTopicDeleted({ groupID: n3, topicIDList: i4 }) : 20 === o3 && a4.onMessageRemindTypeUpdated({ groupID: n3, topicID: t3, messageRemindType: e4 });
    } }, { key: "reset", value: function() {
      this.pendencyMap.clear();
    } }]), ui2 = ["relayFlag"], li2 = (t2(Ei2, c3), e3(Ei2, [{ key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("polling_interval"), t3 = this.getCloudConfig("polling_interval_plus"), n3 = this.getCloudConfig("polling_no_msg_count"), o3 = this.getCloudConfig("polling_simplified_msg"), i4 = this.getCloudConfig("paging_grp_count");
      M2.l("".concat(this._n, "._onCloudConfig pollingInterval:").concat(e4) + " pollingIntervalPlus:".concat(t3, " pollingNoMessageCount:").concat(n3) + " pollingSimplifiedMessage:".concat(o3, " pagingGroupCount:").concat(i4)), this._AVChatRoomHandler.setPollingInterval(e4), this._AVChatRoomHandler.setPollingIntervalPlus(t3), this._AVChatRoomHandler.setPollingNoMessageCount(n3), this._AVChatRoomHandler.setPollingSimplifiedMessage(o3), this._commonGroupHandler.setPagingGroupCount(i4);
    } }, { key: "onCheckTimer", value: function(e4) {
      this.isLoggedIn() && (this._commonGroupHandler.onCheckTimer(e4), this._groupTipsHandler.onCheckTimer(e4));
    } }, { key: "guardForAVChatRoom", value: function(t3) {
      var n3, o3 = this;
      return t3.conversationType !== R2.CONV_GROUP || (n3 = Ut2(t3.to) ? Xt2(t3.to) : t3.to, this.hasLocalGroup(n3)) ? D2() : this.getGroupProfile({ groupID: n3 }).then(function(e4) {
        var e4 = e4.data.group.type;
        return M2.l("".concat(o3._n, ".guardForAVChatRoom. groupID:").concat(n3, " type:").concat(e4)), e4 === R2.GRP_AVCHATROOM ? E2(new L2({ code: e4 = k2.MSG_SEND_FAIL_NOT_IN_AV, message: o3.getErrMsg(e4, t3.from, n3), data: { message: t3 } })) : D2();
      });
    } }, { key: "checkJoinedAVChatRoomByID", value: function(e4) {
      return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e4);
    } }, { key: "onNewMessage", value: function(e4) {
      this._commonGroupHandler.onNewMessage(e4);
    } }, { key: "updateNextMessageSeq", value: function(e4) {
      var n3, o3 = this;
      O2(e4) && (n3 = this.get(10), e4.forEach(function(e5) {
        var t3 = e5.conversationID.replace(R2.CONV_GROUP, "");
        Ut2(t3) && n3.updateUnreadCountAndLastMsg(t3, e5.lastMessage), o3.groupMap.has(t3) && (o3.groupMap.get(t3).nextMessageSeq = e5.lastMessage.sequence + 1);
      }));
    } }, { key: "onNewGroupTips", value: function(e4) {
      this._groupTipsHandler.onNewGroupTips(e4);
    } }, { key: "onMsgRevoked", value: function(e4) {
      this._commonGroupHandler.onMsgRevoked(e4, !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]);
    } }, { key: "onNewGroupSystemNotice", value: function(e4) {
      this._groupSystemNoticeHandler.onNewGroupSystemNotice(e4);
    } }, { key: "onMsgReadNotice", value: function(e4) {
      var a4 = this;
      e4.dataList.forEach(function(e5) {
        var i4, e5 = e5.elements.groupMessageReadNotice;
        N2(e5) || (i4 = a4.get(11), e5.forEach(function(e6) {
          var t3 = e6.groupID, n3 = e6.topicID, n3 = void 0 === n3 ? void 0 : n3, e6 = e6.lastMessageSeq, t3 = (M2.l("".concat(a4._n, ".onMsgReadNotice groupID:").concat(t3, " lastMessageSeq:").concat(e6)), "".concat(R2.CONV_GROUP).concat(t3)), o3 = true;
          S2(n3) || (t3 = "".concat(R2.CONV_GROUP).concat(n3), o3 = false), i4.updateIsReadAfterReadReport({ conversationID: t3, lastMessageSeq: e6 }), i4.updateUnreadCount(t3, o3), i4.clearGroupAtInfoList(t3, o3);
        }));
      });
    } }, { key: "onReadReceiptList", value: function(e4) {
      var o3 = this;
      M2.l("".concat(this._n, ".onReadReceiptList options:"), e4), e4.dataList.forEach(function(e5) {
        var t3 = e5.groupProfile, e5 = e5.elements, t3 = t3.groupID, n3 = o3.get(11), e5 = e5.readReceiptList;
        n3.updateReadReceiptInfo({ groupID: t3, readReceiptList: e5 });
      });
    } }, { key: "onMsgModified", value: function(e4) {
      M2.l("".concat(this._n, ".onMsgModified options:"), e4);
      var t3 = this.get(11);
      e4.dataList.forEach(function(e5) {
        t3.onMessageModified(y2(y2({}, e5), {}, { conversationType: R2.CONV_GROUP, to: e5.topicID || e5.groupID }));
      });
    } }, { key: "deleteGroupSystemNotice", value: function(e4) {
      this._groupSystemNoticeHandler.deleteGroupSystemNotice(e4);
    } }, { key: "initGroupMap", value: function(e4) {
      this.groupMap.set(e4.groupID, new Yo(e4));
    } }, { key: "clearGroupMap", value: function() {
      this.groupMap.clear();
    } }, { key: "deleteGroup", value: function(e4) {
      this.groupMap.delete(e4);
    } }, { key: "updateGroupMap", value: function(e4) {
      var t3, n3 = this, o3 = this.get(11);
      e4.forEach(function(e5) {
        t3 = e5.groupID, n3.groupMap.has(t3) ? n3.groupMap.get(t3).updateGroup(e5) : (n3.groupMap.set(t3, new Yo(e5)), o3.deleteGroupRoamingInfo(t3));
      });
      var i4, a4 = this.getMyUserID(), s4 = F2(this.groupMap);
      try {
        for (s4.s(); !(i4 = s4.n()).done; ) {
          var r3 = j2(i4.value, 2)[1];
          r3.selfInfo.userID = a4, "Owner" === r3.selfInfo.role && (r3.ownerID = a4);
        }
      } catch (e5) {
        s4.e(e5);
      } finally {
        s4.f();
      }
    } }, { key: "getGroupMap", value: function() {
      return this.groupMap;
    } }, { key: "getLocalGroupList", value: function() {
      return d3(this.groupMap.values()).filter(function(e4) {
        return e4.type !== R2.GRP_ROOM && e4.type !== R2.GRP_LIVE;
      });
    } }, { key: "getLocalGroupProfile", value: function(e4) {
      return this.groupMap.get(e4);
    } }, { key: "sortLocalGroupList", value: function() {
      var e4 = d3(this.groupMap).filter(function(e5) {
        e5 = j2(e5, 2);
        return e5[0], !S2(e5[1].lastMessage);
      });
      e4.sort(function(e5, t3) {
        return t3[1].lastMessage.lastTime - e5[1].lastMessage.lastTime;
      }), this.groupMap = new Map(d3(e4));
    } }, { key: "updateGroupLastMessage", value: function(e4) {
      this._commonGroupHandler.updateLastMsg(e4);
    } }, { key: "emitGroupListUpdate", value: function() {
      var e4 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n3 = this.getLocalGroupList();
      e4 && this.emitOEvt(h3.GROUP_LIST_UPDATED), t3 && (e4 = JSON.parse(JSON.stringify(n3)), this.get(11).updateConvGroupProfile(e4));
    } }, { key: "getMyNameCardByGroupID", value: function(e4) {
      e4 = this.getLocalGroupProfile(e4);
      return e4 ? e4.selfInfo.nameCard : "";
    } }, { key: "isPagingGetCompleted", value: function() {
      return this._commonGroupHandler.isPagingGetCompleted();
    } }, { key: "getMsgRemindType", value: function(e4) {
      var n3 = this;
      return !O2(e4) || 0 === e4.length || 0 === (e4 = e4.filter(function(e5) {
        return !Gt2(n3.getLocalGroupProfile(e5).type);
      })).length ? Promise.resolve() : (M2.l("".concat(this._n, ".getMsgRemindType groupIDList:").concat(e4)), this.getGroupProfileAdvance({ groupIDList: e4, responseFilter: { memberInfoFilter: ["MsgFlag"] } }).then(function(e5) {
        var e5 = e5.data.successGroupList, t3 = n3.get(11);
        e5.forEach(function(e6) {
          t3.onGroupMsgRemindTypeUpdated({ groupID: e6.groupID, messageRemindType: O2(e6.members) ? e6.members[0].messageRemindType : "" });
        });
      }));
    } }, { key: "getGroupList", value: function() {
      return this._commonGroupHandler.getGroupList();
    } }, { key: "syncCommunityWithTopic", value: function() {
      return this._commonGroupHandler.syncGroupList(true);
    } }, { key: "getGroupProfile", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".").concat("getGroupProfile"), i4 = new P2("getGroupProfile"), a4 = t3.groupID, e4 = t3.groupCustomFieldFilter, e4 = (M2.l("".concat(o3, " groupID:").concat(a4)), { groupIDList: [a4], responseFilter: { groupBaseInfoFilter: d3(re3), groupCustomFieldFilter: e4, memberInfoFilter: [].concat(d3(ce3), ["NameCard"]) } });
      return this.getGroupProfileAdvance(e4).then(function(e5) {
        var e5 = e5.data, t4 = e5.successGroupList, e5 = e5.failureGroupList;
        return M2.l("".concat(o3, " ok")), 0 < e5.length ? E2(e5[0]) : ((e5 = Gt2(t4[0].type) && !n3.hasLocalGroup(a4) ? new Yo(t4[0]) : (n3.updateGroupMap(t4), n3.getLocalGroupProfile(a4))).isSupportTopic || n3.get(11).updateConvGroupProfile([e5]), i4.setMessage("groupID:".concat(a4, " type:").concat(e5.type, " muteAllMembers:").concat(e5.muteAllMembers, " ownerID:").concat(e5.ownerID)).end(), T2({ group: e5 }));
      }).catch(function(e5) {
        return i4.setError(e5).setMessage("groupID:".concat(t3.groupID)).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getGroupProfileAdvance", value: function(e4) {
      var t3, n3 = "".concat(this._n, ".getGroupProfileAdvance"), o3 = e4.groupIDList, i4 = (O2(o3) && 50 < o3.length && (this.warn("GetGroupProfileLimit"), o3.length = 50), []), a4 = [], o3 = (o3.forEach(function(e5) {
        (Pt2({ groupID: e5 }) ? a4 : i4).push(e5);
      }), []);
      return 0 < i4.length && (t3 = this._getGroupProfileAdvance(y2(y2({}, e4), {}, { groupIDList: i4 })), o3.push(t3)), 0 < a4.length && (t3 = this._getGroupProfileAdvance(y2(y2({}, e4), {}, { groupIDList: a4, relayFlag: 0 < i4.length })), o3.push(t3)), Promise.all(o3).then(function(e5) {
        var t4 = [], n4 = [];
        return e5.forEach(function(e6) {
          t4.push.apply(t4, d3(e6.successGroupList)), n4.push.apply(n4, d3(e6.failureGroupList));
        }), T2({ successGroupList: t4, failureGroupList: n4 });
      }).catch(function(e5) {
        return M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_getGroupProfileAdvance", value: function(t3) {
      var n3 = this, e4 = t3.relayFlag, o3 = void 0 !== e4 && e4, i4 = W2(t3, ui2);
      return this.req({ P: G2.GET_GRP_PROFILE, data: i4 }).then(function(e5) {
        M2.l("".concat(n3._n, "._getGroupProfileAdvance ok. options:"), i4);
        e5 = e5.data.groups;
        return { successGroupList: e5.filter(function(e6) {
          return N2(e6.errorCode) || 0 === e6.errorCode;
        }), failureGroupList: e5.filter(function(e6) {
          return e6.errorCode && 0 !== e6.errorCode;
        }).map(function(e6) {
          return new L2({ code: e6.errorCode, message: e6.errorInfo, data: { groupID: e6.groupID } });
        }) };
      }).catch(function(e5) {
        return o3 && Pt2({ groupID: t3.groupIDList[0] }) ? { successGroupList: [], failureGroupList: [] } : E2(e5);
      });
    } }, { key: "createGroup", value: function(s4) {
      var r3 = this, e4 = [R2.GRP_PUBLIC, R2.GRP_WORK, R2.GRP_MEETING, R2.GRP_AVCHATROOM, R2.GRP_COMMUNITY], c4 = "".concat(this._n, ".").concat("createGroup"), t3 = s4.type, n3 = s4.groupID;
      if (s4.name && false === this._filterProfanity("name", s4))
        return E2({ code: k2.PROFANITY_FOUND });
      if (s4.introduction && false === this._filterProfanity("introduction", s4))
        return E2({ code: k2.PROFANITY_FOUND });
      if (s4.notification && false === this._filterProfanity("notification", s4))
        return E2({ code: k2.PROFANITY_FOUND });
      if (!e4.includes(t3))
        return E2({ code: k2.ILLEGAL_GRP_TYPE });
      if (!Pt2({ type: t3 })) {
        if (!S2(n3) && Pt2({ groupID: n3 }))
          return E2({ code: k2.ILLEGAL_GRP_ID });
        s4.isSupportTopic = void 0;
      }
      if (Gt2(t3) && !N2(s4.memberList) && 0 < s4.memberList.length && (s4.memberList = void 0), this._canIUseJoinOption(t3) || N2(s4.joinOption) || (s4.joinOption = void 0), Pt2({ type: t3 })) {
        if (!S2(n3) && !Pt2({ groupID: n3 }))
          return E2({ code: k2.ILLEGAL_GRP_ID });
        s4.isSupportTopic = true === s4.isSupportTopic ? 1 : 0;
      }
      var u3 = new P2("createGroup"), l3 = (M2.l("".concat(c4, " options:"), s4), null), d4 = [];
      return this.req({ P: G2.CREATE_GRP, data: y2(y2({}, s4), {}, { ownerID: this.getMyUserID(), webPushFlag: 1 }) }).then(function(e5) {
        var t4, n4, o3, e5 = e5.data, i4 = e5.groupID, e5 = e5.overLimitUserIDList, a4 = void 0 === e5 ? [] : e5, e5 = (l3 = i4, d4 = a4, "groupType:".concat(s4.type, " groupID:").concat(i4, " overLimitUserIDList:").concat(a4));
        return u3.setMessage(e5).end(), M2.l("".concat(c4, " ok. ").concat(e5)), s4.type === R2.GRP_AVCHATROOM || s4.type === R2.GRP_COMMUNITY && 1 === s4.isSupportTopic || (S2(s4.memberList) || S2(a4) || (s4.memberList = s4.memberList.filter(function(e6) {
          return -1 === a4.indexOf(e6.userID);
        })), r3.updateGroupMap([y2(y2({}, s4), {}, { groupID: i4 })]), e5 = r3.get(2), o3 = "", t4 = 0, s4.type === R2.GRP_COMMUNITY ? (o3 = r3.isIntl() ? "Create Community" : "创建社群", t4 = 1) : o3 = r3.isIntl() ? "Create Group" : "创建群组", n4 = r3.get(4).getMyNick(), o3 = e5.createCustomMessage({ to: i4, conversationType: R2.CONV_GROUP, payload: { data: JSON.stringify({ businessID: "group_create", content: o3, cmd: t4, opUser: n4 || r3.getMyUserID(), version: 4 }) } }), e5.sendMessageInstance(o3), r3.emitGroupListUpdate()), r3.getGroupProfile({ groupID: i4 });
      }).then(function(e5) {
        var e5 = e5.data.group, t4 = e5.selfInfo, n4 = t4.nameCard, t4 = t4.joinTime;
        return e5.updateSelfInfo({ nameCard: n4, joinTime: t4, messageRemindType: R2.MSG_REMIND_ACPT_AND_NOTE, role: R2.GRP_MBR_ROLE_OWNER }), T2({ group: e5, overLimitUserIDList: d4 });
      }).catch(function(e5) {
        var t4;
        return u3.setMessage("groupType:".concat(s4.type)).setError(e5).end(), 10010 === e5.code || 10007 === e5.code ? (r3._silentlyGetGroupProfile(e5.code, l3), r3.updateGroupMap([y2(y2({}, s4), {}, { groupID: l3 })]), (t4 = r3.getLocalGroupProfile(l3)).selfInfo.role = R2.GRP_MBR_ROLE_OWNER, T2({ group: t4, overLimitUserIDList: d4 })) : (M2.e("".concat(c4, " failed. error:"), e5), E2(e5));
      });
    } }, { key: "dismissGroup", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("dismissGroup"), o3 = "groupID:".concat(e4), i4 = new P2("dismissGroup");
      return i4.setMessage(o3), M2.l("".concat(n3, " ").concat(o3)), this.req({ P: G2.DISMISS_GRP, data: { groupID: e4 } }).then(function() {
        return i4.end(), M2.l("".concat(n3, " ok")), t3.deleteLocalGroupAndConversation(e4), t3.checkJoinedAVChatRoomByID(e4) && t3._AVChatRoomHandler.reset(e4), t3._groupAttributesHandler.deleteLocalGroupAttributes(e4), T2({ groupID: e4 });
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "updateGroupProfile", value: function(e4) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("updateGroupProfile");
      return this.hasLocalGroup(e4.groupID) && (t3 = this.getLocalGroupProfile(e4.groupID).type, this._canIUseJoinOption(t3) || N2(e4.joinOption) || (M2.w("".concat(i4, " joinOption is unavailable for Work/Meeting/AVChatRoom")), e4.joinOption = void 0)), N2(e4.muteAllMembers) || (e4.muteAllMembers ? e4.muteAllMembers = "On" : e4.muteAllMembers = "Off"), e4.name && false === this._filterProfanity("name", e4) || e4.introduction && false === this._filterProfanity("introduction", e4) || e4.notification && false === this._filterProfanity("notification", e4) ? E2({ code: k2.PROFANITY_FOUND }) : ((n3 = new P2("updateGroupProfile")).setMessage(JSON.stringify(e4)), M2.l("".concat(i4, " groupID:").concat(e4.groupID)), this.req({ P: G2.UPDATE_GRP_PROFILE, data: e4 }).then(function() {
        return n3.end(), M2.l("".concat(i4, " ok")), o3.hasLocalGroup(e4.groupID) && o3.groupMap.get(e4.groupID).updateGroup(e4), T2({ group: o3.groupMap.get(e4.groupID) });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.l("".concat(i4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "_filterProfanity", value: function(e4, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e4], se2)).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e4] = o3, true));
    } }, { key: "joinGroup", value: function(t3) {
      var n3, o3 = this, i4 = t3.groupID, a4 = "".concat(this._n, ".joinGroup");
      return this.deleteUnjoinedAVChatRoom(i4), this.hasLocalGroup(i4) ? this.isLoggedIn() ? (n3 = new P2("applyJoinGroup"), this.getGroupProfile({ groupID: i4 }).then(function() {
        return n3.setMessage("groupID:".concat(i4, " joinedStatus:").concat(R2.JOIN_STATUS_ALREADY_IN_GROUP)).end(), D2({ status: R2.JOIN_STATUS_ALREADY_IN_GROUP });
      }).catch(function(e4) {
        return n3.setMessage("groupID:".concat(i4, " unjoined")).end(), M2.w("".concat(a4, " ").concat(i4, " was unjoined, now join!")), o3.groupMap.delete(i4), o3.applyJoinGroup(t3);
      })) : D2({ status: R2.JOIN_STATUS_ALREADY_IN_GROUP }) : (M2.l("".concat(a4, " groupID:").concat(i4)), this.isLoggedIn() ? this.applyJoinGroup(t3) : this._AVChatRoomHandler.joinWithoutAuth(t3));
    } }, { key: "applyJoinGroup", value: function(e4) {
      var c4, u3, l3 = this, d4 = "".concat(this._n, ".").concat("applyJoinGroup"), p4 = e4.groupID;
      return S2(e4.applyMessage) || false !== this._filterProfanity("applyMessage", e4) ? (c4 = new P2("applyJoinGroup"), e4 = y2({}, e4), (u3 = this.canIUse(g2.AV_HISTORY_MSG)) && (e4.historyMessageFlag = 1), this.get(11).deleteTopicRoamingInfo(p4), this.req({ P: G2.APPLY_JOIN_GRP, data: e4 }).then(function(e5) {
        var e5 = e5.data, t3 = e5.joinedStatus, n3 = e5.longPollingKey, o3 = e5.startSeq, i4 = e5.avChatRoomFlag, a4 = e5.avChatRoomKey, s4 = e5.messageList, e5 = "groupID:".concat(p4, " joinedStatus:").concat(t3, " longPollingKey:").concat(n3, " startSeq:").concat(o3) + " avChatRoomFlag:".concat(i4, " canGetAVChatRoomHistoryMsg:").concat(u3, ",") + " historyMsgCount:".concat(S2(s4) ? 0 : s4.length);
        switch (c4.setMessage(e5).end(), M2.l("".concat(d4, " ok. ").concat(e5)), t3) {
          case ot3:
            return T2({ status: ot3 });
          case nt3:
            return l3.getGroupProfile({ groupID: p4 }).then(function(e6) {
              e6 = e6.data.group;
              return l3._handleJoinResult({ group: e6, avChatRoomFlag: i4, longPollingKey: n3, startSeq: o3, avChatRoomKey: a4, messageList: s4 });
            }).catch(function(e6) {
              var t4;
              return 10010 === e6.code || 10007 === e6.code ? (l3._silentlyGetGroupProfile(e6.code, p4), t4 = new Yo({ groupID: p4 }), l3.updateGroupMap([t4]), l3._handleJoinResult({ group: t4, avChatRoomFlag: i4, longPollingKey: n3, startSeq: o3, avChatRoomKey: a4, messageList: s4 })) : (M2.e("".concat(d4, " failed. error:"), e6), E2(e6));
            });
          default:
            var r3 = new L2({ code: k2.JOIN_GRP_FAIL });
            return M2.e("".concat(d4, " failed. error:"), r3), E2(r3);
        }
      }).catch(function(e5) {
        return c4.setMessage("groupID:".concat(p4)).setError(e5).end(), M2.e("".concat(d4, " failed. error:"), e5), E2(e5);
      })) : E2({ code: k2.PROFANITY_FOUND });
    } }, { key: "_handleJoinResult", value: function(e4) {
      var t3 = this, n3 = e4.group, o3 = e4.avChatRoomFlag, i4 = e4.longPollingKey, a4 = e4.startSeq, s4 = e4.avChatRoomKey, r3 = e4.messageList, c4 = n3.groupID;
      return 1 === o3 ? (this.get(11).setCompleted("".concat(R2.CONV_GROUP).concat(c4)), this._groupAttributesHandler.initGroupAttributesCache({ groupID: c4, avChatRoomKey: s4 }), this._groupCountersHandler.initGroupCountersCache({ groupID: c4, avChatRoomKey: s4 }), (e4 = N2(i4) ? this._AVChatRoomHandler.handleJoinResult({ group: n3 }) : this._AVChatRoomHandler.startRunLoop({ group: n3, longPollingKey: i4, startSeq: a4 })).then(function() {
        t3._onAVChatRoomHistoryMessage(r3, c4);
      }), e4) : (this.emitGroupListUpdate(true, false), T2({ status: nt3, group: n3 }));
    } }, { key: "quitGroup", value: function(e4) {
      var t3, n3 = this, o3 = "".concat(this._n, ".").concat("quitGroup"), i4 = "groupID:".concat(e4), a4 = (M2.l("".concat(o3, " ").concat(i4)), this.checkJoinedAVChatRoomByID(e4));
      return a4 || this.hasLocalGroup(e4) ? a4 && !this.isLoggedIn() ? (M2.l("".concat(o3, " anonymously ok. ").concat(i4)), this.deleteLocalGroupAndConversation(e4), this._AVChatRoomHandler.reset(e4), D2({ groupID: e4 })) : ((t3 = new P2("quitGroup")).setMessage(i4), this.req({ P: G2.QUIT_GRP, data: { groupID: e4 } }).then(function() {
        return t3.end(), M2.l("".concat(o3, " ok")), n3.deleteLocalGroupAndConversation(e4), a4 && n3._AVChatRoomHandler.reset(e4), n3._groupAttributesHandler.deleteLocalGroupAttributes(e4), T2({ groupID: e4 });
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      })) : E2({ code: k2.MEMBER_NOT_IN_GRP });
    } }, { key: "searchGroupByID", value: function(e4) {
      var t3 = "".concat(this._n, ".").concat("searchGroupByID"), n3 = { groupIDList: [e4] }, o3 = new P2("searchGroupByID");
      return o3.setMessage("groupID:".concat(e4)), M2.l("".concat(t3, " groupID:").concat(e4)), this.req({ P: G2.SEARCH_GRP, data: n3 }).then(function(e5) {
        e5 = e5.data.groupProfile;
        if (0 !== e5[0].errorCode)
          throw new L2({ code: e5[0].errorCode, message: e5[0].errorInfo });
        return o3.end(), M2.l("".concat(t3, " ok")), T2({ group: new Yo(e5[0]) });
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.w("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "changeGroupOwner", value: function(i4) {
      var a4, s4 = this, r3 = "".concat(this._n, ".").concat("changeGroupOwner");
      return this.hasLocalGroup(i4.groupID) && this.getLocalGroupProfile(i4.groupID).type === R2.GRP_AVCHATROOM ? E2({ code: k2.CANNOT_CHANGE_OWNER_IN_AV }) : i4.newOwnerID === this.getMyUserID() ? E2({ code: k2.CANNOT_CHANGE_OWNER_TO_SELF }) : ((a4 = new P2("changeGroupOwner")).setMessage("groupID:".concat(i4.groupID, " newOwnerID:").concat(i4.newOwnerID)), M2.l("".concat(r3, " groupID:").concat(i4.groupID)), this.req({ P: G2.CHANGE_GRP_OWNER, data: i4 }).then(function() {
        a4.end(), M2.l("".concat(r3, " ok"));
        var e4, t3 = i4.groupID, n3 = i4.newOwnerID, o3 = (s4.groupMap.get(t3).ownerID = n3, s4._groupMemberHandler.getLocalGroupMemberList(t3));
        return o3 instanceof Map && (e4 = o3.get(s4.getMyUserID()), N2(e4) || (e4.updateRole("Member"), s4.groupMap.get(t3).selfInfo.role = "Member"), e4 = o3.get(n3), N2(e4) || e4.updateRole("Owner")), s4.emitGroupListUpdate(true, false), T2({ group: s4.groupMap.get(t3) });
      }).catch(function(e4) {
        return a4.setError(e4).end(), M2.e("".concat(r3, " failed. error:"), e4), E2(e4);
      }));
    } }, { key: "getGroupApplicationList", value: function() {
      return this._groupSystemNoticeHandler.getGroupApplicationList();
    } }, { key: "handleGroupApplication", value: function(e4) {
      var t3, n3, o3, i4, a4, s4 = this, r3 = "".concat(this._n, ".").concat("handleGroupApplication"), c4 = e4.handleAction, u3 = e4.handleMessage, l3 = e4.message, d4 = e4.application, p4 = (l3 ? (t3 = l3.payload.operatorID, n3 = l3.payload.groupProfile.groupID, o3 = l3.payload.authentication, i4 = l3.payload.messageKey) : d4 && (t3 = d4.applicant, n3 = d4.groupID, o3 = d4.authentication, i4 = d4.messageKey), G2.HANDLE_GRP_APPLICATION), _3 = (d4 && 2 === d4.applicationType && (p4 = G2.HANDLE_INVITE_JOIN_GRP, a4 = d4.userID), new P2("handleGroupApplication"));
      return _3.setMessage("groupID:".concat(n3)), M2.l("".concat(r3, " groupID:").concat(n3)), this.req({ P: p4, data: { handleAction: c4, handleMessage: u3, applicant: t3, invitee: a4, groupID: n3, authentication: o3, messageKey: i4 } }).then(function() {
        return _3.end(), M2.l("".concat(r3, " ok")), l3 && s4._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e4.message] }), T2({ group: s4.getLocalGroupProfile(n3) });
      }).catch(function(e5) {
        return _3.setError(e5).end(), M2.e("".concat(r3, " failed. error"), e5), E2(e5);
      });
    } }, { key: "handleGroupInvitation", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("handleGroupInvitation"), o3 = e4.message.payload, i4 = o3.groupProfile.groupID, a4 = o3.authentication, s4 = o3.messageKey, o3 = o3.operatorID, r3 = e4.handleAction, c4 = new P2("handleGroupInvitation");
      return c4.setMessage("groupID:".concat(i4, " inviter:").concat(o3, " handleAction:").concat(r3)), M2.l("".concat(n3, " groupID:").concat(i4, " inviter:").concat(o3, " handleAction:").concat(r3)), this.req({ P: G2.HANDLE_GRP_INVITATION, data: y2(y2({}, e4), {}, { inviter: o3, groupID: i4, authentication: a4, messageKey: s4 }) }).then(function() {
        return c4.end(), M2.l("".concat(n3, " ok")), t3._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e4.message] }), T2({ group: t3.getLocalGroupProfile(i4) });
      }).catch(function(e5) {
        return c4.setError(e5).end(), M2.e("".concat(n3, " failed. error"), e5), E2(e5);
      });
    } }, { key: "getGroupOnlineMemberCount", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".getGroupOnlineMemberCount"), e4 = this._AVChatRoomHandler.checkJoinedAVChatRoomByID(t3), i4 = this.hasLocalGroup(t3);
      if (M2.l("".concat(o3, " groupID:").concat(t3, " isAVChatRoom:").concat(e4, " has:").concat(i4)), e4)
        return this._AVChatRoomHandler.getGroupOnlineMemberCount(t3);
      if (!i4)
        return D2({ memberCount: 0 });
      e4 = Date.now();
      if (this._onlineMemberCountMap.has(t3)) {
        i4 = this._onlineMemberCountMap.get(t3);
        if (e4 - i4.lastReqTime <= 6e4)
          return D2({ memberCount: i4.memberCount });
        i4.lastReqTime = e4;
      }
      return this.requestOnlineCount(t3).then(function(e5) {
        e5 = e5.data.memberCount, e5 = void 0 === e5 ? 0 : e5;
        return n3._onlineMemberCountMap.set(t3, { lastReqTime: Date.now(), memberCount: e5 }), M2.l("".concat(o3, " ok. groupID:").concat(t3, " memberCount:").concat(e5)), D2({ memberCount: e5 });
      }).catch(function(e5) {
        return M2.w("".concat(o3, " failed. error:"), e5), Promise.reject(e5);
      });
    } }, { key: "requestOnlineCount", value: function(e4) {
      return this.req({ P: G2.GET_ONLINE_MBR_NUM, data: { groupID: e4 } });
    } }, { key: "hasLocalGroup", value: function(e4) {
      return this.groupMap.has(e4);
    } }, { key: "deleteLocalGroupAndConversation", value: function(e4) {
      var t3 = this.checkJoinedAVChatRoomByID(e4), n3 = (M2.l("".concat(this._n, ".deleteLocalGroupAndConversation groupID:").concat(e4, " isJoinedAVChatRoom:").concat(t3)), this.get(11)), o3 = "".concat(R2.CONV_GROUP).concat(e4);
      t3 && (this.stopMessageLongPolling({ groupID: e4 }), n3.deleteLocalConv(o3)), Pt2({ groupID: e4 }) && (t3 = this.getLocalGroupProfile(e4)) && true === t3.isSupportTopic && this.get(10).deleteTopicListInCommunity(e4), n3.clearUnreadCount(o3), n3.setCompleted(o3), this._deleteLocalGroup(e4), this._onlineMemberCountMap.delete(e4), this.emitGroupListUpdate(true, false);
    } }, { key: "_deleteLocalGroup", value: function(e4) {
      this.groupMap.delete(e4), this._groupMemberHandler.deleteGroupMemberList(e4);
    } }, { key: "sendMessage", value: function(e4, t3) {
      return O2(e4._receiverList) && 0 < e4._receiverList.length && !this.canIUse(g2.MSG_TO_SPECIFIED_GRP_MBR) ? this.noUse("Targeted Group Message") : (e4 = this.createGroupMessagePack(e4, t3), this.req(e4));
    } }, { key: "createGroupMessagePack", value: function(e4, t3) {
      var n3 = null, o3 = (t3 && t3.offlinePushInfo && (n3 = t3.offlinePushInfo), ""), i4 = (C2(e4.cloudCustomData) && 0 < e4.cloudCustomData.length && (o3 = e4.cloudCustomData), []), a4 = (m3(t3) && m3(t3.messageControlInfo) && (a4 = (r3 = t3.messageControlInfo).excludedFromUnreadCount, s4 = r3.excludedFromLastMessage, r3 = r3.excludedFromContentModeration, true === a4 && i4.push("NoUnread"), true === s4 && i4.push("NoLastMsg"), true === r3) && i4.push("NoMsgCheck"), void 0), s4 = (O2(e4._receiverList) && 0 < e4._receiverList.length && (a4 = e4._receiverList, 50 < e4._receiverList.length) && (a4 = e4._receiverList.slice(0, 50), this.warn("ReceiverListLimit")), this.isOnlineMessage(e4, t3) ? 1 : 0), r3 = JSON.parse(JSON.stringify(e4.getElements())), c4 = this.get(17).getFileDNList(), u3 = e4.getGroupAtInfoList(), r3 = { fromAccount: this.getMyUserID(), groupID: e4.to, msgBody: uo2(e4.type, r3, c4), cloudCustomData: o3, random: e4.random, priority: e4.priority, clientSequence: e4.clientSequence, groupAtInfo: e4.type !== R2.MSG_TEXT || S2(u3) ? void 0 : u3, onlineOnlyFlag: s4, clientTime: e4.clientTime, offlinePushInfo: Go2(n3), messageControlInfo: 0 == s4 ? i4 : void 0, needReadReceipt: true !== e4.needReadReceipt || this.isMessageFromOrToAVChatroom(e4.to) ? 0 : 1, receiverList: a4, isSupportExtension: true === e4.isSupportExtension ? 1 : 0, isRelayMessage: true === e4._relayFlag ? 1 : 0, cmConfigID: e4._cmConfigID, forbidCallbackControl: Ot2(t3) };
      return Ut2(e4.to) && (r3.groupID = Xt2(e4.to), r3.topicID = e4.to), { P: G2.SEND_GRP_MSG, data: r3 };
    } }, { key: "revokeMessage", value: function(e4) {
      var t3 = { groupID: e4.to, msgSeqList: [{ msgSeq: e4.sequence }] };
      return Ut2(e4.to) && (t3.groupID = Xt2(e4.to), t3.topicID = e4.to), this.req({ P: G2.REVOKE_GRP_MSG, data: t3 });
    } }, { key: "deleteMessage", value: function(e4) {
      var t3 = e4.to, e4 = e4.keyList, e4 = (M2.l("".concat(this._n, ".deleteMessage groupID:").concat(t3, " count:").concat(e4.length)), { groupID: t3, deleter: this.getMyUserID(), keyList: e4 });
      return Ut2(t3) && (e4.groupID = Xt2(t3), e4.topicID = t3), this.req({ P: G2.DEL_GRP_MSG, data: e4 });
    } }, { key: "modifyRemoteMessage", value: function(e4) {
      var t3 = e4.to, n3 = e4.sequence, o3 = e4.payload, i4 = e4.type, a4 = e4.version, a4 = void 0 === a4 ? 0 : a4, s4 = e4.cloudCustomData, e4 = e4._elements, r3 = t3, c4 = void 0, t3 = (Ut2(t3) && (r3 = Xt2(t3), c4 = t3), void 0);
      return Qt2(i4) && (1 < e4.length && e4.splice(0, 1, { type: i4, content: o3 }), t3 = e4), this.req({ P: G2.MODIFY_GRP_MSG, data: { groupID: r3, topicID: c4, sequence: n3, version: a4, elements: t3, cloudCustomData: s4 } });
    } }, { key: "getRoamingMessage", value: function(e4) {
      var r3 = this, c4 = "".concat(this._n, ".").concat("getRoamingMessage"), u3 = e4.conversationID, l3 = e4.groupID, e4 = e4.sequence, d4 = new P2("getRoamingMessage"), p4 = 0, _3 = void 0;
      return Ut2(l3) && (l3 = Xt2(_3 = l3)), this._computeLastSequence({ groupID: l3, topicID: _3, sequence: e4 }).then(function(e5) {
        return p4 = e5, M2.l("".concat(c4, " groupID:").concat(l3, " startSequence:").concat(p4)), r3.req({ P: G2.GET_GRP_ROAMING_MSG, data: { groupID: l3, count: 21, sequence: p4, topicID: _3 } });
      }).then(function(e5) {
        var t3 = e5.data, n3 = t3.messageList, o3 = t3.complete, t3 = t3.invisibleSequenceList, t3 = void 0 === t3 ? [] : t3, e5 = e5.data.nextSequence, e5 = void 0 === e5 ? 0 : e5, i4 = (N2(n3) ? M2.l("".concat(c4, " ok. complete:").concat(o3, " nextSequence:").concat(e5, " but messageList is undefined!")) : M2.l("".concat(c4, " ok. complete:").concat(o3, " nextSequence:").concat(e5, " count:").concat(n3.length)), d4.setMessage("groupID:".concat(l3, " topicID:").concat(_3, " startSequence:").concat(p4, " complete:").concat(o3, " nextSequence:").concat(e5)).end(), r3.get(11)), a4 = [], s4 = [], n3 = (S2(n3) || (a4 = i4.onRoamingMessage(n3, u3, true, s4), i4.updateIsRead(u3), i4.patchConvLastMessage(u3)), 2 === o3 || e5 < 1);
        return n3 && (i4.setCompleted(u3), e5 = ""), M2.l("".concat(c4, " isPullingCompleted:").concat(n3, " nextReqID:").concat(e5, " storedMsgCount:").concat(a4.length) + " invisibleSeqCount:".concat(t3.length)), { nextReqID: e5 + "", storedMessageList: a4, assembledMessageList: s4, isPullingCompleted: n3 };
      }).catch(function(e5) {
        return d4.setError(e5).setMessage("groupID:".concat(l3, " topicID:").concat(_3, " startSequence:").concat(p4)).end(), M2.w("".concat(c4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_getGroupIDOfMessage", value: function(e4) {
      return e4.conversationID.replace(R2.CONV_GROUP, "");
    } }, { key: "getReadReceiptList", value: function(n3) {
      var t3, o3 = "".concat(this._n, ".").concat("getReadReceiptList"), e4 = this._getGroupIDOfMessage(n3[0]), i4 = this.getMyUserID(), a4 = n3.filter(function(e5) {
        return e5.from === i4 && true === e5.needReadReceipt;
      }).map(function(e5) {
        return { sequence: e5.sequence };
      });
      return M2.l("".concat(o3, " groupID:").concat(e4, " sequenceList:").concat(JSON.stringify(a4))), 0 === a4.length ? D2({ messageList: n3 }) : ((t3 = new P2("getReadReceiptList")).setMessage("groupID:".concat(e4)), this.req({ P: G2.GET_READ_RECEIPT, data: { groupID: e4, sequenceList: a4 } }).then(function(e5) {
        t3.end(), M2.l("".concat(o3, " ok"));
        e5 = e5.data.readReceiptList;
        return O2(e5) && e5.forEach(function(t4) {
          n3.forEach(function(e6) {
            0 === t4.code && t4.sequence === e6.sequence && (e6.readReceiptInfo.readCount = t4.readCount, e6.readReceiptInfo.unreadCount = t4.unreadCount);
          });
        }), T2({ messageList: n3 });
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.w("".concat(o3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "sendReadReceipt", value: function(e4) {
      var t3 = "".concat(this._n, ".").concat("sendReadReceipt"), n3 = this._getGroupIDOfMessage(e4[0]), o3 = new P2("sendReadReceipt"), i4 = (o3.setMessage("groupID:".concat(n3)), this.getMyUserID()), e4 = e4.filter(function(e5) {
        return e5.from !== i4 && true === e5.needReadReceipt;
      }).map(function(e5) {
        return { sequence: e5.sequence };
      });
      return 0 === e4.length ? E2({ code: k2.READ_RECEIPT_MSG_LIST_EMPTY }) : (M2.l("".concat(t3, ". sequenceList:").concat(JSON.stringify(e4))), this.req({ P: G2.SEND_READ_RECEIPT, data: { groupID: n3, sequenceList: e4 } }).then(function(e5) {
        return o3.end(), M2.l("".concat(t3, " ok")), T2();
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.w("".concat(t3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "getReadReceiptDetail", value: function(e4) {
      var i4 = this, t3 = e4.message, n3 = e4.filter, o3 = e4.cursor, e4 = e4.count, a4 = this._getGroupIDOfMessage(t3), s4 = t3.ID, t3 = t3.sequence, r3 = "".concat(this._n, ".").concat("getReadReceiptDetail"), c4 = this._receiptDetailCompleteMap.get(s4) || false, u3 = 0 !== n3 && 1 !== n3 ? 0 : n3, n3 = C2(o3) ? o3 : "", o3 = !A2(e4) || e4 <= 0 || 100 <= e4 ? 100 : e4, e4 = "groupID:".concat(a4, " sequence:").concat(t3, " cursor:").concat(n3, " filter:").concat(u3, " completeFlag:").concat(c4), l3 = (M2.l("".concat(r3, " ").concat(e4)), { cursor: "", isCompleted: false, messageID: s4, unreadUserIDList: [], readUserIDList: [] }), d4 = new P2("getReadReceiptDetail");
      return d4.setMessage(e4), this.req({ P: G2.GET_READ_RECEIPT_DETAIL, data: { groupID: a4, sequence: t3, flag: u3, cursor: n3, count: o3 } }).then(function(e5) {
        d4.end();
        var e5 = e5.data, t4 = e5.cursor, n4 = e5.isCompleted, o4 = e5.unreadUserIDList, e5 = e5.readUserIDList;
        return l3.cursor = t4, 1 === n4 && (l3.isCompleted = true, i4._receiptDetailCompleteMap.set(s4, true)), 0 === u3 ? l3.readUserIDList = e5.map(function(e6) {
          return e6.userID;
        }) : 1 === u3 && (l3.unreadUserIDList = o4.map(function(e6) {
          return e6.userID;
        })), M2.l("".concat(r3, " ok")), T2(l3);
      }).catch(function(e5) {
        return d4.setError(e5).end(), M2.w("".concat(r3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getGroupReceiptsByUsers", value: function(e4) {
      var t3 = "".concat(this._n, ".").concat("getGroupReceiptsByUsers"), n3 = e4.groupID, e4 = e4.dataList, e4 = void 0 === e4 ? [] : e4, o3 = "groupID:".concat(n3, " dataList length:").concat(e4.length);
      return M2.l("".concat(t3, " ").concat(o3)), 0 === e4.length && M2.w("".concat(t3, " dataList is empty.")), this.req({ P: G2.GET_GRP_RECEIPTS_BY_USERS, data: { groupID: n3, dataList: e4 } }).then(function(e5) {
        e5 = e5.data.dataList, e5 = void 0 === e5 ? [] : e5;
        return M2.l("".concat(t3, " ok.")), T2({ dataList: e5 });
      }).catch(function(e5) {
        return M2.w("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getRoamingMessagesHopping", value: function(c4) {
      var u3 = this, l3 = "".concat(this._n, ".").concat("getRoamingMessagesHopping"), t3 = c4.groupID, n3 = c4.count, d4 = c4.sequence, p4 = c4.direction, o3 = void 0;
      return N2(d4) && 1 === p4 ? D2({ messageList: [], isCompleted: true, nextMessageSeq: "" }) : (Ut2(t3) && (t3 = Xt2(o3 = t3)), this._computeReqSeqHopping({ groupID: t3, topicID: o3, sequence: d4 }).then(function(e4) {
        N2(d4) || 1 !== p4 || (e4 = d4 + n3 - 1);
        var s4 = "".concat(o3 ? "topicID:".concat(o3) : "groupID:".concat(t3), " sequence:").concat(d4, " reqSeq:").concat(e4, " direction:").concat(p4), r3 = (M2.l("".concat(l3, " ").concat(s4)), new P2("getRoamingMessagesHopping"));
        return u3.req({ P: G2.GET_GRP_ROAMING_MSG, data: { groupID: t3, topicID: o3, count: n3, sequence: e4 } }).then(function(e5) {
          var e5 = e5.data, t4 = e5.messageList, t4 = void 0 === t4 ? [] : t4, n4 = e5.complete, o4 = e5.nextSequence, o4 = void 0 === o4 ? 0 : o4, e5 = e5.invisibleSequenceList, e5 = void 0 === e5 ? [] : e5, i4 = "complete:".concat(n4, " nextSequence:").concat(o4, " remoteMsgCount:").concat(t4.length, " invisibleSequenceList:").concat(e5), i4 = (r3.setMessage("".concat(s4, " ").concat(i4)).end(), M2.l("".concat(l3, " ok. ").concat(i4)), "".concat(R2.CONV_GROUP).concat(c4.groupID)), a4 = u3.get(11), i4 = a4.onRoamingMessage(t4, i4, false), t4 = u3._computeResult({ groupID: c4.groupID, direction: p4, sequence: d4, remoteMessageList: t4, processedMessageList: i4, complete: n4, nextSequence: o4, invisibleSequenceList: e5 });
          return a4.storeHoppingMessageList(t4.messageList), T2(t4);
        }).catch(function(e5) {
          return r3.setError(e5).setMessage("groupID:".concat(t3, " sequence:").concat(d4, " count:").concat(n3)).end(), M2.w("".concat(l3, " failed. error:"), e5), E2(e5);
        });
      }));
    } }, { key: "_computeReqSeqHopping", value: function(e4) {
      var n3 = this, o3 = e4.groupID, t3 = e4.topicID, t3 = void 0 === t3 ? void 0 : t3, e4 = e4.sequence, e4 = void 0 === e4 ? void 0 : e4;
      return 0 < e4 ? Promise.resolve(e4) : N2(t3) ? this.getGroupProfileAdvance({ groupIDList: [o3], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(function(e5) {
        var e5 = e5.data.successGroupList, t4 = 0;
        return S2(e5) || (t4 = e5[0].nextMessageSeq - 1), M2.l("".concat(n3._n, "._computeReqSeqHopping groupID:").concat(o3, " lastSequence:").concat(t4, " from remote")), t4;
      }).catch(function(e5) {
        return E2(e5);
      }) : Promise.resolve(0);
    } }, { key: "_computeResult", value: function(e4) {
      var t3 = { messageList: [], isCompleted: false, nextMessageSeq: "" }, n3 = e4.groupID, o3 = e4.direction, i4 = e4.sequence, a4 = e4.remoteMessageList, a4 = void 0 === a4 ? [] : a4, s4 = e4.processedMessageList, s4 = void 0 === s4 ? [] : s4, r3 = e4.complete, c4 = e4.nextSequence, e4 = e4.invisibleSequenceList;
      if (0 === o3)
        return t3.nextMessageSeq = c4, (2 === r3 || c4 < 1) && (t3.isCompleted = true, t3.nextMessageSeq = ""), t3.messageList = s4, t3;
      if (1 === o3) {
        if (S2(a4)) {
          if (S2(e4))
            return t3.isCompleted = true, t3.nextMessageSeq = "", t3;
          t3.nextMessageSeq = e4[0] + 1;
        } else {
          r3 = a4[0].sequence, c4 = e4[0] || 0;
          t3.nextMessageSeq = c4 < r3 ? r3 + 1 : c4 + 1;
        }
        return s4.forEach(function(e5) {
          e5.sequence >= i4 && t3.messageList.push(e5);
        }), (Pt2({ groupID: n3 }) || Ut2(n3)) && 0 === t3.messageList.length && a4[0].sequence < i4 && (t3.isCompleted = true, t3.nextMessageSeq = ""), t3;
      }
    } }, { key: "setMessageRead", value: function(e4) {
      var o3 = this, i4 = e4.conversationID, a4 = e4.lastMessageSeq, s4 = "".concat(this._n, ".").concat("setMessageRead"), e4 = "convID:".concat(i4, " lastMessageSeq:").concat(a4), r3 = (M2.l("".concat(s4, " ").concat(e4)), A2(a4) || this.warn("DoNotModifyLastSeq"), new P2("setMessageRead")), c4 = (r3.setMessage(e4), i4.replace(R2.CONV_GROUP, "")), u3 = void 0;
      return Ut2(c4) && (c4 = Xt2(u3 = c4)), this.req({ P: G2.SET_GRP_MSG_READ, data: { groupID: c4, topicID: u3, messageReadSeq: a4 } }).then(function() {
        r3.end(), M2.l("".concat(s4, " ok"));
        var e5, t3 = o3.get(11), n3 = (t3.updateIsReadAfterReadReport({ conversationID: i4, lastMessageSeq: a4 }), true);
        return !N2(u3) && (n3 = false, e5 = o3.get(10).getLocalTopic(c4, u3)) && e5.updateSelfInfo({ readedSequence: a4 }), t3.updateUnreadCount(i4, n3), T2();
      }).catch(function(e5) {
        return r3.setError(e5).end(), M2.l("".concat(s4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_computeLastSequence", value: function(e4) {
      var t3 = e4.groupID, n3 = e4.topicID, n3 = void 0 === n3 ? void 0 : n3, e4 = e4.sequence;
      return 0 < e4 ? Promise.resolve(e4) : N2(n3) ? this.getGroupLastSequence(t3) : Promise.resolve(0);
    } }, { key: "getGroupLastSequence", value: function(e4) {
      var t3 = "".concat(this._n, ".").concat("getGroupLastSequence"), n3 = new P2("getGroupLastSequence"), o3 = 0, i4 = "", a4 = "groupID:".concat(e4);
      if (this.hasLocalGroup(e4)) {
        var s4 = this.getLocalGroupProfile(e4), r3 = s4.lastMessage;
        if (0 < r3.lastSequence && false === r3.onlineOnlyFlag)
          return o3 = r3.lastSequence, i4 = "".concat(a4, ", ").concat(o3, " from group.lastMessage.lastSequence"), M2.l("".concat(t3, " ").concat(i4)), n3.setMessage(i4).end(), Promise.resolve(o3);
        if (1 < s4.nextMessageSeq)
          return o3 = s4.nextMessageSeq - 1, i4 = "".concat(a4, ", ").concat(o3, " from group.nextMessageSeq"), M2.l("".concat(t3, " ").concat(i4)), n3.setMessage(i4).end(), Promise.resolve(o3);
      }
      r3 = this.get(11).getLocalConversation("GROUP".concat(e4));
      return r3 && r3.lastMessage.lastSequence && false === r3.lastMessage.onlineOnlyFlag ? (o3 = r3.lastMessage.lastSequence, i4 = "".concat(a4, ", ").concat(o3, " from conversation.lastMessage.lastSequence"), M2.l("".concat(t3, " ").concat(i4)), n3.setMessage(i4).end(), Promise.resolve(o3)) : this.getGroupProfileAdvance({ groupIDList: [e4], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(function(e5) {
        e5 = e5.data.successGroupList;
        return S2(e5) ? M2.w("".concat(t3, " ").concat(a4, ", empty successGroupList")) : (o3 = e5[0].nextMessageSeq - 1, i4 = "".concat(a4, ", ").concat(o3, " from remote"), M2.l("".concat(t3, " ").concat(i4))), n3.setMessage(i4).end(), o3;
      }).catch(function(e5) {
        return n3.setError(e5).setMessage(a4).end(), M2.w("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "isMessageFromOrToAVChatroom", value: function(e4) {
      return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e4);
    } }, { key: "hasJoinedAVChatRoom", value: function() {
      return this._AVChatRoomHandler.hasJoinedAVChatRoom();
    } }, { key: "getJoinedAVChatRoom", value: function() {
      return this._AVChatRoomHandler.getJoinedAVChatRoom();
    } }, { key: "getGroupRemoteLastSeq", value: function(e4) {
      e4 = this.getLocalGroupProfile(e4);
      return e4 ? e4.nextMessageSeq - 1 : 1;
    } }, { key: "isOnlineMessage", value: function(e4, t3) {
      return !(!this._canIUseOnlineOnlyFlag(e4) || !t3 || true !== t3.onlineUserOnly);
    } }, { key: "_canIUseOnlineOnlyFlag", value: function(e4) {
      var t3 = this.getJoinedAVChatRoom();
      return !t3 || !t3.includes(e4.to) || e4.conversationType !== R2.CONV_GROUP;
    } }, { key: "_onAVChatRoomHistoryMessage", value: function(e4, t3) {
      var n3;
      S2(e4) || (M2.l("".concat(this._n, "._onAVChatRoomHistoryMessage groupID:").concat(t3, " count:").concat(e4.length)), n3 = [], e4.forEach(function(e5) {
        n3.push(y2(y2({}, e5), {}, { isHistoryMessage: 1 }));
      }), this.onAVChatRoomMessage(n3, t3));
    } }, { key: "onAVChatRoomMessage", value: function(e4) {
      this._AVChatRoomHandler.onMessage(e4, 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "");
    } }, { key: "onAVChatRoomMemberBanned", value: function(e4) {
      this._AVChatRoomHandler.onAVChatRoomMemberBanned(e4);
    } }, { key: "setUnjoinedAVChatRoom", value: function(e4) {
      this._unjoinedAVChatRoomList.set(e4, 1);
    } }, { key: "deleteUnjoinedAVChatRoom", value: function(e4) {
      this._unjoinedAVChatRoomList.has(e4) && this._unjoinedAVChatRoomList.delete(e4);
    } }, { key: "isUnjoinedAVChatRoom", value: function(e4) {
      return this._unjoinedAVChatRoomList.has(e4);
    } }, { key: "isGroupAttributesUpdatedNotice", value: function(e4) {
      return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e4);
    } }, { key: "updateLocalMainSequenceOnReconnected", value: function() {
      this._groupAttributesHandler.updateLocalMainSequenceOnReconnected();
    } }, { key: "initGroupAttributes", value: function(e4) {
      return this._groupAttributesHandler.initGroupAttributes(e4);
    } }, { key: "setGroupAttributes", value: function(e4) {
      return this._groupAttributesHandler.setGroupAttributes(e4);
    } }, { key: "deleteGroupAttributes", value: function(e4) {
      return this._groupAttributesHandler.deleteGroupAttributes(e4);
    } }, { key: "getGroupAttributes", value: function(e4) {
      return this._groupAttributesHandler.getGroupAttributes(e4);
    } }, { key: "isMessageFromTopic", value: function(e4, t3) {
      return 2 === e4 && !S2(t3);
    } }, { key: "isMessageFromCommunityOfTopic", value: function(e4, t3) {
      return 2 === e4 && S2(t3);
    } }, { key: "getMessageExtensions", value: function(e4, t3) {
      return M2.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t3)), this.req({ P: G2.GET_GRP_MSG_EXT, data: { groupID: e4.to, messageSequence: e4.sequence, startSequence: t3 } });
    } }, { key: "modifyMsgExts", value: function(e4, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1;
      return M2.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n3)), this.req({ P: G2.MODIFY_GRP_MSG_EXT, data: { groupID: e4.to, messageSequence: e4.sequence, extensionList: t3, operateType: n3 } });
    } }, { key: "_genNotifyReqList", value: function(e4) {
      for (var t3, n3, o3, i4, a4 = [], s4 = 0, r3 = e4.length; s4 < r3; s4++)
        t3 = e4[s4], i4 = this.getLocalGroupProfile(t3).type, n3 = this._getGroupLastRevokedTime(t3), o3 = 1e3 * Ye3(), i4 = { notifyType: 1, limit: 20, type: Pt2({ type: i4, groupID: t3 }) ? R2.GRP_COMMUNITY : void 0, groupID: t3, beginTime: n3, endTime: o3 }, a4.push(i4);
      return a4;
    } }, { key: "getNotice", value: function(e4) {
      var r3 = this, t3 = "".concat(this._n, ".getNotice"), e4 = e4.filter(function(e5) {
        var t4;
        return !!r3.hasLocalGroup(e5) && (t4 = (e5 = r3.getLocalGroupProfile(e5)).type, e5 = e5.isSupportTopic, !Gt2(t4)) && !e5;
      });
      0 !== e4.length && (M2.l("".concat(t3, " list:").concat(e4)), this.req({ P: G2.GET_GRP_NOTIFY, data: { notifyReqList: this._genNotifyReqList(e4) } }).then(function(e5) {
        var i4, a4, e5 = e5.data.notifyRspList, s4 = [];
        O2(e5) && (i4 = { dataList: [] }, a4 = "".concat(t3, " ok."), e5.forEach(function(e6) {
          var t4 = e6.nextRevokedTime, n3 = e6.groupID, o3 = e6.notifyList;
          a4 += " groupID:".concat(n3, " nextRevokedTime:").concat(t4, " count:").concat(o3.length, "\n"), i4.dataList.push({ elements: { revokedInfos: r3._genRevokedInfos(e6) } }), 0 !== t4 ? (r3._setGroupLastRevokedTime(n3, t4), s4.push(n3)) : r3._setGroupLastRevokedTime(n3, 1e3 * Ye3());
        }), M2.l(a4), r3.onMsgRevoked(i4, false)), 0 < s4.length && r3.getNotice(s4);
      }).catch(function(e5) {
        M2.e("".concat(t3, " failed. error:"), e5);
      }));
    } }, { key: "_genRevokedInfos", value: function(e4) {
      var t3 = e4.notifyList, n3 = e4.groupID, o3 = [];
      return O2(t3) && t3.forEach(function(e5) {
        o3.push({ groupID: n3, sequence: e5.sequence, random: e5.random, revokerInfo: y2({}, e5.revokerInfo) });
      }), o3;
    } }, { key: "_getGroupLastRevokedTime", value: function(e4) {
      return this.hasLocalGroup(e4) ? this.getLocalGroupProfile(e4)._lastRevokedTime : 0;
    } }, { key: "_setGroupLastRevokedTime", value: function(e4, t3) {
      this.hasLocalGroup(e4) && (this.getLocalGroupProfile(e4)._lastRevokedTime = t3);
    } }, { key: "isGroupCountersNotice", value: function(e4) {
      return this._groupCountersHandler.isGroupCountersNotice(e4);
    } }, { key: "setGroupCounters", value: function(e4) {
      return this._groupCountersHandler.setGroupCounters(e4);
    } }, { key: "increaseGroupCounter", value: function(e4) {
      return this._groupCountersHandler.increaseGroupCounter(e4);
    } }, { key: "decreaseGroupCounter", value: function(e4) {
      return this._groupCountersHandler.decreaseGroupCounter(e4);
    } }, { key: "getGroupCounters", value: function(e4) {
      return this._groupCountersHandler.getGroupCounters(e4);
    } }, { key: "getGroupMemberHandler", value: function() {
      return this._groupMemberHandler;
    } }, { key: "getGroupMemberList", value: function(e4) {
      return this._groupMemberHandler.getGroupMemberList(e4);
    } }, { key: "getGroupMemberProfile", value: function(e4) {
      return this._groupMemberHandler.getGroupMemberProfile(e4);
    } }, { key: "addGroupMember", value: function(e4) {
      return this._groupMemberHandler.addGroupMember(e4);
    } }, { key: "deleteGroupMember", value: function(e4) {
      return this._groupMemberHandler.deleteGroupMember(e4);
    } }, { key: "setGroupMemberMuteTime", value: function(e4) {
      return this._groupMemberHandler.setGroupMemberMuteTime(e4);
    } }, { key: "setGroupMemberRole", value: function(e4) {
      return this._groupMemberHandler.setGroupMemberRole(e4);
    } }, { key: "setGroupMemberNameCard", value: function(e4) {
      return this._groupMemberHandler.setGroupMemberNameCard(e4);
    } }, { key: "setGroupMemberCustomField", value: function(e4) {
      return this._groupMemberHandler.setGroupMemberCustomField(e4);
    } }, { key: "markGroupMemberList", value: function(e4) {
      return this._groupMemberHandler.markGroupMemberList(e4);
    } }, { key: "modifyGroupMemberInfo", value: function(e4) {
      return this._groupMemberHandler.modifyGroupMemberInfo(e4);
    } }, { key: "restartPolling", value: function() {
      this._AVChatRoomHandler.restartPolling();
    } }, { key: "getPollingTimerID", value: function(e4) {
      var t3;
      return e4 && (t3 = this.getLocalGroupProfile(e4)) && Gt2(t3.type) ? this._AVChatRoomHandler.getPollingTimerID(e4) : -1;
    } }, { key: "_canIUseJoinOption", value: function(e4) {
      return e4 === R2.GRP_PUBLIC || Pt2({ type: e4 });
    } }, { key: "_silentlyGetGroupProfile", value: function(e4, t3) {
      var n3 = setTimeout(this.getGroupProfile.bind(this, { groupID: t3 }), 3e3);
      this._timeoutIDs.push(n3), M2.l("".concat(this._n, "._silentlyGetGroupProfile errorCode:").concat(e4, " groupID:").concat(t3, " timeoutIDs:").concat(this._timeoutIDs));
    } }, { key: "_clearTimeoutIDs", value: function() {
      this._timeoutIDs.forEach(function(e4) {
        e4 && clearTimeout(e4);
      }), this._timeoutIDs = [];
    } }, { key: "startMessageLongPolling", value: function(e4) {
      var t3, n3 = e4.groupID, o3 = e4.longPollingKey, e4 = e4.longPollingSequence, e4 = void 0 === e4 ? 1 : e4, i4 = this.get(12).isUnlimitedAVChatRoom();
      if (!S2(o3))
        return this._AVChatRoomHandler.hasPollingInstance(n3) && this.stopMessageLongPolling({ groupID: n3 }), t3 = this._AVChatRoomHandler.getJoinedLiveList(), !i4 && 0 < t3.length && this.stopMessageLongPolling({ groupID: t3[0] }), i4 = new Yo({ groupID: n3, type: R2.GRP_LIVE }), M2.l("".concat(this._n, ".startMessageLongPolling groupID:").concat(n3, " longPollingKey:").concat(o3, " longPollingSequence:").concat(e4)), this._AVChatRoomHandler.startRunLoop({ group: i4, longPollingKey: o3, startSeq: e4 });
      index.__f__("warn", "at node_modules/@tencentcloud/chat/index.js:1", "".concat(this._n, ".startMessageLongPolling longPollingKey is empty."));
    } }, { key: "stopMessageLongPolling", value: function(e4) {
      var e4 = e4.groupID, t3 = this.get(11);
      return this._AVChatRoomHandler.reset(e4), this._deleteLocalGroup(e4), t3.deleteLocalConv("".concat(R2.CONV_GROUP).concat(e4)), M2.l("".concat(this._n, ".stopMessageLongPolling ok, groupID:").concat(e4)), D2({ groupID: e4 });
    } }, { key: "reset", value: function() {
      this.groupMap.clear(), this._unjoinedAVChatRoomList.clear(), this._receiptDetailCompleteMap.clear(), this._onlineMemberCountMap.clear(), this._commonGroupHandler.reset(), this._groupSystemNoticeHandler.reset(), this._groupTipsHandler.reset(), this._groupAttributesHandler.reset(), this._groupCountersHandler.reset(), this._AVChatRoomHandler.reset(), this._groupMemberHandler.reset(), this._clearTimeoutIDs();
    } }])), di2 = ["topicID", "topicName", "avatar", "introduction", "notification", "unreadCount", "muteAllMembers", "customData", "groupAtInfoList", "nextMessageSeq", "selfInfo"], pi2 = e3(function e4(t3, n3) {
      p3(this, e4), this.topicID = "", this.topicName = "", this.avatar = "", this.introduction = "", this.notification = "", this.unreadCount = 0, this.muteAllMembers = false, this.customData = "", this.groupAtInfoList = [], this.nextMessageSeq = 0, this.lastMessage = qo2(t3.lastMessage, n3), this.selfInfo = { muteTime: 0, readedSequence: 0, messageRemindType: "", excludedUnreadSequenceList: void 0 }, this._initTopic(t3);
    }, [{ key: "_initTopic", value: function(e4) {
      for (var t3 in e4)
        di2.indexOf(t3) < 0 || ("selfInfo" === t3 ? this.updateSelfInfo(e4[t3]) : this[t3] = "muteAllMembers" === t3 ? 1 === e4[t3] : e4[t3]);
    } }, { key: "updateUnreadCount", value: function() {
      this.unreadCount = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0;
    } }, { key: "updateNextMessageSeq", value: function(e4) {
      this.nextMessageSeq = e4;
    } }, { key: "updateLastMessage", value: function(e4) {
      this.lastMessage = qo2(e4);
    } }, { key: "updateGroupAtInfoList", value: function(e4) {
      this.groupAtInfoList = JSON.parse(JSON.stringify(e4));
    } }, { key: "updateTopic", value: function(e4) {
      N2(e4.selfInfo) || this.updateSelfInfo(e4.selfInfo), N2(e4.muteAllMembers) || (this.muteAllMembers = 1 === e4.muteAllMembers), ht3(this, e4, ["groupID", "lastMessageTime", "selfInfo", "muteAllMembers", "lastMsg"]);
    } }, { key: "updateSelfInfo", value: function(e4) {
      return 0 === ht3(this.selfInfo, e4, [], [""]);
    } }, { key: "reduceUnreadCount", value: function() {
      return 1 <= this.unreadCount && (--this.unreadCount, true);
    } }, { key: "isLastMessageRevoked", value: function(e4) {
      return e4.sequence === this.lastMessage.lastSequence;
    } }, { key: "setLastMessageRevoked", value: function(e4) {
      this.lastMessage.isRevoked = e4;
    } }, { key: "setLastMessageRevoker", value: function(e4) {
      this.lastMessage.revoker = e4;
    } }]), _i2 = (t2(Di2, c3), e3(Di2, [{ key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("topic_cache_time"), t3 = this.getCloudConfig("topic_last_active_time");
      N2(e4) || (this.TOPIC_CACHE_TIME = Number(e4)), N2(t3) || (this.TOPIC_LAST_ACTIVE_TIME = Number(t3));
    } }, { key: "onTopicCreated", value: function(e4) {
      var t3 = e4.groupID;
      this.resetGetTopicTime(t3), this.emitOEvt(h3.TOPIC_CREATED, e4);
    } }, { key: "onTopicDeleted", value: function(e4) {
      var t3 = this, n3 = e4.groupID, o3 = e4.topicIDList;
      (void 0 === o3 ? [] : o3).forEach(function(e5) {
        t3._deleteLocalTopic(n3, e5);
      }), this.emitOEvt(h3.TOPIC_DELETED, e4);
    } }, { key: "onTopicProfileUpdated", value: function(e4) {
      var t3 = e4.groupID, n3 = e4.topicID, n3 = this.getLocalTopic(t3, n3);
      n3 && (n3.updateTopic(e4), this.emitOEvt(h3.TOPIC_UPDATED, { groupID: t3, topic: n3 }));
    } }, { key: "onTopicLatestMsg", value: function(e4) {
      var t3, n3, e4 = e4 || {}, o3 = e4.topicLatestMessage, e4 = e4.excludedUnreadSequenceList;
      S2(o3) || (t3 = o3.groupProfile.topicID, o3.conversationType = R2.CONV_GROUP, o3.to = t3, (n3 = new So2(o3)).setElement(o3.elements), this.updateUnreadCountAndLastMsg(t3, n3, e4));
    } }, { key: "onMessageRemindTypeUpdated", value: function(e4) {
      var t3, n3 = e4.groupID, o3 = e4.topicID, e4 = e4.messageRemindType, i4 = this.getLocalTopic(n3, o3);
      i4 && ((t3 = i4.updateSelfInfo({ messageRemindType: e4 })) && this.emitOEvt(h3.TOPIC_UPDATED, { groupID: n3, topic: i4 }), M2.l("".concat(this._n, ".onMessageRemindTypeUpdated topicID:").concat(o3, " messageRemindType:").concat(e4, " isUpdated:").concat(t3)));
    } }, { key: "onAtInfoUpdated", value: function(e4) {
      var t3 = e4.topicID, e4 = e4.groupAtInfoList, n3 = Xt2(t3), t3 = this.getLocalTopic(n3, t3);
      t3 && !N2(e4) && (t3.updateGroupAtInfoList(e4), this.emitOEvt(h3.TOPIC_UPDATED, { groupID: n3, topic: t3 }));
    } }, { key: "onUnreadCountUpdatedFromConv", value: function(e4) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, n3 = Xt2(e4), e4 = this.getLocalTopic(n3, e4);
      e4 && e4.unreadCount !== t3 && (e4.updateUnreadCount(t3), 0 === t3 && e4.updateSelfInfo({ readedSequence: e4.lastMessage.lastSequence }), this.emitOEvt(h3.TOPIC_UPDATED, { groupID: n3, topic: e4 }));
    } }, { key: "onMessageSent", value: function(e4) {
      var t3, n3, o3 = e4.groupID, i4 = e4.topicID, e4 = e4.lastMessage, i4 = this.getLocalTopic(o3, i4);
      i4 && (n3 = (t3 = void 0 === (t3 = e4.sequence) ? 0 : t3) + 1) > i4.nextMessageSeq && (i4.updateNextMessageSeq(n3), i4.updateLastMessage(e4), i4.updateSelfInfo({ readedSequence: t3 }), i4.updateUnreadCount(0), this.emitOEvt(h3.TOPIC_UPDATED, { groupID: o3, topic: i4 }));
    } }, { key: "onMessageModified", value: function(e4) {
      var t3, n3 = e4.to, o3 = e4.time, i4 = e4.sequence, a4 = e4.elements, s4 = e4.cloudCustomData, r3 = e4.messageVersion, c4 = Xt2(n3), u3 = this.getLocalTopic(c4, n3);
      u3 && (t3 = u3.lastMessage, M2.d("".concat(this._n, ".onMessageModified topicID:").concat(n3, " lastMessage:"), JSON.stringify(t3), "options:", JSON.stringify(e4)), t3) && (null === t3.payload || t3.lastTime === o3 && t3.lastSequence === i4 && t3.version !== r3) && (t3.type = a4[0].type, t3.payload = a4[0].content, t3.messageForShow = Zt2(t3.type, t3.payload, this.isIntl()), t3.cloudCustomData = s4, t3.version = r3, t3.lastSequence = i4, t3.lastTime = o3, this.emitOEvt(h3.TOPIC_UPDATED, { groupID: c4, topic: u3 }));
    } }, { key: "onMessageRevoked", value: function(e4) {
      var n3, o3, i4, a4 = this;
      0 !== e4.length && (o3 = n3 = null, i4 = false, e4.forEach(function(e5) {
        var t3 = e5.to;
        o3 = Xt2(t3), (n3 = a4.getLocalTopic(o3, t3)) && (n3.reduceUnreadCount() && (i4 = true), n3.isLastMessageRevoked(e5) && (n3.setLastMessageRevoked(true), n3.setLastMessageRevoker(e5.revoker), i4 = true), (t3 = n3.selfInfo.excludedUnreadSequenceList || []).push(e5.sequence), n3.updateSelfInfo({ excludedUnreadSequenceList: t3 }));
      }), i4) && this.emitOEvt(h3.TOPIC_UPDATED, { groupID: o3, topic: n3 });
    } }, { key: "isLastMessageRevoked", value: function(e4) {
      var t3 = e4.topicID, e4 = e4.sequence, n3 = Xt2(t3), n3 = this.getLocalTopic(n3, t3), t3 = false;
      return t3 = n3 ? n3.isLastMessageRevoked({ sequence: e4 }) : t3;
    } }, { key: "updateUnreadCountAndLastMsg", value: function(e4, t3, n3) {
      var o3, i4 = Xt2(e4), a4 = this.getLocalTopic(i4, e4);
      a4 && (o3 = a4.selfInfo.excludedUnreadSequenceList || [], N2(n3) || (o3 = n3), t3._isExcludedFromUnreadCount && o3.push(t3.sequence), a4.updateSelfInfo({ excludedUnreadSequenceList: o3 }), M2.l("".concat(this._n, ".updateUnreadCountAndLastMsg seq:").concat(t3.sequence, " lastSeq:").concat(a4.lastMessage.lastSequence)), t3.sequence > a4.lastMessage.lastSequence) && (a4.updateLastMessage(t3), n3 = t3.sequence + 1, a4.updateNextMessageSeq(n3), o3 = this._computeUnreadCount(a4), a4.updateUnreadCount(o3), (t3 = this.get(11).getLocalConversation("".concat(R2.CONV_GROUP).concat(e4))) && t3.updateUnreadCount({ nextUnreadCount: o3, isFromGetConversations: true }), this.emitOEvt(h3.TOPIC_UPDATED, { groupID: i4, topic: a4 }));
    } }, { key: "getJoinedCommunityList", value: function() {
      return this.get(7).syncCommunityWithTopic();
    } }, { key: "createTopicInCommunity", value: function(t3) {
      var n3, o3 = this, i4 = "".concat(this._n, ".").concat("createTopicInCommunity"), e4 = t3.topicID;
      return N2(e4) || Ut2(e4) ? t3.topicName && false === this._filterProfanity("topicName", t3) || t3.introduction && false === this._filterProfanity("introduction", t3) || t3.notification && false === this._filterProfanity("notification", t3) ? E2({ code: k2.PROFANITY_FOUND }) : (n3 = new P2("createTopicInCommunity"), this.req({ P: G2.CREATE_TOPIC, data: y2({}, t3) }).then(function(e5) {
        e5 = e5.data.topicID;
        return n3.setMessage("topicID:".concat(e5)).end(), M2.l("".concat(i4, " ok. topicID:").concat(e5)), o3._updateTopicMap([y2(y2({}, t3), {}, { topicID: e5 })]), T2({ topicID: e5 });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : E2({ code: k2.ILLEGAL_TOPIC_ID });
    } }, { key: "deleteTopicFromCommunity", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("deleteTopicFromCommunity"), a4 = e4.groupID, e4 = e4.topicIDList, e4 = void 0 === e4 ? [] : e4, s4 = new P2("deleteTopicFromCommunity");
      return s4.setMessage("groupID:".concat(a4, " topicIDList:").concat(e4)), this.req({ P: G2.DEL_TOPIC, data: { groupID: a4, topicIDList: e4 } }).then(function(e5) {
        var e5 = e5.data.resultList, o3 = [], i4 = [], e5 = ((void 0 === e5 ? [] : e5).forEach(function(e6) {
          var t4 = e6.topicID, n4 = e6.errorCode, e6 = e6.errorInfo;
          0 === n4 ? o3.push({ topicID: t4 }) : i4.push({ topicID: t4, code: n4, message: e6 });
        }), "success count:".concat(o3.length, ", fail count:").concat(i4.length));
        return s4.setMoreMessage(e5).end(), M2.l("".concat(n3, " ok. ").concat(e5)), o3.forEach(function(e6) {
          t3._deleteLocalTopic(a4, e6.topicID);
        }), T2({ successTopicList: o3, failureTopicList: i4 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "updateTopicProfile", value: function(e4) {
      var t3, n3 = this, o3 = "".concat(this._n, ".").concat("updateTopicProfile");
      return M2.l("".concat(o3, " options:"), e4), e4.topicName && false === this._filterProfanity("topicName", e4) || e4.introduction && false === this._filterProfanity("introduction", e4) || e4.notification && false === this._filterProfanity("notification", e4) ? E2({ code: k2.PROFANITY_FOUND }) : ((t3 = new P2("updateTopicProfile")).setMessage("groupID:".concat(e4.groupID, " topicID:").concat(e4.topicID)), N2(e4.muteAllMembers) || (e4.muteAllMembers = true === e4.muteAllMembers ? "On" : "Off"), this.req({ P: G2.UPDATE_TOPIC_PROFILE, data: y2({}, e4) }).then(function() {
        return t3.end(), M2.l("".concat(o3, " ok")), n3._updateTopicMap([e4]), T2({ topic: n3.getLocalTopic(e4.groupID, e4.topicID) });
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "getTopicList", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("getTopicList"), o3 = e4.groupID, e4 = e4.topicIDList, e4 = void 0 === e4 ? [] : e4, i4 = 0 === e4.length, c4 = new P2("getTopicList");
      if (c4.setMessage("groupID:".concat(o3)), this._getTopicTimeMap.has(o3)) {
        var a4 = this._getTopicTimeMap.get(o3), s4 = a4.isGetAll, a4 = a4.time;
        if ((s4 || !s4 && !i4) && Date.now() - a4 < 1e3 * this.TOPIC_CACHE_TIME) {
          s4 = this._getLocalTopicList(o3, e4);
          if (i4 || s4.length === e4.length)
            return c4.setMoreMessage("from cache, topic count:".concat(s4.length)).end(), M2.l("".concat(n3, " groupID:").concat(o3, " from cache, topic count:").concat(s4.length)), D2({ successTopicList: s4, failureTopicList: [] });
        }
      }
      return this.req({ P: G2.GET_TOPIC_LIST, data: { groupID: o3, topicIDList: e4 } }).then(function(e5) {
        var e5 = e5.data.topicInfoList, a5 = [], s5 = [], r3 = [], e5 = ((void 0 === e5 ? [] : e5).forEach(function(e6) {
          var t4 = e6.topic, n4 = e6.selfInfo, o4 = e6.errorCode, e6 = e6.errorInfo, i5 = t4.topicID;
          0 === o4 ? (a5.push(y2(y2({}, t4), {}, { selfInfo: n4 })), s5.push(i5)) : r3.push({ topicID: i5, code: o4, message: e6 });
        }), t3._updateTopicMap(a5), t3._handleTopicAtInfo(a5), "success count:".concat(s5.length, ", fail count:").concat(r3.length)), e5 = (c4.setMoreMessage(e5).end(), M2.l("".concat(n3, " groupID:").concat(o3, " from remote, ").concat(e5)), []);
        return S2(s5) || (t3._getTopicTimeMap.set(o3, { time: Date.now(), isGetAll: i4 }), e5 = t3._getLocalTopicList(o3, s5)), T2({ successTopicList: e5, failureTopicList: r3 });
      }).catch(function(e5) {
        return c4.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "hasLocalTopic", value: function(e4, t3) {
      return !!this._topicMap.has(e4) && this._topicMap.get(e4).has(t3);
    } }, { key: "getLocalTopic", value: function(e4, t3) {
      var n3 = null;
      return n3 = this._topicMap.has(e4) ? this._topicMap.get(e4).get(t3) : n3;
    } }, { key: "_getLocalTopicList", value: function(e4) {
      var t3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : [], e4 = this._topicMap.get(e4), n3 = [];
      return e4 && (n3 = d3(e4.values())), 0 === t3.length ? n3 : n3.filter(function(e5) {
        return t3.includes(e5.topicID);
      });
    } }, { key: "_deleteLocalTopic", value: function(e4, t3) {
      this._topicMap.has(e4) && this._topicMap.get(e4).has(t3) && (this._topicMap.get(e4).delete(t3), M2.l("".concat(this._n, "._deleteLocalTopic groupID:").concat(e4, " topicID:").concat(t3)));
    } }, { key: "_updateTopicMap", value: function(e4) {
      var i4 = this, a4 = [];
      e4.forEach(function(e5) {
        var t3 = e5.groupID, n3 = e5.topicID, o3 = null, e5 = (i4._topicMap.has(t3) || i4._topicMap.set(t3, /* @__PURE__ */ new Map()), i4._topicMap.get(t3).has(n3) ? (o3 = i4._topicMap.get(t3).get(n3)).updateTopic(e5) : (i4._getTopicLastMessage(e5), o3 = new pi2(e5, i4.isIntl()), i4._topicMap.get(t3).set(n3, o3)), i4._computeUnreadCount(o3));
        o3.updateUnreadCount(e5), a4.push({ conversationID: "".concat(R2.CONV_GROUP).concat(n3), type: R2.CONV_TOPIC, unreadCount: e5 });
      }), 0 < a4.length && this.get(11).updateTopicConversation(a4);
    } }, { key: "resetGetTopicTime", value: function(e4) {
      var t3 = this;
      N2(e4) ? d3(this._getTopicTimeMap.keys()).forEach(function(e5) {
        t3._getTopicTimeMap.set(e5, 0);
      }) : this._getTopicTimeMap.set(e4, 0);
    } }, { key: "getTopicListOnReconnected", value: function() {
      var o3 = this, e4 = d3(this._topicMap.keys()), i4 = [], a4 = this.get(11);
      e4.forEach(function(e5) {
        var n3 = [], t3 = o3._getLocalTopicList(e5);
        a4.deleteTopicRoamingInfo(e5), t3.forEach(function(e6) {
          var t4 = e6.lastMessage.lastTime, t4 = void 0 === t4 ? 0 : t4;
          Date.now() - 1e3 * t4 < 1e3 * o3.TOPIC_LAST_ACTIVE_TIME && n3.push(e6.topicID);
        }), 0 < n3.length && i4.push({ groupID: e5, topicIDList: n3 });
      }), M2.l("".concat(this._n, ".getTopicListOnReconnected. active community count:").concat(i4.length)), this._relayGetTopicList(i4);
    } }, { key: "_relayGetTopicList", value: function(t3) {
      var e4, n3, o3, i4 = this;
      0 !== t3.length && (n3 = 5 < (e4 = t3.shift()).topicIDList.length ? "topicIDList.length:".concat(e4.topicIDList.length) : "topicIDList:".concat(e4.topicIDList), (o3 = new P2("relayGetTopicList")).setMessage(n3), M2.l("".concat(this._n, "._relayGetTopicList. ").concat(n3)), this.getTopicList(e4).then(function() {
        o3.end(), i4._relayGetTopicList(t3);
      }).catch(function(e5) {
        o3.setError(e5).end(), i4._relayGetTopicList(t3);
      }));
    } }, { key: "_handleTopicAtInfo", value: function(e4) {
      var i4 = this;
      0 !== e4.length && e4.forEach(function(e5) {
        var t3 = e5.groupID, n3 = e5.topicID, e5 = e5.groupAtInfoList, o3 = [];
        N2(e5) || (e5.forEach(function(e6) {
          o3.push(y2(y2({}, e6), {}, { groupID: t3, topicID: n3 }));
        }), i4.get(11).onNewGroupAtTips({ dataList: o3 }));
      });
    } }, { key: "_getTopicLastMessage", value: function(e4) {
      var t3;
      N2(e4.lastMsg) || (t3 = { time: e4.lastMsg.time, sequence: e4.lastMsg.sequence, from: e4.lastMsg.from, payload: e4.lastMsg.elements[0] ? e4.lastMsg.elements[0].content : null, type: e4.lastMsg.elements[0] ? e4.lastMsg.elements[0].type : "", nick: e4.lastMsg.nick, avatar: e4.lastMsg.avatar, version: e4.lastMsg.messageVersion, cloudCustomData: e4.lastMsg.cloudCustomData, isRevoked: 2 === e4.lastMsg.isPlaceMessage, revoker: S2(e4.lastMsg.revokerInfo) ? null : e4.lastMsg.revokerInfo.revoker }, e4.lastMessage = t3);
    } }, { key: "deleteTopicListInCommunity", value: function(t3) {
      var n3 = this, e4 = this._getLocalTopicList(t3), o3 = this.get(11);
      e4.forEach(function(e5) {
        e5 = e5.topicID;
        n3._deleteLocalTopic(t3, e5), n3._getTopicTimeMap.delete(t3), o3.deleteLocalConv("".concat(R2.CONV_GROUP).concat(e5));
      });
    } }, { key: "_computeUnreadCount", value: function(t3) {
      var n3, e4 = t3.selfInfo, o3 = e4.excludedUnreadSequenceList, i4 = e4.readedSequence, e4 = t3.nextMessageSeq - t3.selfInfo.readedSequence - 1;
      return O2(o3) && (n3 = 0, o3.forEach(function(e5) {
        i4 < e5 && e5 <= t3.nextMessageSeq - 1 && (n3 += 1);
      }), 1 <= n3) && (e4 -= n3), e4 < 0 ? 0 : e4;
    } }, { key: "_filterProfanity", value: function(e4, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e4], se2)).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e4] = o3, true));
    } }, { key: "getMessageExtensions", value: function(e4, t3) {
      M2.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t3));
      var n3 = Xt2(e4.to);
      return this.req({ P: G2.GET_GRP_MSG_EXT, data: { groupID: n3, topicID: e4.to, messageSequence: e4.sequence, startSequence: t3 } });
    } }, { key: "modifyMsgExts", value: function(e4, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1, o3 = (M2.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n3)), Xt2(e4.to));
      return this.req({ P: G2.MODIFY_GRP_MSG_EXT, data: { groupID: o3, topicID: e4.to, messageSequence: e4.sequence, extensionList: t3, operateType: n3 } });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._topicMap.clear(), this._getTopicTimeMap.clear(), this.TOPIC_CACHE_TIME = 300, this.TOPIC_LAST_ACTIVE_TIME = 3600;
    } }])), hi2 = e3(function e4(t3) {
      p3(this, e4), this._userM = t3, this._n = "ProfileHandler", this.TAG = "profile", this.accountProfileMap = /* @__PURE__ */ new Map(), this.expirationTime = 864e5;
    }, [{ key: "setExpirationTime", value: function(e4) {
      this.expirationTime = e4;
    } }, { key: "getUserProfile", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("getUserProfile"), o3 = e4.userIDList;
      e4.fromAccount = this._userM.getMyAccount(), 100 < o3.length && (M2.w("".concat(n3, " ").concat(tn2(100))), o3.length = 100);
      for (var i4, a4 = [], s4 = [], r3 = 0, c4 = o3.length; r3 < c4; r3++)
        i4 = o3[r3], this._userM.isMyFriend(i4) && this._contains(i4) ? s4.push(this._getProfileFromMap(i4)) : a4.push(i4);
      if (0 === a4.length)
        return D2(s4);
      e4.toAccount = a4;
      var u3 = e4.bFromGetMyProfile || false, l3 = [], d4 = (e4.toAccount.forEach(function(e5) {
        l3.push({ toAccount: e5, standardSequence: 0, customSequence: 0 });
      }), e4.userItem = l3, new P2("getUserProfile"));
      return d4.setMessage(5 < o3.length ? "userIDList.length:".concat(o3.length) : "userIDList:".concat(o3)), this._userM.req({ P: G2.GET_USER_PROFILE, data: e4 }).then(function(e5) {
        d4.end(), M2.i("".concat(n3, " ok"));
        e5 = t3._handleResponse(e5).concat(s4);
        return T2(u3 ? e5[0] : e5);
      }).catch(function(e5) {
        return d4.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "getMyProfile", value: function() {
      var e4, t3 = this._userM.getMyAccount(), n3 = "".concat(this._n, ".getMyProfile");
      return M2.l("".concat(n3, " myAccount:").concat(t3)), this._fill(), this._contains(t3) ? (e4 = this._getProfileFromMap(t3), M2.d("".concat(n3, " from cache, myProfile:").concat(JSON.stringify(e4))), D2(e4)) : this.getUserProfile({ fromAccount: t3, userIDList: [t3], bFromGetMyProfile: true });
    } }, { key: "_handleResponse", value: function(e4) {
      var t3 = e4.data.userProfileItem;
      if (!O2(t3))
        return [];
      for (var n3 = [], e4 = Date.now(), o3 = 0, i4 = t3.length; o3 < i4; o3++) {
        var a4 = t3[o3], s4 = a4.to, a4 = a4.profileItem;
        "@TLS#NOT_FOUND" !== s4 && "" !== s4 && (s4 = this._update(s4, this._getLatestProfileFromResponse(s4, a4)).latestProfile, n3.push(s4));
      }
      return M2.l("".concat(this._n, "._handleResponse cost:").concat(an2(e4))), n3;
    } }, { key: "_getLatestProfileFromResponse", value: function(e4, t3) {
      var n3 = { userID: e4, profileCustomField: [] };
      if (!S2(t3))
        for (var o3 = 0, i4 = t3.length; o3 < i4; o3++)
          if (-1 < t3[o3].tag.indexOf("Tag_Profile_Custom"))
            n3.profileCustomField.push({ key: t3[o3].tag, value: t3[o3].value });
          else
            switch (t3[o3].tag) {
              case f3.NICK:
                n3.nick = t3[o3].value;
                break;
              case f3.GENDER:
                n3.gender = t3[o3].value;
                break;
              case f3.BIRTHDAY:
                n3.birthday = t3[o3].value;
                break;
              case f3.LOCATION:
                n3.location = t3[o3].value;
                break;
              case f3.SELFSIGNATURE:
                n3.selfSignature = t3[o3].value;
                break;
              case f3.ALLOWTYPE:
                n3.allowType = t3[o3].value;
                break;
              case f3.LANGUAGE:
                n3.language = t3[o3].value;
                break;
              case f3.AVATAR:
                n3.avatar = t3[o3].value;
                break;
              case f3.MESSAGESETTINGS:
                n3.messageSettings = t3[o3].value;
                break;
              case f3.ADMINFORBIDTYPE:
                n3.adminForbidType = t3[o3].value;
                break;
              case f3.LEVEL:
                n3.level = t3[o3].value;
                break;
              case f3.ROLE:
                n3.role = t3[o3].value;
                break;
              default:
                M2.w("".concat(this._n, "._getLatestProfileFromResponse unknown tag:"), t3[o3].tag, t3[o3].value);
            }
      return n3;
    } }, { key: "updateMyProfile", value: function(o3) {
      var i4 = this, a4 = "".concat(this._n, ".").concat("updateMyProfile");
      if (o3.nick && false === this._userM.filterProfanity("nick", o3))
        return E2({ code: k2.PROFANITY_FOUND });
      if (o3.selfSignature && false === this._userM.filterProfanity("selfSignature", o3))
        return E2({ code: k2.PROFANITY_FOUND });
      var s4 = new P2("updateMyProfile"), e4 = (s4.setMessage(JSON.stringify(o3)), new Ho().validate(o3));
      if (!e4.valid)
        return s4.setCode(k2.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(e4.tips)).end(), M2.e("".concat(a4, " info:").concat(e4.tips)), E2({ code: k2.UPDATE_PROFILE_INVALID_PARAM });
      var t3, r3, n3 = [];
      for (t3 in o3)
        Object.prototype.hasOwnProperty.call(o3, t3) && ("profileCustomField" === t3 ? o3.profileCustomField.forEach(function(e5) {
          n3.push({ tag: e5.key, value: e5.value });
        }) : n3.push({ tag: f3[t3.toUpperCase()], value: o3[t3] }));
      return 0 === n3.length ? (e4 = new L2({ code: k2.UPDATE_PROFILE_NO_KEY }), s4.setError(e4).end(), M2.e("".concat(a4, " failed. error:"), e4), E2(e4)) : (r3 = this._userM.getMyAccount(), this._userM.req({ P: G2.UPDATE_MY_PROFILE, data: { fromAccount: r3, profileItem: n3 } }).then(function(e5) {
        s4.end(), M2.i("".concat(a4, " ok"));
        var t4 = i4._update(r3, o3), n4 = t4.isProfileUpdated, t4 = t4.latestProfile;
        return true === n4 && i4._userM.emitOEvt(h3.PROFILE_UPDATED, [t4]), D2(t4);
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(a4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "onProfileModified", value: function(e4) {
      var t3 = e4.dataList;
      if (!S2(t3)) {
        var n3 = t3.length;
        M2.d("".concat(this._n, ".onProfileModified count:").concat(n3, " dataList:"), e4.dataList);
        for (var o3 = [], i4 = 0; i4 < n3; i4++) {
          var a4 = t3[i4].userID, a4 = this._update(a4, this._getLatestProfileFromResponse(a4, t3[i4].profileList)), s4 = a4.isProfileUpdated, a4 = a4.latestProfile;
          true === s4 && o3.push(a4);
        }
        0 < o3.length && (this._userM.emitIEvt(U2.PROFILE_UPDATED, o3), this._userM.emitOEvt(h3.PROFILE_UPDATED, o3));
      }
    } }, { key: "_fill", value: function() {
      if (0 === this.accountProfileMap.size) {
        for (var e4 = this._getCachedProfiles(), t3 = Date.now(), n3 = 0, o3 = e4.length; n3 < o3; n3++)
          t3 - e4[n3].lastUpdatedTime < this.expirationTime && this.accountProfileMap.set(e4[n3].userID, e4[n3]);
        M2.l("".concat(this._n, "._fill from cache, size:").concat(this.accountProfileMap.size));
      }
    } }, { key: "_update", value: function(e4, t3) {
      var n3, o3 = false, i4 = Date.now();
      return this._contains(e4) ? (n3 = this._getProfileFromMap(e4), t3.profileCustomField && true === Rt2(n3.profileCustomField, t3.profileCustomField) && (n3.lastUpdatedTime = i4, o3 = true), 0 < ht3(n3, t3, ["profileCustomField"]) && (n3.lastUpdatedTime = i4, o3 = true)) : (n3 = new Ho(t3), !this._userM.isMyFriend(e4) && e4 !== this._userM.getMyAccount() || (n3.lastUpdatedTime = i4, o3 = true, this.accountProfileMap.set(e4, n3))), this._flush(e4 === this._userM.getMyAccount()), true === o3 && M2.l("".concat(this._n, "._update account:").concat(e4, " isUpdated:").concat(o3)), { isProfileUpdated: o3, latestProfile: n3 };
    } }, { key: "_flush", value: function(e4) {
      var t3 = d3(this.accountProfileMap.values()), n3 = this._userM.getStorageModule();
      M2.d("".concat(this._n, "._flush length:").concat(t3.length, " flushAtOnce:").concat(e4)), n3.setItem(this.TAG, t3, e4);
    } }, { key: "_contains", value: function(e4) {
      return this.accountProfileMap.has(e4);
    } }, { key: "_getProfileFromMap", value: function(e4) {
      return this.accountProfileMap.get(e4);
    } }, { key: "_getCachedProfiles", value: function() {
      var e4 = this._userM.getStorageModule().getItem(this.TAG);
      return S2(e4) ? [] : e4;
    } }, { key: "onConvProfileUpdated", value: function(e4) {
      for (var t3, n3, o3, i4 = [], a4 = 0, s4 = e4.length; a4 < s4; a4++)
        n3 = (t3 = e4[a4]).userID, this._userM.isMyFriend(n3) && (this._contains(n3) ? (o3 = this._getProfileFromMap(n3), 0 < ht3(o3, t3) && i4.push(n3)) : i4.push(t3.userID));
      0 !== i4.length && (M2.l("".concat(this._n, ".onConvProfileUpdated toAccountList:").concat(i4)), this.getUserProfile({ userIDList: i4 }));
    } }, { key: "getNickAndAvatarByUserID", value: function(e4) {
      return this._contains(e4) ? { nick: (e4 = this._getProfileFromMap(e4)).nick, avatar: e4.avatar } : { nick: "", avatar: "" };
    } }, { key: "getUserNickAndAvatar", value: function(e4) {
      var t3, n3 = this, o3 = d3(new Set(e4)), i4 = (M2.l("".concat(this._n, ".getUserNickAndAvatar userIDList.length:").concat(e4.length, " uniqueUserIDList.length:").concat(o3.length)), []);
      return 0 === e4.length ? Promise.resolve(i4) : (e4 = this._createUserIDListGroup(o3), t3 = [], e4.forEach(function(e5) {
        t3.push(n3.getUserProfile({ userIDList: e5 }));
      }), Promise.all(t3).then(function(e5) {
        return e5.forEach(function(e6) {
          e6 = e6.data.map(function(e7) {
            return { userID: e7.userID, nick: e7.nick, avatar: e7.avatar };
          });
          i4.push.apply(i4, d3(e6));
        }), i4;
      }));
    } }, { key: "_createUserIDListGroup", value: function(e4) {
      for (var t3 = [], n3 = 0; n3 < e4.length; )
        t3.push(e4.slice(n3, n3 += 100));
      return t3;
    } }, { key: "reset", value: function() {
      this._flush(true), this.accountProfileMap.clear();
    } }]), gi2 = e3(function e4(t3) {
      p3(this, e4);
    }), fi2 = e3(function e4(t3) {
      p3(this, e4), this._userM = t3, this._n = "BlacklistHandler", this._blacklistMap = /* @__PURE__ */ new Map(), this._startIndex = 0;
    }, [{ key: "getLocalBlacklist", value: function() {
      return d3(this._blacklistMap.keys());
    } }, { key: "getBlacklist", value: function() {
      var o3 = this, i4 = "".concat(this._n, ".getBlacklist"), e4 = { fromAccount: this._userM.getMyAccount(), maxLimited: 100, startIndex: this._startIndex }, a4 = new P2("getBlacklist");
      return this._userM.req({ P: G2.GET_BL, data: e4 }).then(function(e5) {
        var e5 = e5.data, t3 = e5.blackListItem, e5 = e5.startIndex, n3 = S2(t3) ? 0 : t3.length;
        a4.setMessage("count:".concat(n3)).end(), M2.i("".concat(i4, " ok")), o3._startIndex = e5, o3._handleResponse(t3, true), o3._userM.emitOEvt(h3.BLACKLIST_UPDATED, d3(o3._blacklistMap.keys())), 0 !== o3._startIndex && o3.getBlacklist();
      }).catch(function(e5) {
        return a4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "addBlacklist", value: function(t3) {
      var e4, n3, o3 = this, i4 = new P2("addToBlacklist"), a4 = "".concat(this._n, ".addBlacklist"), s4 = this._userM.getMyAccount();
      return 1 === t3.userIDList.length && t3.userIDList[0] === s4 ? (n3 = this._userM.getErrMsg(e4 = k2.CANNOT_ADD_SELF_TO_BLACKLIST), i4.setCode(e4).setMessage(n3).end(), n3 = new L2({ code: e4 }), M2.e("".concat(a4, " failed. error:"), n3), E2(n3)) : (t3.userIDList.includes(s4) && (t3.userIDList = t3.userIDList.filter(function(e5) {
        return e5 !== s4;
      })), t3.fromAccount = this._userM.getMyAccount(), t3.toAccount = t3.userIDList, this._userM.req({ P: G2.ADD_TO_BL, data: t3 }).then(function(e5) {
        return i4.setMessage(5 < t3.userIDList.length ? "userIDList.length:".concat(t3.userIDList.length) : "userIDList:".concat(t3.userIDList)).end(), M2.i("".concat(a4, " ok")), o3._handleResponse(e5.resultItem, true), T2(d3(o3._blacklistMap.keys()));
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.e("".concat(a4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "_handleResponse", value: function(e4, t3) {
      if (!S2(e4))
        for (var n3, o3, i4, a4 = 0, s4 = e4.length; a4 < s4; a4++)
          o3 = e4[a4].to, i4 = e4[a4].resultCode, !N2(i4) && 0 !== i4 || (t3 ? ((n3 = this._blacklistMap.has(o3) ? this._blacklistMap.get(o3) : new gi2()).userID = o3, S2(e4[a4].addBlackTimeStamp) || (n3.timeStamp = e4[a4].addBlackTimeStamp), this._blacklistMap.set(o3, n3)) : this._blacklistMap.has(o3) && (n3 = this._blacklistMap.get(o3), this._blacklistMap.delete(o3)));
      M2.l("".concat(this._n, "._handleResponse total:").concat(this._blacklistMap.size, " bAdd:").concat(t3));
    } }, { key: "deleteBlacklist", value: function(t3) {
      var n3 = this, o3 = "".concat(this._n, ".deleteBlacklist"), i4 = new P2("removeFromBlacklist");
      return t3.fromAccount = this._userM.getMyAccount(), t3.toAccount = t3.userIDList, this._userM.req({ P: G2.RM_FROM_BL, data: t3 }).then(function(e4) {
        return i4.setMessage(5 < t3.userIDList.length ? "userIDList.length:".concat(t3.userIDList.length) : "userIDList:".concat(t3.userIDList)).end(), M2.i("".concat(o3, " ok")), n3._handleResponse(e4.data.resultItem, false), T2(d3(n3._blacklistMap.keys()));
      }).catch(function(e4) {
        return i4.setError(e4).end(), M2.e("".concat(o3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "onAccountDeleted", value: function(e4) {
      for (var t3 = 0, n3 = e4.length; t3 < n3; t3++) {
        var o3 = e4[t3];
        this._blacklistMap.has(o3) && this._blacklistMap.delete(o3);
      }
      var i4 = e4.length;
      0 < i4 && (M2.l("".concat(this._n, ".onAccountDeleted count:").concat(i4, " ").concat(i4 < 30 ? "userIDList:".concat(e4) : "")), this._userM.emitOEvt(h3.BLACKLIST_UPDATED, d3(this._blacklistMap.keys())));
    } }, { key: "onAccountAdded", value: function(e4) {
      for (var t3, n3 = [], o3 = 0, i4 = e4.length; o3 < i4; o3++)
        t3 = e4[o3], this._blacklistMap.has(t3) || (this._blacklistMap.set(t3, new gi2({ userID: t3 })), n3.push(t3));
      0 < n3.length && (M2.l("".concat(this._n, ".onAccountAdded count:").concat(n3.length, " userIDList:"), n3), this._userM.emitOEvt(h3.BLACKLIST_UPDATED, d3(this._blacklistMap.keys())));
    } }, { key: "reset", value: function() {
      this._blacklistMap.clear(), this._startIndex = 0;
    } }]), mi2 = e3(function e4(t3) {
      p3(this, e4), this._userM = t3, this._n = "UserStatusHandler", this.MAX_QUERY_USER_COUNT = 500, this.MAX_SUBSCRIBE_USER_COUNT = 100, this.MAX_UNSUBSCRIBE_USER_COUNT = 100, this._userM.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var e4 = this._userM.getCloudConfig("status_query_count"), t3 = this._userM.getCloudConfig("status_sub_count"), n3 = this._userM.getCloudConfig("status_unsub_count");
      M2.l("".concat(this._n, "._onCloudConfig statusQueryCount:").concat(e4, " statusSubscribeCount:").concat(t3) + " statusUnsubscribeCount:".concat(n3)), N2(e4) || (this.MAX_QUERY_USER_COUNT = parseInt(e4, 10)), N2(e4) || (this.MAX_SUBSCRIBE_USER_COUNT = parseInt(t3, 10)), N2(e4) || (this.MAX_UNSUBSCRIBE_USER_COUNT = parseInt(n3, 10));
    } }, { key: "onUserStatusUpdated", value: function(e4) {
      var e4 = e4.dataList, o3 = this._userM.getMyUserID(), i4 = this._userM.get(12), e4 = e4.map(function(e5) {
        var t3 = e5.to, n3 = e5.statusType, e5 = e5.customStatus, e5 = xo2(e5);
        return t3 === o3 && i4.setCustomStatus(e5), { userID: t3, statusType: n3, customStatus: e5 };
      });
      M2.l("".concat(this._n, ".onUserStatusUpdated list:").concat(JSON.stringify(e4))), this._userM.emitOEvt(h3.USER_STATUS_UPDATED, e4);
    } }, { key: "setSelfStatus", value: function(e4) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".setSelfStatus");
      return false === this._userM.filterProfanity("customStatus", e4) ? E2({ code: k2.PROFANITY_FOUND }) : (t3 = new P2("setSelfStatus"), n3 = e4.customStatus, this._userM.req({ P: G2.SET_SELF_STATUS, data: { customStatus: n3 } }).then(function(e5) {
        return t3.setMessage("customStatus:".concat(n3)).end(), M2.l("".concat(i4, " ok. customStatus:").concat(n3)), o3._userM.get(12).setCustomStatus(n3), T2({ userID: o3._userM.getMyUserID(), statusType: 1, customStatus: n3 });
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "getUserStatus", value: function(e4) {
      var o3 = "".concat(this._n, ".").concat("getUserStatus"), e4 = e4.userIDList, i4 = void 0 === e4 ? [] : e4, e4 = this._userM.getMyUserID(), t3 = d3(i4), a4 = void 0, n3 = t3.indexOf(e4);
      if (-1 < n3 && (t3.splice(n3, 1), a4 = { userID: e4, statusType: 1, customStatus: this._userM.get(12).getCustomStatus() }), 0 === t3.length)
        return D2({ successUserList: [a4], failureUserList: [] });
      if (!this._userM.canIUse(g2.USER_STATUS))
        return this._userM.noUse("getUserStatus");
      t3.length > this.MAX_QUERY_USER_COUNT && (M2.w("".concat(o3, " ").concat(tn2(this.MAX_QUERY_USER_COUNT))), t3 = i4.slice(0, this.MAX_QUERY_USER_COUNT));
      var s4 = new P2("getUserStatus");
      return this._userM.req({ P: G2.GET_USER_STATUS, data: { userIDList: t3 } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.successUserList, t4 = void 0 === t4 ? [] : t4, e5 = e5.failureUserList, e5 = void 0 === e5 ? [] : e5, t4 = t4.map(function(e6) {
          var t5 = e6.userID, n5 = e6.statusType, e6 = e6.customStatus;
          return { userID: t5, statusType: n5, customStatus: xo2(e6) };
        }), e5 = e5.map(function(e6) {
          var t5 = e6.userID, n5 = e6.invalidUserID, o4 = e6.errorCode, e6 = e6.errorInfo;
          return { userID: S2(n5) ? t5 : n5, code: o4, message: e6 };
        }), n4 = (N2(a4) || t4.unshift(a4), "userID count:".concat(i4.length, ", success count:").concat(t4.length, ", fail count:").concat(e5.length));
        return s4.setMessage("".concat(n4)).end(), M2.l("".concat(o3, " ok. ").concat(n4, ".")), T2({ successUserList: t4, failureUserList: e5 });
      }).catch(function(e5) {
        return s4.setMessage("userID count:".concat(i4.length)).setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "subscribeUserStatus", value: function(e4) {
      var t3, n3, o3, i4, a4 = "subscribeUserStatus";
      return this._userM.canIUse(g2.USER_STATUS) ? (t3 = "".concat(this._n, ".").concat(a4), (n3 = d3(e4 = void 0 === (e4 = e4.userIDList) ? [] : e4)).length > this.MAX_SUBSCRIBE_USER_COUNT && (M2.w("".concat(t3, " ").concat(tn2(this.MAX_SUBSCRIBE_USER_COUNT))), n3 = e4.slice(0, this.MAX_SUBSCRIBE_USER_COUNT)), o3 = new P2(a4), i4 = "userID count:".concat(e4.length), M2.l("".concat(t3, " ").concat(i4)), this._userM.req({ P: G2.SUB_USER_STATUS, data: { userIDList: n3 } }).then(function(e5) {
        e5 = e5.data.failureUserList, e5 = (void 0 === e5 ? [] : e5).map(function(e6) {
          var t4 = e6.userID, n4 = e6.invalidUserID, o4 = e6.errorCode, e6 = e6.errorInfo;
          return { userID: S2(n4) ? t4 : n4, code: o4, message: e6 };
        });
        return o3.setMessage("".concat(i4, " fail count:").concat(e5.length)).end(), M2.l("".concat(t3, " ok. fail count:").concat(e5.length, ".")), T2({ failureUserList: e5 });
      }).catch(function(e5) {
        return o3.setMessage(i4).setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._userM.noUse(a4);
    } }, { key: "unsubscribeUserStatus", value: function(e4) {
      var t3, n3, o3, i4, a4 = "unsubscribeUserStatus";
      return this._userM.canIUse(g2.USER_STATUS) ? (t3 = "".concat(this._n, ".").concat(a4), n3 = d3(e4 = void 0 === (e4 = (e4 || {}).userIDList) ? [] : e4), e4.length > this.MAX_UNSUBSCRIBE_USER_COUNT && (M2.w("".concat(t3, " ").concat(tn2(this.MAX_UNSUBSCRIBE_USER_COUNT))), n3 = e4.slice(0, this.MAX_UNSUBSCRIBE_USER_COUNT)), o3 = new P2(a4), i4 = "userID count:".concat(e4.length), M2.l("".concat(t3, " ").concat(i4)), e4 = { userIDList: n3 }, 0 === n3.length && (e4.userIDList = void 0, e4.unsubscribeAll = 1), this._userM.req({ P: G2.UNSUB_USER_STATUS, data: e4 }).then(function(e5) {
        e5 = e5.data.failureUserList, e5 = (void 0 === e5 ? [] : e5).map(function(e6) {
          var t4 = e6.userID, n4 = e6.invalidUserID, o4 = e6.errorCode, e6 = e6.errorInfo;
          return { userID: S2(n4) ? t4 : n4, code: o4, message: e6 };
        });
        return o3.setMessage("".concat(i4, " fail count:").concat(e5.length)).end(), M2.l("".concat(t3, " ok. fail count:").concat(e5.length, ".")), T2({ failureUserList: e5 });
      }).catch(function(e5) {
        return o3.setMessage("".concat(i4)).setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this._userM.noUse(a4);
    } }, { key: "reset", value: function() {
      this.MAX_QUERY_USER_COUNT = 500, this.MAX_SUBSCRIBE_USER_COUNT = 100, this.MAX_UNSUBSCRIBE_USER_COUNT = 100;
    } }]), vi2 = (t2(Ti2, c3), e3(Ti2, [{ key: "onContextUpdated", value: function(e4) {
      this._profileHandler.getMyProfile(), this._blacklistHandler.getBlacklist();
    } }, { key: "mockOnNickAvatarModified", value: function(e4, t3) {
      M2.l("".concat(this._n, "._mockOnNickAvatarModified nick:").concat(e4, " avatar:").concat(t3)), this.onProfileModified({ dataList: [{ pushType: 1, userID: this.getMyUserID(), profileList: [{ tag: f3.NICK, value: e4 }, { tag: f3.AVATAR, value: t3 }] }] });
    } }, { key: "onProfileModified", value: function(e4) {
      this._profileHandler.onProfileModified(e4);
    } }, { key: "onRelationChainModified", value: function(e4) {
      var t3, n3, e4 = e4.dataList;
      S2(e4) || (t3 = [], e4.forEach(function(e5) {
        e5.blackListDelAccount && t3.push.apply(t3, d3(e5.blackListDelAccount));
      }), 0 < t3.length && this._blacklistHandler.onAccountDeleted(t3), n3 = [], e4.forEach(function(e5) {
        e5.blackListAddAccount && n3.push.apply(n3, d3(e5.blackListAddAccount));
      }), 0 < n3.length && this._blacklistHandler.onAccountAdded(n3));
    } }, { key: "onConvProfileUpdated", value: function(e4) {
      this._profileHandler.onConvProfileUpdated(e4);
    } }, { key: "getMyAccount", value: function() {
      return this.getMyUserID();
    } }, { key: "getMyNick", value: function() {
      return this._profileHandler.getNickAndAvatarByUserID(this.getMyUserID()).nick;
    } }, { key: "getMyProfile", value: function() {
      return this._profileHandler.getMyProfile();
    } }, { key: "getStorageModule", value: function() {
      return this.get(13);
    } }, { key: "filterProfanity", value: function(e4, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e4], "user_profile")).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e4] = o3, true));
    } }, { key: "isMyFriend", value: function(e4) {
      var t3 = this.get(8);
      return !!t3 && t3.isMyFriend(e4);
    } }, { key: "getUserProfile", value: function(e4) {
      return this._profileHandler.getUserProfile(e4);
    } }, { key: "updateMyProfile", value: function(e4) {
      return this._profileHandler.updateMyProfile(e4);
    } }, { key: "getNickAndAvatarByUserID", value: function(e4) {
      return this._profileHandler.getNickAndAvatarByUserID(e4);
    } }, { key: "getUserNickAndAvatar", value: function(e4) {
      return this._profileHandler.getUserNickAndAvatar(e4);
    } }, { key: "getLocalBlacklist", value: function() {
      var e4 = this._blacklistHandler.getLocalBlacklist();
      return D2(e4);
    } }, { key: "addBlacklist", value: function(e4) {
      return this._blacklistHandler.addBlacklist(e4);
    } }, { key: "deleteBlacklist", value: function(e4) {
      return this._blacklistHandler.deleteBlacklist(e4);
    } }, { key: "onUserStatusUpdated", value: function(e4) {
      this._userStatusHandler.onUserStatusUpdated(e4);
    } }, { key: "setSelfStatus", value: function(e4) {
      return this._userStatusHandler.setSelfStatus(e4);
    } }, { key: "getUserStatus", value: function(e4) {
      return this._userStatusHandler.getUserStatus(e4);
    } }, { key: "subscribeUserStatus", value: function(e4) {
      return this._userStatusHandler.subscribeUserStatus(e4);
    } }, { key: "unsubscribeUserStatus", value: function(e4) {
      return this._userStatusHandler.unsubscribeUserStatus(e4);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._profileHandler.reset(), this._blacklistHandler.reset(), this._userStatusHandler.reset();
    } }])), Ii2 = e3(function e4(t3, n3) {
      p3(this, e4), this._m = t3, this._isLoggedIn = false, this._SDKAppID = n3.SDKAppID, this._userID = n3.userID || "", this._userSig = n3.userSig || "", this._version = "3.5.5", this._a2Key = "", this._tinyID = "", this._customStatus = "", this._contentType = "json", this._unlimitedAVChatRoom = n3.unlimitedAVChatRoom, this._scene = n3.scene || "", this._oversea = n3.oversea, this._instanceID = n3.instanceID, this._statusInstanceID = 0, this._isDevMode = n3.devMode, this._isTestEnv = n3.testEnv, this._proxyServer = n3.proxyServer, this._fileUploadProxy = n3.fileUploadProxy, this._fileDownloadProxy = n3.fileDownloadProxy, this._applicationID = 0, this._isPartialUpdatedConvs = n3.partialUpdatedConversations, this._isIndependentDomainDisabled = n3.disableIndependentDomain, this._isUsingChatCore = false, this._uiPlatform = 0, this._authKey = "", this._customLoginInfo = "";
    }, [{ key: "isLoggedIn", value: function() {
      return this._isLoggedIn;
    } }, { key: "isOversea", value: function() {
      return this._oversea;
    } }, { key: "isPrivateNetWork", value: function() {
      return this._proxyServer;
    } }, { key: "isDevMode", value: function() {
      return this._isDevMode;
    } }, { key: "isTestEnv", value: function() {
      return this._isTestEnv;
    } }, { key: "isPartialUpdatedConvs", value: function() {
      return this._isPartialUpdatedConvs;
    } }, { key: "isIndependentDomainDisabled", value: function() {
      return this._isIndependentDomainDisabled;
    } }, { key: "isSingaporeSite", value: function() {
      return 2e7 <= this._SDKAppID && this._SDKAppID < 3e7 || 172e7 <= this._SDKAppID && this._SDKAppID < 173e7;
    } }, { key: "isKoreaSite", value: function() {
      return 3e7 <= this._SDKAppID && this._SDKAppID < 4e7 || 173e7 <= this._SDKAppID && this._SDKAppID < 174e7;
    } }, { key: "isGermanySite", value: function() {
      return 4e7 <= this._SDKAppID && this._SDKAppID < 5e7 || 174e7 <= this._SDKAppID && this._SDKAppID < 175e7;
    } }, { key: "isIndiaSite", value: function() {
      return 5e7 <= this._SDKAppID && this._SDKAppID < 6e7 || 175e7 <= this._SDKAppID && this._SDKAppID < 176e7;
    } }, { key: "isJapanSite", value: function() {
      return 6e7 <= this._SDKAppID && this._SDKAppID < 7e7 || 176e7 <= this._SDKAppID && this._SDKAppID < 177e7;
    } }, { key: "isUSASite", value: function() {
      return 7e7 <= this._SDKAppID && this._SDKAppID < 8e7 || 177e7 <= this._SDKAppID && this._SDKAppID < 178e7;
    } }, { key: "isIndonesiaSite", value: function() {
      return 8e7 <= this._SDKAppID && this._SDKAppID < 9e7 || 178e7 <= this._SDKAppID && this._SDKAppID < 179e7;
    } }, { key: "isIntl", value: function() {
      return 0 === (e4 = this._SDKAppID) || 2e7 <= e4 && e4 < 9e7 || 172e7 <= e4 && e4 < 179e7;
      var e4;
    } }, { key: "isUnlimitedAVChatRoom", value: function() {
      return this._unlimitedAVChatRoom;
    } }, { key: "isUsingChatCore", value: function() {
      return this._isUsingChatCore;
    } }, { key: "setUsingChatCore", value: function(e4) {
      this._isUsingChatCore = e4;
    } }, { key: "getUIPlatform", value: function() {
      return this._uiPlatform;
    } }, { key: "setUIPlatform", value: function(e4) {
      this._uiPlatform = e4;
    } }, { key: "setUserID", value: function(e4) {
      this._userID = e4;
    } }, { key: "getUserID", value: function() {
      return this._userID;
    } }, { key: "setUserSig", value: function(e4) {
      this._userSig = e4;
    } }, { key: "getUserSig", value: function() {
      return this._userSig;
    } }, { key: "getSDKAppID", value: function() {
      return this._SDKAppID;
    } }, { key: "setTinyID", value: function(e4) {
      this._tinyID = e4, this._isLoggedIn = true;
    } }, { key: "getTinyID", value: function() {
      return this._tinyID;
    } }, { key: "setCustomStatus", value: function(e4) {
      this._customStatus = e4;
    } }, { key: "getCustomStatus", value: function() {
      return this._customStatus;
    } }, { key: "getScene", value: function() {
      return Ue2 ? window.tencent_cloud_im_csig_flutter_for_web_25F_cy : this._isTUIKit() ? "tuikit" : this._scene;
    } }, { key: "getInstanceID", value: function() {
      return this._instanceID;
    } }, { key: "getStatusInstanceID", value: function() {
      return this._statusInstanceID;
    } }, { key: "setStatusInstanceID", value: function(e4) {
      this._statusInstanceID = e4;
    } }, { key: "getVersion", value: function() {
      return this._version;
    } }, { key: "getA2Key", value: function() {
      return this._a2Key;
    } }, { key: "setA2Key", value: function(e4) {
      this._a2Key = e4;
    } }, { key: "getContentType", value: function() {
      return this._contentType;
    } }, { key: "getProxyServer", value: function() {
      return this._proxyServer;
    } }, { key: "getFileUploadProxy", value: function() {
      return this._fileUploadProxy;
    } }, { key: "getFileDownloadProxy", value: function() {
      return this._fileDownloadProxy;
    } }, { key: "setApplicationID", value: function(e4) {
      this._applicationID = e4;
    } }, { key: "getApplicationID", value: function() {
      return this._applicationID;
    } }, { key: "setDowloadFileAuthKey", value: function(e4) {
      this._authKey = e4;
    } }, { key: "getDownloadFileAuthKey", value: function() {
      return this._authKey;
    } }, { key: "setCustomLoginInfo", value: function(e4) {
      this._customLoginInfo = e4;
    } }, { key: "getCustomLoginInfo", value: function() {
      return this._customLoginInfo;
    } }, { key: "_isTUIKit", value: function() {
      var e4 = false, t3 = false, n3 = false, o3 = false, i4 = [];
      v3 && (i4 = Object.keys(I2));
      for (var a4 = 0, s4 = (i4 = Ce3 ? Me3 ? Object.keys(index) : Object.keys(window) : i4).length; a4 < s4; a4++)
        if (i4[a4].toLowerCase().includes("uikit")) {
          e4 = true;
          break;
        }
      var r3, i4 = null, c4 = (v3 && !dt3(I2.createGamePortal) && dt3(getApp) && !N2(getApp()) && (r3 = getApp().globalData, m3(r3)) && true === r3.isTUIKit && (t3 = true), true === this._m.get(13).getStorageSync("TIM_".concat(this._SDKAppID, "_isTUIKit")) && (n3 = true), null);
      if (_e3 && !fe2 && "undefined" == typeof index && __wxConfig && (c4 = __wxConfig.pages), ge2 && "undefined" == typeof index && __qqConfig && (c4 = __qqConfig.pages), O2(c4) && 0 < c4.length) {
        for (var u3 = 0, l3 = c4.length; u3 < l3; u3++)
          if (c4[u3].toLowerCase().includes("tui")) {
            o3 = true;
            break;
          }
        c4 = null;
      }
      return e4 || t3 || n3 || o3;
    } }, { key: "reset", value: function() {
      this._isLoggedIn = false, this._userSig = "", this._a2Key = "", this._tinyID = "", this._customStatus = "", this._statusInstanceID = 0;
    } }]), Mi2 = { "k-vue2-pc": 1, "k-vue2-h5": 2, "k-vue2-h5-uni": 3, "k-vue2-app-uni": 4, "k-vue2-mp-uni": 5, "k-vue2-pc-uni": 6, "k-vue3-pc": 7, "k-vue3-h5": 8, "k-vue3-h5-uni": 9, "k-vue3-app-uni": 10, "k-vue3-mp-uni": 11, "k-vue3-pc-uni": 12, "k-rn": 13 }, yi2 = (t2(Ci2, c3), e3(Ci2, [{ key: "onCheckTimer", value: function(e4) {
      this.isLoggedIn() && e4 % this._helloInterval == 0 && this._hello();
    } }, { key: "getPushModule", value: function() {
      var e4 = void 0, t3 = this.get(36), n3 = this.get(28);
      return t3.canIUseTIMPush() ? e4 = t3 : n3.canIUseOfflinePush() && (e4 = n3), e4;
    } }, { key: "login", value: function(e4) {
      if (this.isLoggedIn())
        return n3 = this.getMyUserID(), (n3 = this.getErrMsg("RepeatLogin", n3)) && M2.w(n3), D2({ actionStatus: "OK", errorCode: 0, errorInfo: n3, repeatLogin: true });
      if (Date.now() - this._lastLoginTs <= 15e3)
        return this.warn("LoggingIn", e4.userID), E2({ code: k2.REPEAT_LOGIN });
      M2.l("".concat(this._n, ".login userID:").concat(e4.userID));
      var t3, n3 = this._checkLoginInfo(e4);
      return 0 !== n3.code ? E2(n3) : (n3 = this.get(12), t3 = e4.userID, e4 = e4.userSig, n3.setUserID(t3), n3.setUserSig(e4), this.get(20).updateProtocolConfig(), this._login());
    } }, { key: "_login", value: function() {
      var _3 = this, h4 = this.get(12), g3 = h4.getScene(), e4 = 0, t3 = g3, f4 = (g3 && g3.startsWith("k-") && (t3 = Mi2[g3], g3 = "tuikit"), new P2("login")), n3 = (f4.setMessage("".concat(t3)).setMoreMessage("identifier:".concat(this.getMyUserID())), "tuikit" === g3), o3 = 0, n3 = (Me3 ? o3 = n3 ? 3 === t3 || 4 === t3 || 5 === t3 || 6 === t3 ? 31 : 9 === t3 || 10 === t3 || 11 === t3 || 12 === t3 ? 32 : 4 : 3 : v3 ? o3 = he3 ? 36 : "tuikit" === g3 ? 12 : 11 : Ce3 ? o3 = Ue2 ? "flutter_web_uikit" === g3 ? 21 : 20 : this._isReactUIKit() ? Pe2 ? 25 : 24 : n3 ? 1 === t3 || 2 === t3 ? 29 : 7 === t3 || 8 === t3 ? 30 : Pe2 ? 17 : 14 : Pe2 ? 16 : 13 : 13 === t3 && (o3 = 38), f4.setUIPlatform(o3), h4.setUIPlatform(o3), this.getPushModule()), m4 = (n3 && (this._isWebUniapp = n3.getUniAppPlatform(), t3 = this._getStatusInstanceID(), h4.setStatusInstanceID(t3), this.get(20).updateProtocolConfig(), e4 = n3.getDeviceBrand()), "".concat(this._n, "._login"));
      return this._lastLoginTs = Date.now(), this.req({ P: G2.LOGIN, data: { deviceBrand: e4, isWebUniapp: this._isWebUniapp, customInfo: h4.getCustomLoginInfo() } }).then(function(e5) {
        _3._lastLoginTs = 0;
        var t4 = Date.now(), n4 = null, o4 = e5.data, i4 = o4.a2Key, a4 = o4.tinyID, s4 = o4.helloInterval, r3 = o4.instanceID, c4 = o4.timeStamp, u3 = o4.customStatus, u3 = void 0 === u3 ? "" : u3, l3 = o4.purchaseBits, o4 = o4.authKey, o4 = void 0 === o4 ? "" : o4, d4 = 1e3 * c4, p4 = t4 - f4.getStartTs(), p4 = d4 + parseInt(p4 / 2) - t4, t4 = f4.getStartTs() + p4;
        if (f4.start(t4), t4 = d4, We3 = p4, (d4 = /* @__PURE__ */ new Date()).setTime(t4), M2.i("baseTime from server:".concat(d4, " offset:").concat(We3)), a4) {
          if (i4)
            return t4 = _3.get(21).getSocketID(), d4 = xo2(u3), u3 = "socketID:".concat(t4, " scene:").concat(g3, " helloInterval:").concat(s4, " instanceID:").concat(r3, " timeStamp:").concat(c4) + " offset:".concat(p4, " customStatus:").concat(d4, " isWebUniapp:").concat(_3._isWebUniapp), M2.l("".concat(m4, " ok. ").concat(u3)), c4 = t4 = "", _e3 && dt3(I2.getAccountInfoSync) && (p4 = I2.getAccountInfoSync().miniProgram) && (t4 = p4.appId, c4 = p4.envVersion), f4.setMoreMessage("".concat(u3, " href:").concat(Ce3 ? window.location.href : "", " mpAppId:").concat(t4, " envVersion:").concat(c4, " authKey:").concat(o4)).end(), h4.setA2Key(i4), h4.setTinyID(a4), h4.setStatusInstanceID(r3), h4.setCustomStatus(d4), h4.setDowloadFileAuthKey(o4), l3 && _3.get(27).onPushedConfig({ errorCode: 0, expiredTime: 0, purchaseBits: l3 }), _3.get(20).updateProtocolConfig(), _3.emitIEvt(U2.A2KEY_AND_TINYID_UPDATED), _3._helloInterval = s4, _3.triggerReady(), (p4 = _3.getPushModule()) && (index.setStorageSync("timUniAppInstanceID", r3), p4.init()), _3._fetchCloudControlConfig(), _3.get(29).init(), e5;
          n4 = new L2({ code: k2.NO_A2KEY });
        } else
          n4 = new L2({ code: k2.NO_TINYID });
        throw f4.setError(n4).end(), n4;
      }).catch(function(e5) {
        return f4.setError(e5).end(true), _3._m.setNotReadyReason(k2.LOGIN_FAILED), M2.e("".concat(m4, " failed. error:"), e5), _3._lastLoginTs = 0, _3._m.onLoginFailed(), E2(e5);
      });
    } }, { key: "logout", value: function() {
      var t3 = this, e4 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, n3 = "".concat(this._n, ".logout"), o3 = this.isLoggedIn();
      return M2.i("".concat(n3, " type:").concat(e4, " isLoggedIn:").concat(o3, " isWebUniapp:").concat(this._isWebUniapp)), o3 ? (new P2("logout").setMessage("identifier:".concat(this.getMyUserID())).end(true), 0 === e4 && this._m.setNotReadyReason(k2.LOGGED_OUT), this.req({ P: G2.LOGOUT, data: { type: e4, isWebUniapp: this._isWebUniapp } }).then(function() {
        return t3.resetReady(), D2({});
      }).catch(function(e5) {
        return M2.e("".concat(n3, " error:"), e5), t3.resetReady(), D2({});
      })) : E2({ code: k2.USER_NOT_LOGGED_IN });
    } }, { key: "getLoginUser", value: function() {
      return this.isLoggedIn() ? this.getMyUserID() : "";
    } }, { key: "_fetchCloudControlConfig", value: function() {
      this.get(23).fetchConfig();
    } }, { key: "_getStatusInstanceID", value: function() {
      return index.getStorageSync("timUniAppInstanceID") || 0;
    } }, { key: "_hello", value: function() {
      var t3 = this;
      this._lastWsHelloTs = Date.now(), this.req({ P: G2.HELLO, data: { isWebUniapp: this._isWebUniapp } }).catch(function(e4) {
        M2.w("".concat(t3._n, "._hello error:"), e4);
      });
    } }, { key: "getLastWsHelloTs", value: function() {
      return this._lastWsHelloTs;
    } }, { key: "_checkLoginInfo", value: function(e4) {
      var t3 = 0;
      return S2(this.get(12).getSDKAppID()) ? t3 = k2.NO_SDKAPPID : S2(e4.userID) ? t3 = k2.NO_IDENTIFIER : S2(e4.userSig) && (t3 = k2.NO_USERSIG), { code: t3 };
    } }, { key: "_isReactUIKit", value: function() {
      return Ce3 && void 0 !== window.tencent_cloud_im_csig_react_uikit_23F_xa;
    } }, { key: "onMultipleAccountKickedOut", value: function(e4) {
      var t3 = this;
      new P2("kickedOut").setMessage("type:".concat(R2.KICKED_OUT_MULT_ACCOUNT, " newInstanceInfo:").concat(JSON.stringify(e4))).end(true), M2.w("".concat(this._n, ".onMultipleAccountKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e4), this.logout(1).then(function() {
        t3.emitOEvt(h3.KICKED_OUT, { type: R2.KICKED_OUT_MULT_ACCOUNT }), t3._m.setNotReadyReason(k2.KICKED_OUT_MULT_ACCOUNT), t3._m.reset();
      });
    } }, { key: "onMultipleDeviceKickedOut", value: function(e4) {
      var t3 = this;
      new P2("kickedOut").setMessage("type:".concat(R2.KICKED_OUT_MULT_DEVICE, " newInstanceInfo:").concat(JSON.stringify(e4))).end(true), M2.w("".concat(this._n, ".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e4), this.logout(1).then(function() {
        t3.emitOEvt(h3.KICKED_OUT, { type: R2.KICKED_OUT_MULT_DEVICE }), t3._m.setNotReadyReason(k2.KICKED_OUT_MULT_DEVICE), t3._m.reset();
      });
    } }, { key: "onUserSigExpired", value: function() {
      new P2("kickedOut").setMessage(R2.KICKED_OUT_USERSIG_EXPIRED).end(true), M2.w("".concat(this._n, ".onUserSigExpired userID:").concat(this.getMyUserID())), 0 !== this.get(12).getStatusInstanceID() && (this.emitOEvt(h3.KICKED_OUT, { type: R2.KICKED_OUT_USERSIG_EXPIRED }), this._m.setNotReadyReason(k2.KICKED_OUT_USERSIG_EXPIRED), this._m.reset());
    } }, { key: "onRestApiKickedOut", value: function(e4) {
      new P2("kickedOut").setMessage("type:".concat(R2.KICKED_OUT_REST_API, " newInstanceInfo:").concat(JSON.stringify(e4))).end(true), M2.w("".concat(this._n, ".onRestApiKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e4), 0 !== this.get(12).getStatusInstanceID() && (this.emitOEvt(h3.KICKED_OUT, { type: R2.KICKED_OUT_REST_API }), this._m.setNotReadyReason(k2.KICKED_OUT_REST_API), this._m.reset(), this.get(21).onRestApiKickedOut());
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this.resetReady(), this._helloInterval = 120, this._lastLoginTs = 0, this._lastWsHelloTs = 0, this._isWebUniapp = 0;
    } }]));
    function Ci2(e4) {
      return p3(this, Ci2), (e4 = i3(this, Ci2, [e4]))._n = "SignModule", e4._helloInterval = 120, e4._lastLoginTs = 0, e4._lastWsHelloTs = 0, e4._isWebUniapp = 0, wo2.mixin(e4), e4;
    }
    function Ti2(e4) {
      return p3(this, Ti2), (e4 = i3(this, Ti2, [e4]))._n = "UserModule", e4._profileHandler = new hi2(e4), e4._blacklistHandler = new fi2(e4), e4._userStatusHandler = new mi2(e4), e4.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, e4.onContextUpdated, e4), e4;
    }
    function Di2(e4) {
      return p3(this, Di2), (e4 = i3(this, Di2, [e4]))._n = "TopicModule", e4._topicMap = /* @__PURE__ */ new Map(), e4._getTopicTimeMap = /* @__PURE__ */ new Map(), e4.TOPIC_CACHE_TIME = 300, e4.TOPIC_LAST_ACTIVE_TIME = 3600, e4.getIEmitInst().on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function Ei2(e4) {
      return p3(this, Ei2), (e4 = i3(this, Ei2, [e4]))._n = "GroupModule", e4._commonGroupHandler = new $o(e4), e4._groupAttributesHandler = new ei2(e4), e4._groupCountersHandler = new ti2(e4), e4._AVChatRoomHandler = new ii2(e4), e4._groupTipsHandler = new Qo(e4), e4._groupSystemNoticeHandler = new ci2(e4), e4._groupMemberHandler = new si2(e4), e4.groupMap = /* @__PURE__ */ new Map(), e4._unjoinedAVChatRoomList = /* @__PURE__ */ new Map(), e4._receiptDetailCompleteMap = /* @__PURE__ */ new Map(), e4._onlineMemberCountMap = /* @__PURE__ */ new Map(), e4._timeoutIDs = [], e4.getIEmitInst().on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function Li2(e4) {
      return p3(this, Li2), (e4 = i3(this, Li2, [e4]))._n = "ConvModule", wo2.mixin(e4), e4._msgListHandler = new Uo2(e4), e4._msgRemindHandler = new zo(e4), e4._convGroupHandler = new Xo(e4), e4._sll = new Ko(100), e4._pagingStatus = bn2, e4._pagingTs = 0, e4._pagingStartIdx = 0, e4._pagingPinnedTs = 0, e4._pagingPinnedStartIdx = 0, e4._pagingConvIDMap = /* @__PURE__ */ new Map(), e4._convIDFromUnreadDBMap = /* @__PURE__ */ new Map(), e4._convMap = /* @__PURE__ */ new Map(), e4._tmpGroupList = [], e4._tmpGroupAtTipsList = [], e4._peerReadTimeMap = /* @__PURE__ */ new Map(), e4._completedMap = /* @__PURE__ */ new Map(), e4._roamingMsgKeyAndTimeMap = /* @__PURE__ */ new Map(), e4._remoteGroupReadSeqMap = /* @__PURE__ */ new Map(), e4._convTotalUnreadCount = 0, e4._pagingGetCostList = [], e4._convMapForDiff = /* @__PURE__ */ new Map(), e4._partialUpdatedConvMap = /* @__PURE__ */ new Map(), e4._everClearedMap = /* @__PURE__ */ new Map(), e4._bPullOnInvite = true, e4._initListeners(), e4;
    }
    function Si2() {
      return null;
    }
    function ki2(e4) {
      var t3 = e4.get(12);
      return { SDKType: 10, SDKAppID: t3.getSDKAppID(), SDKVersion: t3.getVersion(), tinyID: Number(t3.getTinyID()), userID: t3.getUserID(), platform: e4.getPlatform(), instanceID: t3.getInstanceID(), traceID: Ye3() };
    }
    var Ri2 = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._n = "StorageModule", this._storageQueue = /* @__PURE__ */ new Map(), this._errorTolerantHandle();
    }, [{ key: "_errorTolerantHandle", value: function() {
      v3 || "undefined" != typeof window && this._canIUseCookies() || (this.getItem = Si2, this.setItem = Si2, this.removeItem = Si2, this.clear = Si2);
    } }, { key: "onCheckTimer", value: function(e4) {
      e4 % 20 == 0 && 0 !== this._storageQueue.size && this._doFlush();
    } }, { key: "_doFlush", value: function() {
      try {
        var e4, t3 = F2(this._storageQueue);
        try {
          for (t3.s(); !(e4 = t3.n()).done; ) {
            var n3 = j2(e4.value, 2), o3 = n3[0], i4 = n3[1];
            this._setStorageSync(this._getKey(o3), i4);
          }
        } catch (e5) {
          t3.e(e5);
        } finally {
          t3.f();
        }
        this._storageQueue.clear();
      } catch (e5) {
        M2.w("".concat(this._n, "._doFlush error:"), e5);
      }
    } }, { key: "_getPrefix", value: function() {
      var e4 = this._m.get(12);
      return "TIM_".concat(e4.getSDKAppID(), "_").concat(e4.getUserID(), "_");
    } }, { key: "_getKey", value: function(e4) {
      return "".concat(this._getPrefix()).concat(e4);
    } }, { key: "getItem", value: function(e4) {
      var t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1];
      try {
        var n3 = t3 ? this._getKey(e4) : e4;
        return this.getStorageSync(n3);
      } catch (e5) {
        return M2.w("".concat(this._n, ".getItem error:"), e5), {};
      }
    } }, { key: "setItem", value: function(e4, t3) {
      var n3;
      2 < arguments.length && void 0 !== arguments[2] && arguments[2] ? (n3 = !(3 < arguments.length && void 0 !== arguments[3]) || arguments[3] ? this._getKey(e4) : e4, this._setStorageSync(n3, t3)) : this._storageQueue.set(e4, t3);
    } }, { key: "clear", value: function() {
      try {
        v3 ? I2.clearStorageSync() : this._canIUseCookies() && localStorage.clear();
      } catch (e4) {
        M2.w("".concat(this._n, ".clear error:"), e4);
      }
    } }, { key: "removeItem", value: function(e4) {
      var t3 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1];
      try {
        var n3 = t3 ? this._getKey(e4) : e4;
        this._removeStorageSync(n3);
      } catch (e5) {
        M2.w("".concat(this._n, ".removeItem error:"), e5);
      }
    } }, { key: "getSize", value: function(e4) {
      var t3 = this, n3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "b";
      try {
        var o3 = { size: 0, limitSize: 5242880, unit: n3 };
        if (Object.defineProperty(o3, "leftSize", { enumerable: true, get: function() {
          return o3.limitSize - o3.size;
        } }), v3 && (o3.limitSize = 1024 * I2.getStorageInfoSync().limitSize), e4)
          o3.size = JSON.stringify(this.getItem(e4)).length + this._getKey(e4).length;
        else if (v3)
          I2.getStorageInfoSync().keys.forEach(function(e5) {
            o3.size += JSON.stringify(t3.getStorageSync(e5)).length + t3._getKey(e5).length;
          });
        else if (this._canIUseCookies())
          for (var i4 in localStorage)
            localStorage.hasOwnProperty(i4) && (o3.size += localStorage.getItem(i4).length + i4.length);
        return this._convertUnit(o3);
      } catch (e5) {
        M2.w("".concat(this._n, " error:"), e5);
      }
    } }, { key: "_convertUnit", value: function(e4) {
      var t3, n3 = {}, o3 = e4.unit;
      for (t3 in n3.unit = o3, e4)
        "number" == typeof e4[t3] && ("kb" === o3.toLowerCase() ? n3[t3] = Math.round(e4[t3] / 1024) : "mb" === o3.toLowerCase() ? n3[t3] = Math.round(e4[t3] / 1024 / 1024) : n3[t3] = e4[t3]);
      return n3;
    } }, { key: "_setStorageSync", value: function(e4, t3) {
      v3 ? ve3 ? my.setStorageSync({ key: e4, data: t3 }) : I2.setStorageSync(e4, t3) : this._canIUseCookies() && localStorage.setItem(e4, JSON.stringify(t3));
    } }, { key: "getStorageSync", value: function(e4) {
      return v3 ? ve3 ? my.getStorageSync({ key: e4 }).data : I2.getStorageSync(e4) : this._canIUseCookies() ? JSON.parse(localStorage.getItem(e4)) : {};
    } }, { key: "_removeStorageSync", value: function(e4) {
      v3 ? ve3 ? my.removeStorageSync({ key: e4 }) : I2.removeStorageSync(e4) : this._canIUseCookies() && localStorage.removeItem(e4);
    } }, { key: "_canIUseCookies", value: function() {
      return "undefined" != typeof window && navigator && navigator.cookieEnabled && localStorage;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._doFlush();
    } }]), Ai2 = e3(function e4(t3) {
      p3(this, e4), this._n = "SSOLogBody", this._report = [];
    }, [{ key: "pushIn", value: function(e4) {
      M2.d("".concat(this._n, ".pushIn"), this._report.length, e4), this._report.push(e4);
    } }, { key: "backfill", value: function(e4) {
      var t3;
      O2(e4) && 0 !== e4.length && (M2.d("".concat(this._n, ".backfill"), this._report.length, e4.length), (t3 = this._report).unshift.apply(t3, d3(e4)));
    } }, { key: "getLogsNumInMemory", value: function() {
      return this._report.length;
    } }, { key: "isEmpty", value: function() {
      return 0 === this._report.length;
    } }, { key: "_reset", value: function() {
      this._report.length = 0, this._report = [];
    } }, { key: "getLogsInMemory", value: function() {
      var e4 = this._report.slice();
      return this._reset(), e4;
    } }]), Oi2 = (t2(Ui2, c3), e3(Ui2, [{ key: "reportAtOnce", value: function() {
      this._report();
    } }, { key: "_onLoginSuccess", value: function() {
      var t3 = this, e4 = this.get(13), n3 = e4.getItem(this.TAG, false);
      !S2(n3) && dt3(n3.forEach) && (M2.l("".concat(this._n, "._onLoginSuccess. logs count:").concat(n3.length)), n3.forEach(function(e5) {
        t3._reportBody.pushIn(e5);
      }), e4.removeItem(this.TAG, false));
    } }, { key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("evt_rpt_threshold"), t3 = this.getCloudConfig("evt_rpt_waiting"), n3 = this.getCloudConfig("evt_rpt_level"), o3 = this.getCloudConfig("evt_rpt_sdkappid_bl"), i4 = this.getCloudConfig("evt_rpt_tinyid_wl");
      N2(e4) || (this.MIN_THRESHOLD = Number(e4)), N2(t3) || (this.WAITING_TIME = Number(t3)), N2(n3) || (this.REPORT_LEVEL = n3.split(",").map(function(e5) {
        return Number(e5);
      })), N2(o3) || (this.REPORT_SDKAPPID_BLACKLIST = o3.split(",").map(function(e5) {
        return Number(e5);
      })), N2(i4) || (this.REPORT_TINYID_WHITELIST = i4.split(","));
    } }, { key: "pushIn", value: function(e4) {
      e4 instanceof P2 && (e4.updateTimeStamp(), this._reportBody.pushIn(e4), this._reportBody.getLogsNumInMemory() >= this.MIN_THRESHOLD) && this._report();
    } }, { key: "onCheckTimer", value: function() {
      Date.now() < this._lastReportTime + this.WAITING_TIME || this._reportBody.isEmpty() || this._report();
    } }, { key: "_filterLogs", value: function(e4) {
      var t3 = this, n3 = this.get(12), o3 = n3.getSDKAppID(), n3 = n3.getTinyID();
      return Jt2(this.REPORT_SDKAPPID_BLACKLIST, o3) && !zt2(this.REPORT_TINYID_WHITELIST, n3) ? [] : e4.filter(function(e5) {
        return t3.REPORT_LEVEL.includes(e5.level);
      });
    } }, { key: "_report", value: function() {
      var t3, e4, n3 = this;
      this._reportBody.isEmpty() || (t3 = this._reportBody.getLogsInMemory(), 0 !== (e4 = this._filterLogs(t3)).length ? (e4 = { header: ki2(this), event: e4 }, this.req({ P: G2.SSO_STAT, data: y2({}, e4) }).then(function() {
        n3._lastReportTime = Date.now();
      }).catch(function(e5) {
        M2.w("".concat(n3._n, "._report failed. error:"), e5), n3._lastReportTime = Date.now(), n3._reportBody.backfill(t3), n3._reportBody.getLogsNumInMemory() > n3.MAX_THRESHOLD && n3._flushAtOnce();
      })) : this._lastReportTime = Date.now());
    } }, { key: "_flushAtOnce", value: function() {
      var e4 = this.get(13), t3 = e4.getItem(this.TAG, false), n3 = this._reportBody.getLogsInMemory(), o3 = "".concat(this._n, "._flushAtOnce");
      S2(t3) ? (M2.l("".concat(o3, " count:").concat(n3.length)), e4.setItem(this.TAG, n3, true, false)) : ((n3 = n3.concat(t3)).length > this.MAX_THRESHOLD && (n3 = n3.slice(0, this.MAX_THRESHOLD)), M2.l("".concat(o3, " count:").concat(n3.length)), e4.setItem(this.TAG, n3, true, false));
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._lastReportTime = 0, this._report(), this.REPORT_SDKAPPID_BLACKLIST = [], this.REPORT_TINYID_WHITELIST = [];
    } }])), Ni2 = "none", Gi2 = "online", Pi2 = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._networkType = Gi2, this._n = "NetMonitorModule", this._mpNetworkStatusCallback = null, this._webOnlineCallback = null, this._webOfflineCallback = null, this._removeListener = null, this._m.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, this._startRN, this);
    }, [{ key: "_startRN", value: function() {
      var e4, n3 = this;
      ye3 && (e4 = this._m.get(18).getPlugin("chat-network-monitor")) && (this._removeListener = e4.addEventListener(function(e5) {
        var t3 = e5.isConnected, e5 = e5.type;
        n3._networkType !== e5 && n3._onNetworkStatusChange({ isConnected: void 0 !== t3 && t3, networkType: e5 });
      }));
    } }, { key: "start", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".start");
      v3 ? (I2.getNetworkType({ success: function(e4) {
        t3._networkType = e4.networkType || e4.subtype || "", e4.networkType === Ni2 ? M2.w("".concat(n3, " no network, please check!")) : M2.i("".concat(n3, " networkType:").concat(e4.networkType));
      } }), this._mpNetworkStatusCallback = this._onNetworkStatusChange.bind(this), I2.onNetworkStatusChange(this._mpNetworkStatusCallback)) : Ce3 && (this._networkType = Gi2, this._webOnlineCallback = this._onWebOnline.bind(this), this._webOfflineCallback = this._onWebOffline.bind(this), window.addEventListener("online", this._webOnlineCallback), window.addEventListener("offline", this._webOfflineCallback));
    } }, { key: "_onWebOnline", value: function() {
      this._onNetworkStatusChange({ isConnected: true, networkType: Gi2 });
    } }, { key: "_onWebOffline", value: function() {
      this._onNetworkStatusChange({ isConnected: false, networkType: Ni2 });
    } }, { key: "_onNetworkStatusChange", value: function(e4) {
      var t3 = e4.isConnected, e4 = e4.networkType, n3 = "".concat(this._n, "._onNetworkStatusChange"), o3 = false, i4 = "previous:".concat(this._networkType, " current:").concat(e4);
      t3 ? (M2.i("".concat(n3, " ").concat(i4)), this._networkType !== e4 && (o3 = true, this._networkType = e4, this._m.get(21).reConnect(true))) : this._networkType !== e4 && (o3 = true, this._networkType = e4, M2.w("".concat(n3, " no network, please check!")), this._m.get(21).offline()), o3 && new P2("networkChange").setMessage("isConnected:".concat(t3, " ").concat(i4)).end();
    } }, { key: "isOnline", value: function() {
      return this._networkType !== Ni2;
    } }, { key: "getNetworkType", value: function() {
      return this._networkType;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), v3 ? null !== this._mpNetworkStatusCallback && (I2.offNetworkStatusChange && I2.offNetworkStatusChange(this._mpNetworkStatusCallback), this._mpNetworkStatusCallback = null) : Ce3 ? (null !== this._webOnlineCallback && (window.removeEventListener("online", this._webOnlineCallback), this._webOnlineCallback = null), null !== this._onWebOffline && (window.removeEventListener("offline", this._webOfflineCallback), this._webOfflineCallback = null)) : ye3 && this._removeListener && (this._removeListener(), this._removeListener = null);
    } }]);
    function Ui2(e4) {
      p3(this, Ui2), (e4 = i3(this, Ui2, [e4]))._n = "EventStatModule", e4.TAG = "im-ssolog-event", e4._reportBody = new Ai2(), e4.MIN_THRESHOLD = 20, e4.MAX_THRESHOLD = 100, e4.WAITING_TIME = 6e4, e4.REPORT_LEVEL = [4, 5, 6], e4.REPORT_SDKAPPID_BLACKLIST = [], e4.REPORT_TINYID_WHITELIST = [], e4._lastReportTime = Date.now();
      var t3 = e4.getIEmitInst();
      return t3.on(U2.A2KEY_AND_TINYID_UPDATED, e4._onLoginSuccess, e4), t3.on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function bi2(e4, t3) {
      return e4(t3 = { exports: {} }, t3.exports), t3.exports;
    }
    var wi2 = bi2(function(e4) {
      var o3 = Object.prototype.hasOwnProperty, _3 = "~";
      function n3() {
      }
      function a4(e5, t4, n4) {
        this.fn = e5, this.context = t4, this.once = n4 || false;
      }
      function i4(e5, t4, n4, o4, i5) {
        if ("function" != typeof n4)
          throw new TypeError("The listener must be a function");
        n4 = new a4(n4, o4 || e5, i5), o4 = _3 ? _3 + t4 : t4;
        return e5._events[o4] ? e5._events[o4].fn ? e5._events[o4] = [e5._events[o4], n4] : e5._events[o4].push(n4) : (e5._events[o4] = n4, e5._eventsCount++), e5;
      }
      function c4(e5, t4) {
        0 == --e5._eventsCount ? e5._events = new n3() : delete e5._events[t4];
      }
      function t3() {
        this._events = new n3(), this._eventsCount = 0;
      }
      Object.create && (n3.prototype = /* @__PURE__ */ Object.create(null), new n3().__proto__ || (_3 = false)), t3.prototype.eventNames = function() {
        var e5, t4, n4 = [];
        if (0 === this._eventsCount)
          return n4;
        for (t4 in e5 = this._events)
          o3.call(e5, t4) && n4.push(_3 ? t4.slice(1) : t4);
        return Object.getOwnPropertySymbols ? n4.concat(Object.getOwnPropertySymbols(e5)) : n4;
      }, t3.prototype.listeners = function(e5) {
        var e5 = _3 ? _3 + e5 : e5, t4 = this._events[e5];
        if (!t4)
          return [];
        if (t4.fn)
          return [t4.fn];
        for (var n4 = 0, o4 = t4.length, i5 = new Array(o4); n4 < o4; n4++)
          i5[n4] = t4[n4].fn;
        return i5;
      }, t3.prototype.listenerCount = function(e5) {
        e5 = _3 ? _3 + e5 : e5, e5 = this._events[e5];
        return e5 ? e5.fn ? 1 : e5.length : 0;
      }, t3.prototype.emit = function(e5, t4, n4, o4, i5, a5) {
        var s4 = _3 ? _3 + e5 : e5;
        if (!this._events[s4])
          return false;
        var r3, c5 = this._events[s4], u3 = arguments.length;
        if (c5.fn) {
          switch (c5.once && this.removeListener(e5, c5.fn, void 0, true), u3) {
            case 1:
              return c5.fn.call(c5.context), true;
            case 2:
              return c5.fn.call(c5.context, t4), true;
            case 3:
              return c5.fn.call(c5.context, t4, n4), true;
            case 4:
              return c5.fn.call(c5.context, t4, n4, o4), true;
            case 5:
              return c5.fn.call(c5.context, t4, n4, o4, i5), true;
            case 6:
              return c5.fn.call(c5.context, t4, n4, o4, i5, a5), true;
          }
          for (p4 = 1, r3 = new Array(u3 - 1); p4 < u3; p4++)
            r3[p4 - 1] = arguments[p4];
          c5.fn.apply(c5.context, r3);
        } else
          for (var l3, d4 = c5.length, p4 = 0; p4 < d4; p4++)
            switch (c5[p4].once && this.removeListener(e5, c5[p4].fn, void 0, true), u3) {
              case 1:
                c5[p4].fn.call(c5[p4].context);
                break;
              case 2:
                c5[p4].fn.call(c5[p4].context, t4);
                break;
              case 3:
                c5[p4].fn.call(c5[p4].context, t4, n4);
                break;
              case 4:
                c5[p4].fn.call(c5[p4].context, t4, n4, o4);
                break;
              default:
                if (!r3)
                  for (l3 = 1, r3 = new Array(u3 - 1); l3 < u3; l3++)
                    r3[l3 - 1] = arguments[l3];
                c5[p4].fn.apply(c5[p4].context, r3);
            }
        return true;
      }, t3.prototype.on = function(e5, t4, n4) {
        return i4(this, e5, t4, n4, false);
      }, t3.prototype.once = function(e5, t4, n4) {
        return i4(this, e5, t4, n4, true);
      }, t3.prototype.removeListener = function(e5, t4, n4, o4) {
        e5 = _3 ? _3 + e5 : e5;
        if (this._events[e5])
          if (t4) {
            var i5 = this._events[e5];
            if (i5.fn)
              i5.fn !== t4 || o4 && !i5.once || n4 && i5.context !== n4 || c4(this, e5);
            else {
              for (var a5 = 0, s4 = [], r3 = i5.length; a5 < r3; a5++)
                (i5[a5].fn !== t4 || o4 && !i5[a5].once || n4 && i5[a5].context !== n4) && s4.push(i5[a5]);
              s4.length ? this._events[e5] = 1 === s4.length ? s4[0] : s4 : c4(this, e5);
            }
          } else
            c4(this, e5);
        return this;
      }, t3.prototype.removeAllListeners = function(e5) {
        return e5 ? (e5 = _3 ? _3 + e5 : e5, this._events[e5] && c4(this, e5)) : (this._events = new n3(), this._eventsCount = 0), this;
      }, t3.prototype.off = t3.prototype.removeListener, t3.prototype.addListener = t3.prototype.on, t3.prefixed = _3, e4.exports = t3.EventEmitter = t3;
    }), Fi2 = ["rich.my-imcloud.com", "imrich.qcloud.com"], qi2 = ["requestSnapshotUrl"], xi2 = (t2(Wi2, c3), e3(Wi2, [{ key: "_init", value: function() {
      this._fileDownloadProxy = this.getFileDownloadProxy(), this._authKey = this.getDownloadFileAuthKey();
      var e4 = this.get(18);
      this.TIMUploadPlugin = e4.getPlugin("tim-upload-plugin"), this.TIMUploadPlugin ? this._initUploaderMethod() : (this.COSSDK = e4.getPlugin(e4 = v3 ? "cos-wx-sdk" : "cos-js-sdk"), this.COSSDK ? (this._getAuthorizationKey(), this.warn("CosReplacement", e4)) : this.warn("PluginUndetected"));
    } }, { key: "_onCloudConfig", value: function() {
      var t3 = this, e4 = "".concat(this._n, "._onCloudConfig"), n3 = this.getCloudConfig("upload_size_limit"), o3 = this.getCloudConfig("simple_cos"), i4 = this.getCloudConfig("file_dn_list");
      if (M2.l("".concat(e4, " uploadSizeLimit:").concat(n3, " simpleCos:").concat(o3)), !N2(n3))
        try {
          var a4 = JSON.parse(n3);
          this.UPLOAD_SIZE_LIMIT = { A: a4.a ? 1048576 * parseInt(a4.a) : this.UPLOAD_SIZE_LIMIT.A, F: a4.f ? 1048576 * parseInt(a4.f) : this.UPLOAD_SIZE_LIMIT.F, I: a4.i ? 1048576 * parseInt(a4.i) : this.UPLOAD_SIZE_LIMIT.I, V: a4.v ? 1048576 * parseInt(a4.v) : this.UPLOAD_SIZE_LIMIT.V };
        } catch (e5) {
        }
      if (N2(o3) || (this.isSimpleCos = "1" === o3), !N2(i4))
        try {
          JSON.parse(i4).forEach(function(e5) {
            t3._fileDNList.includes(e5) || t3._fileDNList.push(e5);
          });
        } catch (e5) {
        }
    } }, { key: "_getAuthorizationKey", value: function() {
      var n3 = this, o3 = "".concat(this._n, ".").concat("_getAuthorizationKey"), i4 = new P2("_getAuthorizationKey"), a4 = Math.ceil(Date.now() / 1e3);
      this.req({ P: G2.COS_SIGN, data: { duration: this.expiredTimeLimit } }).then(function(e4) {
        var e4 = e4.data, t3 = (M2.l("".concat(o3, " ok. data:"), e4), e4.expiredTime - a4);
        i4.setMessage("requestId:".concat(e4.requestId, " requestTime:").concat(a4, " expiredTime:").concat(e4.expiredTime, " diff:").concat(t3, "s")).end(), !v3 && e4.region && (n3.region = e4.region), n3.appid = e4.appid, n3.bucketName = e4.bucketName, n3.ciUrl = e4.ciUrl, n3.directory = e4.directory, n3.downloadUrl = e4.downloadUrl, n3.uploadUrl = e4.uploadUrl, n3.cosOptions = { secretId: e4.secretId, secretKey: e4.secretKey, sessionToken: e4.sessionToken, expiredTime: e4.expiredTime }, M2.l("".concat(o3, " ok. region:").concat(n3.region, " bucketName:").concat(n3.bucketName)), n3._initUploaderMethod();
      }).catch(function(e4) {
        i4.setError(e4).end(), M2.w("".concat(o3, " failed. error:"), e4);
      });
    } }, { key: "_getCosPreSigUrl", value: function(t3) {
      var i4 = this, a4 = "".concat(this._n, ".").concat("_getCosPreSigUrl"), s4 = Math.ceil(Date.now() / 1e3), r3 = new P2("_getCosPreSigUrl"), e4 = { uploadMethod: t3.uploadMethod, platform: this.getPlatform(), SDKAppID: this.getSDKAppID(), userID: t3.userID, conversationType: t3.conversationType, uploadConfig: [{ fileID: 1, fileType: t3.fileType, fileName: t3.fileName }] }, n3 = G2.SIMPLE_COS_PRE_SIG;
      return this.isSimpleCos || (e4 = { fileType: t3.fileType, fileName: t3.fileName, uploadMethod: t3.uploadMethod, duration: t3.duration }, n3 = G2.COS_PRE_SIG), this.req({ P: n3, data: e4 }).then(function(e5) {
        i4.tryCount = 0;
        var t4, n4, e5 = e5.data || {}, o3 = (M2.l("".concat(a4, " ok. isSimpleCos:").concat(i4.isSimpleCos, " data:"), e5), "");
        return o3 = i4.isSimpleCos ? (t4 = (n4 = e5.preSig[0]).uploadUrl, n4 = n4.fileKey, "uploadIP:".concat(e5.uploadIP, " uploadUrl:").concat(t4, " fileKey:").concat(n4, " cost:").concat(an2(s4))) : "requestId:".concat(e5.requestId, " expiredTime:").concat(e5.expiredTime, " diff:").concat(e5.expiredTime - s4, "s"), r3.setMessage(o3).end(), e5;
      }).catch(function(e5) {
        return -1 === e5.code && (e5.code = k2.COS_GET_SIG_FAIL), r3.setError(e5).end(), M2.w("".concat(a4, " failed. error:"), e5), i4.tryCount < 1 ? (i4.tryCount++, i4._getCosPreSigUrl(t3)) : (i4.tryCount = 0, E2({ code: k2.COS_GET_SIG_FAIL }));
      });
    } }, { key: "_initUploaderMethod", value: function() {
      var n3 = this;
      this.TIMUploadPlugin ? (this.timUploadPlugin = new this.TIMUploadPlugin(), this._cosUploadMethod = function(e4, t3) {
        n3.timUploadPlugin.uploadFile(e4, t3);
      }) : this.appid && (this.cos = v3 ? new this.COSSDK({ ForcePathStyle: true, getAuthorization: this._getAuthorization.bind(this) }) : new this.COSSDK({ getAuthorization: this._getAuthorization.bind(this) }), this._cosUploadMethod = v3 ? function(e4, t3) {
        n3.cos.postObject(e4, t3);
      } : function(e4, t3) {
        n3.cos.uploadFiles(e4, t3);
      });
    } }, { key: "onCheckTimer", value: function(e4) {
      !this.COSSDK || this.TIMUploadPlugin || this.isLoggedIn() && e4 % 60 == 0 && Math.ceil(Date.now() / 1e3) >= this.cosOptions.expiredTime - 120 && this._getAuthorizationKey();
    } }, { key: "getFileDNList", value: function() {
      return this._fileDNList;
    } }, { key: "_getAuthorization", value: function(e4, t3) {
      t3({ TmpSecretId: this.cosOptions.secretId, TmpSecretKey: this.cosOptions.secretKey, XCosSecurityToken: this.cosOptions.sessionToken, ExpiredTime: this.cosOptions.expiredTime });
    } }, { key: "upload", value: function(e4) {
      if (true === e4._relayFlag)
        return Promise.resolve();
      var t3 = this.get(26);
      switch (e4.type) {
        case R2.MSG_IMAGE:
          return t3.addTotalCount(Zn2), this._uploadImage(e4);
        case R2.MSG_FILE:
          return t3.addTotalCount(Zn2), this._uploadFile(e4);
        case R2.MSG_AUDIO:
          return t3.addTotalCount(Zn2), this._uploadAudio(e4);
        case R2.MSG_VIDEO:
          return t3.addTotalCount(Zn2), this._uploadVideo(e4);
        default:
          return Promise.resolve();
      }
    } }, { key: "_uploadImage", value: function(v4) {
      var I3 = this, e4 = this.get(2), M3 = v4.getElements()[0], t3 = e4.getMessageOption(v4.clientSequence);
      return this.doUploadImage({ file: t3.payload.file, to: t3.to, message: v4, onProgress: function(e5) {
        if (M3.updatePercent(e5), dt3(t3.onProgress))
          try {
            t3.onProgress(e5);
          } catch (e6) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e5) {
        var t4 = e5.location, n3 = e5.fileType, o3 = e5.fileSize, i4 = e5.width, a4 = e5.height, s4 = e5.smallImageUrl, r3 = e5.smallImageWidth, c4 = e5.smallImageHeight, u3 = e5.largeImageUrl, l3 = e5.largeImageWidth, d4 = e5.largeImageHeight, p4 = e5.imageInfoArray, e5 = I3.isPrivateNetWork() ? t4 : Mt2(t4);
        M3.updateImageFormat(n3);
        var _3, h4, g3 = { size: o3, url: e5, width: i4, height: a4 };
        if (p4 && 0 < p4.length)
          for (var f4 = 0; f4 < p4.length; f4++) {
            var m4 = p4[f4];
            1 === m4.type ? _3 = m4 : 2 === m4.type ? h4 = m4 : g3 = y2(y2({}, g3), m4);
          }
        else
          h4 = s4 && u3 ? (_3 = { url: s4, width: r3, height: c4 }, { url: u3, width: l3, height: d4 }) : (_3 = Kt2({ originUrl: e5, originWidth: i4, originHeight: a4, min: 198 }), Kt2({ originUrl: e5, originWidth: i4, originHeight: a4, min: 720 }));
        return M3.updateImageInfoArray([y2({}, g3), y2({}, h4), y2({}, _3)]), v4;
      });
    } }, { key: "_uploadFile", value: function(n3) {
      var o3 = this, e4 = this.get(2), i4 = n3.getElements()[0], t3 = e4.getMessageOption(n3.clientSequence);
      return this.doUploadFile({ file: t3.payload.file, to: t3.to, message: n3, onProgress: function(e5) {
        if (i4.updatePercent(e5), dt3(t3.onProgress))
          try {
            t3.onProgress(e5);
          } catch (e6) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e5) {
        var e5 = e5.location, t4 = e5;
        return o3.isPrivateNetWork() || (t4 = co2(t4 = Mt2(e5), o3._fileDownloadProxy, o3._authKey, o3._fileDNList)), i4.updateFileUrl(t4), n3;
      });
    } }, { key: "_uploadAudio", value: function(t3) {
      var n3 = this, e4 = this.get(2), o3 = t3.getElements()[0], i4 = e4.getMessageOption(t3.clientSequence);
      return this.doUploadAudio({ file: i4.payload.file, to: i4.to, message: t3, onProgress: function(e5) {
        if (o3.updatePercent(e5), dt3(i4.onProgress))
          try {
            i4.onProgress(e5);
          } catch (e6) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e5) {
        e5 = e5.location, e5 = n3.isPrivateNetWork() ? e5 : Mt2(e5);
        return o3.updateAudioUrl(e5), t3;
      });
    } }, { key: "_uploadVideo", value: function(n3) {
      var o3 = this, e4 = this.get(2), i4 = n3.getElements()[0], t3 = e4.getMessageOption(n3.clientSequence);
      return this.doUploadVideo({ file: t3.payload.file, to: t3.to, message: n3, onProgress: function(e5) {
        if (i4.updatePercent(e5), dt3(t3.onProgress))
          try {
            t3.onProgress(e5);
          } catch (e6) {
            return E2({ code: k2.MSG_ONPROGRESS_ERR });
          }
      } }).then(function(e5) {
        var t4 = e5.location, e5 = e5.snapshotInfo, t4 = o3.isPrivateNetWork() ? t4 : Mt2(t4);
        return i4.updateVideoUrl(t4), S2(e5) || i4.updateSnapshotInfo(e5), n3;
      });
    } }, { key: "_checkSizeError", value: function(e4) {
      var t3 = "";
      return "A" === e4 ? t3 = "audio" : "I" === e4 ? t3 = "image" : "V" === e4 ? t3 = "video" : "F" === e4 && (t3 = "file"), E2({ code: k2["MSG_".concat(e4, "_SIZE_LIMIT")], message: this.getErrMsg("UploadSizeLimit", t3, "".concat(this.UPLOAD_SIZE_LIMIT[e4] / 1048576, "MB")) });
    } }, { key: "doUploadImage", value: function(o3) {
      var e4, i4, a4 = this;
      return !o3.file || this._isEmptyFileList(o3.file.files) ? E2({ code: k2.MSG_I_SELECT_F_FIRST }) : true !== (e4 = this._checkImageType(o3.file)) ? e4 : true !== (e4 = this._checkImageSize(o3.file)) ? e4 : (i4 = null, this._setUploadFileType(1), this.uploadByCOS(o3).then(function(e5) {
        if (i4 = e5, a4.isPrivateNetWork())
          return xt2(n3);
        if (O2(i4.imageInfoArray)) {
          var t3 = i4.imageInfoArray.find(function(e6) {
            return 3 === e6.type;
          });
          if (t3)
            return t3;
        }
        var n3;
        return ye3 ? { width: o3.file.width, height: o3.file.height } : (n3 = Mt2(e5.location), a4.COSSDK ? xt2(n3) : xt2(n3 = co2(n3, a4._fileDownloadProxy, a4._authKey, a4._fileDNList)));
      }).then(function(e5) {
        return i4.width = e5.width, i4.height = e5.height, Promise.resolve(i4);
      }));
    } }, { key: "_checkImageType", value: function(e4) {
      var t3 = "", t3 = v3 ? e4.url.slice(e4.url.lastIndexOf(".") + 1) : ye3 ? e4.type.split("/")[1] : e4.files[0].name.slice(e4.files[0].name.lastIndexOf(".") + 1);
      return 0 <= Vo.indexOf(t3.toLowerCase()) || E2({ code: k2.MSG_I_TYPES_LIMIT });
    } }, { key: "_checkImageSize", value: function(e4) {
      return 0 === (e4 = (v3 || ye3 ? e4 : e4.files[0]).size) ? E2({ code: k2.MSG_F_IS_EMPTY }) : e4 < this.UPLOAD_SIZE_LIMIT.I || this._checkSizeError("I");
    } }, { key: "doUploadFile", value: function(e4) {
      return !e4.file || this._isEmptyFileList(e4.file.files) ? E2({ code: k2.MSG_F_SELECT_F_FIRST }) : e4.file.files[0].size > this.UPLOAD_SIZE_LIMIT.F ? this._checkSizeError("F") : 0 === e4.file.files[0].size ? E2({ code: k2.MSG_F_IS_EMPTY }) : (this._setUploadFileType(255), this.uploadByCOS(e4));
    } }, { key: "doUploadVideo", value: function(e4) {
      return e4.file.videoFile.size > this.UPLOAD_SIZE_LIMIT.V ? this._checkSizeError("V") : 0 === e4.file.videoFile.size ? E2({ code: k2.MSG_F_IS_EMPTY }) : -1 === Bo2.indexOf(e4.file.videoFile.type) ? E2({ code: k2.MSG_V_TYPES_LIMIT }) : (this._setUploadFileType(2), v3 || ye3 ? this.handleVideoUpload(y2(y2({}, e4), {}, { file: e4.file.videoFile })) : Ce3 ? this.handleVideoUpload(e4) : void 0);
    } }, { key: "handleVideoUpload", value: function(n3) {
      var o3 = this;
      return new Promise(function(t3, e4) {
        o3.uploadByCOS(n3).then(function(e5) {
          t3(e5);
        }).catch(function() {
          o3.uploadByCOS(n3).then(function(e5) {
            t3(e5);
          }).catch(function() {
            e4(new L2({ code: k2.MSG_V_UPLOAD_FAIL }));
          });
        });
      });
    } }, { key: "doUploadAudio", value: function(e4) {
      return e4.file ? e4.file.size > this.UPLOAD_SIZE_LIMIT.A ? this._checkSizeError("A") : 0 === e4.file.size ? E2({ code: k2.MSG_F_IS_EMPTY }) : (this._setUploadFileType(3), this.uploadByCOS(e4)) : E2({ code: k2.MSG_A_UPLOAD_FAIL });
    } }, { key: "uploadByCOS", value: function(t3) {
      var c4, u3, l3, d4, p4 = this;
      return dt3(this._cosUploadMethod) ? this.timUploadPlugin ? this._uploadWithPreSigUrl(t3) : (c4 = new P2("upload"), u3 = "".concat(this._n, ".uploadByCOS"), l3 = Date.now(), d4 = this._getFile(t3), new Promise(function(a4, s4) {
        var e4 = v3 ? p4._createCosOptionsWXMiniApp(t3) : p4._createCosOptionsWeb(t3), r3 = p4;
        p4._cosUploadMethod(e4, function(e5, t4) {
          var n3, o3, i4 = /* @__PURE__ */ Object.create(null);
          t4 ? e5 || O2(t4.files) && t4.files[0].error ? (n3 = new L2({ code: k2.MSG_F_UPLOAD_FAIL }), c4.setError(n3).end(), M2.l("".concat(u3, " failed. error:"), t4.files[0].error), 403 === t4.files[0].error.statusCode && p4._getAuthorizationKey(), s4(n3)) : (i4.fileName = d4.name, i4.fileSize = d4.size, i4.fileType = d4.type.slice(d4.type.indexOf("/") + 1).toLowerCase(), i4.location = (v3 ? t4 : t4.files[0].data).Location, n3 = Date.now() - l3, t4 = r3._formatFileSize(d4.size), o3 = r3._formatSpeed(1e3 * d4.size / n3), t4 = "size:".concat(t4, " time:").concat(n3, "ms speed:").concat(o3), M2.l("".concat(u3, " success. name:").concat(d4.name, " ").concat(t4)), a4(i4), (o3 = p4.get(26)).addCost(Zn2, n3), o3.addFileSize(Zn2, d4.size), c4.setMessage(t4).end()) : (i4 = new L2({ code: k2.MSG_F_UPLOAD_FAIL }), c4.setError(i4).end(), M2.w("".concat(u3, " failed. error:"), e5), 403 === e5.statusCode && p4._getAuthorizationKey(), s4(i4));
        });
      })) : (this.warn("PluginUndetected"), E2({ code: k2.COS_UNDETECTED }));
    } }, { key: "_uploadWithPreSigUrl", value: function(e4) {
      var p4 = this, _3 = "".concat(this._n, "._uploadWithPreSigUrl"), h4 = this._getFile(e4);
      return this._createCosOptionsPreSigUrl(e4).then(function(d4) {
        return new Promise(function(a4, s4) {
          var r3 = new P2("upload"), e5 = d4.requestSnapshotUrl, c4 = void 0 === e5 ? void 0 : e5, u3 = W2(d4, qi2), l3 = Date.now();
          p4._cosUploadMethod(u3, function(e6, t3) {
            if (e6 || 403 === t3.statusCode)
              r3.setError(new L2(e6)).end(), o3 = { HttpStatusCode: 9999, CostTime: an2(l3, false), error: e6, url: d4.url }, t3.data && t3.data.uploadIP && (o3.uploadIP = t3.data.uploadIP), p4._uploadSSOLog(o3), M2.l("".concat(_3, " failed, error:"), e6), s4(new L2({ code: k2.MSG_F_UPLOAD_FAIL }));
            else {
              var n3 = /* @__PURE__ */ Object.create(null), o3 = t3.data.location || "", e6 = (p4.isPrivateNetWork() || 0 !== o3.indexOf("https://") && 0 !== o3.indexOf("http://") || (o3 = o3.split("//")[1]), n3.fileName = h4.name, n3.fileSize = h4.size, n3.fileType = h4.type.slice(h4.type.indexOf("/") + 1).toLowerCase(), n3.location = o3, an2(l3, false)), o3 = p4._formatFileSize(h4.size), i4 = p4._formatSpeed(1e3 * h4.size / e6), o3 = "size:".concat(o3, " time:").concat(e6, "ms speed:").concat(i4, " res:").concat(JSON.stringify(t3.data)), i4 = (M2.l("".concat(_3, " ok. name:").concat(h4.name, " ").concat(o3)), r3.setMessage(o3).end(), { HttpStatusCode: t3.statusCode, FileSize: h4.size, CostTime: e6, url: d4.url }), o3 = (t3.data && t3.data.uploadIP && (i4.uploadIP = t3.data.uploadIP), p4._uploadSSOLog(i4), p4.get(26)), i4 = (o3.addCost(Zn2, e6), o3.addFileSize(Zn2, h4.size), []);
              if (u3.thumbUrl && u3.largeUrl && i4.push.apply(i4, [p4._getSmallImageInfoByUrl(u3.thumbUrl, n3), p4._getLargeImageInfoByUrl(u3.largeUrl, n3)]), 1 === p4.uploadFileType && p4.isSimpleCos && !p4.isPrivateNetWork() && (i4.push(p4._getImageInfoArray(u3.downloadUrl, n3)), t3.data.uploadIP) && i4.push(p4._getDownloadIP(u3.downloadUrl.split("//")[1].split("/")[0], n3)), c4 && i4.push(p4._getSnapshotInfoByUrl(c4, n3)), 0 < i4.length)
                return Promise.all(i4).then(function() {
                  a4(n3);
                });
              a4(n3);
            }
          });
        });
      });
    } }, { key: "_getDownloadIP", value: function(e4, n3) {
      var o3 = "".concat(this._n, "._getDownloadIP"), i4 = Date.now();
      return this.req({ P: G2.GET_IP, data: { domainName: e4 } }).then(function(e5) {
        var t3;
        e5.data && e5.data.ip && (M2.l("".concat(o3, " ok. downloadIP:").concat(e5.data.ip, " cost:").concat(an2(i4))), (t3 = n3.location.split("/"))[0] = e5.data.ip, n3.location = t3.join("/"));
      }).catch(function(e5) {
      });
    } }, { key: "_getImageInfoArray", value: function(t3, n3) {
      var o3 = this, i4 = "".concat(this._n, "._getImageInfoArray"), a4 = Date.now();
      return this.req({ P: G2.GET_IMAGE_INFO, data: { imageUrl: t3 } }).then(function(e4) {
        e4 = e4.data || {};
        return M2.l("".concat(i4, " ok. data: ").concat(JSON.stringify(e4), " cost:").concat(an2(a4))), n3.imageInfoArray = e4.imageInfoArray, e4;
      }).catch(function(e4) {
        n3.imageInfoArray = void 0, o3._uploadSSOLog({ HttpStatusCode: 1e4, CostTime: an2(a4, false), url: t3 });
      });
    } }, { key: "_uploadSSOLog", value: function(e4) {
      var t3, n3;
      this.isSimpleCos && ((t3 = new P2()).setEventType(18), e4.error && t3.setError(new L2(e4.error)), n3 = "HttpStatusCode:".concat(e4.HttpStatusCode, "|CosRequestId:").concat(e4.CosRequestId || "", "|") + "FileAlreadyExist:".concat(e4.FileAlreadyExist || 0, "|FileSize:").concat(e4.FileSize || 0, "|CostTime:").concat(e4.CostTime), e4.uploadIP && (n3 += "|FinalIP:".concat(e4.uploadIP)), t3.setMessage("OK").setMoreMessage(e4.url).setExtension(n3).end());
    } }, { key: "_getRawOrUploadProxyUrl", value: function(e4) {
      var t3 = this.get(12).getFileUploadProxy(), n3 = e4;
      return n3 = t3 ? e4.replace(/^https:\/\/[^/]+/, t3) : n3;
    } }, { key: "_getFile", value: function(e4) {
      return O2(e4.file.files) || pt3(e4.file.files) ? e4.file.files[0] : e4.file;
    } }, { key: "_formatFileSize", value: function(e4) {
      return e4 < 1024 ? e4 + "B" : e4 < 1048576 ? Math.floor(e4 / 1024) + "KB" : Math.floor(e4 / 1048576) + "MB";
    } }, { key: "_formatSpeed", value: function(e4) {
      return e4 <= 1048576 ? jt2(e4 / 1024, 1) + "KB/s" : jt2(e4 / 1048576, 1) + "MB/s";
    } }, { key: "_createCosOptionsWeb", value: function(t3) {
      var e4 = this._getFile(t3), n3 = e4.name, n3 = n3.slice(n3.lastIndexOf(".")), n3 = this._genFileName("".concat(mt3(999999)).concat(n3));
      return { files: [{ Bucket: "".concat(this.bucketName, "-").concat(this.appid), Region: this.region, Key: "".concat(this.directory, "/").concat(n3), Body: e4 }], SliceSize: 1048576, onProgress: function(e5) {
        if ("function" == typeof t3.onProgress)
          try {
            t3.onProgress(e5.percent);
          } catch (e6) {
            M2.w("onProgress callback error:", e6);
          }
      }, onFileFinish: function(e5, t4, n4) {
      } };
    } }, { key: "_createCosOptionsWXMiniApp", value: function(t3) {
      var e4 = this._getFile(t3), n3 = this._genFileName(e4.name), e4 = e4.url;
      return { Bucket: "".concat(this.bucketName, "-").concat(this.appid), Region: this.region, Key: "".concat(this.directory, "/").concat(n3), FilePath: e4, onProgress: function(e5) {
        if (M2.l(JSON.stringify(e5)), "function" == typeof t3.onProgress)
          try {
            t3.onProgress(e5.percent);
          } catch (e6) {
            M2.w("onProgress callback error:", e6);
          }
      } };
    } }, { key: "_createCosOptionsPreSigUrl", value: function(r3) {
      var e4, c4 = this, u3 = "", l3 = "", t3 = 0, n3 = this._getFile(r3), t3 = v3 || ye3 ? (u3 = r3.message.type === R2.MSG_FILE ? (e4 = (e4 = n3.name).slice(e4.lastIndexOf(".")), this._genFileName("".concat(mt3(999999)).concat(e4))) : this._genFileName(n3.name), l3 = n3.url, 1) : (e4 = (e4 = n3.name).slice(e4.lastIndexOf(".")), u3 = this._genFileName("".concat(mt3(999999)).concat(e4)), l3 = n3, 0);
      return this._getCosPreSigUrl({ fileType: this.uploadFileType, fileName: u3, uploadMethod: t3, duration: this.duration, userID: r3.message.from, conversationType: bt3(r3.message.conversationID) ? 1 : 2 }).then(function(e5) {
        var t4 = c4.isSimpleCos ? e5.preSig[0] : e5, n4 = t4.uploadUrl, o3 = t4.downloadUrl, i4 = t4.requestSnapshotUrl, i4 = void 0 === i4 ? void 0 : i4, a4 = t4.thumbUrl, s4 = t4.largeUrl, t4 = t4.fileKey, e5 = e5.uploadIP, e5 = void 0 === e5 ? "" : e5;
        return { url: c4._getRawOrUploadProxyUrl(n4), fileType: c4.uploadFileType, fileName: u3, resources: l3, downloadUrl: o3, requestSnapshotUrl: i4, thumbUrl: a4, largeUrl: s4, fileKey: t4, uploadIP: !c4.isPrivateNetWork() && e5, onProgress: function(e6) {
          if ("function" == typeof r3.onProgress)
            try {
              r3.onProgress(e6.percent);
            } catch (e7) {
              M2.w("onProgress callback error:", e7), M2.e(e7);
            }
        } };
      });
    } }, { key: "_genFileName", value: function(e4) {
      return "".concat(Vt2(), "-").concat(e4);
    } }, { key: "_setUploadFileType", value: function(e4) {
      this.uploadFileType = e4;
    } }, { key: "_getSnapshotInfoByUrl", value: function(e4, n3) {
      var o3 = this, i4 = "_getSnapshotInfoByUrl", a4 = new P2(i4);
      return this.req({ P: G2.VIDEO_COVER, data: { platform: this.getPlatform(), coverName: this._genFileName(mt3(99999)), requestSnapshotUrl: e4 } }).then(function(e5) {
        var t3, e5 = (e5.data || {}).snapshotUrl;
        return M2.l("".concat(o3._n, ".").concat(i4, " ok. snapshotUrl:").concat(e5)), a4.setMessage("snapshotUrl:".concat(e5)).end(), S2(e5) ? {} : xt2(t3 = co2(e5, o3._fileDownloadProxy, o3._authKey, o3._fileDNList)).then(function(e6) {
          n3.snapshotInfo = { snapshotUrl: t3, snapshotWidth: e6.width, snapshotHeight: e6.height };
        });
      }).catch(function(e5) {
        return M2.w("".concat(o3._n, ".").concat(i4, " failed. error:"), e5), a4.setCode(e5.errorCode).setMessage(e5.errorInfo).end(), {};
      });
    } }, { key: "_getSmallImageInfoByUrl", value: function(t3, n3) {
      return xt2(co2(t3, this._fileDownloadProxy, this._authKey, this._fileDNList)).then(function(e4) {
        n3.smallImageUrl = t3, n3.smallImageWidth = e4.width, n3.smallImageHeight = e4.height;
      });
    } }, { key: "_getLargeImageInfoByUrl", value: function(t3, n3) {
      return xt2(co2(t3, this._fileDownloadProxy, this._authKey, this._fileDNList)).then(function(e4) {
        n3.largeImageUrl = t3, n3.largeImageWidth = e4.width, n3.largeImageHeight = e4.height;
      });
    } }, { key: "_isEmptyFileList", value: function(e4) {
      return !(!pt3(e4) || 0 !== e4.length);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }])), Vi2 = ["downloadKey", "pbDownloadKey", "messageList"], Bi2 = e3(function e4(t3) {
      p3(this, e4), this._n = "MergerMessageHandler", this._msgM = t3;
    }, [{ key: "uploadMergerMessage", value: function(e4, n3) {
      var o3 = "".concat(this._n, ".").concat("uploadMergerMessage"), e4 = (M2.d("".concat(o3, " message:"), e4, "messageBytes:".concat(n3)), JSON.parse(JSON.stringify(e4.payload)).messageList), i4 = e4.length, t3 = this._msgM.get(17).getFileDNList(), a4 = new P2("uploadMergerMessage");
      return e4.forEach(function(e5) {
        uo2(e5.messageBody[0].type, e5.messageBody, t3);
      }), this._msgM.req({ P: G2.UPLOAD_MERGER_MSG, data: { messageList: e4 } }).then(function(e5) {
        M2.d("".concat(o3, " ok. response:"), e5.data);
        var e5 = e5.data, t4 = e5.pbDownloadKey, e5 = e5.downloadKey, t4 = { pbDownloadKey: t4, downloadKey: e5, messageNumber: i4 };
        return a4.setMessage("".concat(i4, "-").concat(n3, "-").concat(e5)).end(), t4;
      }).catch(function(e5) {
        throw M2.w("".concat(o3, " failed. error:"), e5), a4.setError(e5).end(), e5;
      });
    } }, { key: "downloadMergerMessage", value: function(i4) {
      var a4 = this, s4 = "".concat(this._n, ".").concat("downloadMergerMessage"), t3 = (M2.d("".concat(s4, " message:"), i4), i4.payload.downloadKey), r3 = this._msgM.getFileDownloadProxy(), c4 = this._msgM.getDownloadFileAuthKey(), u3 = new P2("downloadMergerMessage");
      return u3.setMessage("downloadKey:".concat(t3)), this._msgM.req({ P: G2.DOWNLOAD_MERGER_MSG, data: { downloadKey: t3 } }).then(function(e4) {
        M2.d("".concat(s4, " ok. response:"), e4.data);
        var t4, n3, o3 = a4._msgM.get(17).getFileDNList();
        return dt3(i4.clearElement) ? ((t4 = i4.payload).downloadKey, t4.pbDownloadKey, t4.messageList, t4 = W2(t4, Vi2), i4.clearElement(), i4.setElement({ type: i4.type, content: y2({ messageList: e4.data.messageList }, t4) }, r3, c4, o3)) : (n3 = [], e4.data.messageList.forEach(function(e5) {
          S2(e5) || (e5 = new Do2(e5, r3, c4, o3), n3.push(e5));
        }), i4.payload.messageList = n3, i4.payload.downloadKey = "", i4.payload.pbDownloadKey = ""), u3.end(), i4;
      }).catch(function(e4) {
        throw M2.w("".concat(s4, " failed. key:").concat(t3, " error:"), e4), u3.setError(e4).end(), e4;
      });
    } }, { key: "createMergerMessagePack", value: function(e4, t3, n3) {
      return e4.conversationType === R2.CONV_C2C ? this._createC2CMergerMessagePack(e4, t3, n3) : this._createGroupMergerMessagePack(e4, t3, n3);
    } }, { key: "_createC2CMergerMessagePack", value: function(e4, t3, n3) {
      var o3 = null, i4 = (t3 && (t3.offlinePushInfo && (o3 = t3.offlinePushInfo), true === t3.onlineUserOnly) && (o3 ? o3.disablePush = true : o3 = { disablePush: true }), []), a4 = (m3(t3) && m3(t3.messageControlInfo) && (a4 = (r3 = t3.messageControlInfo).excludedFromUnreadCount, s4 = r3.excludedFromLastMessage, r3 = r3.excludedFromContentModeration, true === a4 && i4.push("NoUnread"), true === s4 && i4.push("NoLastMsg"), true === r3) && i4.push("NoMsgCheck"), ""), s4 = (C2(e4.cloudCustomData) && 0 < e4.cloudCustomData.length && (a4 = e4.cloudCustomData), n3.pbDownloadKey), r3 = n3.downloadKey, n3 = n3.messageNumber, c4 = e4.payload, u3 = c4.title, l3 = c4.abstractList, c4 = c4.compatibleText, d4 = this._msgM.get(6), d4 = d4 && d4.isOnlineMessage(e4, t3) ? 0 : void 0;
      return { P: G2.SEND_C2C_MSG, data: { fromAccount: this._msgM.getMyUserID(), toAccount: e4.to, msgBody: [{ msgType: e4.type, msgContent: { pbDownloadKey: s4, downloadKey: r3, title: u3, abstractList: l3, compatibleText: c4, messageNumber: n3 } }], cloudCustomData: a4, clientTime: e4.clientTime, msgSeq: e4.sequence, msgRandom: e4.random, msgLifeTime: d4, offlinePushInfo: Go2(o3), messageControlInfo: 0 !== d4 ? i4 : void 0, isSupportExtension: true === e4.isSupportExtension ? 1 : 0, isRelayMessage: true === e4._relayFlag ? 1 : 0 } };
    } }, { key: "_createGroupMergerMessagePack", value: function(e4, t3, n3) {
      var o3 = null, i4 = (t3 && t3.offlinePushInfo && (o3 = t3.offlinePushInfo), []), a4 = (m3(t3) && m3(t3.messageControlInfo) && (a4 = (r3 = t3.messageControlInfo).excludedFromUnreadCount, s4 = r3.excludedFromLastMessage, r3 = r3.excludedFromContentModeration, true === a4 && i4.push("NoUnread"), true === s4 && i4.push("NoLastMsg"), true === r3) && i4.push("NoMsgCheck"), ""), s4 = (C2(e4.cloudCustomData) && 0 < e4.cloudCustomData.length && (a4 = e4.cloudCustomData), n3.pbDownloadKey), r3 = n3.downloadKey, n3 = n3.messageNumber, c4 = e4.payload, u3 = c4.title, l3 = c4.abstractList, c4 = c4.compatibleText, d4 = this._msgM.get(7), t3 = d4 && d4.isOnlineMessage(e4, t3) ? 1 : 0;
      return { P: G2.SEND_GRP_MSG, data: { fromAccount: this._msgM.getMyUserID(), groupID: e4.to, msgBody: [{ msgType: e4.type, msgContent: { pbDownloadKey: s4, downloadKey: r3, title: u3, abstractList: l3, compatibleText: c4, messageNumber: n3 } }], random: e4.random, priority: e4.priority, clientSequence: e4.clientSequence, groupAtInfo: void 0, cloudCustomData: a4, onlineOnlyFlag: t3, offlinePushInfo: Go2(o3), clientTime: e4.clientTime, needReadReceipt: true !== e4.needReadReceipt || d4.isMessageFromOrToAVChatroom(e4.to) ? 0 : 1, messageControlInfo: 0 == t3 ? i4 : void 0, isSupportExtension: true === e4.isSupportExtension ? 1 : 0, isRelayMessage: true === e4._relayFlag ? 1 : 0 } };
    } }]), Hi2 = { ERR_SVR_COMM_SENSITIVE_TEXT: 80001, ERR_SVR_COMM_BODY_SIZE_LIMIT: 80002, OPEN_SERVICE_OVERLOAD_ERROR: 60022, ERR_SVR_MSG_PKG_PARSE_FAILED: 20001, ERR_SVR_MSG_INTERNAL_AUTH_FAILED: 20002, ERR_SVR_MSG_INVALID_ID: 20003, ERR_SVR_MSG_PUSH_DENY: 20006, ERR_SVR_MSG_IN_PEER_BLACKLIST: 20007, ERR_SVR_MSG_BOTH_NOT_FRIEND: 20009, ERR_SVR_MSG_NOT_PEER_FRIEND: 20010, ERR_SVR_MSG_NOT_SELF_FRIEND: 20011, ERR_SVR_MSG_SHUTUP_DENY: 20012, ERR_SVR_GROUP_INVALID_PARAMETERS: 10004, ERR_SVR_GROUP_PERMISSION_DENY: 10007, ERR_SVR_GROUP_NOT_FOUND: 10010, ERR_SVR_GROUP_INVALID_GROUPID: 10015, ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY: 10016, ERR_SVR_GROUP_SHUTUP_DENY: 10017, MSG_SEND_FAIL: 2100, OVER_FREQUENCY_LIMIT: 2996 }, Ki2 = [k2.MSG_ONPROGRESS_ERR, k2.MSG_I_SELECT_F_FIRST, k2.MSG_I_TYPES_LIMIT, k2.MSG_F_IS_EMPTY, k2.MSG_I_SIZE_LIMIT, k2.MSG_F_SELECT_F_FIRST, k2.MSG_F_SIZE_LIMIT, k2.MSG_V_SIZE_LIMIT, k2.MSG_V_TYPES_LIMIT, k2.MSG_A_UPLOAD_FAIL, k2.MSG_A_SIZE_LIMIT, k2.COS_UNDETECTED];
    function Wi2(e4) {
      p3(this, Wi2), (e4 = i3(this, Wi2, [e4]))._n = "UploadModule", e4.TIMUploadPlugin = null, e4.timUploadPlugin = null, e4.COSSDK = null, e4._cosUploadMethod = null, e4.expiredTimeLimit = 600, e4.appid = 0, e4.bucketName = "", e4.ciUrl = "", e4.directory = "", e4.downloadUrl = "", e4.uploadUrl = "", e4.region = "ap-shanghai", e4.cos = null, e4.cosOptions = { secretId: "", secretKey: "", sessionToken: "", expiredTime: 0 }, e4.uploadFileType = "", e4.duration = 900, e4.tryCount = 0, e4.UPLOAD_SIZE_LIMIT = { A: 20971520, F: 104857600, I: 20971520, V: 104857600 }, e4.isSimpleCos = false, e4._fileDownloadProxy = "", e4._authKey = "", e4._fileDNList = Fi2;
      var t3 = e4.getIEmitInst();
      return t3.on(U2.A2KEY_AND_TINYID_UPDATED, e4._init, e4), t3.on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function Yi2(e4) {
      var t3 = false;
      return Object.values(Hi2).includes(e4) && (t3 = true), t3 = 120001 <= e4 && e4 <= 13e4 || 10100 <= e4 && e4 <= 10200 ? true : t3;
    }
    t2(aa, c3);
    var ji2 = e3(aa, [{ key: "createTextMessage", value: function(e4) {
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), new So2(e4)), e4 = C2(e4.payload) ? e4.payload : e4.payload.text, e4 = new ao2({ text: e4 }), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e4), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "createImageMessage", value: function(e4) {
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), new So2(e4));
      if (v3) {
        var o3 = e4.payload.file;
        if (ct3(o3))
          return void this.warn("FileUnsupportedInMP", "createImageMessage");
        var i4 = o3.tempFiles[0].path || o3.tempFiles[0].tempFilePath, o3 = { url: i4, name: i4.slice(i4.lastIndexOf("/") + 1), size: o3.tempFiles && o3.tempFiles[0].size || 1, type: i4.slice(i4.lastIndexOf(".") + 1).toLowerCase() };
        e4.payload.file = o3;
      } else
        ye3 ? (o3 = { url: (i4 = e4.payload.file).uri, name: i4.fileName, size: i4.fileSize || 1, type: i4.type, width: i4.width, height: i4.height }, e4.payload.file = o3) : Ce3 && (ct3(e4.payload.file) ? (i4 = e4.payload.file, e4.payload.file = { files: [i4] }) : m3(e4.payload.file) && "undefined" != typeof index && (o3 = e4.payload.file.tempFiles[0], e4.payload.file = { files: [o3] }));
      i4 = this.get(17).getFileDNList(), o3 = new _o2({ imageFormat: Xe3.UNKNOWN, uuid: this._generateUUID(e4.payload.file), file: e4.payload.file }, this.getFileDownloadProxy(), this.getDownloadFileAuthKey(), i4), i4 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(o3), n3.setNickAndAvatar(i4), n3.setNameCard(this._getNameCardByGroupID(n3)), this._messageOptionsMap.set(n3.clientSequence, e4), n3;
    } }, { key: "createAudioMessage", value: function(e4) {
      var t3 = e4.payload.file, n3 = (v3 && (n3 = { url: t3.tempFilePath, name: t3.tempFilePath.slice(t3.tempFilePath.lastIndexOf("/") + 1), size: t3.fileSize, second: parseInt(t3.duration) / 1e3, type: t3.tempFilePath.slice(t3.tempFilePath.lastIndexOf(".") + 1).toLowerCase() }, e4.payload.file = n3), ye3 && (n3 = { url: t3.uri, name: t3.uri.slice(t3.uri.lastIndexOf("/") + 1), size: t3.fileSize || 1, second: Math.floor(t3.duration / 1e3), type: t3.uri.slice(t3.uri.lastIndexOf(".") + 1).toLowerCase() }, e4.payload.file = n3, S2(t3.uri)) && this.warn("VoiceFileInRN"), this.getMyUserID()), o3 = (e4.currentUser = n3, e4.senderTinyID = this.getMyTinyID(), this.get(17).getFileDNList()), i4 = new So2(e4), t3 = new go2({ second: Math.floor(t3.duration / 1e3), size: t3.fileSize || t3.size || 1, url: t3.tempFilePath || t3.uri, uuid: this._generateUUID(e4.payload.file) }, this.getFileDownloadProxy(), this.getDownloadFileAuthKey(), o3), o3 = this._getNickAndAvatarByUserID(n3);
      return i4.setElement(t3), i4.setNickAndAvatar(o3), i4.setNameCard(this._getNameCardByGroupID(i4)), this._messageOptionsMap.set(i4.clientSequence, e4), i4;
    } }, { key: "createVideoMessage", value: function(e4) {
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), e4.payload.file.thumbUrl = "", e4.payload.file.thumbSize = 0, {});
      if (v3) {
        if (ve3)
          return void this.warn("VideoUnsupportedInAlipay");
        if (ct3(e4.payload.file))
          return void this.warn("FileUnsupportedInMP", "createVideoMessage");
        var o3 = e4.payload.file;
        O2(o3.tempFiles) && (o3 = o3.tempFiles[0]), n3.url = o3.tempFilePath, n3.name = o3.tempFilePath.slice(o3.tempFilePath.lastIndexOf("/") + 1), n3.size = o3.size || 1, n3.second = o3.duration || 0, n3.type = o3.tempFilePath.slice(o3.tempFilePath.lastIndexOf(".") + 1).toLowerCase();
      } else
        ye3 ? (o3 = e4.payload.file, n3.url = o3.uri, n3.name = o3.fileName, n3.size = o3.fileSize || 1, n3.second = o3.duration || 0, n3.type = o3.type.split("/")[1]) : Ce3 && (ct3(e4.payload.file) ? (o3 = e4.payload.file, e4.payload.file.files = [o3]) : m3(e4.payload.file) && "undefined" != typeof index && (o3 = e4.payload.file.tempFile, e4.payload.file.files = [o3]), o3 = e4.payload.file, n3.url = window.URL.createObjectURL(o3.files[0]), n3.name = o3.files[0].name, n3.size = o3.files[0].size || 1, n3.second = o3.files[0].duration || 0, n3.type = o3.files[0].type.split("/")[1]);
      e4.payload.file.videoFile = n3;
      var o3 = this.get(17).getFileDNList(), i4 = new So2(e4), n3 = new Co2({ videoFormat: n3.type, videoSecond: jt2(n3.second, 0), videoSize: n3.size, remoteVideoUrl: "", videoUrl: n3.url, videoUUID: this._generateUUID(e4.payload.file.videoFile), thumbUUID: this._generateUUID(e4.payload.file.videoFile, "jpg"), thumbWidth: e4.payload.file.width || 200, thumbHeight: e4.payload.file.height || 200, thumbUrl: e4.payload.file.thumbUrl, thumbSize: e4.payload.file.thumbSize, thumbFormat: "jpg" }, this.getFileDownloadProxy(), this.getDownloadFileAuthKey(), o3), o3 = this._getNickAndAvatarByUserID(t3);
      return i4.setElement(n3), i4.setNickAndAvatar(o3), i4.setNameCard(this._getNameCardByGroupID(i4)), this._messageOptionsMap.set(i4.clientSequence, e4), i4;
    } }, { key: "createCustomMessage", value: function(e4) {
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), new So2(e4)), e4 = new yo2({ data: e4.payload.data, description: e4.payload.description, extension: e4.payload.extension }), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e4), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "createFaceMessage", value: function(e4) {
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), new So2(e4)), e4 = new ho2(e4.payload), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e4), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "createMergerMessage", value: function(e4) {
      var t3 = this.getMyUserID(), t3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), this._getNickAndAvatarByUserID(t3)), n3 = new So2(e4), e4 = new Eo2(e4.payload);
      return n3.setElement(e4), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3.setRelayFlag(true), n3;
    } }, { key: "createForwardMessage", value: function(e4) {
      var t3, n3, o3 = e4.to, i4 = e4.conversationType, a4 = e4.priority, s4 = e4.payload, r3 = e4.needReadReceipt, c4 = e4.receiverList;
      return O2(s4._elements) ? (t3 = this.getMyUserID(), n3 = this._getNickAndAvatarByUserID(t3), s4.type === R2.MSG_GRP_TIP ? E2({ code: k2.MSG_FORWARD_TYPE_INVALID }) : (i4 = { to: o3, conversationType: i4, conversationID: "".concat(i4).concat(o3), priority: a4, isPlaceMessage: 0, status: Gn2, currentUser: t3, senderTinyID: this.getMyTinyID(), cloudCustomData: e4.cloudCustomData || s4.cloudCustomData || "", needReadReceipt: r3, receiverList: c4, isSupportExtension: e4.isSupportExtension || false }, (o3 = new So2(i4)).setElement(s4._elements[0]), o3.setNickAndAvatar(n3), o3.setNameCard(this._getNameCardByGroupID(s4)), o3.setRelayFlag(true), o3)) : E2({ code: k2.MSG_FORWARD_INVALID_ELEMENTS });
    } }, { key: "downloadMergerMessage", value: function(e4) {
      return this._mergerMessageHandler.downloadMergerMessage(e4);
    } }, { key: "createFileMessage", value: function(e4) {
      if (v3) {
        if (!_e3 && !ge2 && !Ie2)
          return;
        var t3 = I2.getSystemInfoSync().SDKVersion;
        if (_e3 && Ht2(t3, "2.5.0") < 0)
          return void this.warn("WXChooseMessageFile");
        if (ge2 && Ht2(t3, "1.18.0") < 0)
          return void this.warn("QQChooseMessageFile");
      }
      Ce3 || Ie2 ? ct3(e4.payload.file) ? (t3 = e4.payload.file, e4.payload.file = { files: [t3] }) : m3(e4.payload.file) && "undefined" != typeof index && (o3 = (t3 = e4.payload.file).tempFiles, t3 = t3.files, n3 = null, O2(o3) ? n3 = o3[0] : O2(t3) && (n3 = t3[0]), e4.payload.file = { files: [n3] }) : _e3 || ge2 ? (t3 = y2(y2({}, (o3 = e4.payload.file.tempFiles)[0]), {}, { url: o3[0].path }), e4.payload.file = { files: [t3] }) : ye3 && (o3 = y2(y2({}, n3 = e4.payload.file), {}, { url: n3.uri }), e4.payload.file = { files: [o3] });
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), new So2(e4)), o3 = new Mo2({ uuid: this._generateUUID(e4.payload.file), file: e4.payload.file }), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(o3), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), this._messageOptionsMap.set(n3.clientSequence, e4), n3;
    } }, { key: "createLocationMessage", value: function(e4) {
      var t3 = this.getMyUserID(), n3 = (e4.currentUser = t3, e4.senderTinyID = this.getMyTinyID(), new So2(e4)), e4 = new To2(e4.payload), t3 = this._getNickAndAvatarByUserID(t3);
      return n3.setElement(e4), n3.setNickAndAvatar(t3), n3.setNameCard(this._getNameCardByGroupID(n3)), n3;
    } }, { key: "_onNoModule", value: function() {
      return E2({ code: k2.NO_MODULE });
    } }, { key: "sendMessageInstance", value: function(i4, a4) {
      var s4 = this;
      if (false === this.get(29).filterMessage(i4, a4))
        return i4.hasRiskContent = true, this._onSendMessageFailed(i4, new L2({ code: k2.PROFANITY_FOUND }));
      var r3, c4, u3, l3, t3 = null;
      if (i4.conversationType === R2.CONV_C2C)
        t3 = this.get(6);
      else {
        if (i4.conversationType !== R2.CONV_GROUP)
          return E2({ code: k2.MSG_INVALID_CONV_TYPE });
        t3 = this.get(7);
      }
      return t3 ? (c4 = "".concat(this._n, ".sendMessageInstance"), u3 = this.get(11), l3 = t3.isOnlineMessage(i4, a4), this.get(17).upload(i4).then(function() {
        return s4._getSendMessageSpecifiedKey(i4) === Xn2 && s4.get(26).addSuccessCount(Zn2), s4._guardForGroup(i4).then(function() {
          if (!i4.isSendable())
            return E2({ code: k2.MSG_F_URL_IS_EMPTY });
          s4._addSendMessageTotalCount(i4), r3 = Date.now();
          var e4 = function(e5) {
            var t4 = "utf-8";
            Ce3 && document && (t4 = document.charset.toLowerCase());
            var n3, o3 = 0, i5 = e5.length;
            if ("utf-8" === t4 || "utf8" === t4)
              for (var a5 = 0; a5 < i5; a5++)
                (n3 = e5.codePointAt(a5)) <= 127 ? o3 += 1 : n3 <= 2047 ? o3 += 2 : n3 <= 65535 ? o3 += 3 : (o3 += 4, a5++);
            else if ("utf-16" === t4 || "utf16" === t4)
              for (var s5 = 0; s5 < i5; s5++)
                (n3 = e5.codePointAt(s5)) <= 65535 ? o3 += 2 : (o3 += 4, s5++);
            else
              o3 = e5.replace(/[^\x00-\xff]/g, "aa").length;
            return o3;
          }(JSON.stringify(i4));
          return i4.type === R2.MSG_MERGER && 11264 < e4 ? s4._mergerMessageHandler.uploadMergerMessage(i4, e4).then(function(e5) {
            e5 = s4._mergerMessageHandler.createMergerMessagePack(i4, a4, e5);
            return s4.req(e5);
          }) : (u3.setMessageRandom(i4), t3.sendMessage(i4, a4));
        }).then(function(e4) {
          var e4 = e4.data, t4 = e4.time, n3 = e4.sequence, o3 = e4.readReceiptCode, e4 = e4.messageDropReason, e4 = (A2(o3) && 0 !== o3 && (new P2("sendMessageWithReceipt").setMessage("from:".concat(i4.from, " to:").concat(i4.to, " sequence:").concat(n3, " readReceiptCode:").concat(o3)).end(), M2.w("".concat(c4, " readReceiptCode:").concat(o3, " message:").concat(s4.getErrMsg(o3)))), e4 && (o3 = new P2("messageDropReason"), e4 = "from:".concat(i4.from, " to:").concat(i4.to, " sequence:").concat(n3, " messageDropReason:").concat(e4), o3.setMessage(e4).end(), M2.w("".concat(c4, " ").concat(e4))), s4._addSendMessageSuccessCount(i4, r3), s4._messageOptionsMap.delete(i4.clientSequence), true === i4.isResend && (o3 = u3.findMessage(i4.ID)) && (M2.l("".concat(c4, " resend ok. ID:").concat(o3.ID)), u3.deleteLocalMessage(o3)), i4.status = Pn2, i4.time = t4, false);
          return i4.conversationType === R2.CONV_GROUP ? i4.sequence = n3 : i4.conversationType === R2.CONV_C2C && (o3 = u3.getLatestMessageSentByMe(i4.conversationID)) && (t4 = o3.nick, n3 = o3.avatar, t4 === i4.nick && n3 === i4.avatar || (e4 = true)), e4 && u3.modifyMessageSentByMe({ conversationID: i4.conversationID, latestNick: i4.nick, latestAvatar: i4.avatar }), true === l3 ? i4._onlineOnlyFlag = true : (u3.appendToMessageList(i4), o3 = i4, m3(a4) && m3(a4.messageControlInfo) && (true === a4.messageControlInfo.excludedFromLastMessage && (i4._isExcludedFromLastMessage = true, o3 = ""), true === a4.messageControlInfo.excludedFromUnreadCount) && (i4._isExcludedFromUnreadCount = true), t4 = i4.conversationType, Ut2(i4.to) && (t4 = R2.CONV_TOPIC, s4.get(10).onMessageSent({ groupID: Xt2(i4.to), topicID: i4.to, lastMessage: o3 })), u3.onMessageSent({ conversationOptionsList: [{ conversationID: i4.conversationID, unreadCount: 0, type: t4, subType: i4.conversationSubType, lastMessage: o3 }] })), i4._relayFlag || "TIMImageElem" !== i4.type || Wt2(i4.payload.imageInfoArray), T2({ message: i4 });
        });
      }).catch(function(e4) {
        return s4._onSendMessageFailed(i4, e4, l3);
      })) : this._onNoModule();
    } }, { key: "_guardForGroup", value: function(e4) {
      if (e4.conversationType !== R2.CONV_GROUP)
        return Promise.resolve();
      var t3 = this.get(7);
      if (!t3)
        return this._onNoModule();
      if (Pt2({ groupID: e4.to })) {
        var n3 = t3.getLocalGroupProfile(e4.to);
        if (n3 && n3.isSupportTopic)
          return E2({ code: k2.MSG_SEND_GRP_WITH_TOPIC_FAIL });
      }
      return t3.guardForAVChatRoom(e4);
    } }, { key: "_onSendMessageFailed", value: function(e4, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] && arguments[2], o3 = "".concat(this._n, "._onSendMessageFailed"), i4 = (e4.status = Un2, 80001 !== t3.code && 80004 !== t3.code || (e4.hasRiskContent = true), this.get(11)), a4 = (i4.deleteMessageRandom(e4), 10100 <= t3.code && t3.code <= 10200 || 120001 <= t3.code && t3.code <= 13e4), n3 = (n3 || a4 || true === i4.appendToMessageList(e4) && M2.l("".concat(o3, " message stored, ID:").concat(e4.ID)), this._addSendMessageFailCountOnUser(e4, t3), new P2("sendMessage")), a4 = "head.seq:".concat(t3.data.headSeq, " type:").concat(e4.type, " from:").concat(e4.from, " to:").concat(e4.to);
      return Ce3 && ("connection" in navigator && (i4 = navigator.connection, a4 += " downlink:".concat(i4.downlink, " effectiveType:").concat(i4.effectiveType, " rtt:").concat(i4.rtt)), "memory" in window.performance) && (i4 = window.performance.memory, a4 += " usedJSHeapSize:".concat(i4.usedJSHeapSize, " totalJSHeapSize:").concat(i4.totalJSHeapSize, " jsHeapSizeLimit:").concat(i4.jsHeapSizeLimit)), n3.setMessage(a4).setError(t3).end(), M2.e("".concat(o3, " ").concat(a4, " error:"), t3), E2(new L2({ code: t3 && t3.code ? t3.code : k2.MSG_SEND_FAIL, message: t3 && t3.message ? t3.message : void 0, data: { message: e4 } }));
    } }, { key: "_getSendMessageSpecifiedKey", value: function(e4) {
      if ([R2.MSG_IMAGE, R2.MSG_AUDIO, R2.MSG_VIDEO, R2.MSG_FILE].includes(e4.type))
        return Xn2;
      if (e4.conversationType === R2.CONV_C2C)
        return jn2;
      if (e4.conversationType === R2.CONV_GROUP) {
        var t3 = this.get(7);
        if (t3) {
          t3 = t3.getLocalGroupProfile(e4.to);
          if (t3)
            return e4 = t3.type, Gt2(e4) ? zn2 : Jn2;
        }
      }
    } }, { key: "_addSendMessageTotalCount", value: function(e4) {
      e4 = this._getSendMessageSpecifiedKey(e4);
      e4 && this.get(26).addTotalCount(e4);
    } }, { key: "_addSendMessageSuccessCount", value: function(e4, t3) {
      var n3, e4 = this._getSendMessageSpecifiedKey(e4);
      e4 && ((n3 = this.get(26)).addSuccessCount(e4), n3.addCost(e4, an2(t3, false)));
    } }, { key: "_addSendMessageFailCountOnUser", value: function(e4, t3) {
      var n3, t3 = t3.code, t3 = void 0 === t3 ? -1 : t3, o3 = this.get(26), e4 = this._getSendMessageSpecifiedKey(e4);
      e4 === Xn2 && (n3 = false, n3 = Ki2.includes(t3) ? true : n3) ? o3.addFailedCountOfUserSide(Zn2) : Yi2(t3) && e4 && o3.addFailedCountOfUserSide(e4);
    } }, { key: "resendMessage", value: function(e4, t3) {
      return e4.isResend = true, e4.status = Gn2, this.sendMessageInstance(e4, t3);
    } }, { key: "revokeMessage", value: function(n3) {
      var o3, i4, t3 = this, e4 = null;
      return n3.conversationType === R2.CONV_C2C ? e4 = this.get(6) : n3.conversationType === R2.CONV_GROUP && (e4 = this.get(7)), e4 ? ((o3 = new P2("revokeMessage")).setMessage("type:".concat(n3.type, " from:").concat(n3.from, " to:").concat(n3.to)), i4 = "".concat(this._n, ".").concat("revokeMessage"), e4.revokeMessage(n3).then(function(e5) {
        var e5 = e5.data.recallRetList;
        return S2(e5) || 0 === e5[0].retCode ? (M2.i("".concat(i4, " ok. ID:").concat(n3.ID)), n3.isRevoked = true, o3.end(), t3.get(11).onMessageRevoked([n3]), T2({ message: n3 })) : (e5 = new L2({ code: e5[0].retCode, data: { message: n3 } }), o3.setCode(e5.code).setMoreMessage(e5.message).end(), E2(e5));
      }).catch(function(e5) {
        o3.setError(e5).end();
        var t4 = new L2({ code: e5 && e5.code ? e5.code : k2.MSG_REVOKE_FAIL, message: e5 && e5.message ? e5.message : void 0, data: { message: n3 } });
        return M2.w("".concat(i4, " failed. error:"), e5), E2(t4);
      })) : this._onNoModule();
    } }, { key: "deleteMessage", value: function(e4) {
      var t3 = this, n3 = null, o3 = e4[0], i4 = o3.conversationID, a4 = "", s4 = [], r3 = [];
      if (o3.conversationType === R2.CONV_C2C)
        n3 = this.get(6), a4 = i4.replace(R2.CONV_C2C, ""), e4.forEach(function(e5) {
          e5 && e5.status === Pn2 && e5.conversationID === i4 && (e5._onlineOnlyFlag || s4.push("".concat(e5.sequence, "_").concat(e5.random, "_").concat(e5.time)), r3.push(e5));
        });
      else if (o3.conversationType === R2.CONV_GROUP)
        n3 = this.get(7), a4 = i4.replace(R2.CONV_GROUP, ""), e4.forEach(function(e5) {
          e5 && e5.status === Pn2 && e5.conversationID === i4 && (e5._onlineOnlyFlag || s4.push("".concat(e5.sequence)), r3.push(e5));
        });
      else if (o3.conversationType === R2.CONV_SYSTEM)
        return E2({ code: k2.CANNOT_DELETE_GRP_SYSTEM_NOTICE });
      if (!n3)
        return this._onNoModule();
      if (0 === s4.length)
        return this._onMessageDeleted(r3);
      30 < s4.length && (s4 = s4.slice(0, 30), r3 = r3.slice(0, 30));
      var c4 = new P2("deleteMessage"), u3 = (c4.setMessage("to:".concat(a4, " count:").concat(s4.length)), "".concat(this._n, ".").concat("deleteMessage"));
      return n3.deleteMessage({ to: a4, keyList: s4 }).then(function(e5) {
        return c4.end(), M2.i("".concat(u3, " ok")), t3._onMessageDeleted(r3);
      }).catch(function(e5) {
        c4.setError(e5).end(), M2.w("".concat(u3, " failed. error:"), e5);
        e5 = new L2({ code: e5 && e5.code ? e5.code : k2.MSG_DELETE_FAIL, message: e5 && e5.message ? e5.message : void 0 });
        return E2(e5);
      });
    } }, { key: "_onMessageDeleted", value: function(e4) {
      return this.get(11).onMessageDeleted(e4), D2({ messageList: e4 });
    } }, { key: "translateText", value: function(e4) {
      var o3 = "".concat(this._n, ".").concat("translateText"), t3 = e4.sourceTextList, n3 = e4.sourceLanguage, e4 = e4.targetLanguage, i4 = new P2("translateText");
      return i4.setMessage("sourceLanguage:".concat(n3, " targetLanguage:").concat(e4)), this.req({ P: G2.TRANSLATE_TEXT, data: { sourceTextList: t3, source: n3 || "auto", target: e4, from: this.getMyTinyID(), SDKAppID: this.getSDKAppID() } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.error, n4 = e5.requestID, e5 = e5.translatedTextList;
        if (0 === t4.code)
          return i4.end(), M2.i("".concat(o3, " ok. requestID:").concat(n4)), T2({ translatedTextList: e5 });
        throw y2(y2({}, t4), {}, { requestID: n4 });
      }).catch(function(e5) {
        return i4.setCode(e5.code).setMoreMessage(e5.requestID).end(), M2.w("".concat(o3, " failed. error:"), e5), E2({ code: e5.code || k2.TRANSLATE_TEXT_FAIL, message: e5.message });
      });
    } }, { key: "convertVoiceToText", value: function(e4) {
      var t3, o3, i4, n3 = e4.message, e4 = e4.language, a4 = n3.payload.url, n3 = (n3.from === this.getMyUserID() && "out" === n3.flow && (a4 = n3.payload.remoteAudioUrl), /\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/);
      return n3.test(a4) ? (n3 = n3.exec(a4)[1] || "mp3", t3 = "16k_zh-PY", e4 ? "zh (cmn-Hans-CN)" === e4 ? t3 = "16k_zh" : "en-US" === e4 ? t3 = "16k_en" : "yue-Hant-HK" === e4 ? t3 = "16k_yue" : "ja-JP" === e4 && (t3 = "16k_ja") : t3 = "16k_zh-PY", e4 = "serviceType:".concat(t3, " url:").concat(a4), o3 = "".concat(this._n, ".").concat("convertVoiceToText"), M2.i("".concat(o3, " ").concat(e4)), (i4 = new P2("convertVoiceToText")).setMessage(e4), this.req({ P: G2.VOICE_TO_TEXT, data: { url: a4, language: t3, SDKAppID: this.getSDKAppID(), format: n3 } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.error, n4 = e5.requestID, e5 = e5.result;
        if (0 === t4.code)
          return i4.end(), M2.i("".concat(o3, " ok. requestID:").concat(n4)), T2({ result: e5 });
        throw y2(y2({}, t4), {}, { requestID: n4 });
      }).catch(function(e5) {
        return i4.setCode(e5.code).setMoreMessage(e5.requestID || "").end(), M2.w("".concat(o3, " failed. error:"), e5), E2({ code: k2.VOICE_TO_TEXT_FAIL });
      })) : E2({ code: k2.UNSUPPORTED_VOICE_FORMAT });
    } }, { key: "modifyRemoteMessage", value: function(n3) {
      var o3 = this;
      if (false === this.get(29).filterMessage(n3))
        return n3.hasRiskContent = true, E2({ code: k2.PROFANITY_FOUND, data: { message: n3 } });
      var e4 = null, t3 = n3.conversationType, i4 = n3.to;
      if (t3 === R2.CONV_C2C)
        e4 = this.get(6);
      else if (t3 === R2.CONV_GROUP) {
        if (!(e4 = this.get(7)))
          return this._onNoModule();
        if (e4.isMessageFromOrToAVChatroom(i4))
          return E2({ code: k2.MSG_MODIFY_DISABLED_IN_AV, data: { message: n3 } });
      }
      var a4 = new P2("modifyMessage"), s4 = (a4.setMessage("to:".concat(i4)), "".concat(this._n, ".modifyRemoteMessage"));
      return e4.modifyRemoteMessage(n3).then(function(e5) {
        a4.end(), M2.i("".concat(s4, " ok"));
        e5 = o3._onModifyRemoteMessageResp(n3, e5.data);
        return T2({ message: e5 });
      }).catch(function(e5) {
        var t4;
        return a4.setCode(e5.code).setMoreMessage(e5.message).end(), M2.w("".concat(s4, " failed. error:"), e5), 20027 === e5.code ? (t4 = o3._onModifyRemoteMessageResp(n3, e5.data), E2({ code: k2.MSG_MODIFY_CONFLICT, data: { message: t4 } })) : E2({ code: e5.code, message: e5.message, data: { message: n3 } });
      });
    } }, { key: "_onModifyRemoteMessageResp", value: function(e4, t3) {
      M2.d("".concat(this._n, "._onModifyRemoteMessageResp options:"), t3);
      var n3 = e4.conversationType, o3 = e4.from, i4 = e4.to, a4 = e4.random, s4 = e4.sequence, e4 = e4.time, r3 = t3.elements, c4 = t3.messageVersion, t3 = t3.cloudCustomData, t3 = void 0 === t3 ? "" : t3;
      return this.get(11).onMessageModified({ conversationType: n3, from: o3, to: i4, time: e4, random: a4, sequence: s4, elements: r3, cloudCustomData: t3, messageVersion: c4 });
    } }, { key: "_generateUUID", value: function(e4, t3) {
      var n3 = this.get(12), n3 = "".concat(n3.getSDKAppID(), "-").concat(n3.getUserID(), "-").concat(vt3());
      return t3 ? "".concat(n3, ".").concat(t3) : (e4 = (t3 = e4.name || e4.value || e4.url || e4.tempFilePath) && t3.slice(t3.lastIndexOf(".") + 1)) ? "".concat(n3, ".").concat(e4) : n3;
    } }, { key: "getMessageOption", value: function(e4) {
      return this._messageOptionsMap.get(e4);
    } }, { key: "_getNickAndAvatarByUserID", value: function(e4) {
      return this.get(4).getNickAndAvatarByUserID(e4);
    } }, { key: "_getNameCardByGroupID", value: function(e4) {
      if (e4.conversationType === R2.CONV_GROUP) {
        var t3 = this.get(7);
        if (t3)
          return t3.getMyNameCardByGroupID(e4.to);
      }
      return "";
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._messageOptionsMap.clear();
    } }]), Ji2 = (t2(ia, c3), e3(ia, [{ key: "onMsgExtNotify", value: function(e4) {
      var o3 = this, e4 = e4.dataList, t3 = e4.messageInfo, i4 = e4.operateType, n3 = e4.operateResultList, a4 = e4.tinyID, e4 = e4.globalSequence, s4 = t3.clientTime, t3 = t3.random, r3 = "".concat(a4, "-").concat(s4, "-").concat(t3), c4 = [], u3 = [], l3 = (M2.l("".concat(this._n, ".onMsgExtNotify messageID:").concat(r3, " operateType:").concat(i4, " globalSequence:").concat(e4)), this._updateGlobalSeq(r3, e4), false), d4 = false;
      n3.forEach(function(e5) {
        var t4 = e5.extensions, t4 = void 0 === t4 ? [] : t4, n4 = e5.clearSequence;
        1 === i4 ? (l3 = true, t4.forEach(function(e6) {
          c4.push({ key: e6.key, value: e6.value });
        }), o3._updateLocalExt(r3, t4)) : 2 === i4 ? (d4 = true, t4.forEach(function(e6) {
          u3.push(e6.key);
        }), o3._updateLocalExt(r3, t4)) : 3 === i4 && (d4 = true, o3._hasLocalExt(r3) && o3._getLocalExt(r3).forEach(function(e6, t5) {
          e6.seq <= n4 && !S2(e6.value) && u3.push(t5);
        }), o3._clearLocalExt(r3, n4));
      }), l3 && this.emitOEvt(h3.MESSAGE_EXTENSIONS_UPDATED, { messageID: r3, extensions: c4 }), d4 && this.emitOEvt(h3.MESSAGE_EXTENSIONS_DELETED, { messageID: r3, keyList: u3 });
    } }, { key: "setMessageExtensions", value: function(e4, t3) {
      var o3, n3, i4, a4, s4, r3, c4, u3 = "setMessageExtensions";
      return this.canIUse(g2.MSG_EXT) ? (o3 = "".concat(this._n, ".").concat(u3), n3 = e4.ID, i4 = e4.conversationID, a4 = e4.sequence, s4 = e4.time, r3 = d3(t3), 20 < t3.length && (r3 = t3.slice(0, 20), M2.w("".concat(o3, ". the length of extensions cannot exceed 20."))), t3 = "convID:".concat(i4, " messageID:").concat(n3, " sequence:").concat(a4, " time:").concat(s4, " count:").concat(r3.length), (c4 = new P2(u3)).setMessage(t3), M2.l("".concat(o3, " ").concat(t3)), this._modifyMsgExts(e4, r3).then(function(e5) {
        var t4 = e5.resultList, n4 = e5.successCount, e5 = e5.failureCount, n4 = "successCount:".concat(n4, " failCount:").concat(e5);
        return c4.setMoreMessage(n4).end(), M2.l("".concat(o3, " ok. ").concat(n4)), T2({ extensions: t4 });
      }).catch(function(e5) {
        return c4.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      })) : this.noUse(u3);
    } }, { key: "getMessageExtensions", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3, c4 = this, u3 = "getMessageExtensions";
      return this.canIUse(g2.MSG_EXT) ? (t3 = "".concat(this._n, ".").concat(u3), n3 = e4.ID, a4 = e4.conversationID, o3 = e4.sequence, i4 = e4.time, a4 = "convID:".concat(a4, " messageID:").concat(n3, " sequence:").concat(o3, " time:").concat(i4), (s4 = new P2(u3)).setMessage(a4), r3 = void M2.l("".concat(t3, " ").concat(a4)), this.getMsgExtsMap.has(n3) && (r3 = this._getGlobalSeq(n3)), this._getMsgExts(e4, r3).then(function(e5) {
        return s4.end(), M2.l("".concat(t3, " ok. extCount:").concat(e5.length)), N2(r3) && 0 < e5.length && c4.getMsgExtsMap.set(n3, 1), T2({ extensions: e5 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this.noUse(u3);
    } }, { key: "deleteMessageExtensions", value: function(e4, t3) {
      var i4, n3, a4, o3, s4, r3, c4, u3 = "deleteMessageExtensions";
      return this.canIUse(g2.MSG_EXT) ? (i4 = "".concat(this._n, ".").concat(u3), n3 = [], a4 = 3, S2(t3) || (a4 = 2, t3.forEach(function(e5) {
        n3.push({ key: e5, value: "", seq: 0 });
      })), t3 = e4.ID, r3 = e4.conversationID, o3 = e4.sequence, s4 = e4.time, r3 = "convID:".concat(r3, " messageID:").concat(t3, " sequence:").concat(o3, " time:").concat(s4, " operateType:").concat(a4), (c4 = new P2(u3)).setMessage(r3), M2.l("".concat(i4, " ").concat(r3)), this._modifyMsgExts(e4, n3, a4).then(function(e5) {
        var t4 = e5.resultList, n4 = e5.successCount, e5 = e5.failureCount, o4 = "";
        return 2 === a4 && (o4 = "success count:".concat(n4, " fail count:").concat(e5)), c4.setMoreMessage("".concat(o4)).end(), M2.l("".concat(i4, " ok. ").concat(o4)), T2({ extensions: t4 });
      }).catch(function(e5) {
        return c4.setError(e5).end(), M2.e("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : this.noUse(u3);
    } }, { key: "_modifyMsgExts", value: function(n3, e4) {
      var o3 = this, t3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1, i4 = Ut2(n3.to) ? R2.CONV_TOPIC : n3.conversationType, a4 = void 0, s4 = (3 !== t3 && (a4 = this._getReqExts(n3, e4)), null);
      switch (i4) {
        case R2.CONV_C2C:
          s4 = this.get(6);
          break;
        case R2.CONV_GROUP:
          s4 = this.get(7);
          break;
        case R2.CONV_TOPIC:
          s4 = this.get(10);
          break;
        default:
          return E2({ code: k2.NO_MODULE });
      }
      return s4.modifyMsgExts(n3, a4, t3).then(function(e5) {
        var e5 = e5.data, t4 = e5.extensions, e5 = e5.seq, i5 = [], a5 = 0, s5 = 0, r3 = [];
        return (t4 = S2(t4) ? [] : t4).forEach(function(e6) {
          var t5 = e6.errorCode, e6 = e6.extension, n4 = e6.key, o4 = e6.value, e6 = e6.seq;
          i5.push({ code: t5, key: n4, value: o4 }), 0 === t5 ? a5++ : s5++, r3.push({ key: n4, value: o4, seq: e6 });
        }), o3._updateGlobalSeq(n3.ID, e5), 0 < r3.length && (o3._updateLocalExt(n3.ID, r3), r3 = null), { resultList: i5, successCount: a5, failureCount: s5 };
      }).catch(function(e5) {
        return E2(e5);
      });
    } }, { key: "_getReqExts", value: function(e4, t3) {
      var o3, i4 = [];
      return this._hasLocalExt(e4.ID) ? (o3 = this._getLocalExt(e4.ID), t3.forEach(function(e5) {
        var t4 = e5.key, e5 = e5.value, n3 = 0;
        o3.has(t4) && (n3 = o3.get(t4).seq), i4.push({ key: t4, value: e5, seq: n3 });
      })) : t3.forEach(function(e5) {
        var t4 = e5.key, e5 = e5.value;
        i4.push({ key: t4, value: e5, seq: 0 });
      }), i4;
    } }, { key: "_getMsgExts", value: function(i4, e4) {
      var a4 = this, s4 = "".concat(this._n, "._getMsgExts"), r3 = i4.ID, t3 = i4.to, n3 = null;
      switch (Ut2(t3) ? R2.CONV_TOPIC : i4.conversationType) {
        case R2.CONV_C2C:
          n3 = this.get(6);
          break;
        case R2.CONV_GROUP:
          n3 = this.get(7);
          break;
        case R2.CONV_TOPIC:
          n3 = this.get(10);
          break;
        default:
          return E2({ code: k2.NO_MODULE });
      }
      return n3.getMessageExtensions(i4, e4).then(function(e5) {
        var e5 = e5.data, t4 = e5.extensions, n4 = e5.completeFlag, o3 = e5.globalSequence, e5 = e5.clearSequence, t4 = S2(t4) ? [] : t4;
        return M2.l("".concat(s4, " ok. completeFlag:").concat(n4, " globalSequence:").concat(o3, " clearSequence:").concat(e5, " count:").concat(t4.length)), a4._updateLocalExt(r3, t4), a4._clearLocalExt(r3, e5), a4._updateGlobalSeq(r3, o3), 1 !== n4 ? (e5 = t4.slice(-1)[0].seq + 1, a4._getMsgExts(i4, e5)) : a4._getLocalExtList(r3);
      }).catch(function(e5) {
        return E2(e5);
      });
    } }, { key: "_hasLocalExt", value: function(e4) {
      return this.msgExtMap.has(e4);
    } }, { key: "_getLocalExt", value: function(e4) {
      return this.msgExtMap.get(e4);
    } }, { key: "_updateLocalExt", value: function(e4, t3) {
      this._hasLocalExt(e4) || this.msgExtMap.set(e4, /* @__PURE__ */ new Map());
      var o3 = this._getLocalExt(e4);
      t3.forEach(function(e5) {
        var t4 = e5.key, n3 = e5.value, e5 = e5.seq;
        o3.set(t4, { value: void 0 === n3 ? "" : n3, seq: e5 });
      });
    } }, { key: "_clearLocalExt", value: function(e4, n3) {
      var o3;
      n3 <= 0 || !this._hasLocalExt(e4) || (o3 = this._getLocalExt(e4)).forEach(function(e5, t3) {
        e5.seq <= n3 && o3.delete(t3);
      });
    } }, { key: "_getLocalExtList", value: function(e4) {
      var n3 = [];
      return this._hasLocalExt(e4) && this._getLocalExt(e4).forEach(function(e5, t3) {
        e5 = e5.value;
        S2(e5) || n3.push({ key: t3, value: e5 });
      }), n3;
    } }, { key: "_getGlobalSeq", value: function(e4) {
      return this.globalSeqMap.get(e4);
    } }, { key: "_updateGlobalSeq", value: function(e4, t3) {
      this.globalSeqMap.set(e4, t3);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this.msgExtMap.clear(), this.globalSeqMap.clear(), this.getMsgExtsMap.clear();
    } }])), zi2 = (t2(oa, c3), e3(oa, [{ key: "onReactionNotifyList", value: function(e4) {
      var a4 = this, e4 = (e4 || {}).dataList;
      (void 0 === e4 ? [] : e4).forEach(function(e5) {
        var t3 = e5.C2CMessageInfo, n3 = e5.groupMessageInfo, n3 = void 0 === n3 ? {} : n3, e5 = e5.reactionList, e5 = void 0 === e5 ? [] : e5, t3 = y2(y2({}, void 0 === t3 ? {} : t3), n3), n3 = t3.tinyID, o3 = t3.clientTime, t3 = t3.random, n3 = "".concat(n3, "-").concat(o3, "-").concat(t3), i4 = [];
        e5.forEach(function(e6) {
          N2(e6.userIDList) && (e6.userIDList = [], e6.count = 0), i4.push.apply(i4, d3(e6.userIDList));
        }), M2.l("".concat(a4._n, ".onReactionNotifyList messageID:").concat(n3, " reactionList:").concat(e5.length)), a4._handleReactionSummary([{ messageID: n3, reactionList: e5 }], i4).then(function(e6) {
          a4.emitOEvt(h3.MESSAGE_REACTIONS_UPDATED, y2({}, e6[0]));
        });
      });
    } }, { key: "onReactionNotify", value: function(e4) {
      var e4 = e4.dataList || {}, t3 = e4.C2CMessageInfo, n3 = e4.groupMessageInfo, n3 = void 0 === n3 ? {} : n3, o3 = e4.reactionID, e4 = e4.operateType, t3 = y2(y2({}, void 0 === t3 ? {} : t3), n3), n3 = t3.tinyID, i4 = t3.clientTime, t3 = t3.random, n3 = "".concat(n3, "-").concat(i4, "-").concat(t3), i4 = (M2.l("".concat(this._n, ".onReactionNotify messageID:").concat(n3, " reactionID:").concat(o3, " operateType:").concat(e4)), 1 === e4 ? this._addReactedByMyselfMap(n3, o3) : this._removeReactedByMyselfMap(n3, o3), "".concat(n3, "-").concat(o3));
      this._reactionInfoMap.has(i4) && ((t3 = this._reactionInfoMap.get(i4)).reactedByMyself = 1 === e4, this.emitOEvt(h3.MESSAGE_REACTIONS_UPDATED, { messageID: n3, reactionList: [t3] }));
    } }, { key: "addMessageReaction", value: function(t3, n3) {
      var o3, e4, i4, a4, s4 = this, r3 = "addMessageReaction";
      return this.canIUse(g2.MSG_REACTION) ? (o3 = "".concat(this._n, ".").concat(r3), a4 = t3.ID, e4 = t3.conversationID, e4 = "convID:".concat(e4, " messageID:").concat(a4, " reactionID:").concat(n3), (i4 = new P2(r3)).setMessage(e4), M2.l("".concat(o3, " ").concat(e4)), a4 = this._createReactionOperationPack(t3, n3, 1), this._addReactedByMyselfMap(t3.ID, n3), this.req(a4).then(function() {
        return i4.end(), M2.l("".concat(o3, " ok.")), T2();
      }).catch(function(e5) {
        return s4._removeReactedByMyselfMap(t3.ID, n3), i4.setError(e5).end(), M2.e("".concat(o3, " failed. error:"), e5), E2(e5);
      })) : this.noUse(r3);
    } }, { key: "removeMessageReaction", value: function(e4, t3) {
      var n3, o3, i4, a4, s4 = "removeMessageReaction";
      return this.canIUse(g2.MSG_REACTION) ? (n3 = "".concat(this._n, ".").concat(s4), a4 = e4.ID, o3 = e4.conversationID, o3 = "convID:".concat(o3, " messageID:").concat(a4, " reactionID:").concat(t3), (i4 = new P2(s4)).setMessage(o3), M2.l("".concat(n3, " ").concat(o3)), a4 = this._createReactionOperationPack(e4, t3, 2), this._removeReactedByMyselfMap(e4.ID, t3), this.req(a4).then(function() {
        return i4.end(), M2.l("".concat(n3, " ok.")), T2();
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5), E2(e5);
      })) : this.noUse(s4);
    } }, { key: "getMessageReactions", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3 = this, c4 = "getMessageReactions";
      return this.canIUse(g2.MSG_REACTION) ? (t3 = "".concat(this._n, ".").concat(c4), n3 = e4.messageList, s4 = e4.maxUserCountPerReaction, o3 = n3[0].conversationID, o3 = "convID:".concat(o3, " maxUserCountPerReaction:").concat(s4, " msgCount:").concat(n3.length), (i4 = new P2(c4)).setMessage(o3), M2.l("".concat(t3, " ").concat(o3)), a4 = /* @__PURE__ */ new Map(), s4 = this._createReactionSummaryPack(y2(y2({}, e4), {}, { messageIDMap: a4 })), this.req(s4).then(function(e5) {
        var e5 = e5.data.resultList, o4 = [], i5 = [];
        return (void 0 === e5 ? [] : e5).forEach(function(e6) {
          var t4 = e6.messageKey, t4 = void 0 === t4 ? void 0 : t4, n4 = e6.messageSequence, n4 = void 0 === n4 ? void 0 : n4, e6 = e6.reactionList, e6 = void 0 === e6 ? [] : e6, n4 = N2(t4) ? a4.get(n4) : a4.get(t4);
          o4.push({ messageID: n4, reactionList: e6 }), e6.forEach(function(e7) {
            i5.push.apply(i5, d3(e7.userIDList));
          });
        }), r3._handleReactionSummary(o4, i5);
      }).then(function(e5) {
        return i4.end(), M2.l("".concat(t3, " ok.")), a4.clear(), T2({ resultList: e5 });
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this.noUse(c4);
    } }, { key: "getAllUserListOfMessageReaction", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3, c4, u3 = this, l3 = "getAllUserListOfMessageReaction";
      return this.canIUse(g2.MSG_REACTION) ? (t3 = "".concat(this._n, ".").concat(l3), a4 = e4.message, n3 = e4.reactionID, o3 = e4.nextSeq, i4 = e4.count, c4 = a4.ID, a4 = a4.conversationID, a4 = "convID:".concat(a4, " messageID:").concat(c4, " reactionID:").concat(n3, " nextSeq:").concat(o3, " count:").concat(i4), (s4 = new P2(l3)).setMessage(a4), M2.l("".concat(t3, " ").concat(a4)), r3 = { userList: [], nextSeq: 0, isCompleted: false }, c4 = this._createReactionUserListPack(e4), this.req(c4).then(function(e5) {
        var e5 = e5.data, t4 = e5.userIDList, t4 = void 0 === t4 ? [] : t4, e5 = e5.nextSeq, e5 = void 0 === e5 ? 0 : e5;
        return r3.nextSeq = e5, r3.isCompleted = 0 === e5, u3.get(4).getUserNickAndAvatar(t4);
      }).then(function(e5) {
        return r3.userList = e5, s4.end(), M2.l("".concat(t3, " ok.")), T2(r3);
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this.noUse(l3);
    } }, { key: "_createReactionOperationPack", value: function(e4, t3, n3) {
      var o3, i4, a4 = void 0, t3 = { reactionID: t3, userIDList: [this.getMyUserID()] };
      return e4.conversationType === R2.CONV_C2C && (o3 = this.get(6), a4 = 1 === n3 ? G2.ADD_C2C_MSG_REACTION : G2.RM_C2C_MSG_REACTION, t3.from = e4.from, t3.to = e4.to, t3.messageKey = o3.getMessageKey(e4)), e4.conversationType === R2.CONV_GROUP && (o3 = void 0, i4 = e4.to, Ut2(e4.to) && (i4 = Xt2(o3 = e4.to)), a4 = 1 === n3 ? G2.ADD_GRP_MSG_REACTION : G2.RM_GRP_MSG_REACTION, t3.groupID = i4, t3.topicID = o3, t3.messageSequence = e4.sequence), { P: a4, data: t3 };
    } }, { key: "_createReactionSummaryPack", value: function(e4) {
      var n3, t3, o3, i4 = e4.messageList, a4 = e4.maxUserCountPerReaction, a4 = void 0 === a4 ? 10 : a4, s4 = e4.messageIDMap, e4 = i4[0], r3 = void 0, c4 = void 0;
      return e4.conversationType === R2.CONV_C2C && (n3 = this.get(6), t3 = i4.map(function(e5) {
        var t4 = n3.getMessageKey(e5);
        return s4.set(t4, e5.ID), t4;
      }), r3 = G2.GET_C2C_MSG_REACTIONS, c4 = { from: e4.from, to: e4.to, messageKeyList: t3, count: a4 }), e4.conversationType === R2.CONV_GROUP && (t3 = void 0, o3 = e4.to, Ut2(e4.to) && (o3 = Xt2(t3 = e4.to)), e4 = i4.map(function(e5) {
        return s4.set(e5.sequence, e5.ID), e5.sequence;
      }), r3 = G2.GET_GRP_MSG_REACTIONS, c4 = { groupID: o3, topicID: t3, messageSequenceList: e4, count: a4 }), { P: r3, data: c4 };
    } }, { key: "_createReactionUserListPack", value: function(e4) {
      var t3 = e4.message, n3 = e4.reactionID, o3 = e4.nextSeq, e4 = e4.count, e4 = void 0 === e4 ? 100 : e4, i4 = void 0, n3 = { reactionID: n3, nextSeq: void 0 === o3 ? 0 : o3, count: 100 < e4 ? 100 : e4 };
      return t3.conversationType === R2.CONV_C2C && (o3 = this.get(6), i4 = G2.GET_C2C_MSG_REACTION_USER_LIST, n3.from = t3.from, n3.to = t3.to, n3.messageKey = o3.getMessageKey(t3)), t3.conversationType === R2.CONV_GROUP && (e4 = void 0, o3 = t3.to, Ut2(t3.to) && (o3 = Xt2(e4 = t3.to)), i4 = G2.GET_GRP_MSG_REACTION_USER_LIST, n3.groupID = o3, n3.topicID = e4, n3.messageSequence = t3.sequence), { P: i4, data: n3 };
    } }, { key: "_handleReactionSummary", value: function(t3, e4) {
      var c4 = this;
      return this.get(4).getUserNickAndAvatar(e4).then(function(r3) {
        var e5 = [];
        return t3.forEach(function(a4) {
          var s4 = [];
          a4.reactionList.forEach(function(e6) {
            var t4 = e6.reactionID, n3 = e6.count, o3 = e6.userIDList, e6 = e6.reactedByMyself, e6 = void 0 === e6 ? void 0 : e6, i4 = [], o3 = (o3.forEach(function(t5) {
              r3.forEach(function(e7) {
                t5 === e7.userID && i4.push(e7);
              });
            }), { reactionID: t4, totalUserCount: n3, partialUserList: i4, reactedByMyself: c4._computeReactedByMyself({ reactedByMyself: e6, messageID: a4.messageID, reactionID: t4 }) });
            s4.push(o3), N2(e6) && !c4._reactedByMyselfMap.has(a4.messageID) && (n3 = "".concat(a4.messageID, "-").concat(t4), c4._reactionInfoMap.set(n3, o3));
          }), e5.push({ messageID: a4.messageID, reactionList: s4 });
        }), e5;
      });
    } }, { key: "_addReactedByMyselfMap", value: function(e4, t3) {
      this._reactedByMyselfMap.has(e4) || this._reactedByMyselfMap.set(e4, []);
      e4 = this._reactedByMyselfMap.get(e4);
      -1 === e4.indexOf(t3) && e4.push(t3);
    } }, { key: "_removeReactedByMyselfMap", value: function(e4, t3) {
      this._reactedByMyselfMap.has(e4) && -1 < (t3 = (e4 = this._reactedByMyselfMap.get(e4)).indexOf(t3)) && e4.splice(t3, 1);
    } }, { key: "_computeReactedByMyself", value: function(e4) {
      var t3 = e4.reactedByMyself, n3 = e4.messageID, e4 = e4.reactionID;
      return N2(t3) ? !!this._reactedByMyselfMap.has(n3) && this._reactedByMyselfMap.get(n3).includes(e4) : 1 === t3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._reactedByMyselfMap.clear(), this._reactionInfoMap.clear();
    } }])), Xi2 = (t2(na, c3), e3(na, [{ key: "sendMessage", value: function(e4) {
      var o3 = this, i4 = this._createMsg(e4);
      if (null === i4)
        return E2({ code: k2.MSG_SEND_FAIL });
      this._addSendMessageTotalCount(i4);
      var a4 = Date.now();
      return this.get(11).setMessageRandom(i4), this._sendComboMessage(i4, e4).then(function(e5) {
        var e5 = e5.data, t3 = e5.time, n3 = e5.sequence, e5 = e5.readReceiptCode, e5 = (A2(e5) && 0 !== e5 && (new P2("sendMessageWithReceipt").setMessage("from:".concat(i4.from, " to:").concat(i4.to, " sequence:").concat(n3, " readReceiptCode:").concat(e5)).end(), M2.w("".concat(o3._n, ".sendMessage readReceiptCode:").concat(e5, " message:").concat(o3.getErrMsg(e5)))), o3._addSendMessageSuccessCount(i4, a4), o3.get(11)), t3 = (i4.status = Pn2, i4.time = t3, i4.conversationType === R2.CONV_GROUP && (i4.sequence = n3), e5.appendToMessageList(i4), i4);
        return true === i4._isExcludedFromLastMessage && (t3 = ""), e5.onMessageSent({ conversationOptionsList: [{ conversationID: i4.conversationID, unreadCount: 0, type: i4.conversationType, subType: i4.conversationSubType, lastMessage: t3 }] }), T2({ message: i4 });
      }).catch(function(e5) {
        return o3._onSendMessageFailed(i4, e5);
      });
    } }, { key: "_sendComboMessage", value: function(e4, t3) {
      var n3 = this._m.get(20), o3 = "";
      return e4.conversationType === R2.CONV_C2C && (o3 = "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SEND_C2C_MSG)), e4.conversationType === R2.CONV_GROUP && (o3 = "".concat(a3.NAME.GRP, ".").concat(G2.SEND_GRP_MSG)), n3.sendComboMessage({ servcmd: o3, data: t3 });
    } }, { key: "_createMsg", value: function(e4) {
      var t3 = "".concat(this._n, "._createMsg"), n3 = null;
      try {
        var o3, i4 = this.getMyUserID(), a4 = {};
        a4.senderTinyID = this.getMyTinyID(), a4.currentUser = i4, a4.from = e4.From_Account || i4, e4.GroupId ? (a4.conversationID = "".concat(R2.CONV_GROUP).concat(e4.GroupId), a4.conversationType = R2.CONV_GROUP, a4.to = e4.GroupId) : e4.To_Account && (a4.conversationID = "".concat(R2.CONV_C2C).concat(e4.To_Account), a4.conversationType = R2.CONV_C2C, a4.to = e4.To_Account), a4.time = e4.MsgTimeStamp || 0, a4.random = e4.Random || e4.MsgRandom || 0, a4.priority = e4.MsgPriority, C2(e4.CloudCustomData) && 0 < e4.CloudCustomData.length && (a4.cloudCustomData = e4.CloudCustomData), O2(e4.SendMsgControl) && (a4.messageControlInfo = {}, e4.SendMsgControl.includes("NoUnread") && (a4.messageControlInfo.excludedFromUnreadCount = 1), e4.SendMsgControl.includes("NoLastMsg")) && (a4.messageControlInfo.excludedFromLastMessage = 1), a4.conversationType === R2.CONV_GROUP && O2(e4.To_Account) && 0 < e4.To_Account.length && (o3 = e4.To_Account, 50 < e4.To_Account.length && (o3 = e4.To_Account.slice(0, 50), M2.w("".concat(t3, " To_Account must be less than or equal to 50."))), a4.receiverList = d3(o3), e4.To_Account = d3(o3)), 1 !== e4.IsNeedReadReceipt && 1 !== e4.NeedReadReceipt || (a4.needReadReceipt = true), 1 === e4.SupportMessageExtension && (a4.isSupportExtension = true), (n3 = new So2(a4)).status = Gn2, e4.MsgClientTime = n3.clientTime, n3.conversationType === R2.CONV_C2C && (e4.MsgSeq = n3.sequence);
        for (var s4, r3 = e4.MsgBody.length, c4 = 0; c4 < r3; c4++)
          "TIMTextElem" === (s4 = e4.MsgBody[c4]).MsgType ? n3.setTextElement(s4.MsgContent.Text) : "TIMCustomElem" === s4.MsgType ? n3.setCustomElement({ data: s4.MsgContent.Data || "", description: s4.MsgContent.Desc || "", extension: s4.MsgContent.Ext || "" }) : "TIMFaceElem" === s4.MsgType && n3.setFaceElement({ index: s4.MsgContent.Index, data: s4.MsgContent.Data });
        var u3 = n3.getElements();
        n3.payload = u3[0].content, n3.type = u3[0].type;
      } catch (e5) {
        n3 = null, M2.e("".concat(t3, " failed. error:"), e5);
      }
      return n3;
    } }, { key: "_onSendMessageFailed", value: function(e4, t3) {
      e4.status = Un2, this.get(11).deleteMessageRandom(e4), this._addSendMessageFailCountOnUser(e4, t3);
      var n3 = new P2("sendMessage"), o3 = "head.seq:".concat(t3.data.headSeq, "  type:").concat(e4.type, " from:").concat(e4.from, " to:").concat(e4.to);
      return n3.setMessage(o3).setError(t3).end(), M2.e("".concat(this._n, "._onSendMessageFailed ").concat(o3, " error:"), t3), E2(new L2({ code: t3 && t3.code ? t3.code : k2.MSG_SEND_FAIL, message: t3 && t3.message ? t3.message : void 0, data: { message: e4 } }));
    } }, { key: "_getSendMessageSpecifiedKey", value: function(e4) {
      if (e4.conversationType === R2.CONV_C2C)
        return jn2;
      if (e4.conversationType === R2.CONV_GROUP) {
        var e4 = this.get(7).getLocalGroupProfile(e4.to);
        if (e4)
          return e4 = e4.type, Gt2(e4) ? zn2 : Jn2;
      }
    } }, { key: "_addSendMessageTotalCount", value: function(e4) {
      e4 = this._getSendMessageSpecifiedKey(e4);
      e4 && this.get(26).addTotalCount(e4);
    } }, { key: "_addSendMessageSuccessCount", value: function(e4, t3) {
      var n3, e4 = this._getSendMessageSpecifiedKey(e4);
      e4 && ((n3 = this.get(26)).addSuccessCount(e4), n3.addCost(e4, an2(t3, false)));
    } }, { key: "_addSendMessageFailCountOnUser", value: function(e4, t3) {
      var t3 = t3.code, t3 = void 0 === t3 ? -1 : t3, n3 = this.get(26), e4 = this._getSendMessageSpecifiedKey(e4);
      Yi2(t3) && e4 && n3.addFailedCountOfUserSide(e4);
    } }])), Zi2 = (t2(ta, c3), e3(ta, [{ key: "registerPlugin", value: function(t3) {
      var n3 = this, o3 = "0";
      Object.keys(t3).forEach(function(e4) {
        n3.plugins[e4] = t3[e4], "tim-upload-plugin" === e4 && "function" == typeof t3[e4].getVersion && (o3 = t3[e4].getVersion());
      }), new P2("registerPlugin").setMessage("".concat(Object.keys(t3))).setMoreMessage("version:".concat(o3)).end();
    } }, { key: "getPlugin", value: function(e4) {
      return this.plugins[e4];
    } }, { key: "reset", value: function() {
    } }])), Qi2 = (t2(ea, c3), e3(ea, [{ key: "_init", value: function() {
      this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 0 });
    } }, { key: "_startSync", value: function(e4) {
      var i4 = this, t3 = e4.cookie, n3 = e4.syncFlag, o3 = e4.isOnlineSync, a4 = "".concat(this._n, "._startSync"), s4 = (M2.l("".concat(a4, " options:"), e4), new P2("syncUnread"));
      s4.setMessage(JSON.stringify(e4)), this.req({ P: G2.SYNC_UNREAD_MSG, data: { cookie: t3, syncFlag: n3, isOnlineSync: o3 } }).then(function(e5) {
        var t4 = e5.data, n4 = t4.cookie, t4 = t4.syncFlag, o4 = "$cookie:".concat(n4, " syncFlag:").concat(t4);
        M2.l("".concat(a4, " ok. ").concat(o4)), i4._cookie = n4, s4.setMoreMessage(o4).end(), S2(n4) || (0 === t4 || 1 === t4 ? (i4._dispatch(y2(y2({}, e5.data), {}, { isSyncingEnded: false })), i4._startSync({ cookie: n4, syncFlag: t4, isOnlineSync: 0 })) : 2 === t4 && i4._dispatch(y2(y2({}, e5.data), {}, { isSyncingEnded: true })));
      }).catch(function(e5) {
        s4.setError(e5).end(), M2.e("".concat(a4, " failed. error:"), e5);
      });
    } }, { key: "_dispatch", value: function(e4) {
      e4.eventArray && this.get(20).onMessage({ head: {}, body: { eventArray: e4.eventArray, isInstantMessage: this._onlineSyncFlag, isSyncingEnded: e4.isSyncingEnded } }), this.get(6).onNewMessage({ dataList: e4.messageList, isInstantMessage: !!e4.isSyncingEnded && this._onlineSyncFlag, C2CRemainingUnreadList: e4.C2CRemainingUnreadList, C2CPairUnreadList: e4.C2CPairUnreadList, isSyncingEnded: e4.isSyncingEnded });
    } }, { key: "syncOnNeed", value: function() {
      M2.l("".concat(this._n, ".syncOnNeed cookie:").concat(this._cookie)), this._onlineSyncFlag = true, this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 1 });
    } }, { key: "syncOnReconnected", value: function() {
      M2.l("".concat(this._n, ".syncOnReconnected cookie:").concat(this._cookie)), this._onlineSyncFlag = true, this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 0 });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._onlineSyncFlag = false, this._cookie = "";
    } }])), $i2 = { req: { toAccount: "To_Account", fromAccount: "From_Account", to: "To_Account", from: "From_Account", groupID: "GroupId", groupAtUserID: "GroupAt_Account", extension: "Ext", data: "Data", description: "Desc", elements: "MsgBody", sizeType: "Type", downloadFlag: "Download_Flag", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", videoUrl: "", imageUrl: "URL", fileUrl: "Url", uuid: "UUID", priority: "MsgPriority", receiverUserID: "To_Account", receiverGroupID: "GroupId", messageSender: "SenderId", messageReceiver: "ReceiverId", nick: "From_AccountNick", avatar: "From_AccountHeadurl", messageNumber: "MsgNum", pbDownloadKey: "PbMsgKey", downloadKey: "JsonMsgKey", applicationType: "PendencyType", userIDList: "To_Account", groupNameList: "GroupName", userID: "To_Account", groupAttributeList: "GroupAttr", mainSequence: "AttrMainSeq", avChatRoomKey: "BytesKey", attributeControl: "AttrControl", sequence: "seq", messageControlInfo: "SendMsgControl", updateSequence: "UpdateSeq", clientTime: "MsgClientTime", sequenceList: "MsgSeqList", topicID: "TopicId", customData: "CustomString", isSupportTopic: "SupportTopic", isWebUniapp: "is_web_uniapp", isSupportExtension: "SupportMessageExtension", messageSequence: "MsgSeq", messageKey: "MsgKey", startSequence: "startSeq", simplifiedMessage: "DownsizeFlag", isRelayMessage: "IsRelayMsg", reactionID: "Reaction", messageSequenceList: "MsgSeqList", messageKeyList: "MsgKeyList", cmConfigID: "CustomModerationConfigID" }, res: { MsgPriority: "priority", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID", Download_Flag: "downloadFlag", GroupId: "groupID", Member_Account: "userID", MsgList: "messageList", SyncFlag: "syncFlag", To_Account: "to", From_Account: "from", MsgSeq: "sequence", MsgRandom: "random", MsgTime: "time", MsgTimeStamp: "time", MsgContent: "content", MsgBody: "elements", From_AccountNick: "nick", From_AccountHeadurl: "avatar", GroupWithdrawInfoArray: "revokedInfos", GroupReadInfoArray: "groupMessageReadNotice", LastReadMsgSeq: "lastMessageSeq", WithdrawC2cMsgNotify: "c2cMessageRevokedNotify", C2cWithdrawInfoArray: "revokedInfos", C2cReadedReceipt: "c2cMessageReadReceipt", ReadC2cMsgNotify: "c2cMessageReadNotice", LastReadTime: "peerReadTime", MsgRand: "random", MsgType: "type", MsgShow: "messageShow", NextMsgSeq: "nextMessageSeq", FaceUrl: "avatar", ProfileDataMod: "profileModify", Profile_Account: "userID", ValueBytes: "value", ValueNum: "value", NoticeSeq: "noticeSequence", NotifySeq: "notifySequence", MsgFrom_AccountExtraInfo: "messageFromAccountExtraInformation", Operator_Account: "operatorID", OpType: "operationType", ReportType: "operationType", UserId: "userID", User_Account: "userID", List_Account: "userIDList", MsgOperatorMemberExtraInfo: "operatorInfo", MsgMemberExtraInfo: "memberInfoList", ImageUrl: "avatar", NickName: "nick", MsgGroupNewInfo: "newGroupProfile", MsgAppDefinedData: "groupCustomField", Owner_Account: "ownerID", GroupFaceUrl: "avatar", GroupIntroduction: "introduction", GroupNotification: "notification", GroupApplyJoinOption: "joinOption", MsgKey: "messageKey", GroupInfo: "groupProfile", ShutupTime: "muteTime", Desc: "description", Ext: "extension", GroupAt_Account: "groupAtUserID", MsgNum: "messageNumber", PbMsgKey: "pbDownloadKey", JsonMsgKey: "downloadKey", MsgModifiedFlag: "isModified", PendencyItem: "applicationItem", PendencyType: "applicationType", AddTime: "time", AddSource: "source", AddWording: "wording", ProfileImImage: "avatar", PendencyAdd: "friendApplicationAdded", FrienPencydDel_Account: "friendApplicationDeletedUserIDList", Peer_Account: "userID", GroupAttr: "groupAttributeList", GroupAttrAry: "groupAttributeList", AttrMainSeq: "mainSequence", seq: "sequence", GroupAttrOption: "groupAttributeOption", BytesChangedKeys: "changedKeyList", GroupAttrInfo: "groupAttributeList", GroupAttrSeq: "mainSequence", PushChangedAttrValFlag: "isWithChangedAttributeInfo", SubKeySeq: "sequence", Val: "value", MsgGroupFromCardName: "senderNameCard", MsgGroupFromNickName: "senderNick", C2cNick: "peerNick", C2cImage: "peerAvatar", SendMsgControl: "messageControlInfo", NoLastMsg: "excludedFromLastMessage", NoUnread: "excludedFromUnreadCount", UpdateSeq: "updateSequence", MuteNotifications: "muteFlag", MsgClientTime: "clientTime", TinyId: "tinyID", GroupMsgReceiptList: "readReceiptList", ReadNum: "readCount", UnreadNum: "unreadCount", TopicId: "topicID", MillionGroupFlag: "communityType", SupportTopic: "isSupportTopic", MsgTopicNewInfo: "newTopicInfo", ShutupAll: "muteAllMembers", CustomString: "customData", TopicFaceUrl: "avatar", TopicIntroduction: "introduction", TopicNotification: "notification", TopicIdArray: "topicIDList", MsgVersion: "messageVersion", C2cMsgModNotifys: "c2cMessageModified", GroupMsgModNotifys: "groupMessageModified", ApplyJoinOption: "joinOption", MsgFlag: "messageRemindType", AtInfoList: "groupAtInfoList", AtFlagList: "groupAtType", AtMsgSeq: "sequence", BanDuration: "duration", BanDescription: "reason", NotVisible: "invisible", BytesTag: "tag", BytesValue: "value", RptBytesValue: "value", LatestSeq: "globalSequence", ClearSeq: "clearSequence", SupportMessageExtension: "isSupportExtension", ExtensionList: "extensions", GroupCounter: "counterList", Revoker_Account: "revoker", MsgExtensionNotify: "messageExtensionNotify", ExtensionC2cMsgInfo: "messageInfo", ExtensionGroupMsgInfo: "messageInfo", MsgOptType: "operateType", SetKVInfo: "operateResultList", DeleteKVInfo: "operateResultList", ClearKVInfo: "operateResultList", MsgKeyValue: "extensions", ClearMsgSeq: "clearSequence", MsgLastSeq: "globalSequence", InviteJoinOption: "inviteOption", MemberList_Account: "inviteeList", MsgMemberExtraInfoList: "inviteeInfoList", E: "event", GInf: "groupProfile", MCT: "clientTime", MR: "random", MP: "priority", MTS: "time", GId: "groupID", MS: "sequence", CCD: "cloudCustomData", F_Account: "from", F_Hd: "avatar", F_NN: "nick", GN: "groupName", GT: "groupType", IsSys: "isSystemMessage", OpInf: "operatorInfo", Img: "avatar", NN: "nick", OnlineInf: "onlineMemberInfo", ET: "expireTime", Num: "onlineMemberNum", Opt: "operationType", O_Account: "operatorID", RT: "operationType", UDF: "userDefinedField", L_Account: "userIDList", IsPlaceMsg: "isPlaceMessage", MsgCheckResult: "checkResult", Results: "resultList", Reaction: "reactionID", Reaction_Account: "userIDList", MsgReactionNotifyList: "messageReactionNotifyList", MsgReactionNotify: "messageReactionNotify", MsgReactionSummary: "reactionList", C2CMsgInfo: "C2CMessageInfo", GroupMsgInfo: "groupMessageInfo", int32_err_code: "errorCode", str_err_msg: "errorMsg", MsgDropReason: "messageDropReason", ReactedByMe: "reactedByMyself", Level: "messageRemindType", PeerReadTime: "timestamp", NoUnreadSeqList: "excludedUnreadSequenceList", NewMsg: "topicLatestMessage" }, ignoreKeyWord: ["C2C", "ID", "USP"] };
    function ea(e4) {
      return p3(this, ea), (e4 = i3(this, ea, [e4]))._n = "SyncUnreadMsgModule", e4._cookie = "", e4._onlineSyncFlag = false, e4.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, e4._init, e4), e4;
    }
    function ta(e4) {
      return p3(this, ta), (e4 = i3(this, ta, [e4]))._n = "PluginModule", e4.plugins = {}, e4;
    }
    function na(e4) {
      return p3(this, na), (e4 = i3(this, na, [e4]))._n = "ComboMsgModule", e4;
    }
    function oa(e4) {
      return p3(this, oa), (e4 = i3(this, oa, [e4]))._n = "MsgReactionModule", e4._reactedByMyselfMap = /* @__PURE__ */ new Map(), e4._reactionInfoMap = /* @__PURE__ */ new Map(), e4;
    }
    function ia(e4) {
      return p3(this, ia), (e4 = i3(this, ia, [e4]))._n = "MsgExtModule", e4.msgExtMap = /* @__PURE__ */ new Map(), e4.globalSeqMap = /* @__PURE__ */ new Map(), e4.getMsgExtsMap = /* @__PURE__ */ new Map(), e4;
    }
    function aa(e4) {
      return p3(this, aa), (e4 = i3(this, aa, [e4]))._n = "MessageModule", e4._messageOptionsMap = /* @__PURE__ */ new Map(), e4._mergerMessageHandler = new Bi2(e4), e4;
    }
    function sa(e4, t3) {
      if ("string" == typeof e4 || Array.isArray(e4))
        return t3 = Object.assign({ pascalCase: false }, t3), 0 === (e4 = Array.isArray(e4) ? e4.map(function(e5) {
          return e5.trim();
        }).filter(function(e5) {
          return e5.length;
        }).join("-") : e4.trim()).length ? "" : 1 === e4.length ? t3.pascalCase ? e4.toUpperCase() : e4.toLowerCase() : (e4 = e4 = (e4 = e4 !== e4.toLowerCase() ? ra(e4) : e4).replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, function(e5, t4) {
          return t4.toUpperCase();
        }).replace(/\d+(\w|$)/g, function(e5) {
          return e5.toUpperCase();
        }), t3.pascalCase ? e4.charAt(0).toUpperCase() + e4.slice(1) : e4);
      throw new TypeError("Expected the input to be `string | string[]`");
    }
    var ra = function(e4) {
      for (var t3 = false, n3 = false, o3 = false, i4 = 0; i4 < e4.length; i4++) {
        var a4 = e4[i4];
        t3 && /[a-zA-Z]/.test(a4) && a4.toUpperCase() === a4 ? (e4 = e4.slice(0, i4) + "-" + e4.slice(i4), o3 = n3, n3 = !(t3 = false), i4++) : n3 && o3 && /[a-zA-Z]/.test(a4) && a4.toLowerCase() === a4 ? (e4 = e4.slice(0, i4 - 1) + "-" + e4.slice(i4 - 1), o3 = n3, t3 = !(n3 = false)) : (t3 = a4.toLowerCase() === a4 && a4.toUpperCase() !== a4, o3 = n3, n3 = a4.toUpperCase() === a4 && a4.toLowerCase() !== a4);
      }
      return e4;
    };
    function ca(e4, t3) {
      var r3 = 0;
      return function n3(e5, i4) {
        var t4, o3, a4, s4;
        return 100 < ++r3 ? (r3--, e5) : O2(e5) ? (t4 = e5.map(function(e6) {
          return ut3(e6) ? n3(e6, i4) : e6;
        }), r3--, t4) : ut3(e5) ? (o3 = e5, a4 = function(e6, t5) {
          if (!_t2(t5))
            return false;
          if (t5 !== sa(t5))
            for (var n4 = 0; n4 < $i2.ignoreKeyWord.length && !t5.includes($i2.ignoreKeyWord[n4]); n4++)
              ;
          var o4;
          return N2(i4[t5]) ? (o4 = t5)[0].toUpperCase() + sa(o4).slice(1) : i4[t5];
        }, s4 = /* @__PURE__ */ Object.create(null), Object.keys(o3).forEach(function(e6) {
          var t5 = a4(o3[e6], e6);
          t5 && (s4[t5] = o3[e6]);
        }), t4 = qt2(t4 = s4, function(e6, t5) {
          return O2(e6) || ut3(e6) ? n3(e6, i4) : e6;
        }), r3--, t4) : void 0;
      }(e4, t3);
    }
    for (var ua = String.fromCharCode, la = function(e4) {
      var t3 = 0 | e4.charCodeAt(0);
      if (55296 <= t3)
        if (t3 < 56320) {
          e4 = 0 | e4.charCodeAt(1);
          if (56320 <= e4 && e4 <= 57343) {
            if (65535 < (t3 = (t3 << 10) + e4 - 56613888 | 0))
              return ua(240 | t3 >>> 18, 128 | t3 >>> 12 & 63, 128 | t3 >>> 6 & 63, 128 | 63 & t3);
          } else
            t3 = 65533;
        } else
          t3 <= 57343 && (t3 = 65533);
      return t3 <= 2047 ? ua(192 | t3 >>> 6, 128 | 63 & t3) : ua(224 | t3 >>> 12, 128 | t3 >>> 6 & 63, 128 | 63 & t3);
    }, da = function(e4) {
      for (var t3 = void 0 === e4 ? "" : ("" + e4).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g, la), n3 = 0 | t3.length, o3 = new Uint8Array(n3), i4 = 0; i4 < n3; i4 = i4 + 1 | 0)
        o3[i4] = 0 | t3.charCodeAt(i4);
      return o3;
    }, pa = e3(function e4(t3) {
      p3(this, e4);
      var n3, i4, o3 = (this._handler = t3).getURL();
      this._socket = null, this._workerSocket = null, this._id = mt3(), this._handler.getIsWorkerEnabled() ? (n3 = URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) {  if (event.data.cmd === "start") {    const url = event.data.url;    _socket = new WebSocket(url);    _socket.binaryType = "arraybuffer";    _socket.onopen = function() {      postMessage({ callback: "onOpen", extensions: _socket.extensions });    };    _socket.onclose = function(e) {      postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } });    };    _socket.onmessage = function(e) {      postMessage({ callback: "onMessage", data: e.data });    };    _socket.onerror = function(e) {      postMessage({ callback: "onError", e: { isTrusted: "true" } });    };  } else if (event.data.cmd === "sendMessage") {    if (_socket !== null) {      _socket.send(event.data.data);    }  } else if (event.data.cmd === "stop") {    if (_socket !== null) {      _socket.close(event.data.code);      _socket = null;    }  }};'], { type: "application/javascript; charset=utf-8" })), this._workerSocket = new Worker(n3), (i4 = this)._workerSocket.onmessage = function(e5) {
        var t4 = e5.data, n4 = t4.callback, o4 = t4.e, t4 = t4.extensions;
        "onOpen" === n4 ? i4._onOpen(t4) : "onClose" === n4 ? i4._onClose(o4) : "onError" === n4 ? i4._onError(o4) : "onMessage" === n4 && i4._onMessage(e5.data);
      }, this._workerSocket.postMessage({ cmd: "start", id: this._id, url: o3 })) : v3 ? ve3 ? (I2.connectSocket({ url: o3, header: { "content-type": "application/json" } }), I2.onSocketClose(this._onClose.bind(this)), I2.onSocketOpen(this._onOpen.bind(this)), I2.onSocketMessage(this._onMessage.bind(this)), I2.onSocketError(this._onError.bind(this))) : (this._socket = I2.connectSocket({ url: o3, header: { "content-type": "application/json" }, complete: function() {
      } }), this._socket.onClose(this._onClose.bind(this)), this._socket.onOpen(this._onOpen.bind(this)), this._socket.onMessage(this._onMessage.bind(this)), this._socket.onError(this._onError.bind(this))) : (this._socket = new WebSocket(o3), this._socket.binaryType = "arraybuffer", this._socket.onopen = this._onOpen.bind(this, this._socket.extensions), this._socket.onmessage = this._onMessage.bind(this), this._socket.onclose = this._onClose.bind(this), this._socket.onerror = this._onError.bind(this)), this._canIUseBinaryFrame = t3.canIUseBinaryFrame();
    }, [{ key: "getID", value: function() {
      return this._id;
    } }, { key: "_onOpen", value: function(e4) {
      this._handler.onOpen({ id: this._id, res: JSON.stringify(e4) });
    } }, { key: "_onClose", value: function(e4) {
      this._handler.onClose({ id: this._id, e: e4 });
    } }, { key: "_onMessage", value: function(e4) {
      e4 = this._canIUseBinaryFrame ? this._isAppCompressedData(e4.data) ? this._handler.inflate(e4.data) : function(e5) {
        for (var t3 = new Uint8Array(e5), n3 = "", o3 = 0, i4 = t3.length; o3 < i4; ) {
          var a4 = t3[o3], s4 = 0, r3 = 0;
          if (a4 <= 127 ? (s4 = 0, r3 = 255 & a4) : a4 <= 223 ? (s4 = 1, r3 = 31 & a4) : a4 <= 239 ? (s4 = 2, r3 = 15 & a4) : a4 <= 244 && (s4 = 3, r3 = 7 & a4), 0 < i4 - o3 - s4)
            for (var c4 = 0; c4 < s4; )
              r3 = r3 << 6 | 63 & (a4 = t3[o3 + c4 + 1]), c4 += 1;
          else
            r3 = 65533, s4 = i4 - o3;
          n3 += String.fromCodePoint(r3), o3 += s4 + 1;
        }
        return n3;
      }(e4.data) : e4.data;
      this._handler.onMessage({ data: e4 });
    } }, { key: "_isAppCompressedData", value: function(e4) {
      e4 = new Uint8Array(e4);
      return 67 === e4[0] && 79 === e4[1] && 77 === e4[2] && 80 === e4[3];
    } }, { key: "_onError", value: function(e4) {
      this._handler.onError({ id: this._id, e: e4 });
    } }, { key: "setIsWorkerEnabled", value: function(e4) {
      this._isWorkerEnabled = true;
    } }, { key: "close", value: function(e4) {
      this._workerSocket && (this._workerSocket.postMessage({ cmd: "stop", code: e4 }), this._workerSocket.terminate(), this._workerSocket = null), ve3 ? (I2.offSocketClose(), I2.offSocketMessage(), I2.offSocketOpen(), I2.offSocketError(), I2.closeSocket()) : this._socket && (v3 ? (this._socket.onClose(function() {
      }), this._socket.onOpen(function() {
      }), this._socket.onMessage(function() {
      }), this._socket.onError(function() {
      })) : (this._socket.onopen = null, this._socket.onmessage = null, this._socket.onclose = null, this._socket.onerror = null), me2 ? this._socket.close({ code: e4 }) : this._socket.close(e4), this._socket = null);
    } }, { key: "send", value: function(e4) {
      this._workerSocket ? this._workerSocket.postMessage({ cmd: "sendMessage", data: this._canIUseBinaryFrame ? da(e4.data).buffer : e4.data }) : ve3 ? I2.sendSocketMessage({ data: e4.data, fail: function() {
        e4.fail && e4.requestID && e4.fail(e4.requestID);
      } }) : this._socket && (v3 ? this._socket.send({ data: this._canIUseBinaryFrame ? da(e4.data).buffer : e4.data, fail: function() {
        e4.fail && e4.requestID && e4.fail(e4.requestID);
      } }) : this._socket.send(this._canIUseBinaryFrame ? da(e4.data) : e4.data));
    } }]), _a = ["keyMap"], ha = ["keyMap"], ga = "connected", fa = "connecting", ma = "disconnected", va = e3(function e4(t3) {
      p3(this, e4), this._chM = t3, this._n = "SocketHandler", this._promiseMap = /* @__PURE__ */ new Map(), this._readyState = ma, this._simpleRequestMap = /* @__PURE__ */ new Map(), this.MAX_SIZE = 100, this._startSequence = mt3(), this._startTs = 0, this._reConnectFlag = false, this._nextPingTs = 0, this._reConnectCount = 0, this.MAX_RECONNECT_COUNT = 3, this._socketID = -1, this._random = 0, this._socket = null, this._url = "", this._onOpenTs = 0, this._canIUseBinaryFrame = true, this._isWorkerEnabled = true, this._currentSite = ae3, this._setWebsocketHost(), this._initConnection();
    }, [{ key: "_setWebsocketHost", value: function() {
      var e4 = this._chM.get(12);
      this._currentSite = ae3, this._chM.isOversea() && (this._currentSite = "OVERSEA"), e4.isSingaporeSite() ? this._currentSite = "SINGAPORE" : e4.isKoreaSite() ? this._currentSite = "KOREA" : e4.isGermanySite() ? this._currentSite = "GERMANY" : e4.isIndiaSite() ? this._currentSite = "IND" : e4.isJapanSite() ? this._currentSite = "JPN" : e4.isUSASite() ? this._currentSite = "USA" : e4.isIndonesiaSite() && (this._currentSite = "INDONESIA"), a3.HOST.setCurrent(this._currentSite);
    } }, { key: "_initConnection", value: function() {
      var e4 = this._chM.get(12).getSDKAppID() + "", t3 = this._chM.get(12).isIndependentDomainDisabled(), t3 = (N2(a3.HOST.CURRENT.BACKUP) ? this._url = a3.HOST.CURRENT.DEFAULT : "" === this._url ? this._url = t3 ? a3.HOST.CURRENT.DEFAULT : a3.HOST.CURRENT.DEFAULT0.replace("*", e4) : -1 < this._url.indexOf(e4) ? this._url = a3.HOST.CURRENT.DEFAULT : this._url === a3.HOST.CURRENT.DEFAULT ? this._url = a3.HOST.CURRENT.IPV6 : this._url === a3.HOST.CURRENT.IPV6 ? this._url = Ce3 ? this._genRandomDomain() : a3.HOST.CURRENT.BACKUP : this._isWebBackupUrl(this._url) || this._url === a3.HOST.CURRENT.BACKUP ? this._url = this._canIUseAnyCast() ? a3.HOST.CURRENT.ANYCAST : a3.HOST.CURRENT.DEFAULT : this._url === a3.HOST.CURRENT.ANYCAST && (a3.HOST.CURRENT.ANYCAST = "", this._url = a3.HOST.CURRENT.DEFAULT), this._chM.get(12)), e4 = t3.getProxyServer();
      S2(e4) || (this._url = e4), t3.isTestEnv() && (this._url = ee3.TEST[this._currentSite].DEFAULT), this._connect(), this._nextPingTs = 0;
    } }, { key: "_genRandomDomain", value: function() {
      var e4 = Math.floor(10001 * Math.random()) + 1e4;
      return a3.HOST.CURRENT.BACKUP_WEB.replace("*", e4);
    } }, { key: "_isWebBackupUrl", value: function(e4) {
      return e4.includes("my-cpaas.com");
    } }, { key: "_canIUseAnyCast", value: function() {
      return Ce3 && a3.HOST.CURRENT.ANYCAST;
    } }, { key: "onCheckTimer", value: function(e4) {
      e4 % 1 == 0 && (this._checkPromiseMap(), this._checkNativeAppWS());
    } }, { key: "_checkPromiseMap", value: function() {
      var a4 = this;
      0 !== this._promiseMap.size && this._promiseMap.forEach(function(e4, t3) {
        var n3 = e4.reject, o3 = e4.timestamp, e4 = e4.headSeq, i4 = 15e3;
        -1 !== t3.indexOf(G2.LOGIN) ? i4 = 9e4 : -1 !== t3.indexOf(G2.PING) && (i4 = 3e3), Date.now() - o3 >= i4 && (M2.l("".concat(a4._n, "._checkPromiseMap request timeout, delete requestID:").concat(t3)), a4._promiseMap.delete(t3), n3(new L2({ code: k2.NETWORK_TIMEOUT, data: { headSeq: e4 } })), a4._chM.onRequestTimeout());
      });
    } }, { key: "_checkNativeAppWS", value: function() {
      Ie2 && !this.isConnected() && this._reConnect();
    } }, { key: "onOpen", value: function(e4) {
      var t3, n3;
      this._readyState !== ma && (this._onOpenTs = Date.now(), n3 = e4.id, e4 = e4.res, this._socketID = n3, t3 = an2(this._startTs, false), n3 = "socketID:".concat(n3, " res:").concat(e4), M2.l("".concat(this._n, "._onOpen cost:").concat(t3, " ms. ").concat(n3)), new P2("wsOnOpen").setMessage(t3).setCostTime(t3).setMoreMessage(n3).end(), this._readyState = ga, this._reConnectCount = 0, this._resend(), true === this._reConnectFlag && (this._chM.onReconnected(), this._reConnectFlag = false), this._chM.onOpen());
    } }, { key: "onClose", value: function(e4) {
      var t3 = new P2("wsOnClose"), n3 = e4.id, e4 = e4.e, o3 = "sourceSocketID:".concat(n3, " currentSocketID:").concat(this._socketID, " code:").concat(e4.code, " reason:").concat(e4.reason), i4 = 0;
      0 !== this._onOpenTs && (i4 = Date.now() - this._onOpenTs), t3.setMessage(i4).setCostTime(i4).setMoreMessage(o3).setCode(e4.code).end(true), M2.l("".concat(this._n, "._onClose ").concat(o3, " onlineTime:").concat(i4)), n3 === this._socketID && (this._readyState = ma, i4 < 1e3 ? this._chM.onReconnectFailed() : this._chM.onClose());
    } }, { key: "onError", value: function(e4) {
      var t3 = e4.id, e4 = e4.e, n3 = "sourceSocketID:".concat(t3, " currentSocketID:").concat(this._socketID);
      new P2("wsOnError").setMessage(e4.errMsg || JSON.stringify(e4, ["message", "code"])).setMoreMessage(n3).setLevel("error").end(true), M2.w("".concat(this._n, "._onError"), e4, n3), t3 === this._socketID && (this._readyState = ma, this._chM.onError());
    } }, { key: "onMessage", value: function(t3) {
      var e4, n3, o3, i4, a4, s4;
      try {
        e4 = JSON.parse(t3.data);
      } catch (e5) {
        new P2("jsonParseError").setMessage(t3.data).end();
      }
      e4 && e4.head && (t3 = this._getRequestIDFromHead(e4.head), n3 = e4.body, this._chM.get(30).isTRTCCommand(t3) || (s4 = Yt2(e4.head), n3 = function t4(e5, n4) {
        var o4, i5, a5;
        return O2(e5) ? e5.map(function(e6) {
          return ut3(e6) ? t4(e6, n4) : e6;
        }) : ut3(e5) ? (o4 = e5, i5 = function(e6, t5) {
          return N2(n4[t5]) ? sa(t5) : n4[t5];
        }, a5 = {}, Object.keys(o4).forEach(function(e6) {
          a5[i5(o4[e6], e6)] = o4[e6];
        }), qt2(a5, function(e6) {
          return O2(e6) || ut3(e6) ? t4(e6, n4) : e6;
        })) : void 0;
      }(e4.body, this._getResKeyMap(s4))), M2.d("".concat(this._n, ".onMessage ret:").concat(JSON.stringify(n3), " requestID:").concat(t3, " has:").concat(this._promiseMap.has(t3))), this._setNextPingTs(), this._promiseMap.has(t3) ? (o3 = (s4 = this._promiseMap.get(t3)).resolve, i4 = s4.reject, a4 = s4.timestamp, s4 = s4.headSeq, this._promiseMap.delete(t3), this._calcRTT(a4), n3.errorCode && 0 !== n3.errorCode ? (this._chM.onErrorCodeNotZero(n3), i4(new L2({ code: n3.errorCode, message: n3.errorInfo || "", data: t3.includes(G2.MODIFY_C2C_MSG) || t3.includes(G2.MODIFY_GRP_MSG) ? { elements: n3.elements, messageVersion: n3.messageVersion, cloudCustomData: n3.cloudCustomData, headSeq: s4 } : { headSeq: s4 } }))) : o3(T2(n3))) : this._chM.onMessage({ head: e4.head, body: n3 }));
    } }, { key: "_calcRTT", value: function(e4) {
      e4 = Date.now() - e4;
      this._chM.get(26).addRTT(e4);
    } }, { key: "_connect", value: function() {
      this._readyState !== fa && this._readyState !== ga && (this._startTs = Date.now(), this._onOpenTs = 0, this._readyState = fa, this._socket = new pa(this), this._socketID = this._socket.getID(), M2.l("".concat(this._n, "._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled(), " socketID:").concat(this._socketID, " url:").concat(this.getURL())), new P2("wsConnect").setMessage("socketID:".concat(this._socketID, " url:").concat(this.getURL())).end());
    } }, { key: "getURL", value: function() {
      this._chM.isDevMode() && (this._canIUseBinaryFrame = false);
      var e4 = Bt2(), t3 = ((ve3 || _e3 && "windows" === e4 || Ie2) && (this._canIUseBinaryFrame = false), -1), n3 = ("ios" === e4 ? t3 = Le3 || -1 : "android" === e4 && (t3 = ke3 || -1), this._chM.get(12)), o3 = this._chM.getPlatform(), i4 = n3.getSDKAppID(), n3 = n3.getInstanceID(), i4 = "sdkappid=".concat(i4, "&instanceid=").concat(n3, "&random=").concat(this._getRandom(), "&platform=").concat(o3, "&host=").concat(e4) + "&version=".concat(t3, "&sdkversion=").concat("3.5.5");
      return he3 && (i4 += "&isminigame=1"), this._chM.canIUseInflate() && (i4 += "&compress=gzip"), (this._canIUseBinaryFrame ? "".concat(this._url, "/binfo?") : "".concat(this._url, "/info?")).concat(i4);
    } }, { key: "_closeConnection", value: function(e4) {
      M2.l("".concat(this._n, "._closeConnection socketID:").concat(this._socketID)), this._socket && (this._socket.close(e4), this._socketID = -1, this._socket = null, this._readyState = ma);
    } }, { key: "_resend", value: function() {
      var i4 = this;
      if (M2.l("".concat(this._n, "._resend reConnectFlag:").concat(this._reConnectFlag), "promiseMap.size:".concat(this._promiseMap.size, " simpleRequestMap.size:").concat(this._simpleRequestMap.size)), 0 < this._promiseMap.size && this._promiseMap.forEach(function(e5, t4) {
        var n4 = e5.uplinkData, o4 = e5.resolve, e5 = e5.reject;
        -1 !== t4.indexOf(G2.AV_POLLING) ? i4._promiseMap.delete(t4) : (i4._promiseMap.set(t4, { resolve: o4, reject: e5, timestamp: Date.now(), uplinkData: n4 }), i4._execute(t4, n4));
      }), 0 < this._simpleRequestMap.size) {
        var e4, t3 = F2(this._simpleRequestMap);
        try {
          for (t3.s(); !(e4 = t3.n()).done; ) {
            var n3 = j2(e4.value, 2), o3 = n3[0], a4 = n3[1];
            this._execute(o3, a4);
          }
        } catch (e5) {
          t3.e(e5);
        } finally {
          t3.f();
        }
        this._simpleRequestMap.clear();
      }
    } }, { key: "send", value: function(n3) {
      var o3 = this, i4 = (n3.head.seq = this._getSequence(), n3.head.reqtime = Math.floor(Date.now() / 1e3), n3.head.cs = this._calcCheckSum(n3.head.servcmd, n3.body), n3.keyMap, W2(n3, _a)), a4 = this._getRequestIDFromHead(n3.head), s4 = JSON.stringify(i4);
      return new Promise(function(e4, t3) {
        o3._promiseMap.set(a4, { resolve: e4, reject: t3, timestamp: Date.now(), uplinkData: s4, headSeq: n3.head.seq }), M2.d("".concat(o3._n, ".send uplinkData:").concat(JSON.stringify(i4), " requestID:").concat(a4, " readyState:").concat(o3._readyState)), o3._readyState !== ga ? o3._reConnect() : (o3._execute(a4, s4), o3._chM.get(26).addRequestCount());
      });
    } }, { key: "simplySend", value: function(e4) {
      e4.head.seq = this._getSequence(), e4.head.reqtime = Math.floor(Date.now() / 1e3), e4.keyMap;
      var t3 = W2(e4, ha), e4 = this._getRequestIDFromHead(e4.head), t3 = JSON.stringify(t3);
      this._readyState !== ga ? (this._simpleRequestMap.size < this.MAX_SIZE ? this._simpleRequestMap.set(e4, t3) : M2.l("".concat(this._n, ".simplySend. simpleRequestMap is full, drop request!")), this._reConnect()) : this._execute(e4, t3);
    } }, { key: "_execute", value: function(e4, t3) {
      this._socket.send({ data: t3, fail: v3 ? this._onSendFail.bind(this) : void 0, requestID: e4 });
    } }, { key: "_onSendFail", value: function(e4) {
      M2.l("".concat(this._n, "._onSendFail requestID:").concat(e4)), this._chM.onSendFail();
    } }, { key: "_getSequence", value: function() {
      var e4;
      if (this._startSequence < 2415919103)
        return e4 = this._startSequence, this._startSequence += 1, 2415919103 === this._startSequence && (this._startSequence = mt3()), e4;
    } }, { key: "_getRequestIDFromHead", value: function(e4) {
      return e4.servcmd + e4.seq;
    } }, { key: "_getResKeyMap", value: function(e4) {
      e4 = this._chM.getKeyMap(e4);
      return y2(y2({}, $i2.res), e4.res);
    } }, { key: "_reConnect", value: function() {
      this._readyState !== ga && this._readyState !== fa && this.forcedReconnect();
    } }, { key: "forcedReconnect", value: function() {
      var e4 = "".concat(this._n, ".forcedReconnect");
      M2.l("".concat(e4, " count:").concat(this._reConnectCount, " readyState:").concat(this._readyState)), this._reConnectFlag = true, this._resetRandom(), this._reConnectCount < this.MAX_RECONNECT_COUNT ? (this._reConnectCount += 1, this._closeConnection(4001), this._initConnection()) : (this._reConnectCount = 0, this._chM.get(15).isOnline() ? (M2.w("".concat(e4, " disconnected from wsserver but network is ok, continue...")), this._closeConnection(4001), this._initConnection()) : this._chM.onReconnectFailed());
    } }, { key: "getReconnectFlag", value: function() {
      return this._reConnectFlag;
    } }, { key: "_setNextPingTs", value: function() {
      this._nextPingTs = Ie2 ? Date.now() + 5e3 : Date.now() + 1e4;
    } }, { key: "getNextPingTs", value: function() {
      return this._nextPingTs;
    } }, { key: "isConnected", value: function() {
      return this._readyState === ga;
    } }, { key: "canIUseBinaryFrame", value: function() {
      return this._canIUseBinaryFrame;
    } }, { key: "getSocketID", value: function() {
      return this._socketID;
    } }, { key: "inflate", value: function(e4) {
      if (this._chM.canIUseInflate())
        return this._chM.get(37).inflate(e4);
    } }, { key: "setIsWorkerEnabled", value: function(e4) {
      M2.l("".concat(this._n, ".setIsWorkerEnabled flag:").concat(e4)), this._isWorkerEnabled = e4;
    } }, { key: "getIsWorkerEnabled", value: function() {
      return this._isWorkerEnabled && Ge3;
    } }, { key: "_getRandom", value: function() {
      return 0 === this._random && (this._random = Math.random()), this._random;
    } }, { key: "_resetRandom", value: function() {
      this._random = 0;
    } }, { key: "_calcCheckSum", value: function(e4, t3) {
      if (-1 !== e4.indexOf(G2.PING) || -1 !== e4.indexOf(G2.LOGIN) || -1 !== e4.indexOf(G2.LOGOUT) || -1 !== e4.indexOf(G2.AV_POLLING) || -1 !== e4.indexOf(G2.AV_NOAUTH_POLLING))
        return 0;
      for (var n3 = da(JSON.stringify(t3)), o3 = 4294967295, i4 = 0, a4 = n3.length; i4 < a4; i4++) {
        o3 ^= n3[i4];
        for (var s4 = 0; s4 < 8; s4++)
          1 == (1 & o3) ? o3 = o3 >>> 1 ^ 3988292384 : o3 >>>= 1;
      }
      return (4294967295 ^ o3) >>> 0;
    } }, { key: "close", value: function() {
      M2.l("".concat(this._n, ".close")), this._closeConnection(4e3), this._promiseMap.clear(), this._startSequence = mt3(), this._readyState = ma, this._simpleRequestMap.clear(), this._reConnectFlag = false, this._reConnectCount = 0, this._onOpenTs = 0, this._url = "", this._random = 0, this._canIUseBinaryFrame = true, this._isWorkerEnabled = true;
    } }]), Ia = function(a4, s4, r3) {
      return new Promise(function(t3, e4) {
        var n3, o3, i4 = "application/x-www-form-urlencoded;charset=UTF-8";
        v3 ? I2.request({ url: s4, data: r3, method: a4, timeout: 3e3, header: { "content-type": i4 }, success: function(e5) {
          e5 && e5.data && e5.data.NetCheckInfo && M2.l("".concat("getconninfo ok in", " miniapp. ret:"), e5.data), t3();
        }, fail: function() {
          e4(new L2({ code: k2.NETWORK_ERROR }));
        } }) : (n3 = new XMLHttpRequest(), o3 = setTimeout(function() {
          n3.abort(), e4(new L2({ code: k2.NETWORK_TIMEOUT }));
        }, 3e3), n3.onreadystatechange = function() {
          4 === n3.readyState && (o3 && clearTimeout(o3), 200 === n3.status || 304 === n3.status ? (n3.responseText && -1 < n3.responseText.indexOf("NetCheckInfo") && M2.l("".concat("getconninfo ok in", " web. ret:"), JSON.parse(n3.responseText)), t3()) : e4(new L2({ code: k2.NETWORK_ERROR })));
        }, n3.open(a4, s4, true), n3.setRequestHeader("Content-type", i4), r3 ? n3.send(r3) : n3.send());
      });
    }, Ma = (t2(Oa, c3), e3(Oa, [{ key: "onCheckTimer", value: function(e4) {
      this._socketHandler && (this.isLoggedIn() ? (0 < this._timerForNotLoggedIn && (clearInterval(this._timerForNotLoggedIn), this._timerForNotLoggedIn = -1), this._socketHandler.onCheckTimer(e4)) : this._socketHandler.onCheckTimer(1), this._checkNextPing());
    } }, { key: "onErrorCodeNotZero", value: function(e4) {
      this.get(20).onErrorCodeNotZero(e4);
    } }, { key: "onMessage", value: function(e4) {
      this.get(20).onMessage(e4);
    } }, { key: "send", value: function(e4) {
      return this._socketHandler ? this._previousState !== R2.NET_STATE_CONNECTED && e4.head.servcmd.includes(G2.SSO_STAT) ? (this.reConnect(), this.isPrivateNetWork() ? Promise.resolve() : this._sendLogViaHTTP(e4)) : this._socketHandler.send(e4) : Promise.reject();
    } }, { key: "_sendLogViaHTTP", value: function(e4) {
      var t3 = a3.HOST.CURRENT.STAT, t3 = "".concat(t3, "/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e4.head.sdkappid, "&reqtime=").concat(Date.now()), e4 = JSON.stringify(e4.body);
      return Ia("POST", t3, e4);
    } }, { key: "simplySend", value: function(e4) {
      return this._socketHandler ? this._socketHandler.simplySend(e4) : Promise.reject();
    } }, { key: "onOpen", value: function() {
      this._ping();
    } }, { key: "onClose", value: function() {
      this._socketHandler && this._socketHandler.getReconnectFlag() && this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED), this.reConnect();
    } }, { key: "onError", value: function() {
      v3 && !Ie2 && this.warn("DomainNameInMP"), this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "getKeyMap", value: function(e4) {
      return this.get(20).getKeyMap(e4);
    } }, { key: "onRequestTimeout", value: function() {
      3e4 <= Date.now() - this._lastDiagnoseTS && this.diagnose();
    } }, { key: "onSendFail", value: function() {
      this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "onReconnected", value: function() {
      M2.l("".concat(this._n, ".onReconnected cost:").concat(an2(this._disconnectedTS, true, true))), this._m.restartTimer(), this.get(20).onReconnected(an2(this._disconnectedTS, false, false)), this._disconnectedTS = 0, this._emitNetStateChangeEvent(R2.NET_STATE_CONNECTED);
    } }, { key: "onReconnectFailed", value: function() {
      M2.l("".concat(this._n, ".onReconnectFailed")), this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "setIsWorkerEnabled", value: function(e4) {
      this._socketHandler && this._socketHandler.setIsWorkerEnabled(false);
    } }, { key: "offline", value: function() {
      this._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
    } }, { key: "reConnect", value: function() {
      var e4 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t3 = false, n3 = (this._socketHandler && (t3 = this._socketHandler.getReconnectFlag()), "forcedFlag:".concat(e4, " fatalErrorFlag:").concat(this._fatalErrorFlag, " previousState:").concat(this._previousState, " reconnectFlag:").concat(t3));
      M2.l("".concat(this._n, ".reConnect ").concat(n3)), this._fatalErrorFlag || !this._socketHandler || true !== e4 && this._previousState === R2.NET_STATE_CONNECTING && t3 || (this._socketHandler.forcedReconnect(), this._emitNetStateChangeEvent(R2.NET_STATE_CONNECTING));
    } }, { key: "_emitNetStateChangeEvent", value: function(e4) {
      this._previousState !== e4 && (M2.l("".concat(this._n, "._emitNetStateChangeEvent from ").concat(this._previousState, " to ").concat(e4)), e4 === R2.NET_STATE_DISCONNECTED && 0 === this._disconnectedTS && (this._disconnectedTS = Date.now(), this.diagnose()), this._previousState = e4, this.emitOEvt(h3.NET_STATE_CHANGE, { state: e4 }));
    } }, { key: "_ping", value: function() {
      var e4, n3 = this;
      true !== this._probing && (this._probing = true, e4 = this.get(20).getProtocolData({ P: G2.PING }), this.send(e4).then(function() {
        n3._probing = false;
      }).catch(function(e5) {
        n3._probing = false;
        var t3 = n3.get(15).isOnline();
        M2.w("".concat(n3._n, "._ping failed. bOnline:").concat(t3, " error:"), e5), e5 && 60002 === e5.code ? (new P2("error").setMessage("code:".concat(e5.code, " message:").concat(e5.message)).end(), n3._fatalErrorFlag = true, n3._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED)) : t3 ? n3.reConnect() : n3._emitNetStateChangeEvent(R2.NET_STATE_DISCONNECTED);
      }));
    } }, { key: "_checkNextPing", value: function() {
      this._socketHandler && this._socketHandler.isConnected() && Date.now() >= this._socketHandler.getNextPingTs() && this._ping();
    } }, { key: "dealloc", value: function() {
      this._socketHandler && (this._socketHandler.close(), this._socketHandler = null), -1 < this._timerForNotLoggedIn && clearInterval(this._timerForNotLoggedIn);
    } }, { key: "onRestApiKickedOut", value: function() {
      this._socketHandler && (this._socketHandler.close(), this.reConnect(true));
    } }, { key: "canIUseInflate", value: function() {
      return this._m.canIUseInflate();
    } }, { key: "getSocketID", value: function() {
      if (this._socketHandler)
        return this._socketHandler.getSocketID();
    } }, { key: "diagnose", value: function() {
      this.isPrivateNetWork() || (this._lastDiagnoseTS = Date.now(), this._diagnoseBySSO(), this._diagnoseByCDN());
    } }, { key: "_diagnoseBySSO", value: function() {
      var t3 = this, e4 = this._socketHandler.getURL(), n3 = e4.split("/")[2];
      n3.startsWith("ws") && (e4 = e4.slice(e4.indexOf("info?") + 5), n3 = "https://".concat(n3, "/v3/netcheck/getconninfo?").concat(e4, "&reqtime=").concat(Date.now()), Ia("GET", n3).catch(function(e5) {
        M2.w("".concat(t3._n, "._diagnoseBySSO failed. error:"), e5);
      }));
    } }, { key: "_diagnoseByCDN", value: function() {
      var t3 = this, e4 = this._socketHandler.getURL(), e4 = e4.slice(e4.indexOf("info?") + 5), e4 = "https://boce-cdn.my-imcloud.com/v3/netcheck/getconninfo?".concat(e4, "&reqtime=").concat(Date.now());
      Ia("GET", e4).catch(function(e5) {
        M2.w("".concat(t3._n, "._diagnoseByCDN failed. error:"), e5);
      });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._previousState = R2.NET_STATE_CONNECTED, this._probing = false, this._fatalErrorFlag = false, this._timerForNotLoggedIn = setInterval(this.onCheckTimer.bind(this), 1e3), this._disconnectedTS = 0, this._lastDiagnoseTS = 0;
    } }])), ya = ["a2", "tinyid"], Ca = ["a2", "tinyid"], Ta = e3(function e4(t3) {
      p3(this, e4), this._n = "PHandler", this._sessionM = t3, this._map = /* @__PURE__ */ new Map(), this._fillMap();
    }, [{ key: "_fillMap", value: function() {
      this._map.clear();
      var e4 = this._sessionM.genCommonHead(), t3 = this._sessionM.genCosSpecifiedHead(), n3 = this._sessionM.genSSOReportHead();
      this._map.set(G2.LOGIN, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.LOGIN) }), body: { state: "Online", isWebUniapp: 0, deviceBrand: 0, customInfo: "" }, keyMap: { req: { deviceBrand: "InstType" }, res: { InstId: "instanceID", HelloInterval: "helloInterval", RichMsgAuthKey: "authKey" } } }), this._map.set(G2.LOGOUT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.LOGOUT) }), body: { type: 0, isWebUniapp: 0 }, keyMap: { req: { type: "wslogout_type" } } }), this._map.set(G2.HELLO, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.HELLO) }), body: { isWebUniapp: 0 }, keyMap: { res: { NewInstInfo: "newInstanceInfo" } } }), this._map.set(G2.KICK_OTHER, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.STAT_SERVICE, ".").concat(G2.KICK_OTHER) }), body: {} }), this._map.set(G2.COS_SIGN, { head: y2(y2({}, t3), {}, { servcmd: "".concat(a3.NAME.IM_COS_SIGN, ".").concat(G2.COS_SIGN) }), body: { cmd: "open_im_cos_svc", subCmd: "get_cos_token", duration: 300, version: 2 }, keyMap: { req: { userSig: "usersig", subCmd: "sub_cmd", cmd: "cmd", duration: "duration", version: "version" }, res: { expired_time: "expiredTime", bucket_name: "bucketName", session_token: "sessionToken", tmp_secret_id: "secretId", tmp_secret_key: "secretKey" } } }), this._map.set(G2.COS_PRE_SIG, { head: y2(y2({}, t3), {}, { servcmd: "".concat(a3.NAME.CUSTOM_UPLOAD, ".").concat(G2.COS_PRE_SIG) }), body: { fileType: void 0, fileName: void 0, uploadMethod: 0, duration: 900 }, keyMap: { req: { userSig: "usersig", fileType: "file_type", fileName: "file_name", uploadMethod: "upload_method" }, res: { expired_time: "expiredTime", request_id: "requestId", head_url: "headUrl", upload_url: "uploadUrl", download_url: "downloadUrl", ci_url: "ciUrl", snapshot_url: "requestSnapshotUrl" } } }), this._map.set(G2.SIMPLE_COS_PRE_SIG, { head: y2(y2({}, t3), {}, { servcmd: "".concat(a3.NAME.CUSTOM_UPLOAD, ".").concat(G2.SIMPLE_COS_PRE_SIG) }), body: { uploadMethod: 0, platform: 2, SDKAppID: 0, userID: "", conversationType: 1, uploadConfig: [{ fileID: 1, fileType: 1, fileName: "" }] }, keyMap: { req: { platform: "uint32_platform", SDKAppID: "uint32_sdkappid", userID: "str_user_id", uploadMethod: "uint32_upload_method", conversationType: "uint32_scene", uploadConfig: "rpt_upload_object", fileID: "uint32_file_id", fileType: "uint32_file_type", fileName: "str_file_name" }, res: { str_final_ip: "uploadIP", rpt_pre_sig: "preSig", uint32_file_id: "fileID", uint32_exist_flag: "existFlag", str_download_url: "downloadUrl", str_upload_url: "uploadUrl", str_snapshot_url: "requestSnapshotUrl", str_file_key: "fileKey" } } }), this._map.set(G2.GET_IMAGE_INFO, { head: y2(y2({}, t3), {}, { servcmd: "".concat(a3.NAME.CUSTOM_UPLOAD, ".").concat(G2.GET_IMAGE_INFO) }), body: { imageUrl: "" }, keyMap: { req: { imageUrl: "str_image_url" }, res: { rpt_msg_image_info: "imageInfoArray", uint32_image_type: "type", str_url: "url", uint32_width: "width", uint32_height: "height", str_image_format: "imageFormat" } } }), this._map.set(G2.GET_IP, { head: y2(y2({}, t3), {}, { servcmd: "".concat(a3.NAME.CUSTOM_UPLOAD, ".").concat(G2.GET_IP) }), body: { domainName: "" }, keyMap: { req: { domainName: "str_domain" }, res: { str_final_ip: "ip" } } }), this._map.set(G2.VIDEO_COVER, { head: y2(y2({}, t3), {}, { servcmd: "".concat(a3.NAME.CUSTOM_UPLOAD, ".").concat(G2.VIDEO_COVER) }), body: { version: 1, platform: void 0, coverName: void 0, requestSnapshotUrl: void 0 }, keyMap: { req: { version: "version", platform: "platform", coverName: "cover_name", requestSnapshotUrl: "snapshot_url" }, res: { error_code: "errorCode", error_msg: "errorInfo", download_url: "snapshotUrl" } } }), this._map.set(G2.FETCH_COMMERCIAL_CONFIG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.FETCH_COMMERCIAL_CONFIG) }), body: { SDKAppID: 0 }, keyMap: { req: { SDKAppID: "uint32_sdkappid" }, res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_purchase_bits: "purchaseBits", uint32_expired_time: "expiredTime" } } }), this._map.set(G2.PUSHED_COMMERCIAL_CONFIG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.PUSHED_COMMERCIAL_CONFIG) }), body: {}, keyMap: { res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_purchase_bits: "purchaseBits", uint32_expired_time: "expiredTime" } } }), this._map.set(G2.FETCH_CLOUD_CTRL_CONFIG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.FETCH_CLOUD_CTRL_CONFIG) }), body: { SDKAppID: 0, version: 0 }, keyMap: { req: { SDKAppID: "uint32_sdkappid", version: "uint64_version" }, res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_json_config: "cloudControlConfig", uint32_expired_time: "expiredTime", uint32_sdkappid: "SDKAppID", uint64_version: "version" } } }), this._map.set(G2.PUSHED_CLOUD_CTRL_CONFIG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_CONFIG_MANAGER, ".").concat(G2.PUSHED_CLOUD_CTRL_CONFIG) }), body: {}, keyMap: { res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_json_config: "cloudControlConfig", uint32_expired_time: "expiredTime", uint32_sdkappid: "SDKAppID", uint64_version: "version" } } }), this._map.set(G2.OVERLOAD_NOTIFY, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OVERLOAD_PUSH, ".").concat(G2.OVERLOAD_NOTIFY) }), body: {}, keyMap: { res: { OverLoadServCmd: "overloadCommand", DelaySecs: "waitingTime" } } }), this._map.set(G2.SYNC_UNREAD_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SYNC_UNREAD_MSG) }), body: { cookie: "", syncFlag: 0, needAbstract: 1, isOnlineSync: 0, needSignaling: 1, needCachedMsg: 1 }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", from: "From_Account", to: "To_Account", time: "MsgTimeStamp", sequence: "MsgSeq", random: "MsgRandom", elements: "MsgBody" }, res: { MsgList: "messageList", SyncFlag: "syncFlag", To_Account: "to", From_Account: "from", ClientSeq: "clientSequence", MsgSeq: "sequence", NoticeSeq: "noticeSequence", NotifySeq: "notifySequence", MsgRandom: "random", MsgTimeStamp: "time", MsgContent: "content", ToGroupId: "to", MsgKey: "messageKey", GroupTips: "groupTips", MsgBody: "elements", MsgType: "type", C2CRemainingUnreadCount: "C2CRemainingUnreadList", C2CPairUnreadCount: "C2CPairUnreadList" } } }), this._map.set(G2.GET_PROFANITY_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_MSG_AUDIT_MGR, ".").concat(G2.GET_PROFANITY_LIST) }), body: { version: 0, deviceID: "", startIndex: void 0 }, keyMap: { req: { version: "uint64_version", deviceID: "str_device_id", startIndex: "uint64_start_index" }, res: { msg_cmd_error_code: "errorInfo", str_err_msg: "errorMessage", uint32_code: "errorCode", msg_scene_ctl_config: "filterConfig", uint64_c2c_custom_msg_flag: "c2c_custom_message", uint64_c2c_text_msg_flag: "c2c_text_message", uint64_group_custom_msg_flag: "group_custom_message", uint64_group_text_msg_flag: "group_text_message", uint64_group_info_flag: "group_profile", uint64_group_member_info_flag: "group_member_profile", uint64_relation_chain_flag: "sns", uint64_user_info_flag: "user_profile", rpt_msg_dirty_word: "lexicon", str_dirty_word: "profanity", str_replaced_content: "replacement", uint64_filter_type: "filterType", uint64_id: "id", uint64_word_type: "profanityType", uint64_complete_flag: "completeFlag", uint64_next_start_index: "nextStartIndex", uint64_version: "version", uint64_expired_time: "expiredTime" } } }), this._map.set(G2.SEND_C2C_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SEND_C2C_MSG) }), body: { fromAccount: "", toAccount: "", msgSeq: 0, msgRandom: 0, msgBody: [], cloudCustomData: void 0, nick: "", avatar: "", msgLifeTime: void 0, offlinePushInfo: { pushFlag: 0, title: "", desc: "", ext: "", apnsInfo: { sound: "", badgeMode: 0, isVoipPush: void 0, image: "", interruptionLevel: "active", contentAvailable: 0 }, androidInfo: { sound: "", XiaoMiChannelID: "", OPPOChannelID: "", GoogleChannelID: "", VIVOClassification: 1, VIVOCategory: "", HuaWeiCategory: "", OPPOCategory: "", HuaWeiImage: "", HonorImage: "", GoogleImage: "", HonorImportance: "", MeizuNotifyType: void 0 } }, messageControlInfo: void 0, clientTime: void 0, needReadReceipt: 0, isSupportExtension: 0, isRelayMessage: 0, cmConfigID: void 0, forbidCallbackControl: void 0 }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom", msgBody: "MsgBody", count: "MaxCnt", lastMessageTime: "LastMsgTime", messageKey: "MsgKey", peerAccount: "Peer_Account", data: "Data", description: "Desc", extension: "Ext", type: "MsgType", content: "MsgContent", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", nick: "From_AccountNick", avatar: "From_AccountHeadurl", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", elements: "MsgBody", clientSequence: "ClientSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody", needReadReceipt: "IsNeedReadReceipt", GoogleChannelID: "GoogleChannelID", XiaoMiChannelID: "XiaoMiChannelID", OPPOChannelID: "OPPOChannelID", OPPOCategory: "OPPOCategory", VIVOClassification: "VIVOClassification", VIVOCategory: "VIVOCategory", HonorImportance: "HonorImportance", MeizuNotifyType: "MeiZuNoticeMsgType" } } }), this._map.set(G2.SEND_GRP_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.SEND_GRP_MSG) }), body: { fromAccount: "", groupID: "", random: 0, clientSequence: 0, priority: "", msgBody: [], cloudCustomData: void 0, onlineOnlyFlag: 0, offlinePushInfo: { pushFlag: 0, title: "", desc: "", ext: "", apnsInfo: { sound: "", badgeMode: 0, isVoipPush: void 0, image: "", interruptionLevel: "active", contentAvailable: 0 }, androidInfo: { sound: "", XiaoMiChannelID: "", OPPOChannelID: "", GoogleChannelID: "", VIVOClassification: 1, VIVOCategory: "", HuaWeiCategory: "", OPPOCategory: "", HuaWeiImage: "", HonorImage: "", GoogleImage: "", HonorImportance: "", MeizuNotifyType: void 0 } }, groupAtInfo: [], messageControlInfo: void 0, clientTime: void 0, needReadReceipt: 0, topicID: void 0, receiverList: void 0, isSupportExtension: 0, isRelayMessage: 0, cmConfigID: void 0, forbidCallbackControl: void 0 }, keyMap: { req: { to: "GroupId", extension: "Ext", data: "Data", description: "Desc", random: "Random", sequence: "ReqMsgSeq", count: "ReqMsgNumber", type: "MsgType", priority: "MsgPriority", content: "MsgContent", elements: "MsgBody", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", clientSequence: "ClientSeq", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody", needReadReceipt: "NeedReadReceipt", receiverList: "To_Account", GoogleChannelID: "GoogleChannelID", XiaoMiChannelID: "XiaoMiChannelID", OPPOChannelID: "OPPOChannelID", OPPOCategory: "OPPOCategory", VIVOClassification: "VIVOClassification", VIVOCategory: "VIVOCategory", HonorImportance: "HonorImportance", MeizuNotifyType: "MeiZuNoticeMsgType" }, res: { MsgTime: "time", MsgSeq: "sequence" } } }), this._map.set(G2.REVOKE_C2C_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.REVOKE_C2C_MSG) }), body: { msgInfo: { fromAccount: "", toAccount: "", msgTimeStamp: 0, msgSeq: 0, msgRandom: 0 } }, keyMap: { req: { msgInfo: "MsgInfo", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom" } } }), this._map.set(G2.REVOKE_GRP_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.REVOKE_GRP_MSG) }), body: { groupID: "", msgSeqList: void 0, topicID: "" }, keyMap: { req: { msgSeqList: "MsgSeqList", msgSeq: "MsgSeq" } } }), this._map.set(G2.GET_C2C_ROAMING_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.GET_C2C_ROAMING_MSG) }), body: { peerAccount: "", count: 15, lastMessageTime: 0, messageKey: "", withRecalledMessage: 1, direction: 0 }, keyMap: { req: { messageKey: "MsgKey", peerAccount: "Peer_Account", count: "MaxCnt", lastMessageTime: "LastMsgTime", withRecalledMessage: "WithRecalledMsg", direction: "GetDirection" }, res: { LastMsgTime: "lastMessageTime", IsNeedReadReceipt: "needReadReceipt", IsPeerRead: "readReceiptSentByPeer" } } }), this._map.set(G2.MODIFY_C2C_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.MODIFY_C2C_MSG) }), body: { from: "", to: "", sequence: 0, random: 0, time: 0, version: 0, elements: void 0, cloudCustomData: void 0 }, keyMap: { req: { sequence: "MsgSeq", random: "MsgRandom", time: "MsgTime", version: "MsgVersion", type: "MsgType", content: "MsgContent" } } }), this._map.set(G2.GET_GRP_ROAMING_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_ROAMING_MSG) }), body: { withRecalledMsg: 1, groupID: "", count: 15, sequence: "", topicID: void 0 }, keyMap: { req: { sequence: "ReqMsgSeq", count: "ReqMsgNumber", withRecalledMessage: "WithRecalledMsg" }, res: { Random: "random", MsgTime: "time", MsgSeq: "sequence", ReqMsgSeq: "sequence", RspMsgList: "messageList", IsSystemMsg: "isSystemMessage", ToGroupId: "to", EnumFrom_AccountType: "fromAccountType", EnumTo_AccountType: "toAccountType", GroupCode: "groupCode", MsgPriority: "priority", MsgBody: "elements", MsgType: "type", MsgContent: "content", IsFinished: "complete", Download_Flag: "downloadFlag", ClientSeq: "clientSequence", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID", ToTopicId: "topicID", InvisibleMsgSeq: "invisibleSequenceList", NextReqMsgSeq: "nextSequence" } } }), this._map.set(G2.SET_C2C_MSG_READ, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SET_C2C_MSG_READ) }), body: { C2CMsgReaded: void 0 }, keyMap: { req: { lastMessageTime: "LastedMsgTime" } } }), this._map.set(G2.SET_C2C_PEER_MUTE_NOTIFICATIONS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SET_C2C_PEER_MUTE_NOTIFICATIONS) }), body: { userIDList: void 0, muteFlag: 0 }, keyMap: { req: { userIDList: "Peer_Account", muteFlag: "Mute_Notifications" } } }), this._map.set(G2.GET_C2C_PEER_MUTE_NOTIFICATIONS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.GET_C2C_PEER_MUTE_NOTIFICATIONS) }), body: { toAccount: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Peer_Account" }, res: { MuteNotificationsList: "muteFlagList" } } }), this._map.set(G2.SET_GRP_MSG_READ, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.SET_GRP_MSG_READ) }), body: { groupID: void 0, messageReadSeq: void 0, topicID: void 0 }, keyMap: { req: { messageReadSeq: "MsgReadedSeq" } } }), this._map.set(G2.SET_ALL_MSG_READ, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SET_ALL_MSG_READ) }), body: { readAllC2CMessage: 0, groupMessageReadInfoList: [] }, keyMap: { req: { readAllC2CMessage: "C2CReadAllMsg", groupMessageReadInfoList: "GroupReadInfo", messageSequence: "MsgSeq" }, res: { C2CReadAllMsg: "readAllC2CMessage", GroupReadInfoArray: "groupMessageReadInfoList" } } }), this._map.set(G2.DEL_C2C_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.DEL_C2C_MSG) }), body: { fromAccount: "", to: "", keyList: void 0 }, keyMap: { req: { keyList: "MsgKeyList" } } }), this._map.set(G2.DEL_GRP_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.DEL_GRP_MSG) }), body: { groupID: "", deleter: "", keyList: void 0, topicID: void 0 }, keyMap: { req: { deleter: "Deleter_Account", keyList: "Seqs" } } }), this._map.set(G2.TRANSLATE_TEXT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_TRANSLATE, ".").concat(G2.TRANSLATE_TEXT) }), body: { sourceTextList: void 0, SDKAppID: 0, from: 0, source: "", target: "" }, keyMap: { req: { sourceTextList: "SourceText", SDKAppID: "SdkAppId", from: "FromAccount" }, res: { TargetText: "translatedTextList", RequestId: "requestID", CmdErrorCode: "error", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(G2.VOICE_TO_TEXT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_SPEECH, ".").concat(G2.VOICE_TO_TEXT) }), body: { url: "", SDKAppID: 0, format: "", sourceType: 0, language: "" }, keyMap: { req: { url: "BytesUrl", SDKAppID: "Uint32Sdkappid", format: "BytesVoiceFormat", sourceType: "Uint64SourceType", language: "BytesEngServiceType" }, res: { BytesRequestid: "requestID", BytesResult: "result", CmdErrorCode: "error", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(G2.MODIFY_GRP_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.MODIFY_GRP_MSG) }), body: { groupID: "", topicID: void 0, sequence: 0, version: 0, elements: void 0, cloudCustomData: void 0 }, keyMap: { req: { sequence: "MsgSeq", version: "MsgVersion", type: "MsgType", content: "MsgContent" } } }), this._map.set(G2.GET_READ_RECEIPT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_READ_RECEIPT) }), body: { groupID: "", sequenceList: void 0 }, keyMap: { req: { sequence: "MsgSeq" } } }), this._map.set(G2.SEND_C2C_READ_RECEIPT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.SEND_C2C_READ_RECEIPT) }), body: { peerAccount: "", messageInfoList: void 0 }, keyMap: { req: { peerAccount: "Peer_Account", messageInfoList: "C2CMsgInfo", fromAccount: "From_Account", toAccount: "To_Account", sequence: "MsgSeq", random: "MsgRandom", time: "MsgTime", clientTime: "MsgClientTime" } } }), this._map.set(G2.SEND_READ_RECEIPT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.SEND_READ_RECEIPT) }), body: { groupID: "", sequenceList: void 0 }, keyMap: { req: { sequenceList: "MsgSeqList", sequence: "MsgSeq" } } }), this._map.set(G2.GET_READ_RECEIPT_DETAIL, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_READ_RECEIPT_DETAIL) }), body: { groupID: "", sequence: void 0, flag: 0, cursor: 0, count: 0 }, keyMap: { req: { sequence: "MsgSeq", count: "Num" }, res: { ReadList: "readUserIDList", Read_Account: "userID", UnreadList: "unreadUserIDList", Unread_Account: "userID", IsFinish: "isCompleted" } } }), this._map.set(G2.GET_GRP_RECEIPTS_BY_USERS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_RECEIPTS_BY_USERS) }), body: { groupID: "", dataList: void 0 }, keyMap: { req: { dataList: "MemberReadMsgList", sequence: "MsgSeq", userIDList: "MemberList_Account" }, res: { MsgReadList: "dataList", Read_Account: "userID", Read_Time: "readTime" } } }), this._map.set(G2.MODIFY_C2C_MSG_EXT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.MODIFY_C2C_MSG_EXT) }), body: { from: void 0, to: void 0, messageKey: void 0, operateType: void 0, extensionList: void 0 } }), this._map.set(G2.GET_C2C_MSG_EXT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_C2C_MSG_EXT) }), body: { from: void 0, to: void 0, messageKey: void 0, startSequence: void 0 } }), this._map.set(G2.MODIFY_GRP_MSG_EXT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.MODIFY_GRP_MSG_EXT) }), body: { groupID: void 0, topicID: void 0, messageSequence: void 0, operateType: void 0, extensionList: void 0 } }), this._map.set(G2.GET_GRP_MSG_EXT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_GRP_MSG_EXT) }), body: { groupID: void 0, topicID: void 0, messageSequence: void 0, startSequence: void 0 } }), this._map.set(G2.ADD_C2C_MSG_REACTION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.ADD_C2C_MSG_REACTION) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Add_Account" } } }), this._map.set(G2.RM_C2C_MSG_REACTION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.RM_C2C_MSG_REACTION) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Del_Account" } } }), this._map.set(G2.GET_C2C_MSG_REACTIONS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_C2C_MSG_REACTIONS) }), body: { from: void 0, to: void 0, messageKeyList: void 0, count: void 0 } }), this._map.set(G2.GET_C2C_MSG_REACTION_USER_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_C2C_MSG_REACTION_USER_LIST) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, count: void 0 } }), this._map.set(G2.ADD_GRP_MSG_REACTION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.ADD_GRP_MSG_REACTION) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Add_Account" } } }), this._map.set(G2.RM_GRP_MSG_REACTION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.RM_GRP_MSG_REACTION) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Del_Account" } } }), this._map.set(G2.GET_GRP_MSG_REACTIONS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_GRP_MSG_REACTIONS) }), body: { groupID: void 0, topicID: void 0, messageSequenceList: void 0, count: void 0 }, keyMap: { res: { MsgSeq: "messageSequence" } } }), this._map.set(G2.GET_GRP_MSG_REACTION_USER_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM_MSG_EXT, ".").concat(G2.GET_GRP_MSG_REACTION_USER_LIST) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, nextSeq: void 0, count: void 0 } }), this._map.set(G2.GET_C2C_PEER_READ_TIME, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.GET_C2C_PEER_READ_TIME) }), body: { userIDList: void 0 }, keyMap: { req: { userIDList: "To_Account" }, res: { ReadTime: "peerReadTimeList" } } }), this._map.set(G2.PAGING_GET_CONV_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.PAGING_GET_CONV_LIST) }), body: { fromAccount: void 0, timeStamp: void 0, startIndex: void 0, pinnedTimeStamp: void 0, pinnedStartIndex: void 0, orderType: void 0, messageAssistFlag: 15, assistFlag: 31 }, keyMap: { req: { messageAssistFlag: "MsgAssistFlags", assistFlag: "AssistFlags", pinnedTimeStamp: "TopTimeStamp", pinnedStartIndex: "TopStartIndex" }, res: { SessionItem: "conversations", ToAccount: "groupID", To_Account: "userID", UnreadMsgCount: "unreadCount", MsgGroupReadedSeq: "messageReadSeq", C2cPeerReadTime: "c2cPeerReadTime", LastMsgFlags: "lastMessageFlag", TopFlags: "isPinned", TopTimeStamp: "pinnedTimeStamp", TopStartIndex: "pinnedStartIndex", GroupId: "convGroupID", C2cRemark: "friendRemark", MsgRecvOption: "messageRemindType", GroupIgnoredUnreadSeqCount: "noUnreadCount", GroupNextMsgSeq: "nextMessageSeq" } } }), this._map.set(G2.DEL_CONV, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.DEL_CONV) }), body: { fromAccount: "", conversationList: void 0, clearHistoryMessage: void 0 }, keyMap: { req: { toGroupID: "ToGroupid", clearHistoryMessage: "ClearRamble", conversationList: "ContactItem" }, res: { ResultItem: "resultList", ToGroupid: "groupID", ResultCode: "code", ResultInfo: "info" } } }), this._map.set(G2.CLEAR_HISTORY_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.CLEAR_HISTORY_MSG) }), body: { fromAccount: "", toAccount: void 0, type: 1, toGroupID: void 0 }, keyMap: { req: { toGroupID: "ToGroupid" } } }), this._map.set(G2.PIN_CONV, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.PIN_CONV) }), body: { fromAccount: "", operationType: 1, itemList: void 0 }, keyMap: { req: { itemList: "RecentContactItem" } } }), this._map.set(G2.DEL_GROUP_AT_TIPS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.DEL_GROUP_AT_TIPS) }), body: { messageListToDelete: void 0 }, keyMap: { req: { messageListToDelete: "DelMsgList", messageSeq: "MsgSeq", messageRandom: "MsgRandom" } } }), this._map.set(G2.SET_CONV_CUSTOM_DATA, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.MARK_CONV) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "MarkItem", operationType: "OptType", groupID: "ToGroupId" }, res: { ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(G2.MARK_CONV, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.MARK_CONV) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "MarkItem", operationType: "OptType", groupID: "ToGroupId" }, res: { ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(G2.CREATE_CONV_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.CREATE_CONV_GRP) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "GroupContactItem", groupID: "ToGroupId" }, res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(G2.DEL_CONV_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.DEL_CONV_GRP) }), body: { fromAccount: "", groupName: void 0 }, keyMap: { res: { GroupId: "convGroupID" } } }), this._map.set(G2.RENAME_CONV_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: void 0 }, keyMap: { req: { oldName: "OldGroupName", newName: "NewGroupName", groupID: "ToGroupId", operationType: "ContactOptType", groupName: "OldGroupName", updateItem: "ContactUpdateItem" }, res: { ContactOptType: "operationType", ToGroupId: "groupID", GroupId: "convGroupID" } } }), this._map.set(G2.ADD_CONV_TO_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: { groupName: void 0, updateGroupType: void 0, updateItem: void 0 } } }), this._map.set(G2.DEL_CONV_FROM_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: void 0 } }), this._map.set(G2.GET_CONV_GRP_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.GET_CONV_GRP_LIST) }), body: { fromAccount: "", startIndex: void 0 }, keyMap: { res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType", CustomMark: "customData", ContactGroupId: "convGroupIDList" } } }), this._map.set(G2.SEARCH_CONV_GRP_MARK, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.RECENT_CONTACT, ".").concat(G2.SEARCH_CONV_GRP_MARK) }), body: { fromAccount: "", contactItem: void 0 }, keyMap: { req: { groupID: "ToGroupId" }, res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType", CustomMark: "customData", ContactGroupId: "convGroupIDList", ContactResultItem: "contactItem" } } }), this._map.set(G2.GET_USER_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.PROFILE, ".").concat(G2.GET_USER_PROFILE) }), body: { fromAccount: "", userItem: [] }, keyMap: { req: { toAccount: "To_Account", standardSequence: "StandardSequence", customSequence: "CustomSequence" } } }), this._map.set(G2.UPDATE_MY_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.PROFILE, ".").concat(G2.UPDATE_MY_PROFILE) }), body: { fromAccount: "", profileItem: [{ tag: f3.NICK, value: "" }, { tag: f3.GENDER, value: "" }, { tag: f3.ALLOWTYPE, value: "" }, { tag: f3.AVATAR, value: "" }] }, keyMap: { req: { toAccount: "To_Account", standardSequence: "StandardSequence", customSequence: "CustomSequence" } } }), this._map.set(G2.GET_BL, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.GET_BL) }), body: { fromAccount: "", startIndex: 0, maxLimited: 30 } }), this._map.set(G2.ADD_TO_BL, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.ADD_TO_BL) }), body: { fromAccount: "", toAccount: [] } }), this._map.set(G2.RM_FROM_BL, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.RM_FROM_BL) }), body: { fromAccount: "", toAccount: [] } }), this._map.set(G2.SET_SELF_STATUS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.SET_SELF_STATUS) }), body: { customStatus: "" } }), this._map.set(G2.GET_USER_STATUS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.GET_USER_STATUS) }), body: { userIDList: void 0 }, keyMap: { res: { UserStatusList: "successUserList", ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID", Status: "statusType" } } }), this._map.set(G2.SUB_USER_STATUS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.SUB_USER_STATUS) }), body: { userIDList: void 0 }, keyMap: { res: { ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID" } } }), this._map.set(G2.UNSUB_USER_STATUS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.UNSUB_USER_STATUS) }), body: { userIDList: void 0, unsubscribeAll: void 0 }, keyMap: { res: { ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID" } } }), this._map.set(G2.GET_FD_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.GET_FD_LIST) }), body: { fromAccount: "", startIndex: 0, standardSequence: 0, customSequence: 0 }, keyMap: { res: { FriendNum: "friendCount", UserDataItem: "resultList", ValueItem: "tagValueList" } } }), this._map.set(G2.ADD_FD, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.ADD_FD) }), body: { fromAccount: "", addFriendItem: [], type: "" }, keyMap: { req: { source: "AddSource", wording: "AddWording", type: "AddType" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.UPDATE_FD, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.UPDATE_FD) }), body: { fromAccount: "", updateItem: void 0 }, keyMap: { req: { snsItem: "SnsItem" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.DEL_FD, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.DEL_FD) }), body: { fromAccount: "", userIDList: [], type: "" }, keyMap: { req: { type: "DeleteType" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.GET_FD_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.GET_FD_PROFILE) }), body: { fromAccount: "", userIDList: void 0 }, keyMap: { res: { InfoItem: "resultList", SnsProfileItem: "tagValueList" } } }), this._map.set(G2.CHECK_FD, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.CHECK_FD) }), body: { fromAccount: "", userIDList: [], type: "" }, keyMap: { req: { type: "CheckType" }, res: { InfoItem: "resultList" } } }), this._map.set(G2.GET_FD_APPLICATION_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.GET_FD_APPLICATION_LIST) }), body: { fromAccount: "", applicationType: "", startTime: 0, maxLimited: 0, lastSequence: 0 }, keyMap: { res: { PendencyItem: "resultList", AddSource: "source", AddTime: "time", AddWording: "wording", Image: "avatar", UnreadPendencyCount: "unreadCount", To_Account: "userID", PendencyType: "type" } } }), this._map.set(G2.RESPOND_FD_APPLICATION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.RESPOND_FD_APPLICATION) }), body: { fromAccount: "", responseFriendItem: [] }, keyMap: { req: { tag: "TagName", action: "ResponseAction" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.DEL_FD_APPLICATION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.DEL_FD_APPLICATION) }), body: { fromAccount: "", type: "", userIDList: void 0 }, keyMap: { req: { type: "PendencyType", userIDList: "To_Account" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.REPORT_FD_APPLICATION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.REPORT_FD_APPLICATION) }), body: { fromAccount: "", latestTimeStamp: "" }, keyMap: { req: { latestTimeStamp: "LatestPendencyTimeStamp" } } }), this._map.set(G2.CREATE_FD_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.CREATE_FD_GRP) }), body: { fromAccount: "", groupName: void 0, userIDList: void 0 }, keyMap: { req: { groupName: "GroupName", userIDList: "To_Account" }, res: { ResultItem: "resultList" } } }), this._map.set(G2.DEL_FD_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.DEL_FD_GRP) }), body: { fromAccount: "", nameList: void 0 }, keyMap: { req: { nameList: "GroupName" } } }), this._map.set(G2.GET_FD_GRP_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.GET_FD_GRP_LIST) }), body: { fromAccount: "", lastSequence: 0, needFriend: "Need_Friend_Type_Yes" }, keyMap: { res: { ResultItem: "resultList", GroupName: "name", FriendNumber: "friendCount", To_Account: "userIDList" } } }), this._map.set(G2.UPDATE_FD_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FD, ".").concat(G2.UPDATE_FD_GRP) }), body: { fromAccount: "", oldName: "", newName: void 0, updateGroupItem: void 0 }, keyMap: { req: { oldName: "GroupOldName", newName: "GroupNewName" }, res: { UpdateType: "type", ResultItem: "resultList" } } }), this._map.set(G2.GET_GRP_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_LIST) }), body: { memberAccount: "", limit: void 0, offset: void 0, groupType: void 0, responseFilter: { groupBaseInfoFilter: void 0, selfInfoFilter: void 0 }, isSupportTopic: 0, needAppDefineData: 1 }, keyMap: { req: { memberAccount: "Member_Account" }, res: { GroupIdList: "groups", MsgSeq: "readedSequence", LastRecallTime: "_lastRevokedTime", AppDefinedData: "groupCustomField" } } }), this._map.set(G2.GET_GRP_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_PROFILE) }), body: { groupIDList: void 0, responseFilter: { groupBaseInfoFilter: void 0, groupCustomFieldFilter: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 } }, keyMap: { req: { groupIDList: "GroupIdList", groupCustomField: "AppDefinedData", memberCustomField: "AppMemberDefinedData", groupCustomFieldFilter: "AppDefinedDataFilter_Group", memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { GroupIdList: "groups", AppDefinedData: "groupCustomField", AppMemberDefinedData: "memberCustomField", AppDefinedDataFilter_Group: "groupCustomFieldFilter", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", InfoSeq: "infoSequence", MemberList: "members", GroupInfo: "groups", ShutUpUntil: "muteUntil", ShutUpAllMember: "muteAllMembers" } } }), this._map.set(G2.CREATE_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.CREATE_GRP) }), body: { type: void 0, name: void 0, groupID: void 0, ownerID: void 0, introduction: void 0, notification: void 0, maxMemberNum: void 0, joinOption: void 0, memberList: void 0, groupCustomField: void 0, memberCustomField: void 0, webPushFlag: 1, avatar: "", isSupportTopic: void 0, inviteOption: void 0 }, keyMap: { req: { ownerID: "Owner_Account", userID: "Member_Account", avatar: "FaceUrl", maxMemberNum: "MaxMemberCount", joinOption: "ApplyJoinOption", groupCustomField: "AppDefinedData", memberCustomField: "AppMemberDefinedData", inviteOption: "InviteJoinOption" }, res: { HugeGroupFlag: "avChatRoomFlag", OverJoinedGroupLimit_Account: "overLimitUserIDList" } } }), this._map.set(G2.DISMISS_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.DISMISS_GRP) }), body: { groupID: void 0 } }), this._map.set(G2.UPDATE_GRP_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.UPDATE_GRP_PROFILE) }), body: { groupID: void 0, name: void 0, introduction: void 0, notification: void 0, avatar: void 0, joinOption: void 0, groupCustomField: void 0, muteAllMembers: void 0, inviteOption: void 0 }, keyMap: { req: { groupCustomField: "AppDefinedData", muteAllMembers: "ShutUpAllMember", joinOption: "ApplyJoinOption", avatar: "FaceUrl", inviteOption: "InviteJoinOption" }, res: { AppDefinedData: "groupCustomField", ShutUpAllMember: "muteAllMembers" } } }), this._map.set(G2.APPLY_JOIN_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.APPLY_JOIN_GRP) }), body: { groupID: void 0, applyMessage: void 0, userDefinedField: void 0, webPushFlag: 1, historyMessageFlag: void 0 }, keyMap: { req: { applyMessage: "ApplyMsg", historyMessageFlag: "HugeGroupHistoryMsgFlag" }, res: { HugeGroupFlag: "avChatRoomFlag", AVChatRoomKey: "avChatRoomKey", RspMsgList: "messageList", ToGroupId: "to" } } }), this._map.set(G2.APPLY_JOIN_GRP_NOAUTH, (e4.a2, e4.tinyid, { head: y2(y2({}, W2(e4, ya)), {}, { servcmd: "".concat(a3.NAME.BIG_GRP_NO_AUTH, ".").concat(G2.APPLY_JOIN_GRP) }), body: { groupID: void 0, applyMessage: void 0, userDefinedField: void 0, webPushFlag: 1 }, keyMap: { req: { applyMessage: "ApplyMsg" }, res: { HugeGroupFlag: "avChatRoomFlag" } } })), this._map.set(G2.QUIT_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.QUIT_GRP) }), body: { groupID: void 0 } }), this._map.set(G2.SEARCH_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.SEARCH_GRP) }), body: { groupIDList: void 0, responseFilter: { groupBasePublicInfoFilter: ["Type", "Name", "Introduction", "Notification", "FaceUrl", "CreateTime", "Owner_Account", "LastInfoTime", "LastMsgTime", "NextMsgSeq", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "InviteJoinOption"] } } }), this._map.set(G2.CHANGE_GRP_OWNER, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.CHANGE_GRP_OWNER) }), body: { groupID: void 0, newOwnerID: void 0 }, keyMap: { req: { newOwnerID: "NewOwner_Account" } } }), this._map.set(G2.HANDLE_GRP_APPLICATION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.HANDLE_GRP_APPLICATION) }), body: { groupID: void 0, applicant: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, messageKey: void 0, userDefinedField: void 0 }, keyMap: { req: { applicant: "Applicant_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg", messageKey: "MsgKey" } } }), this._map.set(G2.HANDLE_INVITE_JOIN_GRP, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.HANDLE_INVITE_JOIN_GRP) }), body: { groupID: void 0, applicant: void 0, invitee: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, userDefinedField: void 0 }, keyMap: { req: { applicant: "Applicant_Account", invitee: "Invited_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg" } } }), this._map.set(G2.HANDLE_GRP_INVITATION, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.HANDLE_GRP_INVITATION) }), body: { groupID: void 0, inviter: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, messageKey: void 0, userDefinedField: void 0 }, keyMap: { req: { inviter: "Inviter_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg", messageKey: "MsgKey" } } }), this._map.set(G2.GET_GRP_PENDENCY, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_PENDENCY) }), body: { startTime: void 0, limit: void 0, handleAccount: void 0 }, keyMap: { req: { handleAccount: "Handle_Account" }, res: { To_Account: "userID", ApplyInviteMsg: "note" } } }), this._map.set(G2.DEL_GRP_SYSTEM_NOTICE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.DEL_GRP_SYSTEM_NOTICE) }), body: { messageListToDelete: void 0 }, keyMap: { req: { messageListToDelete: "DelMsgList", messageSeq: "MsgSeq", messageRandom: "MsgRandom" } } }), this._map.set(G2.AV_POLLING, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.BIG_GRP_POLLING, ".").concat(G2.AV_POLLING) }), body: { USP: 1, startSeq: 1, startBroadcastSeq: void 0, holdTime: 90, key: void 0, simplifiedMessage: void 0 }, keyMap: { req: { USP: "USP" }, res: { ToGroupId: "groupID", RspBroadcastMsgList: "broadcastMessageList", IsSystemMsg: "isSystemMessage" } } }), this._map.set(G2.AV_NOAUTH_POLLING, (e4.a2, e4.tinyid, { head: y2(y2({}, W2(e4, Ca)), {}, { servcmd: "".concat(a3.NAME.BIG_GRP_POLLING_NO_AUTH, ".").concat(G2.AV_POLLING) }), body: { USP: 1, startSeq: 1, holdTime: 90, key: void 0, simplifiedMessage: void 0 }, keyMap: { req: { USP: "USP" }, res: { ToGroupId: "groupID", RspBroadcastMsgList: "broadcastMessageList", IsSystemMsg: "isSystemMessage" } } })), this._map.set(G2.GET_ONLINE_MBR_NUM, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_ONLINE_MBR_NUM) }), body: { groupID: void 0 }, keyMap: { res: { OnlineMemberNum: "memberCount" } } }), this._map.set(G2.SET_GRP_ATTR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.SET_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key", value: "value" } } }), this._map.set(G2.MODIFY_GRP_ATTR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.MODIFY_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key", value: "value" } } }), this._map.set(G2.DEL_GRP_ATTR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.DEL_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key" } } }), this._map.set(G2.CLEAR_GRP_ATTR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.CLEAR_GRP_ATTR) }), body: { groupID: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] } }), this._map.set(G2.GET_GRP_ATTR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_ATTR, ".").concat(G2.GET_GRP_ATTR) }), body: { groupID: void 0, avChatRoomKey: void 0, groupType: 1 }, keyMap: { req: { avChatRoomKey: "Key", groupType: "GroupType" } } }), this._map.set(G2.GET_GRP_NOTIFY, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_NOTIFY) }), body: { notifyReqList: [] }, keyMap: { req: { notifyReqList: "NotifyReqList" }, res: { NextMsgTime: "nextRevokedTime", NotifyMsgList: "notifyList", NotifyRspList: "notifyRspList" } } }), this._map.set(G2.UPDATE_GRP_COUNTER, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.UPDATE_GRP_COUNTER) }), body: { groupID: void 0, counterList: void 0, avChatRoomKey: void 0, mode: void 0 }, keyMap: { req: { counterList: "GroupCounter" } } }), this._map.set(G2.GET_GRP_COUNTER, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_COUNTER) }), body: { groupID: void 0, keyList: [], avChatRoomKey: void 0 }, keyMap: { req: { keyList: "GroupCounterKeys" } } }), this._map.set(G2.CREATE_TOPIC, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_COMMUNITY, ".").concat(G2.CREATE_TOPIC) }), body: { groupID: void 0, topicName: void 0, avatar: void 0, customData: void 0, topicID: void 0, notification: void 0, introduction: void 0 }, keyMap: { req: { avatar: "FaceUrl" } } }), this._map.set(G2.DEL_TOPIC, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_COMMUNITY, ".").concat(G2.DEL_TOPIC) }), body: { groupID: void 0, topicIDList: void 0 }, keyMap: { req: { topicIDList: "TopicIdList" }, res: { DestroyResultItem: "resultList" } } }), this._map.set(G2.UPDATE_TOPIC_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_COMMUNITY, ".").concat(G2.UPDATE_TOPIC_PROFILE) }), body: { groupID: void 0, topicID: void 0, avatar: void 0, customData: void 0, notification: void 0, introduction: void 0, muteAllMembers: void 0, topicName: void 0 }, keyMap: { req: { avatar: "FaceUrl", muteAllMembers: "ShutUpAllMember" } } }), this._map.set(G2.GET_TOPIC_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_COMMUNITY, ".").concat(G2.GET_TOPIC_LIST) }), body: { groupID: void 0, topicIDList: void 0, MemberInfoFilter: ["NoUnreadSeqList"] }, keyMap: { req: { topicIDList: "TopicIdList" }, res: { TopicAndSelfInfo: "topicInfoList", TopicInfo: "topic", GroupID: "groupID", ShutUpTime: "muteTime", ShutUpAllFlag: "muteAllMembers", LastMsgTime: "lastMessageTime", MsgSeq: "readedSequence", LastMsgSeq: "sequence" } } }), this._map.set(G2.GET_GRP_MBR_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_MBR_LIST) }), body: { groupID: void 0, limit: 0, offset: void 0, next: void 0, memberRoleFilter: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 }, keyMap: { req: { memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { AppMemberDefinedData: "memberCustomField", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", MemberList: "members", ShutUpUntil: "muteUntil" } } }), this._map.set(G2.GET_AV_MBR_LIST, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_AV, ".").concat(G2.GET_AV_MBR_LIST) }), body: { groupID: void 0, offset: void 0, filter: void 0 }, keyMap: { req: { offset: "Timestamp", filter: "Mark" }, res: { NextTimestamp: "offset" } } }), this._map.set(G2.GET_GRP_MBR_PROFILE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.GET_GRP_MBR_PROFILE) }), body: { groupID: void 0, userIDList: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 }, keyMap: { req: { userIDList: "Member_List_Account", memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { MemberList: "members", ShutUpUntil: "muteUntil", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", AppMemberDefinedData: "memberCustomField" } } }), this._map.set(G2.ADD_GRP_MBR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.ADD_GRP_MBR) }), body: { groupID: void 0, silence: void 0, userIDList: void 0 }, keyMap: { req: { userID: "Member_Account", userIDList: "MemberList" }, res: { MemberList: "members" } } }), this._map.set(G2.DEL_GRP_MBR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.DEL_GRP_MBR) }), body: { groupID: void 0, userIDList: void 0, reason: void 0 }, keyMap: { req: { userIDList: "MemberToDel_Account" } } }), this._map.set(G2.BAN_AV_MBR, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.BAN_AV_MBR) }), body: { groupID: void 0, userIDList: void 0, duration: void 0, reason: "" }, keyMap: { req: { userIDList: "Members_Account", duration: "Duration", reason: "Description" } } }), this._map.set(G2.MODIFY_GRP_MBR_INFO, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP, ".").concat(G2.MODIFY_GRP_MBR_INFO) }), body: { groupID: void 0, topicID: void 0, userID: void 0, messageRemindType: void 0, nameCard: void 0, role: void 0, memberCustomField: void 0, muteTime: void 0 }, keyMap: { req: { userID: "Member_Account", memberCustomField: "AppMemberDefinedData", muteTime: "ShutUpTime", messageRemindType: "MsgFlag" } } }), this._map.set(G2.MARK_AV_MBR_INFO, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_AV, ".").concat(G2.MARK_AV_MBR_INFO) }), body: { groupID: void 0, operationType: 1, memberList: [] }, keyMap: { req: { operationType: "CommandType", memberList: "MemberList", markType: "Marks", userID: "Member_Account" }, res: { CommandType: "operationType", Marks: "markType", Member_Account: "userID" } } }), this._map.set(G2.CS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.MSG_SEARCH, ".").concat(G2.CS) }), body: { keywordList: void 0, keywordListMatchType: "or", account: void 0, groupID: void 0, count: 100, cursor: void 0, messageTypeList: void 0, senderUserIDList: void 0, startTime: void 0, endTime: void 0 }, keyMap: { req: { keywordListMatchType: "MatchType", account: "PeerAccount", groupID: "GroupID", messageTypeList: "MsgTypeList", senderUserIDList: "SendUserIDList", keywords: "Keywords", keywordMatchType: "KeywordMatchType", count: "Count", miniBirthday: "UserBirthStart", maxBirthday: "UserBirthEnd", gender: "UserGenderType", groupTypeList: "GroupType", groupIDList: "GroupIdList" }, res: { GroupID: "groupID", UserID: "userID", ErrorCode: "code", ErrorInfo: "message", TotalCount: "totalCount", Count: "messageCount", LastMsgTime: "lastMessageTime", ConversationMsgs: "searchResult", IsNeedReadReceipt: "needReadReceipt", IsPeerRead: "readReceiptSentByPeer", MsgSeq: "sequence", ReqMsgSeq: "sequence", IsSystemMsg: "isSystemMessage", ToGroupId: "to", EnumFrom_AccountType: "fromAccountType", EnumTo_AccountType: "toAccountType", GroupCode: "groupCode", MsgContent: "content", ClientSeq: "clientSequence", ToTopicId: "topicID", InvisibleMsgSeq: "invisibleSequenceList", Users: "userList", ProfileItems: "profileItems", StrValue: "value", IntValue: "value", Groups: "groupList", GroupFaceUrl: "avatar", GroupIntroduction: "introduction", GroupOwnerUserID: "ownerID", GroupOwnerUserName: "ownerNick", GroupOwnerTinyID: "ownerTinyID", GroupMemberNum: "memberNum", GroupName: "name", GroupType: "type", GroupMembers: "groupMemberList", GroupMemberUserID: "userID", GroupMemberTinyID: "userTinyID", GroupMemberUserName: "nick", GroupMemberNameCard: "nameCard" } } }), this._map.set(G2.USER_CS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.USER_SEARCH, ".").concat(G2.CS) }), body: { keywords: void 0, keywordMatchType: 0, miniBirthday: void 0, maxBirthday: void 0, gender: void 0, count: 20, cursor: void 0 } }), this._map.set(G2.GRP_CS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_SEARCH, ".").concat(G2.CS) }), body: { keywords: void 0, keywordMatchType: 0, groupType: void 0, count: 20, cursor: void 0 } }), this._map.set(G2.MBR_CS, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.GRP_MEMBER_SEARCH, ".").concat(G2.CS) }), body: { keywords: void 0, keywordMatchType: 0, groupType: void 0, groupIDList: void 0, count: 20, cursor: void 0 } }), this._map.set(G2.SSO_STAT, { head: y2(y2({}, n3), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STAT, ".").concat(G2.SSO_STAT) }), body: { header: {}, event: [], quality: [] }, keyMap: { req: { SDKType: "sdk_type", SDKVersion: "sdk_version", deviceType: "device_type", platform: "platform", instanceID: "instance_id", traceID: "trace_id", SDKAppID: "sdk_app_id", userID: "user_id", tinyID: "tiny_id", extension: "extension", timestamp: "timestamp", networkType: "network_type", eventType: "event_type", code: "error_code", message: "error_message", moreMessage: "more_message", duplicate: "duplicate", costTime: "cost_time", level: "level", qualityType: "quality_type", reportIndex: "report_index", wholePeriod: "whole_period", totalCount: "total_count", rttCount: "success_count_business", successRateOfRequest: "percent_business", countLessThan1Second: "success_count_business", percentOfCountLessThan1Second: "percent_business", countLessThan3Second: "success_count_platform", percentOfCountLessThan3Second: "percent_platform", successCountOfBusiness: "success_count_business", successRateOfBusiness: "percent_business", successCountOfPlatform: "success_count_platform", successRateOfPlatform: "percent_platform", successCountOfMessageReceived: "success_count_business", successRateOfMessageReceived: "percent_business", avgRTT: "average_value", avgDelay: "average_value", avgValue: "average_value", uiPlatform: "ui_platform" } } }), this._map.set(G2.PING, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.HEARTBEAT, ".").concat(G2.PING) }), body: {} }), this._map.set(G2.MSG_PUSH, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_PUSH, ".").concat(G2.MSG_PUSH) }), body: {}, keyMap: { res: { C2cMsgArray: "C2CMessageArray", GroupMsgArray: "groupMessageArray", GroupTips: "groupTips", C2cNotifyMsgArray: "C2CNotifyMessageArray", C2cMsgInfo: "C2CReadReceiptArray", ClientSeq: "clientSequence", MsgPriority: "priority", NoticeSeq: "noticeSequence", MsgContent: "content", MsgType: "type", MsgBody: "elements", ToGroupId: "to", Desc: "description", Ext: "extension", IsSyncMsg: "isSyncMessage", Flag: "needSync", NeedAck: "needAck", PendencyAdd_Account: "userID", ProfileImNick: "nick", PendencyType: "applicationType", C2CReadAllMsg: "readAllC2CMessage", IsNeedReadReceipt: "needReadReceipt", Status: "statusType" } } }), this._map.set(G2.MULTI_MSG_PUSH, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_PUSH, ".").concat(G2.MULTI_MSG_PUSH) }), body: {}, keyMap: { res: { GroupMsgArray: "groupMessageArray", GroupTips: "groupTips", ClientSeq: "clientSequence", MsgPriority: "priority", NoticeSeq: "noticeSequence", MsgContent: "content", MsgType: "type", MsgBody: "elements", ToGroupId: "to", Desc: "description", Ext: "extension", IsSyncMsg: "isSyncMessage", Flag: "needSync", NeedAck: "needAck", PendencyType: "applicationType" } } }), this._map.set(G2.MSG_PUSH_ACK, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OPEN_IM, ".").concat(G2.MSG_PUSH_ACK) }), body: { sessionData: void 0 }, keyMap: { req: { sessionData: "SessionData" } } }), this._map.set(G2.STATUS_FORCE_OFFLINE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.STATUS_FORCE_OFFLINE) }), body: {}, keyMap: { res: { C2cNotifyMsgArray: "C2CNotifyMessageArray", NoticeSeq: "noticeSequence", KickoutMsgNotify: "kickoutMsgNotify", NewInstInfo: "newInstanceInfo" } } }), this._map.set(G2.DOWNLOAD_MERGER_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_LONG_MSG, ".").concat(G2.DOWNLOAD_MERGER_MSG) }), body: { downloadKey: "" }, keyMap: { res: { Data: "data", Desc: "description", Ext: "extension", Download_Flag: "downloadFlag", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID" } } }), this._map.set(G2.UPLOAD_MERGER_MSG, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_LONG_MSG, ".").concat(G2.UPLOAD_MERGER_MSG) }), body: { messageList: [] }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom", msgBody: "MsgBody", type: "MsgType", content: "MsgContent", data: "Data", description: "Desc", extension: "Ext", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", elements: "MsgBody", clientSequence: "ClientSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody" } } }), this._map.set(G2.FOLLOW, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FOLLOW, ".").concat(G2.FOLLOW) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "FollowItem" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(G2.UNFOLLOW, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FOLLOW, ".").concat(G2.UNFOLLOW) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(G2.GET_FOLLOW_INFO, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FOLLOW, ".").concat(G2.GET_FOLLOW_INFO) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { FollowInfo: "followInfoList", To_Account: "userID", FollowerCount: "followersCount", FollowingCount: "followingCount", MutualFollowingCount: "mutualFollowersCount" } } }), this._map.set(G2.GET_FOLLOW, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FOLLOW, ".").concat(G2.GET_FOLLOW) }), body: { fromAccount: "", type: 1, nextCursor: "", count: 500 }, keyMap: { req: { type: "FollowType", nextCursor: "StartCursor", count: "WantNum" }, res: { FollowItem: "resultList", To_Account: "userID", ProfileItem: "profileList" } } }), this._map.set(G2.CHECK_FOLLOW_TYPE, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.FOLLOW, ".").concat(G2.CHECK_FOLLOW_TYPE) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(G2.SET_TOKEN, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.SET_TOKEN) }), body: { tokenID: "", pushMsg: 0, sdkAppID: 0, businessID: "", deviceBrand: "", deviceToken: "", isTpns: 0, isWebUniapp: 0, notificationStatus: 0, deviceModel: "", systemVersion: "", pushVersion: "" }, keyMap: { req: { tokenID: "TokenID", pushMsg: "PushMsg", sdkAppID: "EnterVersion", businessID: "BusiID", deviceBrand: "InstType", deviceToken: "VarToken", isTpns: "IsTpns", notificationStatus: "NotificationStatus", deviceModel: "DeviceModel", systemVersion: "SystemVersion", pushVersion: "PushPluginVersion" } } }), this._map.set(G2.STAT_FOREGROUND, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.STAT_FOREGROUND) }), body: { isWebUniapp: 0 } }), this._map.set(G2.STAT_BACKGROUND, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_OPEN_STATUS, ".").concat(G2.STAT_BACKGROUND) }), body: { C2CUnread: 0, GroupUnread: 0, isWebUniapp: 0 }, keyMap: { req: { c2cUnreadCount: "C2cUnread", groupUnreadCount: "GrpUnread" } } }), this._map.set(G2.PUSH_REPORT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.OFFLINE_PUSH_REPORT, ".").concat(G2.PUSH_REPORT) }), body: { eventList: [] }, keyMap: { req: { eventList: "UinappPushEvents", type: "EventType", time: "EventTime", pushId: "ClickExt" } } }), this._map.set(G2.SET_ALL_RECEIVE_MSG_OPT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_MSG_LOGIC, ".").concat(G2.SET_ALL_RECEIVE_MSG_OPT) }), body: { startTime: 0, endTime: 0, isRepeated: 0, messageRemindType: 0 }, keyMap: { req: { messageRemindType: "Level" } } }), this._map.set(G2.GET_ALL_RECEIVE_MSG_OPT, { head: y2(y2({}, e4), {}, { servcmd: "".concat(a3.NAME.IM_MSG_LOGIC, ".").concat(G2.GET_ALL_RECEIVE_MSG_OPT) }), body: { toAccount: void 0 } });
    } }, { key: "has", value: function(e4) {
      return this._map.has(e4);
    } }, { key: "get", value: function(e4) {
      return this._map.get(e4);
    } }, { key: "update", value: function() {
      this._fillMap();
    } }, { key: "getKeyMap", value: function(e4) {
      return this.has(e4) ? this.get(e4).keyMap || {} : (M2.w("".concat(this._n, ".getKeyMap unknown P:").concat(e4)), {});
    } }, { key: "getProtocolData", value: function(e4) {
      var t3 = e4.P, n3 = e4.data, e4 = this.get(t3), t3 = null;
      if (n3) {
        var o3, i4 = this._simpleDeepCopy(e4), i4 = this._updateService(n3, i4), a4 = i4.body, s4 = /* @__PURE__ */ Object.create(null);
        for (o3 in a4)
          if (Object.prototype.hasOwnProperty.call(a4, o3)) {
            if (s4[o3] = a4[o3], void 0 === n3[o3])
              continue;
            s4[o3] = n3[o3];
          }
        i4.body = s4, t3 = this._getUplinkData(i4);
      } else
        t3 = this._getUplinkData(e4);
      return t3;
    } }, { key: "_getUplinkData", value: function(e4) {
      var e4 = this._dataCleaner(e4), t3 = Yt2(e4.head), t3 = ca(e4.body, this._getReqKeyMap(t3));
      return e4.body = t3, e4;
    } }, { key: "_updateService", value: function(e4, t3) {
      var n3, o3, i4 = Yt2(t3.head);
      return this._isFromGroupRequest(t3) && (n3 = e4.type, o3 = e4.groupID, e4 = void 0 === (e4 = e4.groupIDList) ? [] : e4, N2(o3 = void 0 === o3 ? void 0 : o3) && (o3 = e4[0] || ""), Pt2({ type: n3, groupID: o3 })) && (t3.head.servcmd = "".concat(a3.NAME.GRP_COMMUNITY, ".").concat(i4)), t3;
    } }, { key: "_isFromGroupRequest", value: function(e4) {
      return e4.head.servcmd.includes(a3.NAME.GRP) || e4.head.servcmd.includes(a3.NAME.GRP_ATTR);
    } }, { key: "_getReqKeyMap", value: function(e4) {
      e4 = this.getKeyMap(e4);
      return y2(y2({}, $i2.req), e4.req);
    } }, { key: "_dataCleaner", value: function(e4) {
      var t3, n3 = Array.isArray(e4) ? [] : /* @__PURE__ */ Object.create(null);
      for (t3 in e4)
        Object.prototype.hasOwnProperty.call(e4, t3) && _t2(t3) && null !== e4[t3] && void 0 !== e4[t3] && ("object" !== z2(e4[t3]) ? n3[t3] = e4[t3] : n3[t3] = this._dataCleaner.bind(this)(e4[t3]));
      return n3;
    } }, { key: "_simpleDeepCopy", value: function(e4) {
      for (var t3, n3 = Object.keys(e4), o3 = {}, i4 = 0, a4 = n3.length; i4 < a4; i4++)
        t3 = n3[i4], O2(e4[t3]) ? o3[t3] = Array.from(e4[t3]) : ut3(e4[t3]) ? o3[t3] = this._simpleDeepCopy(e4[t3]) : o3[t3] = e4[t3];
      return o3;
    } }]), Da = [G2.MSG_PUSH_ACK], Ea = e3(function e4(t3) {
      p3(this, e4), this._sessionM = t3, this._n = "MsgDispatcher", this._eventHandlerMap = /* @__PURE__ */ new Map(), this._eventHandlerMap.set("C2CMessageArray", this._onC2CMsgArray.bind(this)), this._eventHandlerMap.set("groupMessageArray", this._onGroupMsgArray.bind(this)), this._eventHandlerMap.set("groupTips", this._onGroupTips.bind(this)), this._eventHandlerMap.set("C2CNotifyMessageArray", this._onC2CNotifyMsgArray.bind(this)), this._eventHandlerMap.set("C2CReadReceiptArray", this._onC2CReadReceiptArray.bind(this)), this._eventHandlerMap.set("profileModify", this._onProfileModified.bind(this)), this._eventHandlerMap.set("friendListMod", this._onRelationChainModified.bind(this)), this._eventHandlerMap.set("recentContactMod", this._onRecentContact.bind(this)), this._eventHandlerMap.set("readAllC2CMessage", this._onAllMsgRead.bind(this)), this._eventHandlerMap.set("c2cMessageModified", this._onC2CMsgModified.bind(this)), this._eventHandlerMap.set("groupMessageModified", this._onGroupMsgModified.bind(this)), this._eventHandlerMap.set("userStatusList", this._onUserStatusList.bind(this)), this._eventHandlerMap.set("messageExtensionNotify", this._onMsgExtNotify.bind(this)), this._eventHandlerMap.set("messageReactionNotifyList", this._onMsgReactionNotifyList.bind(this)), this._eventHandlerMap.set("messageReactionNotify", this._onMsgReactionNotify.bind(this)), this._eventHandlerMap.set("followChangeList", this._onFollowNotify.bind(this)), this._keys = d3(this._eventHandlerMap.keys());
    }, [{ key: "_onC2CMsgArray", value: function(e4) {
      var t3 = this._sessionM.get(6);
      e4.dataList.forEach(function(e5) {
        var t4;
        1 === e5.isSyncMessage && (t4 = e5.from, e5.from = e5.to, e5.to = t4);
      }), 1 === e4.needSync && this._sessionM.get(19).syncOnNeed(), t3.onNewMessage({ dataList: e4.dataList, isInstantMessage: true });
    } }, { key: "_onC2CMsgModified", value: function(e4) {
      this._sessionM.get(6).onMsgModified(e4);
    } }, { key: "_onGroupMsgArray", value: function(e4) {
      var t3 = this._sessionM.get(7);
      t3 && t3.onNewMessage({ event: e4.event, dataList: e4.dataList, isInstantMessage: true });
    } }, { key: "_onGroupMsgModified", value: function(e4) {
      var t3 = this._sessionM.get(7);
      t3 && t3.onMsgModified(e4);
    } }, { key: "_onGroupTips", value: function(e4) {
      var t3 = this._sessionM.get(7);
      if (t3) {
        var n3 = e4.event, o3 = e4.dataList, i4 = e4.isInstantMessage, a4 = void 0 === i4 || i4, s4 = e4.isSyncingEnded;
        switch (n3) {
          case 4:
          case 6:
            t3.onNewGroupTips({ event: n3, dataList: o3 });
            break;
          case 5:
            for (var r3 = 0; r3 < o3.length; r3++)
              if (O2(o3[r3].elements.revokedInfos))
                t3.onMsgRevoked({ dataList: o3 });
              else if (O2(o3[r3].elements.groupMessageReadNotice))
                t3.onMsgReadNotice({ dataList: o3 });
              else {
                if (!O2(o3[r3].elements.readReceiptList)) {
                  t3.onNewGroupSystemNotice({ dataList: o3, isInstantMessage: a4, isSyncingEnded: s4 });
                  break;
                }
                t3.onReadReceiptList({ dataList: o3 });
              }
            break;
          case 12:
            this._sessionM.get(11).onNewGroupAtTips({ dataList: o3 });
            break;
          default:
            M2.l("".concat(this._n, "._onGroupTips unknown event:").concat(n3, " dataList:"), o3);
        }
      }
    } }, { key: "_onC2CNotifyMsgArray", value: function(e4) {
      var o3, i4 = this, a4 = e4.dataList;
      O2(a4) && (o3 = this._sessionM.get(6), a4.forEach(function(e5) {
        var t3, n3;
        m3(e5) && (e5.hasOwnProperty("kickoutMsgNotify") ? (t3 = (n3 = e5.kickoutMsgNotify).kickType, n3 = void 0 === (n3 = n3.newInstanceInfo) ? {} : n3, 1 === t3 ? i4._sessionM.onMultipleAccountKickedOut(n3) : 2 === t3 ? i4._sessionM.onMultipleDeviceKickedOut(n3) : 3 === t3 && i4._sessionM.onRestApiKickedOut(n3)) : e5.hasOwnProperty("c2cMessageRevokedNotify") ? o3 && o3.onMsgRevoked({ dataList: a4 }, true) : e5.hasOwnProperty("c2cMessageReadReceipt") ? o3 && o3.onMsgReadReceipt({ dataList: a4 }) : e5.hasOwnProperty("c2cMessageReadNotice") ? o3 && o3.onMsgReadNotice({ dataList: a4 }) : e5.hasOwnProperty("muteNotificationsSync") && i4._sessionM.get(11).onC2CMsgRemindTypeSynced({ dataList: a4 }));
      }));
    } }, { key: "_onC2CReadReceiptArray", value: function(e4) {
      this._sessionM.get(6).onReadReceiptList(e4);
    } }, { key: "_onProfileModified", value: function(e4) {
      this._sessionM.get(4).onProfileModified({ dataList: e4.dataList });
      var t3 = this._sessionM.get(8);
      t3 && t3.onFriendProfileModified({ dataList: e4.dataList });
    } }, { key: "_onRelationChainModified", value: function(e4) {
      this._sessionM.get(4).onRelationChainModified({ dataList: e4.dataList });
      var t3 = this._sessionM.get(8);
      t3 && t3.onRelationChainModified({ dataList: e4.dataList });
    } }, { key: "_onRecentContact", value: function(e4) {
      var i4, e4 = e4.dataList;
      O2(e4) && (i4 = this._sessionM.get(11)) && e4.forEach(function(e5) {
        var t3, n3, o3 = e5.pushType;
        1 === o3 ? (t3 = e5.recentContactDeleteItem, i4.onConvDeleted(t3.recentContactList)) : 2 === o3 ? (t3 = e5.recentContactTopItem, i4.onConvPinnedStatus(t3.recentContactList, true)) : 3 === o3 ? (t3 = e5.recentContactTopItem, i4.onConvPinnedStatus(t3.recentContactList, false)) : 4 === o3 ? (t3 = e5.recentContactMarkContact, i4.onConvMarkUpdated(t3.recentContactMarkContactItem)) : 5 === o3 ? (t3 = e5.recentContactCreateContactGroup, i4.onConvGroupCreated(t3.msgContactGroupContactItem)) : 6 === o3 ? (t3 = e5.recentContactDelContactGroup, i4.onConvGroupDeleted(t3.msgGroupItem)) : 7 === o3 && (o3 = (t3 = e5.recentContactUpdateContactGroup).updateType, e5 = t3.msgUpdateGroup, t3 = t3.msgUpdateContact, 1 === o3 ? 1 === (n3 = e5.updateGroupType) ? i4.onConvGroupNameUpdated(e5) : 2 === n3 && i4.onConvInGroupUpdated(e5) : 2 === o3 && i4.onConvAddedToOrDeletedFromGroup(t3));
      });
    } }, { key: "_onAllMsgRead", value: function(e4) {
      var e4 = e4.dataList, t3 = this._sessionM.get(11);
      t3 && t3.onPushedAllMessageRead(e4);
    } }, { key: "_onUserStatusList", value: function(e4) {
      this._sessionM.get(4).onUserStatusUpdated(e4);
    } }, { key: "_onMsgExtNotify", value: function(e4) {
      this._sessionM.get(3).onMsgExtNotify(e4);
    } }, { key: "_onMsgReactionNotifyList", value: function(e4) {
      this._sessionM.get(34).onReactionNotifyList(e4);
    } }, { key: "_onMsgReactionNotify", value: function(e4) {
      this._sessionM.get(34).onReactionNotify(e4);
    } }, { key: "_onFollowNotify", value: function(e4) {
      this._sessionM.get(35).onFollowNotify(e4);
    } }, { key: "_onTopicLatestMsg", value: function(e4) {
      this._sessionM.get(10).onTopicLatestMsg(e4);
    } }, { key: "onMessage", value: function(e4) {
      var t3 = this, n3 = e4.body;
      if (this._filterMsgFromIMOpenPush(e4)) {
        var o3, i4 = n3.eventArray, a4 = n3.isInstantMessage, s4 = n3.isSyncingEnded, r3 = n3.needSync;
        if (O2(i4))
          for (var c4, u3, l3, d4 = 0, p4 = i4.length; d4 < p4; d4++)
            100 !== (l3 = (c4 = i4[d4]).event) ? 24 !== l3 ? 26 !== l3 ? (o3 = Object.keys(c4).find(function(e5) {
              return -1 !== t3._keys.indexOf(e5);
            })) ? (u3 = 14 === l3 ? { readAllC2CMessage: c4[o3], groupMessageReadInfoList: c4.groupMessageReadNotice || [] } : 16 === l3 ? { userID: c4.userID, timestamp: c4.timestamp, readReceiptList: c4[o3] } : c4[o3], this._eventHandlerMap.get(o3)({ event: l3, dataList: u3, isInstantMessage: a4, isSyncingEnded: s4, needSync: r3 })) : M2.l("".concat(this._n, ".onMessage unknown eventItem:"), c4) : this._onTopicLatestMsg(c4) : this._onAllRcvMsgOptNotify(c4) : this._onRoomCustomData(c4.content);
      }
    } }, { key: "_onRoomCustomData", value: function(e4) {
      this._sessionM.get(30).onRoomCustomDataReceived(e4), M2.l("".concat(this._n, "._onRoomCustomData data:").concat(e4));
    } }, { key: "_onAllRcvMsgOptNotify", value: function(e4) {
      this._sessionM.get(11).onAllRcvMsgOptNotify(e4);
    } }, { key: "_filterMsgFromIMOpenPush", value: function(e4) {
      var t3 = e4.head, e4 = e4.body, t3 = t3.servcmd, n3 = false;
      return !(n3 = N2(t3) ? n3 : t3.includes(a3.NAME.IM_CONFIG_MANAGER) || t3.includes(a3.NAME.OVERLOAD_PUSH) || t3.includes(a3.NAME.STAT_SERVICE)) || (t3.includes(G2.PUSHED_CLOUD_CTRL_CONFIG) ? this._sessionM.get(23).onPushedConfig(e4) : t3.includes(G2.PUSHED_COMMERCIAL_CONFIG) ? this._sessionM.get(27).onPushedConfig(e4) : t3.includes(G2.OVERLOAD_NOTIFY) ? this._sessionM.onPushedServerOverload(e4) : t3.includes(G2.KICK_OTHER) && (n3 = Date.now(), this._sessionM.reLoginOnKickOther(), e4 = new P2("kickOther"), n3 = n3 - (t3 = this._sessionM.get(1).getLastWsHelloTs()), e4.setMessage("last wshello time:".concat(t3, " diff:").concat(n3, "ms")).end()), false);
    } }]), La = [{ cmd: G2.GET_GRP_PROFILE, interval: 1, count: 8 }, { cmd: G2.UPDATE_GRP_PROFILE, interval: 1, count: 8 }, { cmd: G2.GET_AV_MBR_LIST, interval: 3, count: 1 }, { cmd: G2.GET_GRP_PENDENCY, interval: 1, count: 15 }, { cmd: G2.GET_TOPIC_LIST, interval: 1, count: 10 }, { cmd: G2.SET_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.MODIFY_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.DEL_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.CLEAR_GRP_ATTR, interval: 5, count: 10 }, { cmd: G2.GET_GRP_ATTR, interval: 5, count: 20 }, { cmd: G2.UPDATE_GRP_COUNTER, interval: 5, count: 20 }, { cmd: G2.GET_GRP_COUNTER, interval: 5, count: 20 }, { cmd: G2.SET_ALL_MSG_READ, interval: 1, count: 1 }, { cmd: G2.GET_USER_STATUS, interval: 5, count: 20 }, { cmd: G2.SUB_USER_STATUS, interval: 5, count: 20 }, { cmd: G2.UNSUB_USER_STATUS, interval: 5, count: 20 }, { cmd: G2.CS, interval: 5, count: 20 }, { cmd: G2.GRP_CS, interval: 5, count: 20 }, { cmd: G2.MBR_CS, interval: 5, count: 20 }, { cmd: G2.USER_CS, interval: 5, count: 20 }, { cmd: G2.CHECK_FOLLOW_TYPE, interval: 5, count: 20 }, { cmd: G2.GET_GRP_ROAMING_MSG, interval: 1, count: 20 }, { cmd: G2.GET_C2C_ROAMING_MSG, interval: 1, count: 20 }], Sa = /* @__PURE__ */ new Map(), ka = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"], Ra = 0, Aa = ka.length; Ra < Aa; Ra++)
      Sa.set(Ra, ka[Ra]);
    function Oa(e4) {
      return p3(this, Oa), (e4 = i3(this, Oa, [e4]))._n = "ChannelModule", e4._socketHandler = new va(e4), e4._probing = false, e4._isAppShowing = true, e4._previousState = R2.NET_STATE_CONNECTED, e4._timerForNotLoggedIn = -1, e4._timerForNotLoggedIn = setInterval(e4.onCheckTimer.bind(e4), 1e3), e4._fatalErrorFlag = false, e4._disconnectedTS = 0, e4._lastDiagnoseTS = 0, e4;
    }
    function Na(e4) {
      for (var t3, n3, o3 = e4, i4 = "", a4 = 0, s4 = (o3 = e4.length % 8 != 0 ? "0".repeat(8 - e4.length % 8) + e4 : o3).length; a4 < s4; a4 += 8)
        t3 = parseInt(o3.slice(a4, a4 + 4), 2), n3 = parseInt(o3.slice(a4 + 4, a4 + 8), 2), i4 += Sa.get(t3) + Sa.get(n3);
      return i4;
    }
    function Ga(e4) {
      var t3;
      return e4 < 0 || 53 < e4 ? NaN : (t3 = 0 | 1073741824 * Math.random(), 30 < e4 ? t3 + 1073741824 * (0 | Math.random() * (1 << e4 - 30)) : t3 >>> 30 - e4);
    }
    function Pa(e4, t3) {
      for (var n3 = e4.toString(16), o3 = t3 - n3.length, i4 = "0"; 0 < o3; o3 >>>= 1, i4 += i4)
        1 & o3 && (n3 = i4 + n3);
      return n3;
    }
    t2(Es2, c3);
    var Ua = e3(Es2, [{ key: "_init", value: function() {
      this._updateCmdFreqLimitMap(La);
    } }, { key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("cmd_frequency_limit");
      N2(e4) || (e4 = JSON.parse(e4), this._updateCmdFreqLimitMap(e4));
    } }, { key: "_updateCmdFreqLimitMap", value: function(e4) {
      var t3 = this;
      e4.forEach(function(e5) {
        t3._cmdFreqLimitMap.set(e5.cmd, { interval: e5.interval, count: e5.count });
      });
    } }, { key: "updateProtocolConfig", value: function() {
      this._pHandler.update();
    } }, { key: "req", value: function(e4) {
      M2.d("".concat(this._n, ".req options:"), e4);
      var t3, n3, o3 = e4.P;
      return this._pHandler.has(o3) ? (t3 = (e4 = this.getProtocolData(e4)).head.servcmd, this._isFreqOverLimit(t3) ? E2({ code: n3 = k2.OVER_FREQUENCY_LIMIT, message: this.getErrMsg(n3, this._getCmd(t3)) }) : this._isServerOverload(t3) ? E2({ code: n3 = k2.OPEN_SERVICE_OVERLOAD_ERROR, message: this.getErrMsg(n3, this._getCmd(t3)) }) : (n3 = this.get(21), Da.includes(o3) ? n3.simplySend(e4) : n3.send(e4))) : (M2.w("".concat(this._n, ".req unknown P:").concat(o3)), E2({ code: k2.NO_PROTOCOL }));
    } }, { key: "getKeyMap", value: function(e4) {
      return this._pHandler.getKeyMap(e4);
    } }, { key: "genCommonHead", value: function() {
      var e4 = this.get(12);
      return { ver: "v4", platform: this._platform, websdkappid: oe2, websdkversion: ne2, a2: e4.getA2Key() || void 0, tinyid: e4.getTinyID() || void 0, status_instid: e4.getStatusInstanceID(), sdkappid: e4.getSDKAppID(), contenttype: e4.getContentType(), reqtime: 0, identifier: e4.getA2Key() ? void 0 : e4.getUserID(), usersig: e4.getA2Key() ? void 0 : e4.getUserSig(), sdkability: 75689843, sdkability_ext: Na(""), cappid: e4.getApplicationID(), cs: 0 };
    } }, { key: "genCosSpecifiedHead", value: function() {
      var e4 = this.get(12);
      return { ver: "v4", platform: this._platform, websdkappid: oe2, websdkversion: ne2, sdkappid: e4.getSDKAppID(), contenttype: e4.getContentType(), reqtime: 0, identifier: e4.getUserID(), usersig: e4.getUserSig(), status_instid: e4.getStatusInstanceID(), sdkability: 75689843, sdkability_ext: Na(""), cappid: e4.getApplicationID(), cs: 0 };
    } }, { key: "genSSOReportHead", value: function() {
      var e4 = this.get(12);
      return { ver: "v4", platform: this._platform, websdkappid: oe2, websdkversion: ne2, sdkappid: e4.getSDKAppID(), contenttype: "", reqtime: 0, identifier: "", usersig: "", status_instid: e4.getStatusInstanceID(), sdkability: 75689843, sdkability_ext: Na(""), cappid: e4.getApplicationID(), cs: 0 };
    } }, { key: "getProtocolData", value: function(e4) {
      return this._pHandler.getProtocolData(e4);
    } }, { key: "trans", value: function(e4) {
      var t3 = e4.servcmd, e4 = e4.data, t3 = { head: y2(y2({}, this.genCommonHead()), {}, { servcmd: t3 }), body: e4 };
      return this.get(21).send(t3);
    } }, { key: "sendComboMessage", value: function(e4) {
      var t3 = e4.servcmd, e4 = e4.data, t3 = { head: y2(y2({}, this.genCommonHead()), {}, { servcmd: t3 }), body: e4 };
      return this.get(21).send(t3);
    } }, { key: "onErrorCodeNotZero", value: function(e4) {
      var t3, n3 = e4.errorCode;
      n3 === k2.HELLO_ANSWER_KICKED_OUT && (t3 = e4.kickType, e4 = void 0 === (e4 = e4.newInstanceInfo) ? {} : e4, 1 === t3 ? this.onMultipleAccountKickedOut(e4) : 2 === t3 ? this.onMultipleDeviceKickedOut(e4) : 3 === t3 && this.onRestApiKickedOut(e4)), n3 !== k2.MSG_A2KEY_EXPIRED && n3 !== k2.ACCOUNT_A2KEY_EXPIRED || (this._onUserSigExpired(), this.get(21).reConnect());
    } }, { key: "onMessage", value: function(e4) {
      var t3 = e4.body, n3 = t3.needAck, t3 = t3.sessionData;
      1 === (void 0 === n3 ? 0 : n3) && this._sendACK(t3), this._msgDispatcher.onMessage(e4);
    } }, { key: "onReconnected", value: function(e4) {
      this._incrementalPullContactFlag = e4 <= 300, this._reLoginOnReconnected();
    } }, { key: "reLoginOnKickOther", value: function() {
      M2.l("".concat(this._n, ".reLoginOnKickOther")), this._reLogin();
    } }, { key: "_reLoginOnReconnected", value: function() {
      M2.l("".concat(this._n, "._reLoginOnReconnected")), this._reLogin();
    } }, { key: "_reLogin", value: function() {
      var e4, t3, s4, r3 = this, c4 = "".concat(this._n, "._reLogin");
      this.isLoggedIn() && (e4 = 0, (t3 = this.get(1).getPushModule()) && (e4 = t3.getUniAppPlatform()), s4 = new P2("reLogin"), this.req({ P: G2.LOGIN, data: { isWebUniapp: e4, customInfo: this.get(12).getCustomLoginInfo() } }).then(function(e5) {
        var e5 = e5.data, t4 = e5.instanceID, e5 = e5.customStatus, n3 = r3.get(12), o3 = xo2(e5), i4 = (n3.setStatusInstanceID(t4), r3.get(21)), a4 = i4.getSocketID(), a4 = "socketID:".concat(a4, " instanceID:").concat(t4, " customStatus:").concat(o3), t4 = (s4.setMessage(a4).end(true), M2.l("".concat(c4, " ok. ").concat(a4)), n3.getCustomStatus() !== o3 && r3.get(4).onUserStatusUpdated({ dataList: [{ to: r3.getMyUserID(), statusType: R2.USER_STATUS_ONLINE, customStatus: e5 }] }), i4.diagnose(), r3.get(11).syncConvList(r3._incrementalPullContactFlag).then(function() {
          M2.l("".concat(c4, ", sync conv list ok.")), r3.get(25).start();
        }), r3.get(7)), a4 = (t4 && t4.updateLocalMainSequenceOnReconnected(), r3.get(10)), n3 = (a4.resetGetTopicTime(), a4.getTopicListOnReconnected(), r3.get(35)), o3 = (n3 && n3.clearCacheOnReconnected(), r3.get(8));
        o3 && o3.updateCacheOnReconnected();
      }));
    } }, { key: "onMultipleAccountKickedOut", value: function(e4) {
      this.get(1).onMultipleAccountKickedOut(e4);
    } }, { key: "onMultipleDeviceKickedOut", value: function(e4) {
      this.get(1).onMultipleDeviceKickedOut(e4);
    } }, { key: "_onUserSigExpired", value: function() {
      this.get(1).onUserSigExpired();
    } }, { key: "onRestApiKickedOut", value: function(e4) {
      this.get(1).onRestApiKickedOut(e4);
    } }, { key: "_sendACK", value: function(e4) {
      this.req({ P: G2.MSG_PUSH_ACK, data: { sessionData: e4 } });
    } }, { key: "_isFreqOverLimit", value: function(e4) {
      var t3, n3, o3, i4, e4 = e4.split(".")[1];
      return !!this._cmdFreqLimitMap.has(e4) && (!this._cmdReqInfoMap.has(e4) || (t3 = (n3 = this._cmdFreqLimitMap.get(e4)).count, n3 = n3.interval, o3 = (i4 = this._cmdReqInfoMap.get(e4)).startTime, i4 = i4.requestCount, Date.now() - o3 > 1e3 * n3) ? (this._cmdReqInfoMap.set(e4, { startTime: Date.now(), requestCount: 1 }), false) : (this._cmdReqInfoMap.set(e4, { startTime: o3, requestCount: i4 += 1 }), t3 < i4));
    } }, { key: "_isServerOverload", value: function(e4) {
      var t3, n3;
      return !!this._serverOverloadInfoMap.has(e4) && (t3 = (n3 = this._serverOverloadInfoMap.get(e4)).overloadTime, n3 = n3.waitingTime, Date.now() - t3 <= 1e3 * n3 || (this._serverOverloadInfoMap.delete(e4), false));
    } }, { key: "_getCmd", value: function(e4) {
      var t3 = "";
      if (e4.includes(".")) {
        var n3, o3 = e4.split(".")[1];
        for (n3 in G2)
          if (G2[n3] === o3) {
            t3 = n3;
            break;
          }
      }
      return t3;
    } }, { key: "onPushedServerOverload", value: function(e4) {
      var t3 = e4.overloadCommand, e4 = e4.waitingTime;
      this._serverOverloadInfoMap.set(t3, { overloadTime: Date.now(), waitingTime: e4 }), M2.w("".concat(this._n, ".onPushedServerOverload waitingTime:").concat(e4, "s cmd:").concat(this._getCmd(t3)));
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._updateCmdFreqLimitMap(La), this._cmdReqInfoMap.clear(), this._serverOverloadInfoMap.clear(), this._incrementalPullContactFlag = true;
    } }]), ba = (t2(Ds2, c3), e3(Ds2, [{ key: "getCloudConfig", value: function(e4) {
      return N2(e4) ? this._cloudConfig : this._cloudConfig.has(e4) ? this._cloudConfig.get(e4) : void 0;
    } }, { key: "getServerConfig", value: function(e4) {
      var t3 = { code: 0, data: "" };
      return !N2(e4) && this._cloudConfig.has(e4) && (t3.data = this._cloudConfig.get(e4)), Promise.resolve(t3);
    } }, { key: "_canFetch", value: function() {
      return this.isLoggedIn() && !this._isFetching && Date.now() >= this._expiredTime;
    } }, { key: "fetchConfig", value: function() {
      var o3, i4 = this, a4 = "".concat(this._n, ".fetchConfig"), e4 = this._canFetch();
      M2.l("".concat(a4, " canFetch:").concat(e4)), e4 && (o3 = new P2("fetchCloudCtrlConfig"), e4 = this.get(12).getSDKAppID(), this._isFetching = true, this.req({ P: G2.FETCH_CLOUD_CTRL_CONFIG, data: { SDKAppID: e4, version: this._version } }).then(function(e5) {
        i4._isFetching = false;
        var t3 = e5.data, n3 = t3.version, t3 = t3.cloudControlConfig;
        o3.setMessage("version:".concat(i4._version, " newVersion:").concat(n3, " config:").concat(t3)).end(), M2.l("".concat(a4, " ok")), i4._parse(e5.data);
      }).catch(function(e5) {
        i4._isFetching = false, o3.setError(e5).end(), M2.l("".concat(a4, " failed. error:"), e5), i4._setExpiredTime(12e4);
      }));
    } }, { key: "onPushedConfig", value: function(e4) {
      M2.l("".concat(this._n, ".onPushedConfig config:"), e4), new P2("pushedCloudCtrlConfig").setMessage("newVersion:".concat(e4.version, " config:").concat(e4.cloudControlConfig)).end(), this._parse(e4);
    } }, { key: "onCheckTimer", value: function(e4) {
      this._canFetch() && this.fetchConfig();
    } }, { key: "_parse", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, "._parse"), o3 = e4.errorCode, i4 = e4.errorMessage, a4 = e4.cloudControlConfig, s4 = e4.version, r3 = e4.expiredTime;
      if (0 === o3) {
        if (this._version !== s4) {
          var c4 = null;
          try {
            c4 = JSON.parse(a4);
          } catch (e5) {
            this.isPrivateNetWork() || M2.e("".concat(n3, " failed. config:"), a4);
          }
          c4 && (this._cloudConfig.clear(), Object.keys(c4).forEach(function(e5) {
            t3._cloudConfig.set(e5, c4[e5]);
          }), this._version = s4, this.emitIEvt(U2.CLOUD_CONFIG), this.emitOEvt(h3.SERVER_CONFIG_UPDATED, { config: c4 }));
        }
        this._setExpiredTime(1e3 * r3);
      } else
        N2(o3) ? (M2.l("".concat(n3, " failed. Invalid message format:"), e4), this._setExpiredTime(36e5)) : (M2.e("".concat(n3, " errorCode:").concat(o3, " errorMessage:").concat(i4)), this._setExpiredTime(12e4));
    } }, { key: "_setExpiredTime", value: function(e4) {
      this._expiredTime = Date.now() + e4;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._cloudConfig.clear(), this._expiredTime = 0, this._version = 0, this._isFetching = false;
    } }])), wa = (t2(Ts2, c3), e3(Ts2, [{ key: "start", value: function() {
      this._recoverGroupChat(), this._recoverC2CChat();
    } }, { key: "_recoverGroupChat", value: function() {
      var n3, o3, i4, a4, s4 = this, e4 = this._getLocalConvList().filter(function(e5) {
        return e5.type === R2.CONV_GROUP && e5.groupProfile.type !== R2.GRP_AVCHATROOM;
      }), r3 = this.get(11), c4 = [];
      e4.forEach(function(e5) {
        var t3 = e5.conversationID, e5 = e5.lastMessage;
        n3 = t3.replace(R2.CONV_GROUP, ""), o3 = r3.getLocalLastMessage(t3), e5 && 0 !== e5.lastSequence && o3 && (i4 = e5.lastSequence, o3 = o3.sequence, a4 = i4 - o3, 0 < o3) && 1 <= a4 && a4 < 300 ? s4._recoverGroupMsg({ groupID: n3, localLastMessageSequence: o3, remoteLastMessageSequence: i4 }) : c4.push(n3);
      }), this._getGroupNotice(c4);
    } }, { key: "_recoverC2CChat", value: function() {
      var n3, o3, i4, a4 = this, e4 = this._getLocalConvList().filter(function(e5) {
        return e5.type === R2.CONV_C2C;
      }), s4 = this.get(11), r3 = [Promise.resolve()], c4 = [];
      e4.forEach(function(e5) {
        var t3 = e5.conversationID, e5 = e5.lastMessage;
        n3 = s4.getLocalLastMessage(t3), e5 && 0 !== e5.lastTime && n3 && (o3 = e5.lastTime, n3 = n3.time, i4 = o3 - n3, 0 < n3) && 1 <= i4 && i4 <= 600 && (r3.push(a4._recoverC2CMsg({ conversationID: t3, localLastMessageTime: n3, remoteLastMessageTime: o3 })), c4.push(t3));
      }), Promise.all(r3).then(function() {
        M2.l("".concat(a4._n, "._recoverC2CChat all done, convIDList:"), c4), a4.get(19).syncOnReconnected();
      });
    } }, { key: "_getLocalConvList", value: function() {
      return this.get(11).getLocalConvList();
    } }, { key: "_recoverGroupMsg", value: function(e4) {
      var d4 = this, p4 = "".concat(this._n, ".").concat("_recoverGroupMsg"), _3 = (M2.l("".concat(p4, " options:"), e4), e4.groupID), h4 = e4.localLastMessageSequence, g3 = e4.remoteLastMessageSequence, f4 = JSON.stringify(e4), m4 = new P2("_recoverGroupMsg");
      m4.setMessage(f4), this._getGroupRoamingMsg({ groupID: _3, sequence: h4 }).then(function(e5) {
        var e5 = e5.data, t3 = e5.complete, n3 = e5.messageList;
        if (!N2(n3)) {
          var e5 = n3[0].sequence, o3 = n3.map(function(e6) {
            return e6.sequence;
          }), o3 = "".concat(f4, " complete:").concat(t3, " sequenceList:").concat(o3), i4 = (M2.l("".concat(p4, " ").concat(o3)), e5 !== h4 && e5 < g3 && 2 !== t3 && d4._recoverGroupMsg({ groupID: _3, localLastMessageSequence: e5, remoteLastMessageSequence: g3 }), m4.setMessage(o3).end(), d4.get(7));
          1 < n3.length && n3.sort(function(e6, t4) {
            return e6.sequence - t4.sequence;
          });
          for (var a4 = false, s4 = 0, r3 = n3.length; s4 < r3; s4++)
            if (n3[s4].from === R2.CONV_SYSTEM) {
              a4 = true;
              break;
            }
          if (a4)
            for (var c4 = 0, u3 = n3.length; c4 < u3; c4++) {
              var l3 = n3[c4];
              l3.from !== R2.CONV_SYSTEM ? i4.onNewMessage({ dataList: [l3], isInstantMessage: false, updateUnreadCount: false }) : i4.onNewGroupTips({ event: l3.event, dataList: [l3] });
            }
          else
            i4.onNewMessage({ dataList: n3, isInstantMessage: false, updateUnreadCount: false });
        }
      }).catch(function(e5) {
        m4.setError(e5).end(), M2.w("".concat(p4, " failed. error:"), e5);
      });
    } }, { key: "_getGroupNotice", value: function(e4) {
      var t3 = e4.length;
      if (M2.l("".concat(this._n, "._getGroupNotice length:").concat(t3)), 0 !== t3) {
        var n3 = this.get(7);
        if (t3 <= 10)
          n3.getNotice(e4);
        else {
          var o3 = Math.floor(t3 / 10);
          5 <= o3 && (o3 = 5);
          for (var i4 = 0; i4 <= o3; i4++)
            n3.getNotice(e4.slice(10 * i4, 10 * (i4 + 1)));
        }
      }
    } }, { key: "_getGroupRoamingMsg", value: function(e4) {
      var t3 = e4.groupID, e4 = e4.sequence;
      return this.req({ P: G2.GET_GRP_ROAMING_MSG, data: { groupID: t3, count: this.PULL_LIMIT_COUNT, sequence: e4 + this.PULL_LIMIT_COUNT - 1 } });
    } }, { key: "_recoverC2CMsg", value: function(e4) {
      var o3 = this, i4 = "".concat(this._n, ".").concat("_recoverC2CMsg"), a4 = (M2.l("".concat(i4, " options:"), e4), e4.conversationID), t3 = e4.localLastMessageTime, s4 = e4.remoteLastMessageTime, r3 = JSON.stringify(e4), c4 = new P2("_recoverC2CMsg");
      return c4.setMessage(r3), this._getC2CRoamingMsg({ conversationID: a4, time: t3 }).then(function(e5) {
        var e5 = e5.data, t4 = e5.complete, e5 = e5.messageList;
        if (!N2(e5)) {
          var n3 = e5.length, n3 = (o3.get(6).onNewMessage({ dataList: e5, isInstantMessage: true }), e5[n3 - 1].time), e5 = e5.map(function(e6) {
            return e6.random;
          }), e5 = "".concat(r3, " complete:").concat(t4, " randomList:").concat(e5);
          if (M2.l("".concat(i4, " ").concat(e5)), c4.setMessage(e5).end(), n3 < s4 && 1 !== t4)
            return o3._recoverC2CMsg({ conversationID: a4, localLastMessageTime: n3, remoteLastMessageTime: s4 });
        }
      }).catch(function(e5) {
        c4.setError(e5).end(), M2.w("".concat(i4, " failed. error:"), e5);
      });
    } }, { key: "_getC2CRoamingMsg", value: function(e4) {
      var t3 = e4.conversationID, e4 = e4.time;
      return this.req({ P: G2.GET_C2C_ROAMING_MSG, data: { peerAccount: t3.replace(R2.CONV_C2C, ""), count: this.PULL_LIMIT_COUNT + 1, lastMessageTime: e4, direction: 1 } });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }])), Fa = e3(function e4() {
      p3(this, e4), this._n = "AvgE2EDelay", this._e2eDelayArray = [];
    }, [{ key: "addMessageDelay", value: function(e4) {
      e4 = He2() - e4;
      0 <= e4 && this._e2eDelayArray.push(e4);
    } }, { key: "_calcAvg", value: function(e4, t3) {
      var n3;
      return 0 === t3 ? 0 : (n3 = 0, e4.forEach(function(e5) {
        n3 += e5;
      }), jt2(n3 / t3, 1));
    } }, { key: "_calcCountWithLimit", value: function(e4) {
      var t3 = e4.e2eDelayArray, n3 = e4.min, o3 = e4.max;
      return t3.filter(function(e5) {
        return n3 <= e5 && e5 < o3;
      }).length;
    } }, { key: "_calcPercent", value: function(e4, t3) {
      e4 = jt2(e4 / t3 * 100, 2);
      return e4 = 100 < e4 ? 100 : e4;
    } }, { key: "_checkE2EDelayException", value: function(e4, t3) {
      var n3, o3, i4, a4 = e4.filter(function(e5) {
        return t3 < e5;
      });
      0 < a4.length && (n3 = a4.length, o3 = Math.min.apply(Math, d3(a4)), i4 = Math.max.apply(Math, d3(a4)), a4 = this._calcAvg(a4, n3), 50 < (e4 = jt2(n3 / e4.length * 100, 2))) && new P2("messageE2EDelayException").setMessage("count:".concat(n3, " min:").concat(o3, " max:").concat(i4, " avg:").concat(a4, " percent:").concat(e4)).setLevel("warning").end();
    } }, { key: "getStatResult", value: function() {
      var e4, t3, n3, o3, i4, a4, s4 = this._e2eDelayArray.length;
      return 0 === s4 ? null : (e4 = d3(this._e2eDelayArray), t3 = this._calcCountWithLimit({ e2eDelayArray: e4, min: 0, max: 1 }), n3 = this._calcCountWithLimit({ e2eDelayArray: e4, min: 1, max: 3 }), o3 = this._calcPercent(t3, s4), i4 = this._calcPercent(n3, s4), a4 = this._calcAvg(e4, s4), this._checkE2EDelayException(e4, 3), e4.length = 0, this.reset(), { totalCount: s4, countLessThan1Second: t3, percentOfCountLessThan1Second: o3, countLessThan3Second: n3, percentOfCountLessThan3Second: i4, avgDelay: a4 });
    } }, { key: "reset", value: function() {
      this._e2eDelayArray.length = 0;
    } }]), qa2 = e3(function e4() {
      p3(this, e4), this._n = "AvgRTT", this._requestCount = 0, this._rttArray = [];
    }, [{ key: "addRequestCount", value: function() {
      this._requestCount += 1;
    } }, { key: "addRTT", value: function(e4) {
      this._rttArray.push(e4);
    } }, { key: "_calcTotalCount", value: function() {
      return this._requestCount;
    } }, { key: "_calcRTTCount", value: function(e4) {
      return e4.length;
    } }, { key: "_calcSuccessRateOfRequest", value: function(e4, t3) {
      return 0 === t3 ? 0 : 100 < (e4 = jt2(e4 / t3 * 100, 2)) ? 100 : e4;
    } }, { key: "_calcAvg", value: function(e4, t3) {
      var n3;
      return 0 === t3 ? 0 : (n3 = 0, e4.forEach(function(e5) {
        n3 += e5;
      }), parseInt(n3 / t3));
    } }, { key: "_calcMax", value: function() {
      return Math.max.apply(Math, d3(this._rttArray));
    } }, { key: "_calcMin", value: function() {
      return Math.min.apply(Math, d3(this._rttArray));
    } }, { key: "getStatResult", value: function() {
      var e4, t3, n3 = this._calcTotalCount(), o3 = d3(this._rttArray);
      return 0 === n3 ? null : (e4 = this._calcRTTCount(o3), t3 = this._calcSuccessRateOfRequest(e4, n3), o3 = this._calcAvg(o3, e4), M2.l("".concat(this._n, ".getStatResult max:").concat(this._calcMax(), " min:").concat(this._calcMin(), " avg:").concat(o3)), this.reset(), { totalCount: n3, rttCount: e4, successRateOfRequest: t3, avgRTT: o3 });
    } }, { key: "reset", value: function() {
      this._requestCount = 0, this._rttArray.length = 0;
    } }]), xa = e3(function e4() {
      p3(this, e4), this._map = /* @__PURE__ */ new Map();
    }, [{ key: "initMap", value: function(e4) {
      var t3 = this;
      e4.forEach(function(e5) {
        t3._map.set(e5, { totalCount: 0, successCount: 0, failedCountOfUserSide: 0, costArray: [], fileSizeArray: [] });
      });
    } }, { key: "addTotalCount", value: function(e4) {
      return !(N2(e4) || !this._map.has(e4) || (this._map.get(e4).totalCount += 1, 0));
    } }, { key: "addSuccessCount", value: function(e4) {
      return !(N2(e4) || !this._map.has(e4) || (this._map.get(e4).successCount += 1, 0));
    } }, { key: "addFailedCountOfUserSide", value: function(e4) {
      return !(N2(e4) || !this._map.has(e4) || (this._map.get(e4).failedCountOfUserSide += 1, 0));
    } }, { key: "addCost", value: function(e4, t3) {
      return !(N2(e4) || !this._map.has(e4) || (this._map.get(e4).costArray.push(t3), 0));
    } }, { key: "addFileSize", value: function(e4, t3) {
      return !(N2(e4) || !this._map.has(e4) || (this._map.get(e4).fileSizeArray.push(t3), 0));
    } }, { key: "_calcSuccessRateOfBusiness", value: function(e4) {
      return N2(e4) || !this._map.has(e4) ? -1 : 100 < (e4 = jt2((e4 = this._map.get(e4)).successCount / e4.totalCount * 100, 2)) ? 100 : e4;
    } }, { key: "_calcSuccessRateOfPlatform", value: function(e4) {
      var t3;
      return N2(e4) || !this._map.has(e4) ? -1 : (t3 = this._map.get(e4), 100 < (e4 = jt2(e4 = this._calcSuccessCountOfPlatform(e4) / t3.totalCount * 100, 2)) ? 100 : e4);
    } }, { key: "_calcTotalCount", value: function(e4) {
      return N2(e4) || !this._map.has(e4) ? -1 : this._map.get(e4).totalCount;
    } }, { key: "_calcSuccessCountOfBusiness", value: function(e4) {
      return N2(e4) || !this._map.has(e4) ? -1 : this._map.get(e4).successCount;
    } }, { key: "_calcSuccessCountOfPlatform", value: function(e4) {
      return N2(e4) || !this._map.has(e4) ? -1 : (e4 = this._map.get(e4)).successCount + e4.failedCountOfUserSide;
    } }, { key: "_calcAvg", value: function(e4) {
      return N2(e4) || !this._map.has(e4) ? -1 : e4 === Zn2 ? this._calcAvgSpeed(e4) : this._calcAvgCost(e4);
    } }, { key: "_calcAvgCost", value: function(e4) {
      var t3, n3 = this._map.get(e4).costArray.length;
      return 0 === n3 ? 0 : (t3 = 0, this._map.get(e4).costArray.forEach(function(e5) {
        t3 += e5;
      }), parseInt(t3 / n3));
    } }, { key: "_calcAvgSpeed", value: function(e4) {
      var t3 = 0, n3 = 0;
      return this._map.get(e4).costArray.forEach(function(e5) {
        t3 += e5;
      }), this._map.get(e4).fileSizeArray.forEach(function(e5) {
        n3 += e5;
      }), parseInt(1e3 * n3 / t3);
    } }, { key: "getStatResult", value: function(e4) {
      var t3, n3, o3, i4, a4, s4 = this._calcTotalCount(e4);
      return 0 === s4 ? null : (t3 = this._calcSuccessCountOfBusiness(e4), n3 = this._calcSuccessRateOfBusiness(e4), o3 = this._calcSuccessCountOfPlatform(e4), i4 = this._calcSuccessRateOfPlatform(e4), a4 = this._calcAvg(e4), this.reset(e4), { totalCount: s4, successCountOfBusiness: t3, successRateOfBusiness: n3, successCountOfPlatform: o3, successRateOfPlatform: i4, avgValue: a4 });
    } }, { key: "reset", value: function(e4) {
      N2(e4) ? this._map.clear() : this._map.set(e4, { totalCount: 0, successCount: 0, failedCountOfUserSide: 0, costArray: [], fileSizeArray: [] });
    } }]), Va = e3(function e4() {
      p3(this, e4), this._lastMap = /* @__PURE__ */ new Map(), this._currentMap = /* @__PURE__ */ new Map();
    }, [{ key: "initMap", value: function(e4) {
      var t3 = this;
      e4.forEach(function(e5) {
        t3._lastMap.set(e5, /* @__PURE__ */ new Map()), t3._currentMap.set(e5, /* @__PURE__ */ new Map());
      });
    } }, { key: "addMessageSequence", value: function(e4) {
      var t3, n3, o3, i4 = e4.key, a4 = e4.message;
      return !(N2(i4) || !this._lastMap.has(i4) || !this._currentMap.has(i4) || (t3 = a4.conversationID, a4 = a4.sequence, t3 = t3.replace(R2.CONV_GROUP, ""), 0 !== this._lastMap.get(i4).size && this._lastMap.get(i4).has(t3) && (o3 = (n3 = this._lastMap.get(i4).get(t3)).length - 1, a4 > n3[0]) && a4 < n3[o3] ? (n3.push(a4), n3.sort(), this._lastMap.get(i4).set(t3, n3)) : this._addCurrentMap(e4), 0));
    } }, { key: "_addCurrentMap", value: function(e4) {
      var t3 = e4.key, e4 = e4.message, n3 = e4.conversationID, e4 = e4.sequence, n3 = n3.replace(R2.CONV_GROUP, "");
      this._currentMap.get(t3).has(n3) || this._currentMap.get(t3).set(n3, []), this._currentMap.get(t3).get(n3).push(e4);
    } }, { key: "_copyData", value: function(e4) {
      if (!N2(e4)) {
        this._lastMap.set(e4, /* @__PURE__ */ new Map());
        var t3, n3 = this._lastMap.get(e4), o3 = F2(this._currentMap.get(e4));
        try {
          for (o3.s(); !(t3 = o3.n()).done; ) {
            var i4 = j2(t3.value, 2), a4 = i4[0], s4 = i4[1];
            n3.set(a4, s4);
          }
        } catch (e5) {
          o3.e(e5);
        } finally {
          o3.f();
        }
        n3 = null, this._currentMap.set(e4, /* @__PURE__ */ new Map());
      }
    } }, { key: "getStatResult", value: function(e4) {
      var o3, i4, t3;
      return N2(this._currentMap.get(e4)) || N2(this._lastMap.get(e4)) ? null : 0 === this._lastMap.get(e4).size ? (this._copyData(e4), null) : (i4 = o3 = 0, this._lastMap.get(e4).forEach(function(e5, t4) {
        var e5 = d3(e5.values()), n3 = e5.length, e5 = e5[n3 - 1] - e5[0] + 1;
        o3 += e5, i4 += n3;
      }), 0 === o3 ? null : (100 < (t3 = jt2(i4 / o3 * 100, 2)) && (t3 = 100), this._copyData(e4), { totalCount: o3, successCountOfMessageReceived: i4, successRateOfMessageReceived: t3 }));
    } }, { key: "reset", value: function() {
      this._currentMap.clear(), this._lastMap.clear();
    } }]), Ba = (t2(Cs2, c3), e3(Cs2, [{ key: "_onLoginSuccess", value: function() {
      var t3 = this, e4 = (this._rateMessageSent.initMap(this._messageSentItems), this._rateMessageReceived.initMap(this._messageReceivedItems), this.get(13)), n3 = e4.getItem(this.TAG, false);
      !S2(n3) && dt3(n3.forEach) && (M2.l("".concat(this._n, "._onLoginSuccess. logs count:").concat(n3.length)), n3.forEach(function(e5) {
        t3._statInfoArr.push(e5);
      }), e4.removeItem(this.TAG, false));
    } }, { key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("q_rpt_interval"), t3 = this.getCloudConfig("q_rpt_sdkappid_bl"), n3 = this.getCloudConfig("q_rpt_tinyid_wl");
      N2(e4) || (this.REPORT_INTERVAL = Number(e4)), N2(t3) || (this.REPORT_SDKAPPID_BLACKLIST = t3.split(",").map(function(e5) {
        return Number(e5);
      })), N2(n3) || (this.REPORT_TINYID_WHITELIST = n3.split(","));
    } }, { key: "onCheckTimer", value: function(e4) {
      this.isLoggedIn() && e4 % this.REPORT_INTERVAL == 0 && (this.wholePeriod = true, this._report());
    } }, { key: "addRequestCount", value: function() {
      this._avgRTT.addRequestCount();
    } }, { key: "addRTT", value: function(e4) {
      this._avgRTT.addRTT(e4);
    } }, { key: "addMessageDelay", value: function(e4) {
      this._avgE2EDelay.addMessageDelay(e4);
    } }, { key: "addTotalCount", value: function(e4) {
      this._rateMessageSent.addTotalCount(e4) || M2.w("".concat(this._n, ".addTotalCount invalid key:"), e4);
    } }, { key: "addSuccessCount", value: function(e4) {
      this._rateMessageSent.addSuccessCount(e4) || M2.w("".concat(this._n, ".addSuccessCount invalid key:"), e4);
    } }, { key: "addFailedCountOfUserSide", value: function(e4) {
      this._rateMessageSent.addFailedCountOfUserSide(e4) || M2.w("".concat(this._n, ".addFailedCountOfUserSide invalid key:"), e4);
    } }, { key: "addCost", value: function(e4, t3) {
      this._rateMessageSent.addCost(e4, t3) || M2.w("".concat(this._n, ".addCost invalid key or cost:"), e4, t3);
    } }, { key: "addFileSize", value: function(e4, t3) {
      this._rateMessageSent.addFileSize(e4, t3) || M2.w("".concat(this._n, ".addFileSize invalid key or size:"), e4, t3);
    } }, { key: "addMessageSequence", value: function(e4) {
      this._rateMessageReceived.addMessageSequence(e4) || M2.w("".concat(this._n, ".addMessageSequence invalid key:"), e4.key);
    } }, { key: "_getQualityItem", value: function(e4) {
      var t3 = {}, n3 = oo2[this.get(15).getNetworkType()], n3 = (N2(n3) && (n3 = 8), { qualityType: to2[e4], timestamp: Ye3(), networkType: n3, extension: "" });
      switch (e4) {
        case Wn2:
          t3 = this._avgRTT.getStatResult();
          break;
        case Yn2:
          t3 = this._avgE2EDelay.getStatResult();
          break;
        case jn2:
        case Jn2:
        case zn2:
        case Xn2:
        case Zn2:
          t3 = this._rateMessageSent.getStatResult(e4);
          break;
        case Qn2:
        case $n2:
        case eo2:
          t3 = this._rateMessageReceived.getStatResult(e4);
      }
      return null === t3 ? null : y2(y2({}, n3), t3);
    } }, { key: "_report", value: function(e4) {
      var t3 = this, n3 = [], o3 = null, e4 = (N2(e4) ? this._qualityItems.forEach(function(e5) {
        null !== (o3 = t3._getQualityItem(e5)) && (o3.reportIndex = t3.reportIndex, o3.wholePeriod = t3.wholePeriod, n3.push(o3));
      }) : null !== (o3 = this._getQualityItem(e4)) && (o3.reportIndex = this.reportIndex, o3.wholePeriod = this.wholePeriod, n3.push(o3)), M2.d("".concat(this._n, "._report"), n3), 0 < this._statInfoArr.length && (n3 = n3.concat(this._statInfoArr), this._statInfoArr = []), this.get(12)), i4 = e4.getSDKAppID(), e4 = e4.getTinyID();
      0 < (n3 = Jt2(this.REPORT_SDKAPPID_BLACKLIST, i4) && !zt2(this.REPORT_TINYID_WHITELIST, e4) ? [] : n3).length && this._doReport(n3);
    } }, { key: "_doReport", value: function(t3) {
      var n3 = this, e4 = { header: ki2(this), quality: t3 };
      this.req({ P: G2.SSO_STAT, data: y2({}, e4) }).then(function() {
        n3.reportIndex++, n3.wholePeriod = false;
      }).catch(function(e5) {
        M2.w("".concat(n3._n, "._doReport failed. error:"), e5), n3._statInfoArr = n3._statInfoArr.concat(t3), n3._flushAtOnce();
      });
    } }, { key: "_flushAtOnce", value: function() {
      var e4 = this.get(13), t3 = e4.getItem(this.TAG, false), n3 = this._statInfoArr, o3 = "".concat(this._n, "._flushAtOnce");
      S2(t3) ? (M2.l("".concat(o3, " count:").concat(n3.length)), e4.setItem(this.TAG, n3, true, false)) : (10 < (n3 = n3.concat(t3)).length && (n3 = n3.slice(0, 10)), M2.l("".concat(o3, " count:").concat(n3.length)), e4.setItem(this.TAG, n3, true, false)), this._statInfoArr = [];
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._report(), this.reportIndex = 0, this.wholePeriod = false, this.REPORT_SDKAPPID_BLACKLIST = [], this.REPORT_TINYID_WHITELIST = [], this._avgRTT.reset(), this._avgE2EDelay.reset(), this._rateMessageSent.reset(), this._rateMessageReceived.reset();
    } }])), Ha = e3(function e4(t3) {
      p3(this, e4), S2(t3) || (this.userID = t3.userID || "", this.nick = t3.nick || "", this.avatar = t3.avatar || "", this.time = t3.time || 0, this.source = t3.source || "", this.wording = t3.wording || "", this.type = t3.type || "");
    }), Ka = e3(function e4(t3) {
      p3(this, e4), this._snsM = t3, this._n = "FriendApplicationHandler", this._startTime = 0, this._maxLimited = 100, this._currentSeq = 0, this._map = /* @__PURE__ */ new Map(), this._unreadCount = 0;
    }, [{ key: "updateCacheOnReconnected", value: function() {
      this._startTime = 0, this._currentSeq = 0, this.getApplicationList();
    } }, { key: "getLocalApplicationList", value: function() {
      return { friendApplicationList: d3(this._map.values()), unreadCount: this._unreadCount };
    } }, { key: "_onApplicationListUpdated", value: function() {
      this._snsM.emitOEvt(h3.FRIEND_APPLICATION_LIST_UPDATED, { friendApplicationList: d3(this._map.values()), unreadCount: this._unreadCount });
    } }, { key: "onApplicationRead", value: function() {
      this._unreadCount = 0, this._onApplicationListUpdated();
    } }, { key: "onApplicationAdded", value: function(e4, t3) {
      var n3, o3, i4 = this;
      S2(e4) || (n3 = "", n3 = t3 === this._snsM.getMyUserID() ? R2.SNS_APPLICATION_SENT_BY_ME : R2.SNS_APPLICATION_SENT_TO_ME, o3 = false, e4.forEach(function(e5) {
        var t4 = "".concat(e5.userID, "_").concat(n3);
        n3 !== R2.SNS_APPLICATION_SENT_TO_ME || i4._map.has(t4) || (i4._unreadCount += 1), i4._map.set(t4, new Ha(y2(y2({}, e5), {}, { type: n3 }))), o3 = true;
      }), o3 && this._onApplicationListUpdated());
    } }, { key: "onApplicationDeleted", value: function(e4) {
      S2(e4) || (this._startTime = 0, this._currentSeq = 0, this.getApplicationList());
    } }, { key: "getApplicationList", value: function() {
      var a4 = this, s4 = "".concat(this._n, ".").concat("getApplicationList"), r3 = new P2("getApplicationList");
      return this._snsM.req({ P: G2.GET_FD_APPLICATION_LIST, data: { applicationType: R2.SNS_APPLICATION_TYPE_BOTH, fromAccount: this._snsM.getMyUserID(), maxLimited: this._maxLimited, startTime: this._startTime, lastSequence: this._currentSeq } }).then(function(e4) {
        var e4 = e4.data, t3 = e4.resultList, n3 = e4.unreadCount, o3 = e4.startTime, e4 = e4.currentSequence, i4 = (a4._startTime = o3, a4._currentSeq = e4, a4._unreadCount = n3, O2(t3) ? t3.length : 0), i4 = "applicationCount:".concat(i4, " unreadCount:").concat(n3, " startTime:").concat(o3, " currentSequence:").concat(e4);
        r3.setMessage(i4).end(), M2.i("".concat(s4, " ok. ").concat(i4)), a4._map.clear(), O2(t3) && t3.forEach(function(e5) {
          var t4 = e5.userID, n4 = e5.type, e5 = new Ha(e5);
          a4._map.set("".concat(t4, "_").concat(n4), e5);
        }), a4._onApplicationListUpdated();
      }).catch(function(e4) {
        return r3.setError(e4).end(), M2.w("".concat(s4, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "deleteApplication", value: function(e4) {
      var i4, a4 = "".concat(this._n, ".").concat("deleteApplication"), s4 = e4.userID, r3 = e4.type;
      return r3 && (r3 === R2.SNS_APPLICATION_SENT_BY_ME || r3 === R2.SNS_APPLICATION_SENT_TO_ME) || (r3 = R2.SNS_APPLICATION_SENT_TO_ME), this._map.has("".concat(s4, "_").concat(r3)) ? ((i4 = new P2("deleteApplication")).setMessage("userID:".concat(s4, " type:").concat(r3)), this._snsM.req({ P: G2.DEL_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), userIDList: [s4], type: r3 } }).then(function(e5) {
        var e5 = e5.data.resultList, t3 = e5[0], n3 = t3.to, o3 = t3.resultCode, t3 = t3.resultInfo;
        return i4.setMoreMessage("resultList:".concat(JSON.stringify(e5))).end(), M2.i("".concat(a4, " ok. userID:").concat(s4, " type:").concat(r3)), 0 === o3 ? T2() : E2({ userID: n3, code: o3, message: t3 });
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.w("".concat(a4, " failed. error:"), e5), E2(e5);
      })) : E2({ code: k2.FRIEND_APPLICATION_NOT_EXIST });
    } }, { key: "acceptApplication", value: function(e4) {
      var n3 = "".concat(this._n, ".").concat("acceptApplication"), o3 = e4.userID, t3 = e4.remark, i4 = e4.tag, a4 = e4.type, s4 = (a4 && (a4 === R2.SNS_APPLICATION_AGREE || a4 === R2.SNS_APPLICATION_AGREE_AND_ADD) || (a4 = R2.SNS_APPLICATION_AGREE_AND_ADD), new P2("acceptApplication"));
      return s4.setMessage("userID:".concat(o3, " type:").concat(a4)), this._snsM.req({ P: G2.RESPOND_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), responseFriendItem: [{ userID: o3, remark: t3, tag: i4, action: a4 }] } }).then(function(e5) {
        s4.end();
        var e5 = e5.data.resultList[0], t4 = e5.resultCode, e5 = e5.resultInfo;
        if (0 !== t4)
          return E2({ code: t4, message: e5 });
        M2.i("".concat(n3, " ok. userID:").concat(o3, " type:").concat(a4));
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.w("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "refuseApplication", value: function(e4) {
      var n3 = "".concat(this._n, ".").concat("refuseApplication"), o3 = e4.userID, i4 = new P2("refuseApplication");
      return i4.setMessage("userID:".concat(o3)), this._snsM.req({ P: G2.RESPOND_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), responseFriendItem: [{ userID: o3, action: "Response_Action_Reject" }] } }).then(function(e5) {
        i4.end();
        var e5 = e5.data.resultList[0], t3 = e5.resultCode, e5 = e5.resultInfo;
        if (0 !== t3)
          return E2({ code: t3, message: e5 });
        M2.i("".concat(n3, " ok. userID:").concat(o3));
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.w("".concat(n3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "setApplicationRead", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("setApplicationRead"), o3 = new P2("setApplicationRead");
      return this._snsM.req({ P: G2.REPORT_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), latestTimeStamp: jt2(Ye3() / 1e3, 0) } }).then(function(e4) {
        o3.end(), M2.i("".concat(n3, " ok")), t3._unreadCount = 0;
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.w("".concat(n3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "reset", value: function() {
      this._maxLimited = 100, this._startTime = 0, this._currentSeq = 0, this._unreadCount = 0, this._map.clear();
    } }]), Wa = e3(function e4(t3, n3) {
      p3(this, e4), this.userID = t3, this.remark = "", this.groupList = [], this.source = "", this.addTime = 0, this.friendCustomField = [], this.timestamp = 0;
      var o3 = {}, i4 = [];
      if (o3.userID = t3, !S2(n3))
        for (var a4, s4 = "", r3 = 0, c4 = n3.length; r3 < c4; r3++)
          if (s4 = n3[r3].tag, a4 = n3[r3].value, -1 < s4.indexOf("Tag_SNS_Custom"))
            this.friendCustomField.push({ key: s4, value: a4 });
          else if (-1 < s4.indexOf("Tag_Profile_Custom"))
            i4.push({ key: s4, value: a4 });
          else
            switch (s4) {
              case f3.NICK:
                o3.nick = a4;
                break;
              case f3.GENDER:
                o3.gender = a4;
                break;
              case f3.BIRTHDAY:
                o3.birthday = a4;
                break;
              case f3.LOCATION:
                o3.location = a4;
                break;
              case f3.SELFSIGNATURE:
                o3.selfSignature = a4;
                break;
              case f3.ALLOWTYPE:
                o3.allowType = a4;
                break;
              case f3.LANGUAGE:
                o3.language = a4;
                break;
              case f3.AVATAR:
                o3.avatar = a4;
                break;
              case f3.MESSAGESETTINGS:
                o3.messageSettings = a4;
                break;
              case f3.ADMINFORBIDTYPE:
                o3.adminForbidType = a4;
                break;
              case f3.LEVEL:
                o3.level = a4;
                break;
              case f3.ROLE:
                o3.role = a4;
                break;
              case Ze3.REMARK:
                this.remark = a4;
                break;
              case Ze3.ADDTIME:
                this.addTime = a4;
                break;
              case Ze3.GROUP:
                this.groupList = JSON.parse(JSON.stringify(a4));
                break;
              case Ze3.ADDSOURCE:
                this.source = a4;
                break;
              case Ze3.ADDWORDING:
                break;
              default:
                M2.l("snsProfileItem unknown tag->", n3[r3].tag);
            }
      this.profile = new Ho(y2(y2({}, o3), {}, { profileCustomField: i4 }));
    }, [{ key: "validate", value: function(e4) {
      var t3, n3 = true, o3 = "";
      if (S2(e4))
        return { valid: false, tips: "empty options" };
      if (e4.profileCustomField)
        for (var i4 = e4.profileCustomField.length, a4 = null, s4 = 0; s4 < i4; s4++) {
          if (a4 = e4.profileCustomField[s4], !C2(a4.key) || -1 === a4.key.indexOf("Tag_Profile_Custom"))
            return { valid: false, tips: "The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom" };
          if (!C2(a4.value))
            return { valid: false, tips: "The type of values of the custom profile key-value pairs (which is profileCustomField) must be String" };
        }
      for (t3 in e4)
        if (Object.prototype.hasOwnProperty.call(e4, t3)) {
          if ("profileCustomField" === t3)
            continue;
          if (S2(e4[t3]) && !C2(e4[t3]) && !A2(e4[t3])) {
            o3 = "key:" + t3 + ", invalid value:" + e4[t3], n3 = false;
            continue;
          }
          switch (t3) {
            case "nick":
              C2(e4[t3]) || (n3 = !(o3 = "nick must be a string")), 500 < ft3(e4[t3]) && (o3 = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(ft3(e4[t3]), " bytes"), n3 = false);
              break;
            case "gender":
              It2(Qe3, e4.gender) || (o3 = "key:gender, invalid value:" + e4.gender, n3 = false);
              break;
            case "birthday":
              A2(e4.birthday) || (n3 = !(o3 = "birthday must be a number"));
              break;
            case "location":
              C2(e4.location) || (n3 = !(o3 = "location must be a string"));
              break;
            case "selfSignature":
              C2(e4.selfSignature) || (n3 = !(o3 = "selfSignature must be a string"));
              break;
            case "allowType":
              It2(et3, e4.allowType) || (o3 = "key:allowType, invalid value:" + e4.allowType, n3 = false);
              break;
            case "language":
              A2(e4.language) || (n3 = !(o3 = "language must be a number"));
              break;
            case "avatar":
              C2(e4.avatar) || (n3 = !(o3 = "avatar must be a string"));
              break;
            case "messageSettings":
              0 !== e4.messageSettings && 1 !== e4.messageSettings && (n3 = !(o3 = "messageSettings must be 0 or 1"));
              break;
            case "adminForbidType":
              It2($e3, e4.adminForbidType) || (o3 = "key:adminForbidType, invalid value:" + e4.adminForbidType, n3 = false);
              break;
            case "level":
              A2(e4.level) || (n3 = !(o3 = "level must be a number"));
              break;
            case "role":
              A2(e4.role) || (n3 = !(o3 = "role must be a number"));
              break;
            default:
              o3 = "unknown key:" + t3 + "  " + e4[t3], n3 = false;
          }
        }
      return { valid: n3, tips: o3 };
    } }, { key: "update", value: function(e4) {
      var n3 = this, o3 = "", i4 = "", a4 = [];
      this.friendCustomField.forEach(function(e5) {
        a4.push(e5.key);
      });
      for (var s4 = 0, t3 = e4.length; s4 < t3; s4++)
        !function() {
          if (o3 = e4[s4].tag, i4 = e4[s4].value, -1 < o3.indexOf("Tag_SNS_Custom"))
            -1 < a4.indexOf(o3) ? n3.friendCustomField.forEach(function(e5) {
              e5.key === o3 && (e5.value = i4);
            }) : n3.friendCustomField.push({ key: o3, value: i4 });
          else if (-1 < o3.indexOf("Tag_Profile_Custom")) {
            var t4 = false;
            n3.profile.profileCustomField.forEach(function(e5) {
              e5.key === o3 && (e5.value = i4, t4 = true);
            }), t4 || n3.profile.profileCustomField.push({ key: o3, value: i4 });
          } else
            switch (o3) {
              case f3.NICK:
                n3.profile.nick = i4;
                break;
              case f3.GENDER:
                n3.profile.gender = i4;
                break;
              case f3.BIRTHDAY:
                n3.profile.birthday = i4;
                break;
              case f3.LOCATION:
                n3.profile.location = i4;
                break;
              case f3.SELFSIGNATURE:
                n3.profile.selfSignature = i4;
                break;
              case f3.ALLOWTYPE:
                n3.profile.allowType = i4;
                break;
              case f3.LANGUAGE:
                n3.profile.language = i4;
                break;
              case f3.AVATAR:
                n3.profile.avatar = i4;
                break;
              case f3.MESSAGESETTINGS:
                n3.profile.messageSettings = i4;
                break;
              case f3.ADMINFORBIDTYPE:
                n3.profile.adminForbidType = i4;
                break;
              case f3.LEVEL:
                n3.profile.level = i4;
                break;
              case f3.ROLE:
                n3.profile.role = i4;
                break;
              case Ze3.REMARK:
                n3.remark = i4;
                break;
              case Ze3.ADDTIME:
                n3.addTime = i4;
                break;
              case Ze3.GROUP:
                n3.groupList = JSON.parse(JSON.stringify(i4));
                break;
              case Ze3.ADDSOURCE:
                n3.source = i4;
                break;
              case Ze3.ADDWORDING:
                break;
              default:
                M2.d("snsProfileItem unkown tag->", e4[s4].tag);
            }
        }();
      this.timestamp = Date.now(), a4.length = 0;
    } }, { key: "updateProfile", value: function(e4) {
      this.profile = JSON.parse(JSON.stringify(e4)), this.timestamp = Date.now();
    } }, { key: "addToGroupList", value: function(e4) {
      -1 === this.groupList.indexOf(e4) && (this.groupList.push(e4), this.count = this.groupList.length);
    } }, { key: "removeFromGroupList", value: function(e4) {
      e4 = this.groupList.indexOf(e4);
      -1 < e4 && (this.groupList.splice(e4, 1), this.count = this.groupList.length);
    } }]), Ya = e3(function e4(t3) {
      p3(this, e4), this._snsM = t3, this._n = "FriendHandler", this._map = /* @__PURE__ */ new Map(), this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0, this._expirationTime = 18e4;
    }, [{ key: "updateCacheOnReconnected", value: function() {
      this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0, this.pagingGetFriendList();
    } }, { key: "getLocalFriendList", value: function() {
      return d3(this._map.values());
    } }, { key: "getFriendRemark", value: function(e4) {
      return this._map.has(e4) ? this._map.get(e4).remark : "";
    } }, { key: "onFriendProfileModified", value: function(e4) {
      var o3, i4 = this, e4 = e4.dataList;
      S2(e4) || (o3 = this._snsM.get(11), e4.forEach(function(e5) {
        var t3, n3 = e5.userID, e5 = e5.profileList;
        i4.isMyFriend(n3) && (M2.l("".concat(i4._n, ".onFriendProfileModified. friend account:").concat(n3, ", profileList:").concat(JSON.stringify(e5))), (t3 = i4._map.get(n3)).update(e5), o3.modifyMessageSentByPeer({ conversationID: "".concat(R2.CONV_C2C).concat(n3), latestNick: t3.profile.nick, latestAvatar: t3.profile.avatar }));
      }), this._onFriendListUpdated());
    } }, { key: "onFriendAdded", value: function(t3) {
      var n3 = this;
      0 !== t3.length && (M2.l("".concat(this._n, ".onFriendAdded userIDList:").concat(t3)), t3.forEach(function(e4) {
        n3._map.set(e4, new Wa(e4));
      }), this.getFriendProfile({ userIDList: t3 }).then(function(e4) {
        t3.forEach(function(e5) {
          var t4 = n3._map.get(e5);
          0 < t4.groupList.length && n3._snsM.updateWhenFriendAdded({ nameList: t4.groupList, userID: e5 });
        }), n3._onFriendListUpdated();
      }));
    } }, { key: "onFriendDeleted", value: function(e4) {
      var n3 = this;
      0 !== e4.length && (M2.l("".concat(this._n, ".onFriendDeleted userIDList:").concat(e4)), e4.forEach(function(e5) {
        var t3 = n3._map.get(e5);
        0 < t3.groupList.length && n3._snsM.updateWhenFriendDeleted({ nameList: t3.groupList, userID: e5 }), n3._map.delete(e5);
      }), this._onFriendListUpdated());
    } }, { key: "_onFriendListUpdated", value: function() {
      this._snsM.emitOEvt(h3.FRIEND_LIST_UPDATED), this._snsM.get(11).checkAndPatchRemark();
    } }, { key: "getFriendProfile", value: function(e4) {
      var t3, a4 = this, n3 = "".concat(this._n, ".").concat("getFriendProfile"), e4 = e4.userIDList, s4 = [], r3 = [], o3 = [];
      return e4.forEach(function(e5) {
        var t4;
        a4._map.has(e5) ? (t4 = a4._map.get(e5), Date.now() - t4.timestamp < a4._expirationTime ? r3.push(t4) : o3.push(e5)) : s4.push({ userID: e5, code: k2.NOT_MY_FRIEND, message: a4._snsM.getErrMsg(k2.NOT_MY_FRIEND) });
      }), 0 === o3.length ? (M2.i("".concat(n3, " newUserIDList is empty")), D2({ friendList: r3, failureUserIDList: s4 })) : ((t3 = new P2("getFriendProfile")).setMessage("userIDList:".concat(o3)), M2.i("".concat(n3, " userIDList:").concat(o3)), this._snsM.req({ P: G2.GET_FD_PROFILE, data: { fromAccount: this._snsM.getMyUserID(), userIDList: o3 } }).then(function(e5) {
        return t3.end(), M2.i("".concat(n3, " ok")), e5.data.resultList.forEach(function(e6) {
          var t4, n4 = e6.to, o4 = e6.resultCode, i4 = e6.resultInfo, e6 = e6.tagValueList;
          N2(o4) || 0 === o4 ? (a4._map.has(n4) ? (t4 = a4._map.get(n4)).update(e6) : (t4 = new Wa(n4, e6), a4._map.set(n4, t4)), r3.push(t4)) : s4.push({ userID: n4, code: o4, message: i4 });
        }), T2({ friendList: r3, failureUserIDList: s4 });
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.w("".concat(n3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "isMyFriend", value: function(e4) {
      return this._map.has(e4);
    } }, { key: "pagingGetFriendList", value: function() {
      var s4 = this, r3 = "".concat(this._n, ".").concat("getFriendList"), c4 = new P2("getFriendList"), u3 = Date.now();
      this._snsM.req({ P: G2.GET_FD_LIST, data: { fromAccount: this._snsM.getMyUserID(), startIndex: this._startIdx, standardSequence: this._standardSeq, customSequence: this._customSeq } }).then(function(e4) {
        var e4 = e4.data, t3 = e4.friendCount, n3 = e4.resultList, o3 = e4.nextStartIndex, i4 = e4.standardSequence, a4 = e4.customSequence, e4 = e4.completeFlag, t3 = (s4._startIdx = o3, s4._standardSeq = i4, s4._customSeq = a4, "friendCount:".concat(t3, " nextStartIndex:").concat(o3, " standardSequence:").concat(i4, " ") + "customSequence:".concat(a4, " completeFlag:").concat(e4, " cost:").concat(an2(u3)));
        c4.setMessage(t3).end(), M2.i("".concat(r3, " ok."), t3), S2(n3) || n3.forEach(function(e5) {
          var t4 = e5.to, e5 = e5.tagValueList;
          s4._map.set(t4, new Wa(t4, e5));
        }), 0 === e4 ? s4.pagingGetFriendList() : (s4._snsM.emitOEvt(h3.FRIEND_LIST_UPDATED), s4._pagingGetFriendProfile());
      }).catch(function(e4) {
        return c4.setError(e4).end(), M2.w("".concat(r3, " failed. error:"), e4), E2(e4);
      });
    } }, { key: "_pagingGetFriendProfile", value: function() {
      var n3 = this, e4 = d3(this._map.keys()), t3 = this._snsM.get(4), o3 = e4.length, i4 = o3 <= 100 ? 1 : Math.ceil(o3 / 100);
      M2.l("".concat(this._n, "._pagingGetFriendProfile friendCount:").concat(o3, " pageCount:").concat(i4));
      for (var a4 = 0; a4 < i4; a4++)
        t3.getUserProfile({ userIDList: e4.slice(100 * a4, 100 * (a4 + 1)) }).then(function(e5) {
          e5.data.forEach(function(e6) {
            var t4 = n3._map.get(e6.userID);
            t4 && t4.updateProfile(e6);
          }), n3._onFriendListUpdated();
        });
    } }, { key: "addFriend", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3, c4 = this, u3 = "".concat(this._n, ".").concat("addFriend");
      return e4.wording && false === this._snsM.filterProfanity("wording", e4) ? E2({ code: k2.PROFANITY_FOUND }) : (t3 = e4.to, n3 = e4.source, o3 = e4.type, i4 = e4.wording, a4 = e4.remark, e4 = e4.groupName, (s4 = o3) && (s4 === R2.SNS_ADD_TYPE_SINGLE || s4 === R2.SNS_ADD_TYPE_BOTH) || (s4 = R2.SNS_ADD_TYPE_BOTH), (r3 = new P2("addFriend")).setMessage("to:".concat(t3, " source:").concat(n3, " type:").concat(s4)), this._snsM.req({ P: G2.ADD_FD, data: { fromAccount: this._snsM.getMyUserID(), addFriendItem: [{ to: t3, source: n3, wording: i4, remark: a4, groupName: e4 }], type: s4 } }).then(function(e5) {
        var e5 = e5.data.resultList, e5 = (r3.setMoreMessage("resultList:".concat(JSON.stringify(e5))).end(), e5[0]), t4 = e5.to, n4 = e5.resultCode, e5 = e5.resultInfo;
        return M2.i("".concat(u3, " ok. to:").concat(t4, " type:").concat(s4, " code:").concat(n4)), N2(n4) || 0 === n4 ? T2({ userID: t4, code: 0 }) : 30539 === n4 ? T2({ userID: t4, code: n4, message: c4._snsM.getErrMsg(n4) }) : E2({ userID: t4, code: n4, message: c4._snsM.getErrMsg(n4) || e5 });
      }).catch(function(e5) {
        return r3.setError(e5).end(), M2.w("".concat(u3, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "deleteFriend", value: function(e4) {
      var t3, n3 = this, o3 = "".concat(this._n, ".").concat("deleteFriend"), i4 = e4.userIDList, e4 = e4.type, a4 = (1e3 < i4.length && (M2.w("".concat(o3, " ").concat(tn2(1e3))), i4.length = 1e3), []), s4 = [], r3 = [];
      return i4.forEach(function(e5) {
        n3._map.has(e5) ? r3.push(e5) : a4.push({ userID: e5, code: k2.NOT_MY_FRIEND, message: n3._snsM.getErrMsg(k2.NOT_MY_FRIEND) });
      }), 0 === r3.length ? D2({ successUserIDList: s4, failureUserIDList: a4 }) : ((i4 = e4) && (i4 === R2.SNS_DELETE_TYPE_SINGLE || i4 === R2.SNS_DELETE_TYPE_BOTH) || (i4 = R2.SNS_DELETE_TYPE_BOTH), (t3 = new P2("deleteFriend")).setMessage("userIDList:".concat(r3, " type:").concat(i4)), this._snsM.req({ P: G2.DEL_FD, data: { fromAccount: this._snsM.getMyUserID(), userIDList: r3, type: i4 } }).then(function(e5) {
        t3.end(), M2.i("".concat(o3, " ok"));
        e5 = e5.data.resultList;
        return S2(e5) || e5.forEach(function(e6) {
          var t4 = e6.to, n4 = e6.resultCode, e6 = e6.resultInfo;
          N2(n4) || 0 === n4 ? s4.push({ userID: t4 }) : a4.push({ userID: t4, code: n4, message: e6 });
        }), T2({ successUserIDList: s4, failureUserIDList: a4 });
      }).catch(function(e5) {
        return t3.setError(e5).end(), M2.w("".concat(o3, " error:"), e5), E2(e5);
      }));
    } }, { key: "updateFriend", value: function(e4) {
      var o3, i4, t3, a4 = this, n3 = e4.userID, s4 = e4.remark, r3 = e4.friendCustomField;
      return this._map.has(n3) ? (o3 = "".concat(this._n, ".").concat("updateFriend"), (i4 = new P2("updateFriend")).setMessage("userID:".concat(n3, " remark:").concat(s4, " friendCustomField:").concat(r3)), t3 = [], N2(s4) || t3.push({ tag: Ze3.REMARK, value: s4 }), O2(r3) && 0 < r3.length && r3.forEach(function(e5) {
        t3.push({ tag: e5.key, value: e5.value });
      }), this._snsM.req({ P: G2.UPDATE_FD, data: { fromAccount: this._snsM.getMyUserID(), updateItem: [{ to: n3, snsItem: t3 }] } }).then(function(e5) {
        i4.end(), M2.i("".concat(o3, " ok"));
        var e5 = e5.data.resultList[0], t4 = e5.to, n4 = e5.resultCode, e5 = e5.resultInfo;
        return N2(n4) || 0 === n4 ? ((t4 = a4._map.get(t4)) && (N2(s4) || (t4.remark = s4), O2(r3) && 0 < r3.length && Rt2(t4.friendCustomField, r3), a4._onFriendListUpdated()), T2(t4)) : E2({ code: n4, message: e5 });
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.w("".concat(o3, " failed. error:"), e5), E2(e5);
      })) : E2({ code: k2.NOT_MY_FRIEND });
    } }, { key: "checkFriend", value: function(e4) {
      var t3 = "".concat(this._n, ".").concat("checkFriend"), n3 = e4.userIDList, o3 = e4.type, s4 = (o3 && (o3 === R2.SNS_CHECK_TYPE_SINGLE || o3 === R2.SNS_CHECK_TYPE_BOTH) || (o3 = R2.SNS_CHECK_TYPE_BOTH), new P2("checkFriend"));
      return s4.setMessage("userIDList:".concat(n3, " type:").concat(o3)), this._snsM.req({ P: G2.CHECK_FD, data: { fromAccount: this._snsM.getMyUserID(), userIDList: n3, type: o3 } }).then(function(e5) {
        s4.end(), M2.i("".concat(t3, " ok. userIDList:").concat(n3, " type:").concat(o3));
        var i4 = [], a4 = [], e5 = e5.data.resultList;
        return O2(e5) && e5.forEach(function(e6) {
          var t4 = e6.to, n4 = e6.relation, o4 = e6.resultCode, e6 = e6.resultInfo;
          N2(o4) || 0 === o4 ? i4.push({ userID: t4, code: 0, relation: n4 }) : a4.push({ userID: t4, code: o4, message: e6 });
        }), T2({ successUserIDList: i4, failureUserIDList: a4 });
      }).catch(function(e5) {
        return s4.setError(e5).end(), M2.w("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "onAddedToFriendGroup", value: function(e4) {
      var t3 = this, n3 = e4.name, e4 = e4.userIDList;
      M2.l("".concat(this._n, ".onAddedToFriendGroup groupName:").concat(n3, " userIDList:").concat(e4)), n3 && !S2(e4) && e4.forEach(function(e5) {
        t3._map.has(e5) && t3._map.get(e5).addToGroupList(n3);
      });
    } }, { key: "onRemovedFromFriendGroup", value: function(e4) {
      var t3 = this, n3 = e4.name, e4 = e4.userIDList;
      M2.l("".concat(this._n, ".onRemovedFromFriendGroup groupName:").concat(n3, " userIDList:").concat(e4)), n3 && !S2(e4) && e4.forEach(function(e5) {
        t3._map.has(e5) && t3._map.get(e5).removeFromGroupList(n3);
      });
    } }, { key: "reset", value: function() {
      this._map.clear(), this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0;
    } }]), ja = e3(function e4(t3) {
      p3(this, e4), S2(t3) || (this.name = t3.name || "", this.userIDList = t3.userIDList || [], this.count = this.userIDList.length || 0);
    }, [{ key: "addToUserIDList", value: function(e4) {
      -1 === this.userIDList.indexOf(e4) && (this.userIDList.push(e4), this.count = this.userIDList.length);
    } }, { key: "removeFromUserIDList", value: function(e4) {
      e4 = this.userIDList.indexOf(e4);
      -1 < e4 && (this.userIDList.splice(e4, 1), this.count = this.userIDList.length);
    } }]), Ja = e3(function e4(t3) {
      p3(this, e4), this._snsM = t3, this._n = "FriendGroupHandler", this._map = /* @__PURE__ */ new Map();
    }, [{ key: "updateCacheOnReconnected", value: function() {
      this.getGroupList();
    } }, { key: "getLocalGroupList", value: function() {
      return d3(this._map.values());
    } }, { key: "_onGroupListUpdated", value: function() {
      var e4 = d3(this._map.values());
      this._snsM.emitOEvt(h3.FRIEND_GROUP_LIST_UPDATED, e4);
    } }, { key: "getGroupList", value: function() {
      var n3 = this, t3 = "".concat(this._n, ".").concat("getGroupList"), o3 = new P2("getGroupList");
      return this._snsM.req({ P: G2.GET_FD_GRP_LIST, data: { fromAccount: this._snsM.getMyUserID() } }).then(function(e4) {
        o3.end();
        e4 = e4.data.resultList;
        S2(e4) ? M2.i("".concat(t3, " ok. count:0")) : (M2.i("".concat(t3, " ok. count:").concat(e4.length)), n3._map.clear(), e4.forEach(function(e5) {
          var t4 = new ja(e5);
          n3._map.set(e5.name, t4);
        }), n3._onGroupListUpdated());
      }).catch(function(e4) {
        return o3.setError(e4).end(), M2.w("".concat(t3, " error:"), e4), E2(e4);
      });
    } }, { key: "createGroup", value: function(e4) {
      var t3, n3, o3 = this, s4 = "".concat(this._n, ".").concat("createGroup"), r3 = e4.name, e4 = e4.userIDList;
      return this._map.has(r3) ? E2({ code: k2.FRIEND_GRP_EXISTED }) : (t3 = "name:".concat(r3, " userIDList:").concat(e4), (n3 = new P2("createGroup")).setMessage(t3), this._snsM.req({ P: G2.CREATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), groupName: [r3], userIDList: O2(e4) ? e4 : void 0 } }).then(function(e5) {
        n3.end(), M2.l("".concat(s4, " ok. ").concat(t3));
        var e5 = e5.data.resultList, i4 = [], a4 = [], e5 = (e5 && e5.forEach(function(e6) {
          var t4 = e6.to, n4 = e6.resultCode, o4 = e6.resultInfo;
          N2(n4) || 0 === n4 ? i4.push(t4) : (t4 = { userID: e6.to, code: n4, message: o4 }, a4.push(t4));
        }), new ja({ name: r3, userIDList: i4 }));
        return o3._map.set(r3, e5), o3._snsM.onAddedToFriendGroup({ name: r3, userIDList: i4 }), o3._onGroupListUpdated(), T2({ friendGroup: e5, failureUserIDList: a4 });
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.w("".concat(s4, " failed. error:"), e5), E2(e5);
      }));
    } }, { key: "deleteGroup", value: function(e4) {
      var n3, o3, i4 = this, a4 = "".concat(this._n, ".").concat("deleteGroup"), s4 = e4.name;
      return this._map.has(s4) ? (n3 = "name:".concat(s4), (o3 = new P2("deleteGroup")).setMessage(n3), this._snsM.req({ P: G2.DEL_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), nameList: [s4] } }).then(function(e5) {
        o3.end(), M2.l("".concat(a4, " ok. ").concat(n3));
        var t3 = i4._map.get(s4);
        return t3 && (i4._snsM.onRemovedFromFriendGroup({ name: s4, userIDList: t3.userIDList }), i4._map.delete(s4), t3.userIDList.length = 0), i4._onGroupListUpdated(), T2(t3);
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.w("".concat(a4, " failed. error:"), e5), E2(e5);
      })) : this._onGroupNotExist();
    } }, { key: "renameGroup", value: function(e4) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("renameGroup"), a4 = e4.oldName, s4 = e4.newName;
      return this._map.has(a4) ? (t3 = "oldName:".concat(a4, " newName:").concat(s4), (n3 = new P2("renameGroup")).setMessage(t3), this._snsM.req({ P: G2.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: a4, newName: s4 } }).then(function() {
        var e5;
        return n3.end(), M2.l("".concat(i4, " ok. ").concat(t3)), o3._map.has(a4) ? ((e5 = o3._map.get(a4)).name = s4, o3._map.delete(a4), o3._map.set(s4, e5), o3._snsM.onRemovedFromFriendGroup({ name: a4, userIDList: e5.userIDList }), o3._snsM.onAddedToFriendGroup({ name: s4, userIDList: e5.userIDList }), o3._onGroupListUpdated(), T2(e5)) : T2();
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.w("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : this._onGroupNotExist();
    } }, { key: "addToGroup", value: function(e4) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("addToGroup"), a4 = e4.name, e4 = e4.userIDList;
      return this._map.has(a4) ? (t3 = "name:".concat(a4, " userIDList:").concat(e4), (n3 = new P2("addToGroup")).setMessage(t3), this._snsM.req({ P: G2.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: a4, updateGroupItem: e4.filter(function(e5) {
        return o3._snsM.isMyFriend(e5);
      }).map(function(e5) {
        return { to: e5, updateType: "Update_Type_Add" };
      }) } }).then(function(e5) {
        return n3.end(), M2.l("".concat(i4, " ok. ").concat(t3)), o3._onGroupUpdated(a4, e5);
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.w("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : this._onGroupNotExist();
    } }, { key: "removeFromGroup", value: function(e4) {
      var t3, n3, o3 = this, i4 = "".concat(this._n, ".").concat("removeFromGroup"), a4 = e4.name, e4 = e4.userIDList;
      return this._map.has(a4) ? (t3 = "name:".concat(a4, " userIDList:").concat(e4), (n3 = new P2("removeFromGroup")).setMessage(t3), this._snsM.req({ P: G2.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: a4, updateGroupItem: e4.filter(function(e5) {
        return o3._snsM.isMyFriend(e5);
      }).map(function(e5) {
        return { to: e5, updateType: "Update_Type_Delete" };
      }) } }).then(function(e5) {
        return n3.end(), M2.l("".concat(i4, " ok. ").concat(t3)), o3._onGroupUpdated(a4, e5);
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.w("".concat(i4, " failed. error:"), e5), E2(e5);
      })) : this._onGroupNotExist();
    } }, { key: "_onGroupUpdated", value: function(e4, t3) {
      var t3 = t3.data.resultList, a4 = this._map.get(e4), s4 = [], r3 = [], c4 = [];
      return O2(t3) && t3.forEach(function(e5) {
        var t4 = e5.to, n3 = e5.resultCode, o3 = e5.resultInfo, i4 = e5.type;
        0 === n3 ? "Update_Type_Add" === i4 ? a4 && (a4.addToUserIDList(t4), r3.push(t4)) : "Update_Type_Delete" === i4 && a4 && (a4.removeFromUserIDList(t4), c4.push(t4)) : s4.push({ to: e5.to, code: n3, message: o3 });
      }), M2.l("".concat(this._n, "._onGroupUpdated name:").concat(e4, " userIDList:").concat(a4.userIDList)), 0 < r3.length && this._snsM.onAddedToFriendGroup({ name: e4, userIDList: r3 }), 0 < c4.length && this._snsM.onRemovedFromFriendGroup({ name: e4, userIDList: c4 }), T2({ friendGroup: a4, failureUserIDList: s4 });
    } }, { key: "updateWhenFriendAdded", value: function(e4) {
      var t3 = this, n3 = e4.nameList, o3 = e4.userID;
      M2.l("".concat(this._n, ".updateWhenFriendAdded userID:").concat(o3, " nameList:").concat(n3)), S2(n3) || n3.forEach(function(e5) {
        t3._map.has(e5) && t3._map.get(e5).addToUserIDList(o3);
      });
    } }, { key: "updateWhenFriendDeleted", value: function(e4) {
      var t3 = this, n3 = e4.nameList, o3 = e4.userID;
      M2.l("".concat(this._n, ".updateWhenFriendDeleted userID:").concat(o3, " nameList:").concat(n3)), S2(n3) || n3.forEach(function(e5) {
        t3._map.has(e5) && t3._map.get(e5).removeFromUserIDList(o3);
      });
    } }, { key: "_onGroupNotExist", value: function(e4) {
      return E2({ code: k2.FRIEND_GRP_NOT_EXIST });
    } }, { key: "reset", value: function() {
      this._map.clear();
    } }]), za = (t2(ys2, c3), e3(ys2, [{ key: "onContextUpdated", value: function(e4) {
      this._friendHandler.pagingGetFriendList(), this._friendGroupHandler.getGroupList(), this._friendApplicationHandler.getApplicationList();
    } }, { key: "onRelationChainModified", value: function(e4) {
      var n3, o3, i4, a4, s4, r3, c4 = this, e4 = e4.dataList;
      S2(e4) || (n3 = [], o3 = [], i4 = [], s4 = !(a4 = []), r3 = "", e4.forEach(function(e5) {
        var t3;
        3 !== e5.pushType && 4 !== e5.pushType || !e5.from || (r3 = e5.from), e5.friendAddAccount && (n3.push.apply(n3, d3(e5.friendAddAccount)), a4.push.apply(a4, d3(e5.friendAddAccount))), e5.friendDelAccount && o3.push.apply(o3, d3(e5.friendDelAccount)), e5.friendApplicationAdded && i4.push.apply(i4, d3(e5.friendApplicationAdded)), e5.friendApplicationDeletedUserIDList && a4.push.apply(a4, d3(e5.friendApplicationDeletedUserIDList)), e5.reportTime && 7 === e5.pushType && (s4 = true), e5.friendUpInfo && (t3 = { dataList: [] }, e5.friendUpInfo.forEach(function(e6) {
          t3.dataList.push({ userID: e6.friendAccount, profileList: d3(e6.sns) });
        }), c4.onFriendProfileModified(t3));
      }), s4 && this._friendApplicationHandler.onApplicationRead(), this._friendApplicationHandler.onApplicationAdded(i4, r3), this._friendApplicationHandler.onApplicationDeleted(a4), this._friendHandler.onFriendAdded(n3), this._friendHandler.onFriendDeleted(o3));
    } }, { key: "isMyFriend", value: function(e4) {
      return this._friendHandler.isMyFriend(e4);
    } }, { key: "filterProfanity", value: function(e4, t3) {
      var n3, o3 = this.get(29);
      return !o3 || (n3 = (o3 = o3.filterText(t3[e4], "sns")).isAllowedToSend, o3 = o3.modifiedText, true === n3 && (t3[e4] = o3, true));
    } }, { key: "onFriendProfileModified", value: function(e4) {
      this._friendHandler.onFriendProfileModified(e4);
    } }, { key: "getLocalFriendList", value: function() {
      var e4 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t3 = this._friendHandler.getLocalFriendList();
      return e4 ? D2(t3) : t3;
    } }, { key: "getFriendRemark", value: function(e4) {
      return this._friendHandler.getFriendRemark(e4);
    } }, { key: "getFriendList", value: function() {
      return this._friendHandler.pagingGetFriendList();
    } }, { key: "addFriend", value: function(e4) {
      return this._friendHandler.addFriend(e4);
    } }, { key: "deleteFriend", value: function(e4) {
      return this._friendHandler.deleteFriend(e4);
    } }, { key: "checkFriend", value: function(e4) {
      return this._friendHandler.checkFriend(e4);
    } }, { key: "getFriendProfile", value: function(e4) {
      return this._friendHandler.getFriendProfile(e4);
    } }, { key: "updateFriend", value: function(e4) {
      return this._friendHandler.updateFriend(e4);
    } }, { key: "onAddedToFriendGroup", value: function(e4) {
      this._friendHandler.onAddedToFriendGroup(e4);
    } }, { key: "onRemovedFromFriendGroup", value: function(e4) {
      this._friendHandler.onRemovedFromFriendGroup(e4);
    } }, { key: "getLocalFriendApplicationList", value: function() {
      var e4 = this._friendApplicationHandler.getLocalApplicationList();
      return D2(e4);
    } }, { key: "deleteFriendApplication", value: function(e4) {
      return this._friendApplicationHandler.deleteApplication(e4);
    } }, { key: "refuseFriendApplication", value: function(e4) {
      return this._friendApplicationHandler.refuseApplication(e4);
    } }, { key: "acceptFriendApplication", value: function(e4) {
      return this._friendApplicationHandler.acceptApplication(e4);
    } }, { key: "setFriendApplicationRead", value: function(e4) {
      return this._friendApplicationHandler.setApplicationRead(e4);
    } }, { key: "getLocalFriendGroupList", value: function() {
      var e4 = this._friendGroupHandler.getLocalGroupList();
      return D2(e4);
    } }, { key: "createFriendGroup", value: function(e4) {
      return this._friendGroupHandler.createGroup(e4);
    } }, { key: "deleteFriendGroup", value: function(e4) {
      return this._friendGroupHandler.deleteGroup(e4);
    } }, { key: "addToFriendGroup", value: function(e4) {
      return this._friendGroupHandler.addToGroup(e4);
    } }, { key: "removeFromFriendGroup", value: function(e4) {
      return this._friendGroupHandler.removeFromGroup(e4);
    } }, { key: "renameFriendGroup", value: function(e4) {
      return this._friendGroupHandler.renameGroup(e4);
    } }, { key: "updateWhenFriendAdded", value: function(e4) {
      this._friendGroupHandler.updateWhenFriendAdded(e4);
    } }, { key: "updateWhenFriendDeleted", value: function(e4) {
      this._friendGroupHandler.updateWhenFriendDeleted(e4);
    } }, { key: "updateCacheOnReconnected", value: function() {
      M2.l("".concat(this._n, ".updateCacheOnReconnected")), this._friendHandler.updateCacheOnReconnected(), this._friendGroupHandler.updateCacheOnReconnected(), this._friendApplicationHandler.updateCacheOnReconnected();
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._friendHandler.reset(), this._friendGroupHandler.reset(), this._friendApplicationHandler.reset();
    } }])), Xa = (t2(Ms2, c3), e3(Ms2, [{ key: "isWorkerEnabled", value: function() {
      return this._isWorkerEnabled && Ge3;
    } }, { key: "startWorkerTimer", value: function() {
      M2.l("".concat(this._n, ".startWorkerTimer")), this._workerTimer && this._workerTimer.postMessage("start");
    } }, { key: "stopWorkerTimer", value: function() {
      M2.l("".concat(this._n, ".stopWorkerTimer")), this._workerTimer && this._workerTimer.postMessage("stop");
    } }, { key: "_init", value: function() {
      var e4, t3;
      Ge3 && (e4 = URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) {  if (event.data === "start") {    if (interval > 0) {      clearInterval(interval);    }    interval = setInterval(() => {      postMessage("");    }, 1000);    postMessage(interval);  } else if (event.data === "stop") {    clearInterval(interval);    interval = -1;  }};'], { type: "application/javascript; charset=utf-8" })), this._workerTimer = new Worker(e4), (t3 = this)._workerTimer.onmessage = function(e5) {
        e5.data ? (t3._timerID = e5.data, M2.l("".concat(t3._n, "._init seed:").concat(t3._timerID))) : t3._m.onCheckTimer();
      });
    } }, { key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("enable_worker");
      M2.l("".concat(this._n, "._onCloudConfig enableWorker:").concat(e4)), N2(e4) || "1" === e4 ? !this._isWorkerEnabled && Ge3 && (this._isWorkerEnabled = true, this.startWorkerTimer(), this._m.onWorkerTimerEnabled()) : this._isWorkerEnabled && Ge3 && (this._isWorkerEnabled = false, this.stopWorkerTimer(), this._m.onWorkerTimerDisabled());
    } }, { key: "terminate", value: function() {
      M2.l("".concat(this._n, ".terminate")), this._workerTimer && (this._workerTimer.terminate(), this._workerTimer = null, this._timerID = -1);
    } }, { key: "getTimerID", value: function() {
      return this._timerID;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }])), Za = e3(function e4(t3) {
      p3(this, e4), this._commercialConfigM = t3, this._n = "PurchasedFeatureHandler", this._isCSPluginReported = false, this._featureMap = /* @__PURE__ */ new Map();
    }, [{ key: "isValidPurchaseBits", value: function(e4) {
      return e4 && "string" == typeof e4 && 1 <= e4.length && e4.length <= 64 && /[01]{1,64}/.test(e4);
    } }, { key: "parsePurchaseBits", value: function(e4) {
      if (this.isValidPurchaseBits(e4)) {
        this._featureMap.clear();
        for (var t3, n3 = e4.length - 1, o3 = 0; 0 <= n3; n3--, o3++)
          t3 = (o3 < 32 ? new $3(0, Math.pow(2, o3)) : new $3(Math.pow(2, o3 - 32), 0)).toString(), "1" === e4[n3] ? this._featureMap.set(t3, true) : this._featureMap.set(t3, false);
      } else
        M2.w("".concat(this._n, ".parsePurchaseBits invalid purchasebits:").concat(e4));
    } }, { key: "hasPurchasedFeature", value: function(e4) {
      return !!this._featureMap.get(e4);
    } }, { key: "isFeatureEnabled", value: function(e4) {
      for (var t3 = parseInt(e4).toString(2), n3 = void 0, o3 = true, i4 = t3.length - 1, a4 = 0; 0 <= i4; i4--, a4++)
        if ("1" === t3.charAt(i4) && (n3 = (a4 < 32 ? new $3(0, Math.pow(2, a4)) : new $3(Math.pow(2, a4 - 32), 0)).toString(), !this._featureMap.get(n3))) {
          o3 = false;
          break;
        }
      return M2.l("".concat(this._n, ".isFeatureEnabled decimalNumber:").concat(e4, " key:").concat(n3, " ret:").concat(o3)), D2({ enabled: o3 });
    } }, { key: "isFeatureEnabledForStat", value: function(e4) {
      for (var t3 = parseInt(e4).toString(2), n3 = t3.length - 1, o3 = 0; 0 <= n3; n3--, o3++)
        if ("1" === t3.charAt(n3)) {
          if (i4 = (o3 < 32 ? new $3(0, Math.pow(2, o3)) : new $3(Math.pow(2, o3 - 32), 0)).toString(), !this._featureMap.get(i4))
            break;
          var i4, a4 = "", s4 = 0;
          i4 === g2.PLUGIN_TRANSLATE ? (a4 = "plugin_translate", s4 = 16) : i4 === g2.PLUGIN_VOICE_TO_TEXT ? (a4 = "plugin_voice_to_text", s4 = 17) : i4 === g2.PLUGIN_CS ? (a4 = "plugin_cs", s4 = 14) : i4 === g2.PLUGIN_PUSH ? (a4 = "plugin_push", s4 = 13) : i4 === g2.PLUGIN_BOT ? (a4 = "plugin_bot", s4 = 15) : i4 === g2.MSG_REACTION && (a4 = "plugin_emoji_reaction", s4 = 18), "" !== a4 && (i4 = this._commercialConfigM.get(12).getUIPlatform(), new P2(a4).setCode(s4).setUIPlatform(i4).end(), M2.l("".concat(this._n, ".isFeatureEnabledForStat ").concat(a4, " code:").concat(s4, " uiPlatform:").concat(i4)));
        }
    } }, { key: "isCSPluginEnabled", value: function() {
      var e4;
      this._isCSPluginReported || (e4 = this._commercialConfigM.get(12).getUIPlatform(), new P2("plugin_search").setCode(6).setUIPlatform(e4).end(), this._isCSPluginReported = true);
    } }, { key: "clear", value: function() {
      this._featureMap.clear(), this._isCSPluginReported = false;
    } }]), Qa = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._n = "CommercialConfigModule", this._expiredTime = 0, this._isFetching = false, this._purchasedFeatureHandler = new Za(this);
    }, [{ key: "_canFetch", value: function() {
      return this.get(12).isLoggedIn() ? !this._isFetching && Date.now() >= this._expiredTime : (this._expiredTime = Date.now() + 2e3, false);
    } }, { key: "onCheckTimer", value: function(e4) {
      this._canFetch() && this.fetchConfig();
    } }, { key: "fetchConfig", value: function() {
      var t3, e4, n3 = this, o3 = this._canFetch(), i4 = "".concat(this._n, ".fetchConfig");
      M2.l("".concat(i4, " canFetch:").concat(o3)), o3 && (t3 = new P2("fetchCommercialConfig"), o3 = this.get(12).getSDKAppID(), e4 = this.get(20), this._isFetching = true, e4.req({ P: G2.FETCH_COMMERCIAL_CONFIG, data: { SDKAppID: o3 } }).then(function(e5) {
        t3.setMessage("purchaseBits:".concat(e5.data.purchaseBits)).end(), M2.l("".concat(i4, " ok.")), n3._parseConfig(e5.data), n3._isFetching = false;
      }).catch(function(e5) {
        t3.setError(e5).end(), n3._isFetching = false;
      }));
    } }, { key: "onPushedConfig", value: function(e4) {
      var t3 = "".concat(this._n, ".onPushedConfig data:").concat(JSON.stringify(e4));
      M2.l("".concat(t3)), new P2("pushedCommercialConfig").setMessage("purchaseBits:".concat(e4.purchaseBits)).end(), this._parseConfig(e4);
    } }, { key: "_parseConfig", value: function(e4) {
      var t3 = "".concat(this._n, "._parseConfig"), n3 = e4.errorCode, o3 = e4.errorMessage, i4 = e4.purchaseBits, a4 = e4.expiredTime;
      0 === n3 ? (this._purchasedFeatureHandler.parsePurchaseBits(i4), this._expiredTime = Date.now() + 1e3 * a4) : N2(n3) ? (M2.l("".concat(t3, " failed. Invalid message format:"), e4), this._setExpiredTimeOnResponseError(36e5)) : (M2.e("".concat(t3, " errorCode:").concat(n3, " errorMessage:").concat(o3)), this._setExpiredTimeOnResponseError(12e4));
    } }, { key: "_setExpiredTimeOnResponseError", value: function(e4) {
      this._expiredTime = Date.now() + e4;
    } }, { key: "canIUse", value: function(e4) {
      return this._purchasedFeatureHandler.hasPurchasedFeature(e4);
    } }, { key: "isFeatureEnabled", value: function(e4) {
      return this._purchasedFeatureHandler.isFeatureEnabled(e4);
    } }, { key: "isFeatureEnabledForStat", value: function(e4) {
      this._purchasedFeatureHandler.isFeatureEnabledForStat(e4);
    } }, { key: "isCSPluginEnabled", value: function() {
      this._purchasedFeatureHandler.isCSPluginEnabled();
    } }, { key: "get", value: function(e4) {
      return this._m.get(e4);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._expiredTime = 0, this._isFetching = false, this._purchasedFeatureHandler.clear();
    } }]), $a = (t2(Is2, c3), e3(Is2, [{ key: "registerPlugin", value: function(e4) {
      var t3, n3, o3, i4, a4, s4, r3, c4, u3, l3, d4, p4, _3;
      Ie2 ? (this._offlinePushPlugin = e4["tim-offline-push-plugin"], t3 = (_3 = e4.offlinePushConfig || {}).huaweiBusinessID, n3 = _3.xiaomiBusinessID, o3 = _3.xiaomiAppID, i4 = _3.xiaomiAppKey, a4 = _3.meizuBusinessID, s4 = _3.meizuAppID, r3 = _3.meizuAppKey, c4 = _3.vivoBusinessID, u3 = _3.oppoBusinessID, l3 = _3.oppoAppKey, d4 = _3.oppoAppSecret, p4 = _3.honorBusinessID, _3 = _3.iosBusinessID, this._androidPushConfig.huaweiPushBussinessId = t3, this._androidPushConfig.xiaomiPushBussinessId = n3, this._androidPushConfig.xiaomiPushAppId = o3, this._androidPushConfig.xiaomiPushAppKey = i4, this._androidPushConfig.meizuPushBussinessId = a4, this._androidPushConfig.meizuPushAppId = s4, this._androidPushConfig.meizuPushAppKey = r3, this._androidPushConfig.vivoPushBussinessId = c4, this._androidPushConfig.oppoPushBussinessId = u3, this._androidPushConfig.oppoPushAppKey = l3, this._androidPushConfig.oppoPushAppSecret = d4, this._androidPushConfig.honorPushBussinessId = p4, new P2("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!N2(this._offlinePushPlugin))).end(true), M2.l("".concat(this._n, ".").concat("registerPlugin", " ok. offlinePushConfig:").concat(JSON.stringify(e4.offlinePushConfig))), this._iosBusinessID = _3, this._setAppShowListener()) : this.warn("OfflinePushInUniapp");
    } }, { key: "init", value: function() {
      this._isWebUniapp = this.getUniAppPlatform(), this._getDeviceToken();
    } }, { key: "_getDeviceToken", value: function() {
      var c4, u3 = this, l3 = "".concat(this._n, ".").concat("_getDeviceToken");
      dt3(this._offlinePushPlugin.getDeviceToken) ? (c4 = "androidPushConfig:".concat(JSON.stringify(this._androidPushConfig), ", iosBusinessID:").concat(this._iosBusinessID), M2.l("".concat(l3, " start. ").concat(c4)), new P2("_getDeviceToken").setMessage("".concat(c4)).end(true), this._offlinePushPlugin.getDeviceToken(this._androidPushConfig, function(e4) {
        var t3, n3, o3, i4, a4 = new P2("getDeviceTokenRes"), s4 = e4.code, r3 = e4.msg;
        0 === s4 ? (t3 = (i4 = e4.data).deviceToken, n3 = i4.deviceBrand, o3 = i4.deviceType, i4 = i4.bussinessId, u3._deviceToken = t3, u3._businessID = i4 || u3._iosBusinessID, c4 = "deviceToken:".concat(t3, ", deviceBrand:").concat(n3 || o3, ", businessID:").concat(u3._businessID), M2.l("".concat(l3, " ok. ").concat(c4)), a4.setMessage(c4).end(true), u3._setToken()) : (a4.setMessage("code:".concat(s4, ", msg:").concat(r3)).end(true), M2.e("".concat(l3, " failed. error:"), e4));
      })) : M2.e("".concat(l3, " getDeviceToken is not a function"));
    } }, { key: "canIUseOfflinePush", value: function() {
      return Ie2 && !N2(this._offlinePushPlugin);
    } }, { key: "_setAppShowListener", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_setAppShowListener");
      N2(this._offlinePushPlugin) ? M2.e("".concat(n3, " offlinePushPlugin is undefined")) : dt3(this._offlinePushPlugin.setAppShowListener) ? (new P2("_setAppShowListener").end(true), M2.l("".concat(n3, " start")), this._offlinePushPlugin.setAppShowListener(function(e4) {
        e4 = (e4 || {}).appShow;
        new P2("setAppShowListenerRes").setMessage("appShow:".concat(e4)).end(true), M2.l("".concat(n3, " ok. appShow:").concat(e4)), t3._m.isReady() && (0 === e4 ? (t3._getConvUnreadCount(), t3._onBackground()) : 1 === e4 && t3._onForeground());
      })) : M2.e("".concat(n3, " setAppShowListener is not a function"));
    } }, { key: "getDeviceBrand", value: function() {
      var e4;
      if (!N2(this._offlinePushPlugin) && dt3(this._offlinePushPlugin.getDeviceType))
        return e4 = (this._offlinePushPlugin.getDeviceType() || {}).deviceType, M2.l("".concat(this._n, ".getDeviceBrand ok. deviceType:").concat(e4)), e4;
    } }, { key: "_setToken", value: function() {
      var t3 = "".concat(this._n, "._setToken"), e4 = this.get(12), n3 = 1, o3 = "", i4 = "", a4 = (S2(this._deviceToken) && (n3 = 0), this.getUniAppPlatform()), s4 = this.getDeviceBrand(), r3 = (a4 === te3.IOS || a4 === te3.IPAD || a4 === te3.MAC ? i4 = this._deviceToken : a4 === te3.ANDROID && (o3 = this._deviceToken), new P2("offlinePushSetToken")), a4 = "deviceToken:".concat(i4 || o3, ", businessID:").concat(this._businessID, ", ") + "deviceBrand:".concat(s4, ", isWebUniapp:").concat(this._isWebUniapp, ", pushMsg:").concat(n3, ", platform:").concat(a4);
      return r3.setMessage("".concat(a4)), M2.l("".concat(t3, " ").concat(a4)), this.req({ P: G2.SET_TOKEN, data: { tokenID: o3, pushMsg: n3, sdkAppID: e4.getSDKAppID(), businessID: parseInt(this._businessID), deviceBrand: s4, deviceToken: i4, isWebUniapp: this._isWebUniapp } }).then(function(e5) {
        return r3.end(), M2.l("".concat(t3, " ok")), e5;
      }).catch(function(e5) {
        return r3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_getConvUnreadCount", value: function() {
      var t3 = this;
      this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this.get(11).getLocalConvList().forEach(function(e4) {
        e4.type === R2.CONV_C2C && (t3._c2cUnreadCount += e4.unreadCount), e4.type === R2.CONV_GROUP && (t3._groupUnreadCount += e4.unreadCount);
      });
    } }, { key: "_onBackground", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_onBackground"), o3 = new P2("_onBackground");
      this.req({ P: G2.STAT_BACKGROUND, data: { c2cUnreadCount: this._c2cUnreadCount, groupUnreadCount: this._groupUnreadCount, isWebUniapp: this._isWebUniapp } }).then(function(e4) {
        return o3.setMessage("c2cUnreadCount: ".concat(t3._c2cUnreadCount, ", groupUnreadCount: ").concat(t3._groupUnreadCount)).end(), M2.l("".concat(n3, " ok")), e4;
      }).catch(function(e4) {
        o3.setError(e4).end(), M2.e("".concat(n3, " failed. error:"), e4);
      });
    } }, { key: "_onForeground", value: function() {
      var t3 = "".concat(this._n, ".").concat("_onForeground"), n3 = new P2("_onForeground");
      this.req({ P: G2.STAT_FOREGROUND, data: { isWebUniapp: this._isWebUniapp } }).then(function(e4) {
        return n3.end(), M2.l("".concat(t3, " ok")), e4;
      }).catch(function(e4) {
        n3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4);
      });
    } }, { key: "getUniAppPlatform", value: function() {
      var e4 = index.getSystemInfoSync().platform, t3 = this.getDeviceBrand();
      return "ios" === e4 ? te3.IOS : "android" === e4 ? te3.ANDROID : 1002 === t3 ? te3.IPAD : 1001 === t3 ? te3.MAC : void 0;
    } }, { key: "reset", value: function() {
      this._deviceToken = "", this._businessID = 0, this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this._isWebUniapp = 0, M2.l("".concat(this._n, ".reset"));
    } }])), es2 = (t2(vs2, c3), e3(vs2, [{ key: "registerPlugin", value: function(e4) {
      var t3, n3, o3;
      Ie2 ? (t3 = "".concat(this._n, ".").concat("registerPlugin"), this._pushPlugin = e4["tim-push"], this._getDeviceInfo(), n3 = (o3 = e4.pushConfig || {}).androidConfig, o3 = o3.iOSConfig, ut3(n3) && (this._androidPushConfig = n3[this._deviceInfo.packageName]), n3 = (o3 || {}).iOSBusinessID, this._iOSBusinessID = n3, o3 = !N2(this._pushPlugin), new P2("registerPlugin").setMessage(this._pluginName).setMoreMessage("isExisted:".concat(o3)).end(true), M2.l("".concat(t3, " ok. pushConfig:").concat(JSON.stringify(e4.pushConfig))), o3 ? (this._setAppShowListener(), this._setPushEventReportListener()) : M2.e("".concat(t3, " ").concat(this._pluginName, " is undefined"))) : this.warn("TIMPushInUniapp");
    } }, { key: "init", value: function() {
      this._isWebUniapp = this.getUniAppPlatform(), this._reportEventCacheList(), this._getDeviceToken(), this.get(27).isFeatureEnabledForStat(Math.pow(2, 41));
    } }, { key: "_reportEventCacheList", value: function() {
      var a4 = this, s4 = "".concat(this._n, ".").concat("_reportEventCacheList");
      dt3(this._pushPlugin.getPushEventCacheList) ? (new P2("_reportEventCacheList").end(true), this._pushPlugin.getPushEventCacheList(function(e4) {
        var t3 = e4.code, n3 = e4.data.eventList, o3 = new P2("getPushEventCacheListRes");
        if (o3.setCode(t3), 0 !== t3)
          o3.setMessage("res:".concat(JSON.stringify(e4))).end(true), M2.e("".concat(s4, " failed. error:").concat(JSON.stringify(e4)));
        else {
          t3 = n3.length < 10 ? "eventList:".concat(JSON.stringify(n3)) : "eventList.length:".concat(n3.length);
          M2.l("".concat(s4, " ok. ").concat(t3)), o3.setMessage(t3).end(true);
          for (var i4 = y2(y2({}, e4.data), {}, { eventList: [] }); 0 < n3.length; )
            i4.eventList = n3.splice(0, 40), a4._pushReport(i4);
        }
      })) : M2.e("".concat(this._pluginName, ".getPushEventCacheList is not a function"));
    } }, { key: "_getDeviceToken", value: function() {
      var r3, c4 = this, u3 = "".concat(this._n, ".").concat("_getDeviceToken");
      dt3(this._pushPlugin.getDeviceToken) ? (r3 = "androidPushConfig:".concat(JSON.stringify(this._androidPushConfig), " iOSBusinessID:").concat(this._iOSBusinessID), M2.l("".concat(u3, " start. ").concat(r3)), new P2("_getDeviceToken").setMessage("".concat(r3)).end(true), this._pushPlugin.getDeviceToken(this._androidPushConfig, function(e4) {
        var t3, n3, o3, i4 = e4.code, a4 = e4.msg, s4 = new P2("getDeviceTokenRes");
        s4.setCode(i4), 0 === i4 ? (t3 = (i4 = e4.data).deviceToken, n3 = i4.deviceBrand, o3 = i4.deviceType, i4 = i4.bussinessId, c4._deviceToken = t3, c4._businessID = i4 || c4._iOSBusinessID, r3 = "deviceToken:".concat(t3, " deviceBrand:").concat(n3 || o3, " businessID:").concat(c4._businessID), M2.l("".concat(u3, " ok. ").concat(r3)), s4.setMessage(r3).end(true), c4._setToken()) : (s4.setMessage(a4).end(true), M2.e("".concat(u3, " failed. error:").concat(JSON.stringify(e4))));
      })) : M2.e("".concat(this._pluginName, ".getDeviceToken is not a function"));
    } }, { key: "_getDeviceInfo", value: function() {
      var e4, t3, n3, o3, i4 = "".concat(this._n, ".").concat("_getDeviceInfo");
      dt3(this._pushPlugin.getDeviceInfo) ? (o3 = (e4 = this._pushPlugin.getDeviceInfo()).code, t3 = e4.data, (n3 = new P2("_getDeviceInfo")).setCode(o3), 0 === o3 ? (this._deviceInfo = y2(y2({}, this._deviceInfo), t3), this._deviceInfo.pushVersion || (this._deviceInfo.pushVersion = "1.0.1"), o3 = "deviceInfo:".concat(JSON.stringify(this._deviceInfo)), M2.l("".concat(i4, " ok. ").concat(o3)), n3.setMessage(o3).end(true)) : (n3.setMessage("deviceInfoRes:".concat(JSON.stringify(e4))).end(true), M2.e("".concat(i4, " failed. error:").concat(JSON.stringify(e4))))) : M2.e("".concat(this._pluginName, ".getDeviceInfo is not a function"));
    } }, { key: "canIUseTIMPush", value: function() {
      return Ie2 && !N2(this._pushPlugin);
    } }, { key: "_setAppShowListener", value: function() {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_setAppShowListener");
      dt3(this._pushPlugin.setAppShowListener) ? (new P2("_setAppShowListener").end(true), M2.l("".concat(n3, " start")), this._pushPlugin.setAppShowListener(function(e4) {
        e4 = (e4 || {}).appShow;
        new P2("setAppShowListenerRes").setMessage("appShow:".concat(e4)).end(true), M2.l("".concat(n3, " ok. appShow:").concat(e4)), t3._m.isReady() && (0 === e4 ? (t3._getConvUnreadCount(), t3._onBackground()) : 1 === e4 && t3._onForeground());
      })) : M2.e("".concat(this._pluginName, ".setAppShowListener is not a function"));
    } }, { key: "_setPushEventReportListener", value: function() {
      var a4 = this, s4 = "".concat(this._n, ".").concat("_setPushEventReportListener");
      dt3(this._pushPlugin.setPushEventReportListener) ? (new P2("_setPushEventReportListener").end(true), this._pushPlugin.setPushEventReportListener(function(e4) {
        var t3 = e4.code, n3 = e4.data, o3 = n3.eventList, i4 = new P2("setPushEventReportListenerRes");
        i4.setCode(t3), 0 === t3 ? (t3 = "eventList:".concat(JSON.stringify(o3)), M2.l("".concat(s4, " ok. ").concat(t3)), i4.setMessage(t3).end(true), a4._m.isReady() && O2(o3) && 0 < o3.length && a4._pushReport(n3)) : (i4.setMessage("res:".concat(JSON.stringify(e4))).end(true), M2.e("".concat(s4, " failed. error:").concat(JSON.stringify(e4))));
      })) : M2.e("".concat(this._pluginName, ".setPushEventReportListener is not a function"));
    } }, { key: "getDeviceBrand", value: function() {
      var e4;
      if (!N2(this._pushPlugin) && dt3(this._pushPlugin.getDeviceType))
        return e4 = (this._pushPlugin.getDeviceType() || {}).deviceType, M2.l("".concat(this._n, ".getDeviceBrand ok. deviceType:").concat(e4)), e4;
    } }, { key: "_setToken", value: function() {
      var t3 = "".concat(this._n, ".").concat("_setToken"), e4 = this.get(12), n3 = 1, o3 = "", i4 = "", a4 = (S2(this._deviceToken) && (n3 = 0), this.getUniAppPlatform()), s4 = this.getDeviceBrand(), a4 = (a4 === te3.IOS || a4 === te3.IPAD || a4 === te3.MAC ? i4 = this._deviceToken : a4 === te3.ANDROID && (o3 = this._deviceToken), y2({ tokenID: o3, pushMsg: n3, sdkAppID: e4.getSDKAppID(), businessID: parseInt(this._businessID), deviceBrand: s4, deviceToken: i4, isWebUniapp: this._isWebUniapp }, this._deviceInfo)), r3 = new P2("_setToken"), o3 = "data:".concat(JSON.stringify(a4));
      r3.setMessage("".concat(o3)), M2.l("".concat(t3, " ").concat(o3)), this.req({ P: G2.SET_TOKEN, data: a4 }).then(function() {
        r3.end(), M2.w("".concat(t3, " ok"));
      }).catch(function(e5) {
        r3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_getConvUnreadCount", value: function() {
      var t3 = this;
      this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this.get(11).getLocalConvList().forEach(function(e4) {
        e4.type === R2.CONV_C2C && (t3._c2cUnreadCount += e4.unreadCount), e4.type === R2.CONV_GROUP && (t3._groupUnreadCount += e4.unreadCount);
      });
    } }, { key: "_onBackground", value: function() {
      var e4 = this, t3 = "".concat(this._n, ".").concat("_onBackground"), n3 = new P2("_onBackground");
      this.req({ P: G2.STAT_BACKGROUND, data: { c2cUnreadCount: this._c2cUnreadCount, groupUnreadCount: this._groupUnreadCount, isWebUniapp: this._isWebUniapp } }).then(function() {
        n3.setMessage("c2cUnreadCount:".concat(e4._c2cUnreadCount, " groupUnreadCount:").concat(e4._groupUnreadCount)).end(), M2.l("".concat(t3, " ok"));
      }).catch(function(e5) {
        n3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5);
      });
    } }, { key: "_onForeground", value: function() {
      var t3 = "".concat(this._n, ".").concat("_onForeground"), n3 = new P2("_onForeground");
      this.req({ P: G2.STAT_FOREGROUND, data: { isWebUniapp: this._isWebUniapp } }).then(function() {
        n3.end(), M2.l("".concat(t3, " ok"));
      }).catch(function(e4) {
        n3.setError(e4).end(), M2.e("".concat(t3, " failed. error:"), e4);
      });
    } }, { key: "_pushReport", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("_pushReport"), o3 = new P2("_pushReport");
      this.req({ P: G2.PUSH_REPORT, data: { eventList: e4.eventList } }).then(function() {
        o3.end(), t3._notifyReportSuccess(e4);
      }).catch(function(e5) {
        o3.setError(e5).end(), M2.e("".concat(n3, " failed. error:"), e5);
      });
    } }, { key: "_notifyReportSuccess", value: function(e4) {
      !N2(this._pushPlugin) && dt3(this._pushPlugin.notifyReportSuccess) && (this._pushPlugin.notifyReportSuccess(e4), M2.l("".concat(this._n, "._notifyReportSuccess ok")));
    } }, { key: "getUniAppPlatform", value: function() {
      var e4 = index.getSystemInfoSync().platform, t3 = this.getDeviceBrand();
      return "ios" === e4 ? te3.IOS : "android" === e4 ? te3.ANDROID : 1002 === t3 ? te3.IPAD : 1001 === t3 ? te3.MAC : void 0;
    } }, { key: "reset", value: function() {
      this._deviceToken = "", this._businessID = 0, this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this._isWebUniapp = 0, M2.l("".concat(this._n, ".reset"));
    } }])), ts2 = (t2(ms2, c3), e3(ms2, [{ key: "init", value: function() {
      var e4 = this.get(18).getPlugin("tim-profanity-filter-plugin");
      e4 && (this._plugin = new e4({ logger: M2, isArray: O2, isMap: st3, isDevMode: this.isDevMode() }), this._getLexicon());
    } }, { key: "onCheckTimer", value: function() {
      this._plugin && this._canIUseLexicon && this.isLoggedIn() && !this._isFetching && Date.now() >= this._expiredTime && this._getLexicon();
    } }, { key: "filterMessage", value: function(e4, t3) {
      var n3 = true;
      if (this._plugin && this._canIUseLexicon && (!t3 || !t3.messageControlInfo || true !== t3.messageControlInfo.excludedFromContentModeration)) {
        var t3 = e4.type, o3 = e4.conversationType;
        if (t3 === R2.MSG_TEXT || t3 === R2.MSG_CUSTOM) {
          var i4, a4 = "".concat(this._n, ".filterMessage");
          if (M2.l("".concat(a4)), t3 === R2.MSG_TEXT) {
            if (o3 === R2.CONV_C2C ? i4 = "c2c_text_message" : o3 === R2.CONV_GROUP && (i4 = "group_text_message"), !this._isConfigOn(i4))
              return n3;
            var s4 = this._plugin.filter(e4.payload.text), r3 = s4.type, s4 = s4.modifiedText;
            1 === r3 ? n3 = false : 2 === r3 && (e4.payload.text = s4);
          } else if (t3 === R2.MSG_CUSTOM) {
            if (o3 === R2.CONV_C2C ? i4 = "c2c_custom_message" : o3 === R2.CONV_GROUP && (i4 = "group_custom_message"), !this._isConfigOn(i4))
              return n3;
            r3 = this._plugin.filter(e4.payload.data), s4 = this._plugin.filter(e4.payload.description), t3 = this._plugin.filter(e4.payload.extension);
            1 === r3.type || 1 === s4.type || 1 === t3.type ? n3 = false : (2 === r3.type && (e4.payload.data = r3.modifiedText), 2 === s4.type && (e4.payload.description = s4.modifiedText), 2 === t3.type && (e4.payload.extension = t3.modifiedText));
          }
          M2.l("".concat(a4, " done. isAllowedToSend:").concat(n3));
        }
      }
      return n3;
    } }, { key: "filterText", value: function(e4, t3) {
      var n3 = "".concat(this._n, ".filterText"), o3 = { isAllowedToSend: true, modifiedText: e4 };
      return this._plugin && this._canIUseLexicon && this._isConfigOn(t3) && (M2.l("".concat(n3)), e4 = (t3 = this._plugin.filter(e4)).type, t3 = t3.modifiedText, 1 === e4 ? o3.isAllowedToSend = false : 2 === e4 && (o3.modifiedText = t3), M2.l("".concat(n3, " done. ret:"), o3)), o3;
    } }, { key: "_getLexicon", value: function() {
      var l3 = this, d4 = new P2("profanityFilter"), p4 = "".concat(this._n, "._getLexicon");
      this._isFetching = true, this.req({ P: G2.GET_PROFANITY_LIST, data: { startIndex: this._startIndex, version: this._version } }).then(function(e4) {
        var e4 = e4.data, t3 = e4.errorInfo, n3 = e4.filterConfig, o3 = e4.lexicon, i4 = e4.strToken, a4 = e4.completeFlag, s4 = e4.nextStartIndex, r3 = e4.version, e4 = e4.expiredTime, c4 = t3.errorCode, u3 = t3.errorMessage;
        return 0 !== c4 ? (l3._isFetching = false, M2.w("".concat(p4, " failed. error:"), t3), void d4.setCode(c4).setMessage(u3).end()) : (l3._onFilterConfig(n3), l3._getToken(i4), 1 === a4 ? (M2.l("".concat(p4, " done. version:").concat(r3, " expiredTime:").concat(e4)), l3._version = r3, l3._canIUseLexicon = true, l3._isFetching = false, l3._expiredTime = Date.now() + 1e3 * e4, void l3._plugin.onLexiconCompleted(o3)) : (l3._startIndex = s4, l3._plugin.onLexiconSliced(o3), void l3._getLexicon()));
      }).catch(function(e4) {
        d4.setError(e4).end(), l3._isFetching = false, M2.l("".concat(p4, " failed. error:"), e4);
      });
    } }, { key: "_onFilterConfig", value: function(t3) {
      var n3 = this;
      S2(t3) || (this._filterConfigMap.clear(), Object.keys(t3).forEach(function(e4) {
        n3._filterConfigMap.set(e4, t3[e4]);
      }), M2.l("".concat(this._n, "._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys()), " values:").concat(Array.from(this._filterConfigMap.values()))));
    } }, { key: "_isConfigOn", value: function(e4) {
      return 1 === this._filterConfigMap.get(e4);
    } }, { key: "_getToken", value: function(e4) {
      if (C2(e4)) {
        var t3 = e4.length, n3 = "";
        if (t3 % 2 == 0)
          for (var o3 = 0; o3 <= t3 - 1; o3 += 2)
            n3 = (n3 += e4[o3 + 1]) + e4[o3];
        else {
          for (var i4 = 0; i4 < t3 - 1; i4 += 2)
            n3 = (n3 += e4[i4 + 1]) + e4[i4];
          n3 += e4[t3 - 1];
        }
        this._plugin.onToken(n3);
      }
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._plugin && (this._plugin.reset(), this._plugin = null), this._filterConfigMap.clear(), this._startIndex = 0, this._version = 0, this._canIUseLexicon = false, this._isFetching = false, this._expiredTime = 0;
    } }])), ns2 = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._n = "TransCmdModule", this._TRTCCommandList = ["tui_room_svr.*", "callkit_records_svr.*", "room_engine_srv.*", "room_engine_http_srv.*", "room_engine_mic.*", "live_engine_srv.*", "live_engine_http_srv.*", "live_engine_pk.*", "trtc_ai_service.*", "call_engine_srv.*"], this._TRTCCommandMap = /* @__PURE__ */ new Map(), this._setTRTCCommandMap(), this._m.getIEmitInst().on(U2.CLOUD_CONFIG, this._onCloudConfig, this);
    }, [{ key: "_onCloudConfig", value: function() {
      var t3 = this, e4 = this._m.get(23).getCloudConfig("rtc_cmd");
      N2(e4) || ((e4 = JSON.parse(e4)).forEach(function(e5) {
        t3._TRTCCommandList.includes(e5) || t3._TRTCCommandList.push(e5);
      }), this._setTRTCCommandMap());
    } }, { key: "_setTRTCCommandMap", value: function() {
      for (var e4, t3 = 0, n3 = this._TRTCCommandList.length; t3 < n3; t3++)
        e4 = this._TRTCCommandList[t3].split(".")[0], this._TRTCCommandMap.set(e4, 1);
    } }, { key: "onRoomCustomDataReceived", value: function(e4) {
      this._m.getOEmitInst().emit(h3.ROOM_CUSTOM_DATA_RECEIVED, e4);
    } }, { key: "sendTRTCCustomData", value: function(e4) {
      var t3 = e4.serviceCommand, e4 = e4.data, n3 = "".concat(a3.NAME.TUIROOM_SVR, ".*");
      return N2(t3) || (n3 = t3), this._isValidServiceCommand(n3) ? this._trans({ servcmd: n3, data: e4 }) : E2({ code: k2.INVALID_TRTC_CMD });
    } }, { key: "_trans", value: function(e4) {
      M2.d("".concat(this._n, "._trans. options:").concat(JSON.stringify(e4)));
      var t3 = e4.servcmd, e4 = e4.data;
      return this._m.get(20).trans({ servcmd: t3, data: C2(e4) ? JSON.parse(e4) : e4 });
    } }, { key: "_isValidServiceCommand", value: function(e4) {
      return e4.endsWith(".*") ? this._TRTCCommandList.includes(e4) : (e4 = e4.split(".")[0], this._TRTCCommandMap.has(e4));
    } }, { key: "isTRTCCommand", value: function(e4) {
      e4 = e4.split(".")[0];
      return this._TRTCCommandMap.has(e4);
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }]), os2 = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._n = "ErrMsgModule", this.TIM_ERROR_ASSISTANCE = "tim_error_assistance", this.STORAGE_EXPIRES_TIME = 6048e5, this.CURRENT_DOMAIN = ue2, this._map = /* @__PURE__ */ new Map(), this._init();
    }, [{ key: "_init", value: function() {
      var e4, t3 = this._getStorageModule().getItem(this.TIM_ERROR_ASSISTANCE, false);
      if (t3) {
        try {
          e4 = JSON.parse(t3);
        } catch (e5) {
          this._getStorageModule().removeItem(this.TIM_ERROR_ASSISTANCE, false), M2.w("".concat(this._n, "._init error:"), e5);
        }
        e4 && (this._needToUpdate(e4) ? this._fetch() : this._fillMap(e4.message));
      } else
        this._fetch();
    } }, { key: "_needToUpdate", value: function(e4) {
      var t3 = e4.localSavedTime, e4 = e4.localSavedVersion, t3 = t3 && (/* @__PURE__ */ new Date()).getTime() - t3 >= this.STORAGE_EXPIRES_TIME, e4 = !e4 || "3.5.5" !== e4;
      return M2.l("".concat(this._n, "._needToUpdate isTimeout:").concat(t3, " isDifferentVersion:").concat(e4)), t3 || e4;
    } }, { key: "_fetch", value: function() {
      this._m.get(12).isPrivateNetWork() || this._fetchWithRetry();
    } }, { key: "_fetchWithRetry", value: function() {
      var e4 = this;
      this._fetchAdapter().catch(function() {
        e4.CURRENT_DOMAIN !== de2 && (e4._generateCurrentDomain(), e4._fetchWithRetry());
      });
    } }, { key: "_generateCurrentDomain", value: function() {
      this.CURRENT_DOMAIN === ue2 ? this.CURRENT_DOMAIN = le2 : this.CURRENT_DOMAIN === le2 && (this.CURRENT_DOMAIN = de2);
    } }, { key: "_fetchAdapter", value: function() {
      var i4 = "https://".concat(this.CURRENT_DOMAIN, "/im/download/error-message/v3/0.0.7/tim-error-message.txt"), a4 = "application/x-www-form-urlencoded;charset=UTF-8", s4 = "".concat(this._n, "._fetchAdapter ok in"), r3 = this;
      return new Promise(function(t3, n3) {
        var e4, o3;
        v3 ? I2.request({ url: i4, method: "GET", timeout: 3e3, header: { "content-type": a4 }, dataType: "text", success: function(e5) {
          r3._fillAndSave(e5.data), M2.l("".concat(s4, " mini program.")), t3();
        }, fail: function(e5) {
          n3(e5);
        } }) : (e4 = new XMLHttpRequest(), o3 = setTimeout(function() {
          e4.abort();
        }, 3e3), e4.onreadystatechange = function() {
          4 === e4.readyState && (o3 && clearTimeout(o3), 200 === e4.status || 304 === e4.status ? (M2.l("".concat(s4, " browser.")), r3._fillAndSave(e4.responseText), t3()) : n3(e4.status));
        }, e4.onerror = function(e5) {
          n3(e5);
        }, e4.open("GET", i4, true), e4.setRequestHeader("Content-type", a4), e4.send());
      });
    } }, { key: "_fillAndSave", value: function(e4) {
      this._fillMap(e4), this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE, JSON.stringify({ message: e4, localSavedTime: (/* @__PURE__ */ new Date()).getTime(), localSavedVersion: "3.5.5" }), true, false);
    } }, { key: "_getStorageModule", value: function() {
      return this._m.get(13);
    } }, { key: "_fillMap", value: function(e4) {
      this._map.clear();
      for (var t3, n3, o3 = e4.split(";\n"), i4 = o3.length, a4 = new RegExp(/'/g), s4 = 0; s4 < i4; s4++)
        if (n3 = o3[s4].indexOf(":"), t3 = o3[s4].slice(0, n3), n3 = o3[s4].slice(n3 + 1, o3[s4].length), !t3.startsWith("//")) {
          if (N2(n3))
            continue;
          this._map.set(t3, n3.replace(a4, ""));
        }
    } }, { key: "get", value: function(e4) {
      var t3 = e4.isIntl, n3 = e4.key, o3 = e4.replacement1, e4 = e4.replacement2, t3 = "".concat(n3, t3 ? "_en" : "_cn"), n3 = (!this._map.has(t3) && this._map.has(n3) && (t3 = n3), "");
      return this._map.has(t3) && (n3 = this._map.get(t3), N2(o3) || (n3 = n3.replace("$replacement1", o3)), N2(e4) || (n3 = n3.replace("$replacement2", e4))), n3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset"));
    } }]), is2 = e3(function e4(t3) {
      p3(this, e4), this._n = "RemoteSignalingHandler", this._sigM = t3;
    }, [{ key: "onNewMessageList", value: function(e4) {
      var n3 = this;
      e4.forEach(function(e5) {
        var t3 = n3.getPayloadData(e5);
        t3 && n3._handleActionType(t3, e5);
      });
    } }, { key: "onMessageModified", value: function(e4) {
      var n3 = this;
      e4.forEach(function(e5) {
        var t3 = n3.getPayloadData(e5);
        t3 && n3._onInvitationModified(t3, e5);
      });
    } }, { key: "getPayloadData", value: function(t3) {
      var n3 = "".concat(this._n, ".getPayloadData"), t3 = t3.payload.data;
      try {
        return JSON.parse(t3);
      } catch (e4) {
        return M2.e("".concat(n3, " JSON parse error. signalingData:").concat(t3)), null;
      }
    } }, { key: "_handleActionType", value: function(e4, t3) {
      switch (e4.actionType) {
        case _2.ACTION_TYPE_INVITE:
          this._onNewInvitationReceived(e4, t3);
          break;
        case _2.ACTION_TYPE_REJECT_INVITE:
          this._onInviteeRejected(e4);
          break;
        case _2.ACTION_TYPE_ACCEPT_INVITE:
          this._onInviteeAccepted(e4);
          break;
        case _2.ACTION_TYPE_CANCEL_INVITE:
          this._onInvitationCancelled(e4);
          break;
        case _2.ACTION_TYPE_INVITE_TIMEOUT:
          this._onInvitationTimeout(e4);
      }
    } }, { key: "_genBaseEmitData", value: function(e4) {
      return { inviteID: e4.inviteID, inviter: e4.inviter, groupID: e4.groupID, data: e4.data || "" };
    } }, { key: "_onNewInvitationReceived", value: function(e4, t3) {
      var n3 = "".concat(this._n, "._onNewInvitationReceived"), o3 = e4.inviteID, i4 = e4.inviteeList, a4 = e4.groupID, s4 = e4.inviter, r3 = this._sigM.getMyUserID(), c4 = i4.includes(r3), u3 = e4.timeout, l3 = (Ve3().getTime() - 1e3 * t3.time) / 1e3, n3 = (0 < u3 && 0 < l3 && l3 < u3 && (u3 -= l3), "".concat(n3, " myselfIncluded:").concat(c4, " groupID:").concat(a4, " signalObj:").concat(JSON.stringify(e4)));
      M2.l("".concat(n3, " timeout:").concat(u3, "s delta:").concat(l3, "s")), !(a4 && c4 || !a4) || (n3 = this._sigM.getInviteInfo(o3)) && n3 === e4 || (n3 || this._sigM.setInviteInfo(o3, y2(y2({}, e4), {}, { message: t3 })), this._sigM.emitEvent(_2.NEW_INVITATION_RECEIVED, y2(y2({}, this._genBaseEmitData(e4)), {}, { inviteeList: i4 })), s4 !== r3 && this._sigM.startTimer(y2(y2({}, e4), {}, { timeout: u3 })));
    } }, { key: "_onInviteeRejected", value: function(e4) {
      var t3 = "".concat(this._n, "._onInviteeRejected"), n3 = e4.inviteID, o3 = e4.inviter, i4 = e4.groupID, a4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(a4, " inviter:").concat(o3, " groupID:").concat(i4)), a4 && (this._sigM.updateInviteInfo(e4), this._sigM.emitEvent(_2.INVITEE_REJECTED, y2(y2({}, this._genBaseEmitData(e4)), {}, { invitee: e4.inviteeList[0] })));
    } }, { key: "_onInviteeAccepted", value: function(e4) {
      var t3 = "".concat(this._n, "._onInviteeAccepted"), n3 = e4.inviteID, o3 = e4.inviter, i4 = e4.groupID, a4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(a4, " inviter:").concat(o3, " groupID:").concat(i4)), a4 && (this._sigM.updateInviteInfo(e4), this._sigM.emitEvent(_2.INVITEE_ACCEPTED, y2(y2({}, this._genBaseEmitData(e4)), {}, { invitee: e4.inviteeList[0] })));
    } }, { key: "_onInvitationCancelled", value: function(e4) {
      var t3 = "".concat(this._n, "._onInvitationCancelled"), n3 = e4.inviteID, o3 = e4.inviter, i4 = e4.groupID, a4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(a4, " inviter:").concat(o3, " groupID:").concat(i4)), a4 && (this._sigM.deleteInviteInfo(n3), this._sigM.emitEvent(_2.INVITATION_CANCELLED, this._genBaseEmitData(e4)));
    } }, { key: "_onInvitationTimeout", value: function(e4) {
      var t3 = "".concat(this._n, "._onInvitationTimeout"), n3 = e4.inviteID, o3 = e4.inviter, i4 = e4.groupID, a4 = e4.inviteeList, s4 = this._sigM.hasInviteInfo(n3);
      M2.l("".concat(t3, " inviteID:").concat(n3, " hasInviteID:").concat(s4, " inviter:").concat(o3, " groupID:").concat(i4, "  data:").concat(e4.data)), s4 && (this._sigM.updateInviteInfo(e4), this._sigM.emitEvent(_2.INVITATION_TIMEOUT, y2(y2({}, this._genBaseEmitData(e4)), {}, { inviteeList: a4, isSelfTimeout: false })));
    } }, { key: "_onInvitationModified", value: function(e4, t3) {
      var n3 = "".concat(this._n, "._onInvitationModified"), o3 = e4.inviteID, i4 = e4.data, a4 = this._sigM.hasInviteInfo(o3);
      M2.l("".concat(n3, " inviteID:").concat(o3, " hasInviteID:").concat(a4, " data:").concat(i4)), a4 && (this._sigM.setInviteInfo(o3, y2(y2({}, e4), {}, { message: t3 })), this._sigM.emitEvent(_2.INVITATION_MODIFIED, { inviteID: o3, data: i4 }));
    } }]), as2 = e3(function e4(t3) {
      p3(this, e4), this._n = "LocalSignalingHandler", this._sigM = t3;
    }, [{ key: "generateInviteID", value: function() {
      var e4, t3 = (t3 = Pa)((e4 = Ga)(32), 8) + "-" + t3(e4(16), 4) + "-" + t3(16384 | e4(12), 4) + "-" + t3(32768 | e4(14), 4) + "-" + t3(e4(48), 12);
      return M2.l("".concat(this._n, ".generateInviteID inviteID:").concat(t3)), t3;
    } }, { key: "createInviteInfo", value: function(e4) {
      var t3 = this.generateInviteID(), e4 = this.createInviteCustomData(y2(y2({}, e4), {}, { inviteID: t3 })), n3 = e4.groupID, o3 = e4.inviteeList, n3 = n3 || o3[0];
      return { customData: e4, message: this._sigM.createSignaling(e4, n3), inviteID: t3 };
    } }, { key: "_genBaseCustomData", value: function(e4) {
      var t3 = e4.data, n3 = e4.inviteID, e4 = e4.groupID;
      return { businessID: 1, timeout: 0, data: void 0 === t3 ? "" : t3, inviteID: void 0 === n3 ? "" : n3, groupID: void 0 === e4 ? "" : e4 };
    } }, { key: "createInviteCustomData", value: function(e4) {
      var t3 = e4.userID, n3 = e4.timeout, n3 = void 0 === n3 ? 0 : n3, o3 = e4.groupID, o3 = void 0 === o3 ? "" : o3, i4 = this._sigM.getMyUserID(), i4 = y2(y2({}, this._genBaseCustomData(e4)), {}, { actionType: _2.ACTION_TYPE_INVITE, inviter: i4, inviteeList: o3 ? e4.inviteeList : [t3], timeout: n3 });
      return M2.l("".concat(this._n, ".createInviteCustomData customData:"), i4), i4;
    } }, { key: "createCancelCustomData", value: function(e4) {
      var t3, n3 = "".concat(this._n, ".createCancelCustomData"), o3 = e4.inviteID, i4 = this._sigM.getMyUserID(), o3 = this._sigM.getInviteInfo(o3), a4 = o3.inviteeList, s4 = o3.groupID, o3 = o3.inviter;
      return o3 === i4 ? t3 = y2(y2({}, this._genBaseCustomData(e4)), {}, { actionType: _2.ACTION_TYPE_CANCEL_INVITE, groupID: s4, inviter: i4, inviteeList: a4 }) : M2.e("".concat(n3, " unmatched inviter:").concat(o3, " and my userID:").concat(i4)), M2.l("".concat(n3, " customData:"), t3), t3;
    } }, { key: "createAcceptCustomData", value: function(e4) {
      var t3, n3 = "".concat(this._n, ".createAcceptCustomData"), o3 = e4.inviteID, i4 = this._sigM.getMyUserID(), a4 = this._sigM.getInviteInfo(o3), s4 = a4.inviter, r3 = a4.groupID;
      return a4.inviteeList.includes(i4) ? t3 = y2(y2({}, this._genBaseCustomData(e4)), {}, { actionType: _2.ACTION_TYPE_ACCEPT_INVITE, groupID: r3, inviter: s4, inviteeList: [i4] }) : M2.e("".concat(n3, " userID:").concat(i4, " not in inviteeList. inviteID:").concat(o3, " groupID:").concat(r3)), M2.l("".concat(n3, " customData:"), t3), t3;
    } }, { key: "createRejectCustomData", value: function(e4) {
      var t3, n3 = "".concat(this._n, ".createRejectCustomData"), o3 = e4.inviteID, i4 = this._sigM.getMyUserID(), a4 = this._sigM.getInviteInfo(o3), s4 = a4.inviter, r3 = a4.groupID;
      return a4.inviteeList.includes(i4) ? t3 = y2(y2({}, this._genBaseCustomData(e4)), {}, { actionType: _2.ACTION_TYPE_REJECT_INVITE, groupID: r3, inviter: s4, inviteeList: [i4] }) : M2.e("".concat(n3, " userID:").concat(i4, " not in inviteeList. inviteID:").concat(o3, " groupID:").concat(r3)), M2.l("".concat(n3, " customData:"), t3), t3;
    } }, { key: "createTimeoutCustomData", value: function(e4) {
      var t3 = "".concat(this._n, ".createTimeoutCustomData"), n3 = e4.inviteeList, o3 = e4.inviter, i4 = e4.isInviter, i4 = void 0 !== i4 && i4, a4 = this._sigM.getMyUserID(), e4 = y2(y2({}, this._genBaseCustomData(e4)), {}, { actionType: _2.ACTION_TYPE_INVITE_TIMEOUT, inviter: o3, inviteeList: i4 ? n3 : [a4] });
      return M2.l("".concat(t3, " customData:"), e4), e4;
    } }]), ss2 = e3(function e4(t3) {
      p3(this, e4), this._n = "HistorySignalingHandler", this._sigM = t3, this.COUNT = 20, this.EXPIRED_TIME = 300, this._map = /* @__PURE__ */ new Map(), this._relatedToMeMap = /* @__PURE__ */ new Map();
    }, [{ key: "setCloudConfig", value: function() {
      var e4 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 20, t3 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 300;
      this.COUNT = e4, this.EXPIRED_TIME = t3, M2.l("".concat(this._n, ".setCloudConfig count:").concat(e4, ", time:").concat(t3));
    } }, { key: "getHistorySignaling", value: function() {
      var t3 = this, e4 = this._sigM.get(11).getLocalConvList();
      S2(e4) || (this._getC2CSignalingList(), e4 = this._getValidGroupConvList(e4), this._getGroupSignalingList(e4).then(function(e5) {
        t3._handleSignalingList(e5);
      }));
    } }, { key: "_getC2CSignalingList", value: function() {
      var e4 = this._sigM.get(6).getMessageListFromUnreadDB(), e4 = this._sigM.filterMessageList(e4);
      this._getRelatedToMeMap(e4);
    } }, { key: "_getGroupSignalingList", value: function(e4) {
      var n3 = this, e4 = this._createPromiseList(e4);
      return 0 === e4.length ? Promise.resolve(this._sortSignaling(this._relatedToMeMap)) : this._concurrentGetMessageList(e4).then(function(e5) {
        var t3 = /* @__PURE__ */ new Map();
        return e5.forEach(function(e6) {
          e6 = e6.list, e6 = n3._getRelatedToMeMap(e6);
          t3 = new Map([].concat(d3(t3), d3(e6)));
        }), n3._sortSignaling(t3);
      });
    } }, { key: "_handleSignalingList", value: function(e4) {
      S2(e4) || this._sigM.onNewMessageList(e4);
    } }, { key: "_getValidGroupConvList", value: function(e4) {
      for (var t3 = [], n3 = 0, o3 = e4.length; n3 < o3; n3++) {
        var i4 = e4[n3], a4 = i4.type, s4 = i4.unreadCount, i4 = i4.lastMessage, a4 = a4 === R2.CONV_GROUP, i4 = this._isNotExpired(i4);
        a4 && s4 && i4 && t3.push(e4[n3]);
      }
      return t3;
    } }, { key: "_isNotExpired", value: function(e4) {
      return !(!e4 || !e4.lastTime) && e4.lastTime > He2() - this.EXPIRED_TIME;
    } }, { key: "_createPromiseList", value: function(e4) {
      for (var t3 = [], n3 = 0; n3 < e4.length; n3++) {
        var o3 = e4[n3], i4 = o3.conversationID, o3 = o3.unreadCount, o3 = o3 < this.COUNT ? o3 : this.COUNT, o3 = (this._map.set(i4, { msgCount: o3, list: [] }), this._sigM.get(11).getMessageList({ conversationID: i4 }));
        t3.push(o3);
      }
      return t3;
    } }, { key: "_concurrentGetMessageList", value: function(e4) {
      var i4 = this, a4 = [];
      return Promise.all(e4).then(function(e5) {
        for (var t3 = 0; t3 < e5.length; t3++) {
          var n3 = e5[t3], o3 = n3.code, n3 = n3.data;
          0 === o3 && 0 !== n3.messageList.length && (i4._handleMessageList(n3.messageList), o3 = i4._relayGetMessageList(n3)) && a4.push(o3);
        }
        return 0 < a4.length ? i4._concurrentGetMessageList(a4) : i4._map;
      });
    } }, { key: "_relayGetMessageList", value: function(e4) {
      var t3, n3 = e4.messageList, o3 = e4.nextReqMessageID, e4 = e4.isCompleted;
      return 0 === n3.length || (n3 = n3[0].conversationID, 0 === (t3 = this._map.get(n3).msgCount)) || e4 ? null : this._sigM.get(11).getMessageList({ conversationID: n3, nextReqMessageID: o3, count: t3 });
    } }, { key: "_handleMessageList", value: function(e4) {
      var t3 = e4.length, n3 = e4[0].conversationID, o3 = this._map.get(n3), i4 = o3.msgCount, o3 = o3.list;
      this._map.set(n3, { msgCount: 0 < i4 - t3 ? i4 - t3 : 0, list: o3.concat(this._sigM.filterMessageList(e4)) });
    } }, { key: "_getRelatedToMeMap", value: function(e4) {
      for (var t3 = 0; t3 < e4.length; t3++) {
        var n3 = e4[t3];
        this._saveRelatedToMe(n3);
      }
      return this._relatedToMeMap;
    } }, { key: "_saveRelatedToMe", value: function(e4) {
      var t3 = this._sigM.getPayloadData(e4) || {}, n3 = t3.actionType, t3 = t3.inviteID, o3 = void 0 === t3 ? "" : t3;
      switch (void 0 === n3 ? "" : n3) {
        case _2.ACTION_TYPE_INVITE:
          this._setHistoryInvite(e4);
          break;
        case _2.ACTION_TYPE_REJECT_INVITE:
        case _2.ACTION_TYPE_ACCEPT_INVITE:
          this._updateHistoryInvite(e4);
          break;
        case _2.ACTION_TYPE_CANCEL_INVITE:
          this._delHistoryInvite(o3);
          break;
        case _2.ACTION_TYPE_INVITE_TIMEOUT:
          this._updateHistoryInvite(e4);
      }
    } }, { key: "_setHistoryInvite", value: function(e4) {
      var t3 = this._sigM.getPayloadData(e4) || {}, n3 = t3.inviteID, n3 = void 0 === n3 ? "" : n3, o3 = t3.inviteeList, o3 = void 0 === o3 ? [] : o3, i4 = t3.timeout, i4 = void 0 === i4 ? 0 : i4, a4 = this._sigM.getMyUserID();
      o3.includes(a4) && (o3 = He2() - e4.time, 0 < i4 && i4 < o3 && 0 !== i4 || this._relatedToMeMap.set(n3, y2(y2({}, t3), {}, { messageList: [e4] })));
    } }, { key: "_delHistoryInvite", value: function(e4) {
      this._relatedToMeMap.has(e4) && this._relatedToMeMap.delete(e4);
    } }, { key: "_updateHistoryInvite", value: function(e4) {
      var t3 = this._sigM.getPayloadData(e4) || {}, n3 = t3.inviteID, n3 = void 0 === n3 ? "" : n3, t3 = t3.inviteeList, o3 = void 0 === t3 ? [] : t3;
      if (this._relatedToMeMap.has(n3)) {
        for (var t3 = this._relatedToMeMap.get(n3), i4 = t3.inviteeList, t3 = t3.messageList, a4 = 0; a4 < o3.length; a4++) {
          var s4 = o3[a4];
          i4.includes(s4) && i4.splice(i4.indexOf(s4), 1);
        }
        0 === i4.length ? this._delHistoryInvite(n3) : t3.push(e4);
      } else
        this._delHistoryInvite(n3);
    } }, { key: "_sortSignaling", value: function(e4) {
      var t3 = [];
      return e4.forEach(function(e5) {
        t3 = [].concat(d3(t3), d3(e5.messageList));
      }), t3.sort(function(e5, t4) {
        return e5.time - t4.time;
      });
    } }, { key: "reset", value: function() {
      this._map.clear(), this._relatedToMeMap.clear();
    } }]), rs2 = e3(function e4(t3, n3) {
      p3(this, e4), this.businessID = t3.businessID || 1, this.inviteID = t3.inviteID, this.groupID = t3.groupID || "", this.inviter = t3.inviter || "", this.inviteeList = t3.inviteeList || [], this.data = t3.data || "", this.actionType = t3.actionType || _2.ACTION_TYPE_INVITE, this.timeout = t3.timeout || 0;
    }), cs2 = ["message"], us2 = ["message"], ls2 = (t2(fs2, c3), e3(fs2, [{ key: "onC2CUnreadHandleCompleted", value: function() {
      this._isC2CUnreadHandleCompleted = true, this._isCloudConfigCompleted && this._isConvSyncCompleted && !this._isSyncCompleted && this.onReady();
    } }, { key: "onConvSyncCompleted", value: function() {
      this._isConvSyncCompleted = true, this._isC2CUnreadHandleCompleted && this._isCloudConfigCompleted && !this._isSyncCompleted && this.onReady();
    } }, { key: "onCloudConfig", value: function() {
      this._isCloudConfigCompleted = true;
      var e4 = this.getCloudConfig("history_s_count"), t3 = this.getCloudConfig("history_s_time");
      N2(e4) || (e4 = Number(e4)), N2(t3) || (t3 = Number(t3)), this._historySignalingHandler.setCloudConfig(e4, t3), this._isC2CUnreadHandleCompleted && this._isConvSyncCompleted && !this._isSyncCompleted && this.onReady();
    } }, { key: "_isListenerExisted", value: function() {
      return -1 < this._m.getOEmitInst().eventNames().indexOf(_2.NEW_INVITATION_RECEIVED);
    } }, { key: "onReady", value: function() {
      this._isSyncCompleted = true;
      var e4 = this._isListenerExisted();
      M2.l("".concat(this._n, ".onReady. isListenerExisted: ").concat(e4)), e4 && this._historySignalingHandler.getHistorySignaling();
    } }, { key: "onNewMessageList", value: function(e4) {
      e4 = this.filterMessageList(e4);
      if (0 < e4.length)
        return this._remoteSignalingHandler.onNewMessageList(e4);
    } }, { key: "onMessageModified", value: function(e4) {
      e4 = this.filterMessageList(e4);
      if (0 < e4.length)
        return this._remoteSignalingHandler.onMessageModified(e4);
    } }, { key: "hasInviteInfo", value: function(e4) {
      return this._inviteInfoMap.has(e4);
    } }, { key: "getInviteInfo", value: function(e4) {
      return this._inviteInfoMap.get(e4);
    } }, { key: "setInviteInfo", value: function(e4, t3) {
      var n3 = t3.message, t3 = W2(t3, cs2);
      M2.l("".concat(this._n, ".setInviteInfo inviteID:").concat(e4, " data:"), t3), this._inviteInfoMap.set(e4, y2(y2({}, t3), {}, { message: n3 }));
    } }, { key: "deleteInviteInfo", value: function(e4) {
      this.hasInviteInfo(e4) && (M2.l("".concat(this._n, ".deleteInviteInfo inviteID:").concat(e4, ".")), this._inviteInfoMap.delete(e4));
    } }, { key: "updateInviteInfo", value: function(e4) {
      var t3 = "".concat(this._n, ".updateInviteInfo"), n3 = e4.inviteID, o3 = e4.inviter, i4 = e4.inviteeList, e4 = e4.groupID;
      M2.l("".concat(t3, " inviteID:").concat(n3, " inviter:").concat(o3, " groupID:").concat(e4)), e4 && this.hasInviteInfo(n3) && (o3 = i4[0], (e4 = this.getInviteInfo(n3).inviteeList).includes(o3) && (e4.splice(e4.indexOf(o3), 1), M2.l("".concat(t3, " remove ").concat(o3, ". localInviteeList.length:").concat(e4.length))), 0 !== e4.length) || this.deleteInviteInfo(n3);
    } }, { key: "canIUseSignaling", value: function() {
      return this._canIUseSignaling;
    } }, { key: "emitEvent", value: function(e4, t3) {
      this.emitOEvt(e4, t3);
    } }, { key: "addSignalingListener", value: function(e4, t3, n3) {
      this._canIUseSignaling || (this._canIUseSignaling = true), this._m.getOEmitInst().on(e4, t3, n3);
    } }, { key: "removeSignalingListener", value: function(e4, t3, n3) {
      this._m.getOEmitInst().off(e4, t3, n3), this._isListenerExisted() || (this._canIUseSignaling = false);
    } }, { key: "invite", value: function(e4) {
      var t3 = this, n3 = "".concat(this._n, ".").concat("invite"), o3 = this._localSignalingHandler.createInviteInfo(e4), i4 = o3.message, a4 = o3.customData, s4 = o3.inviteID;
      return M2.l("".concat(n3, " options:").concat(JSON.stringify(e4), " inviteID:").concat(s4)), this.sendSignaling(i4, e4).then(function(e5) {
        return e5 && 0 === e5.code ? (t3.setInviteInfo(s4, y2(y2({}, a4), {}, { message: i4 })), t3.startTimer(y2(y2({}, a4), {}, { inviteID: s4 })), y2(y2({}, e5), {}, { inviteID: s4 })) : e5;
      }).catch(function(e5) {
        return E2(e5);
      });
    } }, { key: "inviteSync", value: function(e4, t3, n3) {
      var o3 = this, i4 = "".concat(this._n, ".").concat("inviteSync"), a4 = this._localSignalingHandler.createInviteInfo(e4), s4 = a4.message, r3 = a4.customData, c4 = a4.inviteID;
      return M2.l("".concat(i4, " options:").concat(JSON.stringify(e4), " inviteID:").concat(c4)), this.sendSignaling(s4, e4).then(function(e5) {
        if (e5 && 0 === e5.code)
          return o3.setInviteInfo(c4, y2(y2({}, r3), {}, { message: s4 })), o3.startTimer(y2(y2({}, r3), {}, { inviteID: c4 })), t3 && t3({ inviteID: c4 }), { inviteID: c4 };
        n3 && n3(0 === e5.code, e5.message || "");
      }).catch(function(e5) {
        return n3 && n3(e5.code, e5.message), E2(e5);
      }), c4;
    } }, { key: "_handleImResponse", value: function(e4, t3, n3) {
      t3 && 0 === t3.code && (this._isHandling = false, n3 ? this.deleteInviteInfo(e4.inviteID) : this.updateInviteInfo(e4));
    } }, { key: "cancel", value: function(t3) {
      var n3 = this, e4 = "".concat(this._n, ".").concat("cancel");
      if (M2.l("".concat(e4, " options:").concat(JSON.stringify(t3))), !this.hasInviteInfo(t3.inviteID) || this._isHandling)
        return E2({ code: k2.INVALID_CANCEL_MESSAGE });
      this._isHandling = true;
      var o3, i4 = this._localSignalingHandler.createCancelCustomData(t3);
      return i4 ? (e4 = i4.groupID, o3 = i4.inviteeList, e4 = e4 || o3[0], o3 = this.createSignaling(i4, e4), this.sendSignaling(o3, t3).then(function(e5) {
        return n3._handleImResponse(i4, e5, true), 0 === e5.code ? y2(y2({}, e5), {}, { inviteID: t3.inviteID }) : e5;
      }).catch(function(e5) {
        return E2(e5);
      })) : (this._isHandling = false, E2({ code: k2.SIGNALING_NO_PERMISSION }));
    } }, { key: "accept", value: function(t3) {
      var n3 = this, e4 = "".concat(this._n, ".").concat("accept");
      if (M2.l("".concat(e4, " options:").concat(JSON.stringify(t3))), !this.hasInviteInfo(t3.inviteID) || this._isHandling)
        return E2({ code: k2.SIGNALING_INVALID_INVITE_ID });
      this._isHandling = true;
      var o3 = this._localSignalingHandler.createAcceptCustomData(t3);
      return o3 ? (e4 = this.createSignaling(o3), this.sendSignaling(e4, t3).then(function(e5) {
        return n3._handleImResponse(o3, e5), 0 === e5.code ? y2(y2({}, e5), {}, { inviteID: t3.inviteID }) : e5;
      }).catch(function(e5) {
        return E2(e5);
      })) : (this._isHandling = false, E2({ code: k2.SIGNALING_NO_PERMISSION }));
    } }, { key: "reject", value: function(t3) {
      var n3 = this, e4 = "".concat(this._n, ".").concat("reject");
      if (M2.l("".concat(e4, " options:").concat(JSON.stringify(t3))), !this.hasInviteInfo(t3.inviteID) || this._isHandling)
        return E2({ code: k2.SIGNALING_INVALID_INVITE_ID });
      this._isHandling = true;
      var o3 = this._localSignalingHandler.createRejectCustomData(t3);
      return o3 ? (e4 = this.createSignaling(o3), this.sendSignaling(e4, t3).then(function(e5) {
        return n3._handleImResponse(o3, e5, true), 0 === e5.code ? y2(y2({}, e5), {}, { inviteID: t3.inviteID }) : e5;
      }).catch(function(e5) {
        return E2(e5);
      })) : (this._isHandling = false, E2({ code: k2.SIGNALING_NO_PERMISSION }));
    } }, { key: "getSignalingInfo", value: function(e4) {
      var t3 = "".concat(this._n, ".getSignalingInfo"), n3 = e4.ID, o3 = e4.from, i4 = e4.to, a4 = this._filterSignaling(e4), s4 = null, e4 = (a4 && (e4 = this.getPayloadData(e4), s4 = new rs2(e4)), a4 ? "actionType:".concat(s4.actionType) : "");
      return M2.l("".concat(t3, " messageID:").concat(n3, " from:").concat(o3, " to:").concat(i4, " ") + "".concat(e4, " isSignaling:").concat(a4)), s4;
    } }, { key: "modifyInvitation", value: function(e4) {
      var t3, n3, o3, i4, a4 = this, s4 = e4.inviteID, e4 = e4.data;
      return this.hasInviteInfo(s4) ? (t3 = this.getInviteInfo(s4), n3 = t3.message, o3 = W2(t3, us2), i4 = n3.payload.data, o3.data = e4, n3.payload.data = JSON.stringify(o3), this.get(2).modifyRemoteMessage(n3).then(function(e5) {
        return a4.hasInviteInfo(s4) && a4.setInviteInfo(s4, y2(y2({}, o3), {}, { message: n3 })), e5;
      }).catch(function(e5) {
        return n3.payload.data = i4, E2(e5);
      })) : E2({ code: k2.SIGNALING_INVALID_INVITE_ID });
    } }, { key: "_genMsgCtrlInfo", value: function() {
      var e4 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t3 = e4.data, t3 = void 0 === t3 ? "" : t3, n3 = e4.onlineUserOnly, o3 = e4.inviteID, o3 = void 0 === o3 ? "" : o3, i4 = e4.offlinePushInfo, e4 = e4.actionType, a4 = { _onlineOnlyFlag: false }, o3 = { onlineUserOnly: (a4 = o3 && this.getInviteInfo(o3) ? this.getInviteInfo(o3).message : a4)._onlineOnlyFlag || n3 || false, offlinePushInfo: i4, messageControlInfo: { excludedFromContentModeration: true, excludedFromUnreadCount: false, excludedFromLastMessage: false } };
      return e4 === _2.ACTION_TYPE_INVITE_TIMEOUT ? (a4 = !!t3.match(/excludeTimeoutSignalingFromHistoryMessage/), o3.messageControlInfo.excludedFromUnreadCount = a4, o3.messageControlInfo.excludedFromLastMessage = a4) : (n3 = !!t3.match(/excludeFromHistoryMessage/), i4 = !!t3.match(/excludeOriginalSignalingFromHistoryMessage/), o3.messageControlInfo.excludedFromUnreadCount = n3 || i4, o3.messageControlInfo.excludedFromLastMessage = n3 || i4), o3;
    } }, { key: "sendSignaling", value: function(e4, t3) {
      var n3 = this;
      return this.get(2).sendMessageInstance(e4, this._genMsgCtrlInfo(t3)).catch(function(e5) {
        return n3._isHandling = false, E2(e5);
      });
    } }, { key: "filterMessageList", value: function(e4) {
      var t3 = this;
      return e4.filter(function(e5) {
        return t3._filterSignaling(e5);
      });
    } }, { key: "getPayloadData", value: function(e4) {
      return this._remoteSignalingHandler.getPayloadData(e4);
    } }, { key: "createSignaling", value: function(e4, t3) {
      var n3 = e4.groupID, o3 = e4.inviter, t3 = { to: t3 || n3 || o3, conversationType: n3 ? R2.CONV_GROUP : R2.CONV_C2C, priority: R2.MSG_PRIORITY_HIGH, payload: { data: JSON.stringify(e4) } }, o3 = this.get(2).createCustomMessage(t3);
      return M2.l("".concat(this._n, ".createSignaling. message:"), o3), o3;
    } }, { key: "_filterSignaling", value: function(e4) {
      var t3, n3, o3 = false;
      return e4.type && e4.type === R2.MSG_CUSTOM && (t3 = e4.cloudCustomData, e4 = void 0 === (e4 = e4.payload.data) ? "" : e4, t3 = (void 0 === t3 ? "" : t3).match(/"type":"tsignaling"/), n3 = e4.match(/inviteID/), e4 = e4.match(/actionType/), o3 = t3 || n3 && e4), !!o3;
    } }, { key: "startTimer", value: function(t3) {
      var n3, o3, i4, a4 = this, s4 = "".concat(this._n, ".startTimer"), e4 = t3.timeout, r3 = t3.inviteID, c4 = t3.inviter, u3 = t3.groupID, l3 = c4 === this.getMyUserID();
      M2.l("".concat(s4, " timeout:").concat(e4, " isInviter:").concat(l3, " groupID:").concat(u3)), e4 <= 0 || (n3 = l3 ? e4 + 5 : e4, o3 = 1, i4 = setInterval(function() {
        var e5 = a4._hasLocalInviteInfo(t3, l3);
        o3 < n3 && e5 ? ++o3 : (e5 && a4._sendTimeoutNotice(r3, l3), M2.l("".concat(s4, " end.")), clearInterval(i4));
      }, 1e3));
    } }, { key: "_hasLocalInviteInfo", value: function(e4, t3) {
      var n3, o3, i4 = e4.inviteID, e4 = e4.groupID;
      return !!this.hasInviteInfo(i4) && (n3 = "".concat(this._n, "._hasLocalInviteInfo"), o3 = this.getInviteInfo(i4).inviteeList, M2.l("".concat(n3, " inviteID:").concat(i4, " inviteeList:").concat(o3, " groupID:").concat(e4)), !e4 || (t3 ? 0 < o3.length : 0 < o3.length && o3.includes(this.getMyUserID())));
    } }, { key: "_getReceiver", value: function(e4, t3) {
      var n3 = t3.groupID, o3 = t3.inviteeList, t3 = t3.inviter;
      return e4 ? n3 || o3[0] : n3 || t3;
    } }, { key: "_sendTimeoutNotice", value: function(i4, a4) {
      var s4 = this, e4 = this.getInviteInfo(i4), t3 = this._getReceiver(a4, e4), r3 = (M2.l("".concat(this._n, "._sendTimeoutNotice inviteID:").concat(i4, " to:").concat(t3, " isInviter:").concat(a4)), this._localSignalingHandler.createTimeoutCustomData(y2(y2({}, e4), {}, { isInviter: a4 }))), c4 = this.createSignaling(r3, t3);
      return this.sendSignaling(c4, r3).then(function(e5) {
        var t4, n3, o3;
        e5 && 0 === e5.code && (e5 = r3.data, t4 = r3.groupID, n3 = r3.inviteeList, o3 = r3.inviter, s4.emitEvent(_2.INVITATION_TIMEOUT, { data: e5, groupID: t4, inviteID: i4, inviteeList: n3, inviter: o3, isSelfTimeout: true, message: c4 }), a4 ? s4.deleteInviteInfo(i4) : s4.updateInviteInfo(r3));
      });
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._inviteInfoMap.clear(), this._canIUseSignaling = false, this._isHandling = false, this._historySignalingHandler.reset(), this._isC2CUnreadHandleCompleted = false, this._isConvSyncCompleted = false, this._isSyncCompleted = false, this._isCloudConfigCompleted = false;
    } }])), ds2 = ["followDiffList"], ps2 = ["from"], _s2 = { NONE: 0, FOLLOWERS: 1, FOLLOWING: 2, MUTUAL: 3 }, hs2 = (t2(gs2, c3), e3(gs2, [{ key: "_onCloudConfig", value: function() {
      var e4 = this.getCloudConfig("follow_req_count");
      N2(e4) || (e4 = Number(e4), this.DEFAULT_COUNT = e4 > this.MAX_COUNT ? this.MAX_COUNT : e4, this._clearFollowList());
    } }, { key: "clearCacheOnReconnected", value: function() {
      this._clearFollowList();
    } }, { key: "onFollowNotify", value: function(e4) {
      var a4 = this, e4 = e4.dataList || [];
      M2.l("".concat(this._n, ".onFollowNotify followChangeList:").concat(e4.length)), e4.forEach(function(e5) {
        var t3 = e5.followDiffList, t3 = void 0 === t3 ? [] : t3, e5 = W2(e5, ds2), o3 = e5.from, i4 = W2(e5, ps2);
        t3.forEach(function(e6) {
          var t4 = e6.isAdd, e6 = e6.followType, e6 = void 0 === e6 ? 0 : e6, n3 = a4._initFollowInfo();
          1 === t4 ? (i4.userID = o3, n3[e6].userInfoList.push(i4), n3[e6].isAdd = true) : (n3[e6].userInfoList.push(o3), n3[e6].isAdd = false), a4._emitEvent(n3);
        });
      });
    } }, { key: "_initFollowInfo", value: function() {
      var t3 = {};
      return Object.values(_s2).forEach(function(e4) {
        e4 !== _s2.NONE && (t3[e4] = { userInfoList: [], isAdd: false });
      }), t3;
    } }, { key: "_emitEvent", value: function(n3) {
      var o3 = this;
      Object.keys(n3).forEach(function(e4) {
        var e4 = Number(e4), t3 = n3[e4];
        0 < t3.userInfoList.length && (e4 === _s2.FOLLOWERS && (o3._clearFollowList(_s2.FOLLOWERS), o3.emitOEvt(h3.MY_FOLLOWERS_LIST_UPDATED, t3)), e4 === _s2.FOLLOWING && (o3._clearFollowList(_s2.FOLLOWING), o3.emitOEvt(h3.MY_FOLLOWING_LIST_UPDATED, t3)), e4 === _s2.MUTUAL) && (o3._clearFollowList(_s2.MUTUAL), o3.emitOEvt(h3.MUTUAL_FOLLOWERS_LIST_UPDATED, t3));
      });
    } }, { key: "followUser", value: function(e4) {
      var t3, n3, o3;
      return this.canIUse(g2.FOLLOW) ? (t3 = "".concat(this._n, ".").concat("followUser"), n3 = "userIDList:".concat(e4.length), (o3 = new P2("followUser")).setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.FOLLOW, data: { fromAccount: this.getMyUserID(), userIDList: e4.map(function(e5) {
        return { userID: e5 };
      }) } }).then(function(e5) {
        return o3.end(), M2.l("".concat(t3, " ok.")), T2(e5.data.resultList);
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this.noUse("followUser");
    } }, { key: "unfollowUser", value: function(e4) {
      var t3, n3, o3;
      return this.canIUse(g2.FOLLOW) ? (t3 = "".concat(this._n, ".").concat("unfollowUser"), n3 = "userIDList:".concat(e4.length), (o3 = new P2("unfollowUser")).setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.UNFOLLOW, data: { fromAccount: this.getMyUserID(), userIDList: e4 } }).then(function(e5) {
        return o3.end(), M2.l("".concat(t3, " ok.")), T2(e5.data.resultList);
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this.noUse("unfollowUser");
    } }, { key: "getMyFollowersList", value: function() {
      var t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o3 = "getMyFollowersList";
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse(o3);
      var i4 = n3 || this.FIRST_PAGE_INDEX;
      if (this._myFollowersList.has(i4)) {
        var e4 = this._myFollowersList.get(i4), a4 = e4.resultList, s4 = e4.nextCursor, e4 = e4.lastUpdateTime;
        if (Date.now() - e4 < this.MAX_CATCH_TIME && 0 < a4.length)
          return M2.l("".concat(this._n, ".").concat(o3, " nextCursor:").concat(n3, " from local.")), D2({ resultList: a4, nextCursor: s4 });
      }
      return this._getFollowList(n3, _s2.FOLLOWERS).then(function(e5) {
        return t3._myFollowersList.set(i4, y2(y2({}, e5), {}, { lastUpdateTime: Date.now() })), M2.l("".concat(t3._n, ".").concat(o3, " nextCursor:").concat(n3, " from remote.")), T2(e5);
      });
    } }, { key: "getMyFollowingList", value: function() {
      var t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o3 = "getMyFollowingList";
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse(o3);
      var i4 = n3 || this.FIRST_PAGE_INDEX;
      if (this._myFollowingList.has(i4)) {
        var e4 = this._myFollowingList.get(i4), a4 = e4.resultList, s4 = e4.nextCursor, e4 = e4.lastUpdateTime;
        if (Date.now() - e4 < this.MAX_CATCH_TIME && 0 < a4.length)
          return M2.l("".concat(this._n, ".").concat(o3, " nextCursor:").concat(n3, " from local.")), D2({ resultList: a4, nextCursor: s4 });
      }
      return this._getFollowList(n3, _s2.FOLLOWING).then(function(e5) {
        return t3._myFollowingList.set(i4, y2(y2({}, e5), {}, { lastUpdateTime: Date.now() })), M2.l("".concat(t3._n, ".").concat(o3, " nextCursor:").concat(n3, " from remote.")), T2(e5);
      });
    } }, { key: "getMutualFollowersList", value: function() {
      var t3 = this, n3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o3 = "getMutualFollowersList";
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse(o3);
      var i4 = n3 || this.FIRST_PAGE_INDEX;
      if (this._myMutualFollowersList.has(i4)) {
        var e4 = this._myMutualFollowersList.get(i4), a4 = e4.resultList, s4 = e4.nextCursor, e4 = e4.lastUpdateTime;
        if (Date.now() - e4 < this.MAX_CATCH_TIME && 0 < a4.length)
          return M2.l("".concat(this._n, ".").concat(o3, " nextCursor:").concat(n3, " from local.")), D2({ resultList: a4, nextCursor: s4 });
      }
      return this._getFollowList(n3, _s2.MUTUAL).then(function(e5) {
        return t3._myMutualFollowersList.set(i4, y2(y2({}, e5), {}, { lastUpdateTime: Date.now() })), M2.l("".concat(t3._n, ".").concat(o3, " nextCursor:").concat(n3, " from remote.")), T2(e5);
      });
    } }, { key: "_getFollowList", value: function(e4, t3) {
      var i4 = this, n3 = new P2("_getFollowList");
      return n3.setMessage("nextCursor:".concat(e4, " type:").concat(t3)), this.req({ P: G2.GET_FOLLOW, data: { fromAccount: this.getMyUserID(), count: this.DEFAULT_COUNT, nextCursor: e4, type: t3 } }).then(function(e5) {
        n3.end();
        var e5 = e5.data, t4 = e5.resultList, t4 = void 0 === t4 ? [] : t4, e5 = e5.nextCursor, e5 = void 0 === e5 ? "" : e5, o3 = [];
        return t4.forEach(function(e6) {
          var t5 = e6.userID, n4 = e6.followTime, e6 = e6.profileList;
          o3.push(y2({ userID: t5, followTime: n4 }, i4._handleProfileItem(void 0 === e6 ? [] : e6)));
        }), { resultList: o3, nextCursor: e5 };
      }).catch(function(e5) {
        return n3.setError(e5).end(), M2.e("".concat(i4._n, "._getFollowList failed. error:"), e5), E2(e5);
      });
    } }, { key: "_handleProfileItem", value: function(e4) {
      var t3 = {};
      return e4.forEach(function(e5) {
        switch (e5.tag) {
          case f3.NICK:
            t3.nick = e5.value;
            break;
          case f3.GENDER:
            t3.gender = e5.value;
            break;
          case f3.BIRTHDAY:
            t3.birthday = e5.value;
            break;
          case f3.LOCATION:
            t3.location = e5.value;
            break;
          case f3.SELFSIGNATURE:
            t3.selfSignature = e5.value;
            break;
          case f3.ALLOWTYPE:
            t3.allowType = e5.value;
            break;
          case f3.LANGUAGE:
            t3.language = e5.value;
            break;
          case f3.AVATAR:
            t3.avatar = e5.value;
            break;
          case f3.MESSAGESETTINGS:
            t3.messageSettings = e5.value;
            break;
          case f3.ADMINFORBIDTYPE:
            t3.adminForbidType = e5.value;
            break;
          case f3.LEVEL:
            t3.level = e5.value;
            break;
          case f3.ROLE:
            t3.role = e5.value;
            break;
          default:
            t3[e5.tag] = e5.value;
        }
      }), t3;
    } }, { key: "getUserFollowInfo", value: function(e4) {
      var t3, n3, i4;
      return this.canIUse(g2.FOLLOW) ? (n3 = false, N2(e4 = e4) && (e4 = [this.getMyUserID()], n3 = true), t3 = "".concat(this._n, ".").concat("getUserFollowInfo"), n3 = "userIDList:".concat(e4.length, " isGetMyFollowInfo:").concat(n3), (i4 = new P2("getUserFollowInfo")).setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.GET_FOLLOW_INFO, data: { fromAccount: this.getMyUserID(), userIDList: e4 } }).then(function(e5) {
        i4.end(), M2.l("".concat(t3, " ok."));
        var e5 = e5.data.followInfoList, o3 = [];
        return (void 0 === e5 ? [] : e5).forEach(function(e6) {
          var t4 = e6.followersCount, n4 = e6.followingCount, e6 = e6.mutualFollowersCount;
          o3.push({ followersCount: t4, followingCount: n4, mutualFollowersCount: e6 });
        }), T2(o3);
      }).catch(function(e5) {
        return i4.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      })) : this.noUse("getUserFollowInfo");
    } }, { key: "checkFollowType", value: function(e4) {
      if (!this.canIUse(g2.FOLLOW))
        return this.noUse("checkFollowType");
      100 < e4.length && (e4 = e4.slice(0, 100), M2.w("".concat(t3, " ").concat(tn2(100))));
      var t3 = "".concat(this._n, ".").concat("checkFollowType"), n3 = "userIDList length:".concat(e4.length, " "), o3 = new P2("checkFollowType");
      return o3.setMessage(n3), M2.l("".concat(t3, " ").concat(n3)), this.req({ P: G2.CHECK_FOLLOW_TYPE, data: { fromAccount: this.getMyUserID(), userIDList: e4 } }).then(function(e5) {
        o3.end(), M2.l("".concat(t3, " ok."));
        var e5 = e5.data.resultList, n4 = [];
        return (void 0 === e5 ? [] : e5).forEach(function(e6) {
          var t4 = e6.userID, e6 = e6.followType;
          n4.push({ userID: t4, followType: e6 });
        }), T2(n4);
      }).catch(function(e5) {
        return o3.setError(e5).end(), M2.e("".concat(t3, " failed. error:"), e5), E2(e5);
      });
    } }, { key: "_clearFollowList", value: function(e4) {
      N2(e4) ? (this._myFollowersList.clear(), this._myFollowingList.clear(), this._myMutualFollowersList.clear()) : e4 !== _s2.FOLLOWERS ? e4 !== _s2.FOLLOWING ? e4 === _s2.MUTUAL && this._myMutualFollowersList.clear() : this._myFollowingList.clear() : this._myFollowersList.clear();
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._clearFollowList();
    } }])), ie3 = bi2(function(e4, t3) {
      var n3 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;
      t3.assign = function(e5) {
        for (var t4, n4, o4 = Array.prototype.slice.call(arguments, 1); o4.length; ) {
          var i5 = o4.shift();
          if (i5) {
            if ("object" !== z2(i5))
              throw new TypeError(i5 + "must be non-object");
            for (var a4 in i5)
              t4 = i5, n4 = a4, Object.prototype.hasOwnProperty.call(t4, n4) && (e5[a4] = i5[a4]);
          }
        }
        return e5;
      }, t3.shrinkBuf = function(e5, t4) {
        return e5.length === t4 ? e5 : e5.subarray ? e5.subarray(0, t4) : (e5.length = t4, e5);
      };
      var o3 = { arraySet: function(e5, t4, n4, o4, i5) {
        if (t4.subarray && e5.subarray)
          e5.set(t4.subarray(n4, n4 + o4), i5);
        else
          for (var a4 = 0; a4 < o4; a4++)
            e5[i5 + a4] = t4[n4 + a4];
      }, flattenChunks: function(e5) {
        for (var t4, n4, o4, i5 = 0, a4 = 0, s4 = e5.length; a4 < s4; a4++)
          i5 += e5[a4].length;
        for (o4 = new Uint8Array(i5), a4 = t4 = 0, s4 = e5.length; a4 < s4; a4++)
          n4 = e5[a4], o4.set(n4, t4), t4 += n4.length;
        return o4;
      } }, i4 = { arraySet: function(e5, t4, n4, o4, i5) {
        for (var a4 = 0; a4 < o4; a4++)
          e5[i5 + a4] = t4[n4 + a4];
      }, flattenChunks: function(e5) {
        return [].concat.apply([], e5);
      } };
      t3.setTyped = function(e5) {
        e5 ? (t3.Buf8 = Uint8Array, t3.Buf16 = Uint16Array, t3.Buf32 = Int32Array, t3.assign(t3, o3)) : (t3.Buf8 = Array, t3.Buf16 = Array, t3.Buf32 = Array, t3.assign(t3, i4));
      }, t3.setTyped(n3);
    });
    function gs2(e4) {
      return p3(this, gs2), (e4 = i3(this, gs2, [e4]))._n = "FollowModule", e4._myFollowersList = /* @__PURE__ */ new Map(), e4._myFollowingList = /* @__PURE__ */ new Map(), e4._myMutualFollowersList = /* @__PURE__ */ new Map(), e4.MAX_CATCH_TIME = 6e5, e4.FIRST_PAGE_INDEX = vt3(), e4.DEFAULT_COUNT = 500, e4.MAX_COUNT = 1e3, e4.getIEmitInst().on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function fs2(e4) {
      p3(this, fs2), (e4 = i3(this, fs2, [e4]))._n = "SignalingModule", e4._inviteInfoMap = /* @__PURE__ */ new Map(), e4._canIUseSignaling = false, e4._isHandling = false, e4._remoteSignalingHandler = new is2(e4), e4._localSignalingHandler = new as2(e4), e4._historySignalingHandler = new ss2(e4), e4._isC2CUnreadHandleCompleted = false, e4._isConvSyncCompleted = false, e4._isSyncCompleted = false, e4._isCloudConfigCompleted = false;
      var t3 = e4.getIEmitInst();
      return t3.on(U2.C2C_UNREAD_HANDLE_COMPLETED, e4.onC2CUnreadHandleCompleted, e4), t3.on(U2.CONV_SYNC_COMPLETED, e4.onConvSyncCompleted, e4), t3.on(U2.CLOUD_CONFIG, e4.onCloudConfig, e4), e4;
    }
    function ms2(e4) {
      return p3(this, ms2), (e4 = i3(this, ms2, [e4]))._n = "ProfanityFilterModule", e4._plugin = null, e4._filterConfigMap = /* @__PURE__ */ new Map(), e4._startIndex = 0, e4._version = 0, e4._canIUseLexicon = false, e4._isFetching = false, e4._expiredTime = 0, e4;
    }
    function vs2(e4) {
      var t3;
      return p3(this, vs2), (t3 = i3(this, vs2, [e4]))._m = e4, t3._n = "TIMPushModule", t3._pluginName = "TIMPush", t3._pushPlugin = void 0, t3._androidPushConfig = {}, t3._deviceToken = "", t3._businessID = 0, t3._iOSBusinessID = 0, t3._c2cUnreadCount = 0, t3._groupUnreadCount = 0, t3._isWebUniapp = 0, t3._deviceInfo = { notificationStatus: 0, deviceModel: "", systemVersion: "", pushVersion: "1.0.1", packageName: "" }, t3;
    }
    function Is2(e4) {
      var t3;
      return p3(this, Is2), (t3 = i3(this, Is2, [e4]))._m = e4, t3._n = "OfflinePushModule", t3._offlinePushPlugin = void 0, t3._androidPushConfig = { huaweiPushBussinessId: "", xiaomiPushBussinessId: "", xiaomiPushAppId: "", xiaomiPushAppKey: "", meizuPushBussinessId: "", meizuPushAppId: "", meizuPushAppKey: "", vivoPushBussinessId: "", fcmPushBussinessId: "", oppoPushBussinessId: "", oppoPushAppKey: "", oppoPushAppSecret: "", honorPushBussinessId: "" }, t3._deviceToken = "", t3._businessID = 0, t3._iosBusinessID = 0, t3._c2cUnreadCount = 0, t3._groupUnreadCount = 0, t3._isWebUniapp = 0, t3;
    }
    function Ms2(e4) {
      return p3(this, Ms2), (e4 = i3(this, Ms2, [e4]))._n = "WorkerTimerModule", e4._isWorkerEnabled = true, e4._workerTimer = null, e4._timerID = -1, e4._init(), e4.getIEmitInst().on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function ys2(e4) {
      return p3(this, ys2), (e4 = i3(this, ys2, [e4]))._n = "SnsModule", e4._friendHandler = new Ya(e4), e4._friendApplicationHandler = new Ka(e4), e4._friendGroupHandler = new Ja(e4), e4.getIEmitInst().on(U2.A2KEY_AND_TINYID_UPDATED, e4.onContextUpdated, e4), e4;
    }
    function Cs2(e4) {
      p3(this, Cs2), (e4 = i3(this, Cs2, [e4]))._n = "QualityStatModule", e4.TAG = "im-ssolog-quality-stat", e4.reportIndex = 0, e4.wholePeriod = false, e4._qualityItems = [Wn2, Yn2, jn2, Jn2, zn2, Xn2, Zn2, Qn2, $n2, eo2], e4._messageSentItems = [jn2, Jn2, zn2, Xn2, Zn2], e4._messageReceivedItems = [Qn2, $n2, eo2], e4.REPORT_INTERVAL = 120, e4.REPORT_SDKAPPID_BLACKLIST = [], e4.REPORT_TINYID_WHITELIST = [], e4._statInfoArr = [], e4._avgRTT = new qa2(), e4._avgE2EDelay = new Fa(), e4._rateMessageSent = new xa(), e4._rateMessageReceived = new Va();
      var t3 = e4.getIEmitInst();
      return t3.on(U2.A2KEY_AND_TINYID_UPDATED, e4._onLoginSuccess, e4), t3.on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    function Ts2(e4) {
      return p3(this, Ts2), (e4 = i3(this, Ts2, [e4]))._n = "RecoverMsgModule", e4.PULL_LIMIT_COUNT = 15, e4;
    }
    function Ds2(e4) {
      return p3(this, Ds2), (e4 = i3(this, Ds2, [e4]))._n = "CloudControlModule", e4._cloudConfig = /* @__PURE__ */ new Map(), e4._expiredTime = 0, e4._version = 0, e4._isFetching = false, e4;
    }
    function Es2(e4) {
      return p3(this, Es2), (e4 = i3(this, Es2, [e4]))._n = "SessionModule", e4._platform = e4.getPlatform(), e4._pHandler = new Ta(e4), e4._msgDispatcher = new Ea(e4), e4._cmdFreqLimitMap = /* @__PURE__ */ new Map(), e4._cmdReqInfoMap = /* @__PURE__ */ new Map(), e4._serverOverloadInfoMap = /* @__PURE__ */ new Map(), e4._incrementalPullContactFlag = true, e4._init(), e4.getIEmitInst().on(U2.CLOUD_CONFIG, e4._onCloudConfig, e4), e4;
    }
    ie3.assign, ie3.shrinkBuf, ie3.setTyped, ie3.Buf8, ie3.Buf16, ie3.Buf32;
    function Ls2(e4, t3, n3, o3) {
      for (var i4 = 65535 & e4 | 0, a4 = e4 >>> 16 & 65535 | 0, s4 = 0; 0 !== n3; ) {
        for (n3 -= s4 = 2e3 < n3 ? 2e3 : n3; a4 = a4 + (i4 = i4 + t3[o3++] | 0) | 0, --s4; )
          ;
        i4 %= 65521, a4 %= 65521;
      }
      return i4 | a4 << 16 | 0;
    }
    function Ss2(e4, t3, n3, o3) {
      var i4 = Rs2, a4 = o3 + n3;
      e4 ^= -1;
      for (var s4 = o3; s4 < a4; s4++)
        e4 = e4 >>> 8 ^ i4[255 & (e4 ^ t3[s4])];
      return -1 ^ e4;
    }
    function ks2(e4, t3, n3, o3, i4, a4, s4, r3) {
      for (var c4, u3, l3, d4, p4, _3, h4, g3, f4, m4 = r3.bits, v4 = 0, I3 = 0, M3 = 0, y3 = 0, C3 = 0, T3 = 0, D3 = 0, E3 = 0, L3 = 0, S3 = 0, k3 = null, R3 = 0, A3 = new ie3.Buf16(16), O3 = new ie3.Buf16(16), N3 = null, G3 = 0, v4 = 0; v4 <= 15; v4++)
        A3[v4] = 0;
      for (I3 = 0; I3 < o3; I3++)
        A3[t3[n3 + I3]]++;
      for (C3 = m4, y3 = 15; 1 <= y3 && 0 === A3[y3]; y3--)
        ;
      if (y3 < C3 && (C3 = y3), 0 === y3)
        i4[a4++] = 20971520, i4[a4++] = 20971520, r3.bits = 1;
      else {
        for (M3 = 1; M3 < y3 && 0 === A3[M3]; M3++)
          ;
        for (C3 < M3 && (C3 = M3), v4 = E3 = 1; v4 <= 15; v4++)
          if ((E3 = (E3 << 1) - A3[v4]) < 0)
            return -1;
        if (0 < E3 && (0 === e4 || 1 !== y3))
          return -1;
        for (O3[1] = 0, v4 = 1; v4 < 15; v4++)
          O3[v4 + 1] = O3[v4] + A3[v4];
        for (I3 = 0; I3 < o3; I3++)
          0 !== t3[n3 + I3] && (s4[O3[t3[n3 + I3]]++] = I3);
        if (_3 = 0 === e4 ? (k3 = N3 = s4, 19) : 1 === e4 ? (k3 = As2, R3 -= 257, N3 = Os2, G3 -= 257, 256) : (k3 = Ns2, N3 = Gs2, -1), v4 = M3, p4 = a4, D3 = I3 = S3 = 0, l3 = -1, d4 = (L3 = 1 << (T3 = C3)) - 1, 1 === e4 && 852 < L3 || 2 === e4 && 592 < L3)
          return 1;
        for (; ; ) {
          for (f4 = s4[I3] < _3 ? (g3 = 0, s4[I3]) : s4[I3] > _3 ? (g3 = N3[G3 + s4[I3]], k3[R3 + s4[I3]]) : (g3 = 96, 0), c4 = 1 << (h4 = v4 - D3), M3 = u3 = 1 << T3; i4[p4 + (S3 >> D3) + (u3 -= c4)] = h4 << 24 | g3 << 16 | f4 | 0, 0 !== u3; )
            ;
          for (c4 = 1 << v4 - 1; S3 & c4; )
            c4 >>= 1;
          if (0 !== c4 ? S3 = (S3 & c4 - 1) + c4 : S3 = 0, I3++, 0 == --A3[v4]) {
            if (v4 === y3)
              break;
            v4 = t3[n3 + s4[I3]];
          }
          if (C3 < v4 && (S3 & d4) !== l3) {
            for (p4 += M3, E3 = 1 << (T3 = v4 - (D3 = 0 === D3 ? C3 : D3)); T3 + D3 < y3 && !((E3 -= A3[T3 + D3]) <= 0); )
              T3++, E3 <<= 1;
            if (L3 += 1 << T3, 1 === e4 && 852 < L3 || 2 === e4 && 592 < L3)
              return 1;
            i4[l3 = S3 & d4] = C3 << 24 | T3 << 16 | p4 - a4 | 0;
          }
        }
        0 !== S3 && (i4[p4 + S3] = v4 - D3 << 24 | 64 << 16 | 0), r3.bits = C3;
      }
      return 0;
    }
    var Rs2 = function() {
      for (var e4 = [], t3 = 0; t3 < 256; t3++) {
        for (var n3 = t3, o3 = 0; o3 < 8; o3++)
          n3 = 1 & n3 ? 3988292384 ^ n3 >>> 1 : n3 >>> 1;
        e4[t3] = n3;
      }
      return e4;
    }(), As2 = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], Os2 = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], Ns2 = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], Gs2 = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
    function Ps2(e4) {
      return (e4 >>> 24 & 255) + (e4 >>> 8 & 65280) + ((65280 & e4) << 8) + ((255 & e4) << 24);
    }
    function Us2() {
      this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new ie3.Buf16(320), this.work = new ie3.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
    }
    function bs2(e4) {
      var t3;
      return e4 && e4.state ? (t3 = e4.state, e4.total_in = e4.total_out = t3.total = 0, e4.msg = "", t3.wrap && (e4.adler = 1 & t3.wrap), t3.mode = 1, t3.last = 0, t3.havedict = 0, t3.dmax = 32768, t3.head = null, t3.hold = 0, t3.bits = 0, t3.lencode = t3.lendyn = new ie3.Buf32(852), t3.distcode = t3.distdyn = new ie3.Buf32(592), t3.sane = 1, t3.back = -1, 0) : -2;
    }
    function ws2(e4) {
      var t3;
      return e4 && e4.state ? ((t3 = e4.state).wsize = 0, t3.whave = 0, t3.wnext = 0, bs2(e4)) : -2;
    }
    function Fs2(e4, t3) {
      var n3, o3;
      return !e4 || !e4.state || (o3 = e4.state, t3 < 0 ? (n3 = 0, t3 = -t3) : (n3 = 1 + (t3 >> 4), t3 < 48 && (t3 &= 15)), t3 && (t3 < 8 || 15 < t3)) ? -2 : (null !== o3.window && o3.wbits !== t3 && (o3.window = null), o3.wrap = n3, o3.wbits = t3, ws2(e4));
    }
    function qs2(e4, t3) {
      var n3;
      return e4 ? (n3 = new Us2(), (e4.state = n3).window = null, 0 !== (n3 = Fs2(e4, t3)) && (e4.state = null), n3) : -2;
    }
    var xs2, Vs2, Bs2 = true;
    function Hs2(e4, t3, n3, o3) {
      var i4, e4 = e4.state;
      return null === e4.window && (e4.wsize = 1 << e4.wbits, e4.wnext = 0, e4.whave = 0, e4.window = new ie3.Buf8(e4.wsize)), o3 >= e4.wsize ? (ie3.arraySet(e4.window, t3, n3 - e4.wsize, e4.wsize, 0), e4.wnext = 0, e4.whave = e4.wsize) : ((i4 = e4.wsize - e4.wnext) > o3 && (i4 = o3), ie3.arraySet(e4.window, t3, n3 - o3, i4, e4.wnext), (o3 -= i4) ? (ie3.arraySet(e4.window, t3, n3 - o3, o3, 0), e4.wnext = o3, e4.whave = e4.wsize) : (e4.wnext += i4, e4.wnext === e4.wsize && (e4.wnext = 0), e4.whave < e4.wsize && (e4.whave += i4))), 0;
    }
    var Ks2 = { inflateReset: ws2, inflateReset2: Fs2, inflateResetKeep: bs2, inflateInit: function(e4) {
      return qs2(e4, 15);
    }, inflateInit2: qs2, inflate: function(e4, b3) {
      var t3, n3, w3, o3, i4, a4, s4, r3, c4, F3, u3, l3, q3, x3, d4, p4, _3, h4, V3, B3, g3, f4, m4, v4, I3 = 0, M3 = new ie3.Buf8(4), H3 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
      if (!e4 || !e4.state || !e4.output || !e4.input && 0 !== e4.avail_in)
        return -2;
      12 === (t3 = e4.state).mode && (t3.mode = 13), i4 = e4.next_out, w3 = e4.output, s4 = e4.avail_out, o3 = e4.next_in, n3 = e4.input, a4 = e4.avail_in, r3 = t3.hold, c4 = t3.bits, F3 = a4, u3 = s4, f4 = 0;
      e:
        for (; ; )
          switch (t3.mode) {
            case 1:
              if (0 === t3.wrap)
                t3.mode = 13;
              else {
                for (; c4 < 16; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                if (2 & t3.wrap && 35615 === r3)
                  M3[t3.check = 0] = 255 & r3, M3[1] = r3 >>> 8 & 255, t3.check = Ss2(t3.check, M3, 2, 0), c4 = r3 = 0, t3.mode = 2;
                else if (t3.flags = 0, t3.head && (t3.head.done = false), !(1 & t3.wrap) || (((255 & r3) << 8) + (r3 >> 8)) % 31)
                  e4.msg = "incorrect header check", t3.mode = 30;
                else if (8 != (15 & r3))
                  e4.msg = "unknown compression method", t3.mode = 30;
                else {
                  if (c4 -= 4, g3 = 8 + (15 & (r3 >>>= 4)), 0 === t3.wbits)
                    t3.wbits = g3;
                  else if (g3 > t3.wbits) {
                    e4.msg = "invalid window size", t3.mode = 30;
                    break;
                  }
                  t3.dmax = 1 << g3, e4.adler = t3.check = 1, t3.mode = 512 & r3 ? 10 : 12, c4 = r3 = 0;
                }
              }
              break;
            case 2:
              for (; c4 < 16; ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              if (t3.flags = r3, 8 != (255 & t3.flags)) {
                e4.msg = "unknown compression method", t3.mode = 30;
                break;
              }
              if (57344 & t3.flags) {
                e4.msg = "unknown header flags set", t3.mode = 30;
                break;
              }
              t3.head && (t3.head.text = r3 >> 8 & 1), 512 & t3.flags && (M3[0] = 255 & r3, M3[1] = r3 >>> 8 & 255, t3.check = Ss2(t3.check, M3, 2, 0)), c4 = r3 = 0, t3.mode = 3;
            case 3:
              for (; c4 < 32; ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              t3.head && (t3.head.time = r3), 512 & t3.flags && (M3[0] = 255 & r3, M3[1] = r3 >>> 8 & 255, M3[2] = r3 >>> 16 & 255, M3[3] = r3 >>> 24 & 255, t3.check = Ss2(t3.check, M3, 4, 0)), c4 = r3 = 0, t3.mode = 4;
            case 4:
              for (; c4 < 16; ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              t3.head && (t3.head.xflags = 255 & r3, t3.head.os = r3 >> 8), 512 & t3.flags && (M3[0] = 255 & r3, M3[1] = r3 >>> 8 & 255, t3.check = Ss2(t3.check, M3, 2, 0)), c4 = r3 = 0, t3.mode = 5;
            case 5:
              if (1024 & t3.flags) {
                for (; c4 < 16; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                t3.length = r3, t3.head && (t3.head.extra_len = r3), 512 & t3.flags && (M3[0] = 255 & r3, M3[1] = r3 >>> 8 & 255, t3.check = Ss2(t3.check, M3, 2, 0)), c4 = r3 = 0;
              } else
                t3.head && (t3.head.extra = null);
              t3.mode = 6;
            case 6:
              if (1024 & t3.flags && ((l3 = (l3 = t3.length) > a4 ? a4 : l3) && (t3.head && (g3 = t3.head.extra_len - t3.length, t3.head.extra || (t3.head.extra = new Array(t3.head.extra_len)), ie3.arraySet(t3.head.extra, n3, o3, l3, g3)), 512 & t3.flags && (t3.check = Ss2(t3.check, n3, l3, o3)), a4 -= l3, o3 += l3, t3.length -= l3), t3.length))
                break e;
              t3.length = 0, t3.mode = 7;
            case 7:
              if (2048 & t3.flags) {
                if (0 === a4)
                  break e;
                for (l3 = 0; g3 = n3[o3 + l3++], t3.head && g3 && t3.length < 65536 && (t3.head.name += String.fromCharCode(g3)), g3 && l3 < a4; )
                  ;
                if (512 & t3.flags && (t3.check = Ss2(t3.check, n3, l3, o3)), a4 -= l3, o3 += l3, g3)
                  break e;
              } else
                t3.head && (t3.head.name = null);
              t3.length = 0, t3.mode = 8;
            case 8:
              if (4096 & t3.flags) {
                if (0 === a4)
                  break e;
                for (l3 = 0; g3 = n3[o3 + l3++], t3.head && g3 && t3.length < 65536 && (t3.head.comment += String.fromCharCode(g3)), g3 && l3 < a4; )
                  ;
                if (512 & t3.flags && (t3.check = Ss2(t3.check, n3, l3, o3)), a4 -= l3, o3 += l3, g3)
                  break e;
              } else
                t3.head && (t3.head.comment = null);
              t3.mode = 9;
            case 9:
              if (512 & t3.flags) {
                for (; c4 < 16; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                if (r3 !== (65535 & t3.check)) {
                  e4.msg = "header crc mismatch", t3.mode = 30;
                  break;
                }
                c4 = r3 = 0;
              }
              t3.head && (t3.head.hcrc = t3.flags >> 9 & 1, t3.head.done = true), e4.adler = t3.check = 0, t3.mode = 12;
              break;
            case 10:
              for (; c4 < 32; ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              e4.adler = t3.check = Ps2(r3), c4 = r3 = 0, t3.mode = 11;
            case 11:
              if (0 === t3.havedict)
                return e4.next_out = i4, e4.avail_out = s4, e4.next_in = o3, e4.avail_in = a4, t3.hold = r3, t3.bits = c4, 2;
              e4.adler = t3.check = 1, t3.mode = 12;
            case 12:
              if (5 === b3 || 6 === b3)
                break e;
            case 13:
              if (t3.last)
                r3 >>>= 7 & c4, c4 -= 7 & c4, t3.mode = 27;
              else {
                for (; c4 < 3; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                switch (t3.last = 1 & r3, --c4, 3 & (r3 >>>= 1)) {
                  case 0:
                    t3.mode = 14;
                    break;
                  case 1:
                    y3 = C3 = void 0;
                    var y3, C3 = t3;
                    if (Bs2) {
                      for (xs2 = new ie3.Buf32(512), Vs2 = new ie3.Buf32(32), y3 = 0; y3 < 144; )
                        C3.lens[y3++] = 8;
                      for (; y3 < 256; )
                        C3.lens[y3++] = 9;
                      for (; y3 < 280; )
                        C3.lens[y3++] = 7;
                      for (; y3 < 288; )
                        C3.lens[y3++] = 8;
                      for (ks2(1, C3.lens, 0, 288, xs2, 0, C3.work, { bits: 9 }), y3 = 0; y3 < 32; )
                        C3.lens[y3++] = 5;
                      ks2(2, C3.lens, 0, 32, Vs2, 0, C3.work, { bits: 5 }), Bs2 = false;
                    }
                    if (C3.lencode = xs2, C3.lenbits = 9, C3.distcode = Vs2, C3.distbits = 5, t3.mode = 20, 6 !== b3)
                      break;
                    r3 >>>= 2, c4 -= 2;
                    break e;
                  case 2:
                    t3.mode = 17;
                    break;
                  case 3:
                    e4.msg = "invalid block type", t3.mode = 30;
                }
                r3 >>>= 2, c4 -= 2;
              }
              break;
            case 14:
              for (r3 >>>= 7 & c4, c4 -= 7 & c4; c4 < 32; ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              if ((65535 & r3) != (r3 >>> 16 ^ 65535)) {
                e4.msg = "invalid stored block lengths", t3.mode = 30;
                break;
              }
              if (t3.length = 65535 & r3, c4 = r3 = 0, t3.mode = 15, 6 === b3)
                break e;
            case 15:
              t3.mode = 16;
            case 16:
              if (l3 = t3.length) {
                if (0 === (l3 = s4 < (l3 = a4 < l3 ? a4 : l3) ? s4 : l3))
                  break e;
                ie3.arraySet(w3, n3, o3, l3, i4), a4 -= l3, o3 += l3, s4 -= l3, i4 += l3, t3.length -= l3;
              } else
                t3.mode = 12;
              break;
            case 17:
              for (; c4 < 14; ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              if (t3.nlen = 257 + (31 & r3), r3 >>>= 5, c4 -= 5, t3.ndist = 1 + (31 & r3), r3 >>>= 5, c4 -= 5, t3.ncode = 4 + (15 & r3), r3 >>>= 4, c4 -= 4, 286 < t3.nlen || 30 < t3.ndist) {
                e4.msg = "too many length or distance symbols", t3.mode = 30;
                break;
              }
              t3.have = 0, t3.mode = 18;
            case 18:
              for (; t3.have < t3.ncode; ) {
                for (; c4 < 3; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                t3.lens[H3[t3.have++]] = 7 & r3, r3 >>>= 3, c4 -= 3;
              }
              for (; t3.have < 19; )
                t3.lens[H3[t3.have++]] = 0;
              if (t3.lencode = t3.lendyn, t3.lenbits = 7, m4 = { bits: t3.lenbits }, f4 = ks2(0, t3.lens, 0, 19, t3.lencode, 0, t3.work, m4), t3.lenbits = m4.bits, f4) {
                e4.msg = "invalid code lengths set", t3.mode = 30;
                break;
              }
              t3.have = 0, t3.mode = 19;
            case 19:
              for (; t3.have < t3.nlen + t3.ndist; ) {
                for (; p4 = (I3 = t3.lencode[r3 & (1 << t3.lenbits) - 1]) >>> 16 & 255, _3 = 65535 & I3, !((d4 = I3 >>> 24) <= c4); ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                if (_3 < 16)
                  r3 >>>= d4, c4 -= d4, t3.lens[t3.have++] = _3;
                else {
                  if (16 === _3) {
                    for (v4 = d4 + 2; c4 < v4; ) {
                      if (0 === a4)
                        break e;
                      a4--, r3 += n3[o3++] << c4, c4 += 8;
                    }
                    if (r3 >>>= d4, c4 -= d4, 0 === t3.have) {
                      e4.msg = "invalid bit length repeat", t3.mode = 30;
                      break;
                    }
                    g3 = t3.lens[t3.have - 1], l3 = 3 + (3 & r3), r3 >>>= 2, c4 -= 2;
                  } else if (17 === _3) {
                    for (v4 = d4 + 3; c4 < v4; ) {
                      if (0 === a4)
                        break e;
                      a4--, r3 += n3[o3++] << c4, c4 += 8;
                    }
                    g3 = 0, l3 = 3 + (7 & (r3 >>>= d4)), r3 >>>= 3, c4 = c4 - d4 - 3;
                  } else {
                    for (v4 = d4 + 7; c4 < v4; ) {
                      if (0 === a4)
                        break e;
                      a4--, r3 += n3[o3++] << c4, c4 += 8;
                    }
                    g3 = 0, l3 = 11 + (127 & (r3 >>>= d4)), r3 >>>= 7, c4 = c4 - d4 - 7;
                  }
                  if (t3.have + l3 > t3.nlen + t3.ndist) {
                    e4.msg = "invalid bit length repeat", t3.mode = 30;
                    break;
                  }
                  for (; l3--; )
                    t3.lens[t3.have++] = g3;
                }
              }
              if (30 === t3.mode)
                break;
              if (0 === t3.lens[256]) {
                e4.msg = "invalid code -- missing end-of-block", t3.mode = 30;
                break;
              }
              if (t3.lenbits = 9, m4 = { bits: t3.lenbits }, f4 = ks2(1, t3.lens, 0, t3.nlen, t3.lencode, 0, t3.work, m4), t3.lenbits = m4.bits, f4) {
                e4.msg = "invalid literal/lengths set", t3.mode = 30;
                break;
              }
              if (t3.distbits = 6, t3.distcode = t3.distdyn, m4 = { bits: t3.distbits }, f4 = ks2(2, t3.lens, t3.nlen, t3.ndist, t3.distcode, 0, t3.work, m4), t3.distbits = m4.bits, f4) {
                e4.msg = "invalid distances set", t3.mode = 30;
                break;
              }
              if (t3.mode = 20, 6 === b3)
                break e;
            case 20:
              t3.mode = 21;
            case 21:
              if (6 <= a4 && 258 <= s4) {
                e4.next_out = i4, e4.avail_out = s4, e4.next_in = o3, e4.avail_in = a4, t3.hold = r3, t3.bits = c4, G3 = W3 = k3 = S3 = L3 = E3 = D3 = T3 = oe3 = ne3 = te4 = ee4 = U3 = P3 = $4 = Q4 = Z3 = X4 = z3 = J4 = j3 = N3 = Y3 = O3 = A3 = void 0;
                var T3, D3, E3, L3, S3, k3, R3 = e4, K3 = u3, A3 = R3.state, O3 = R3.next_in, W3 = R3.input, Y3 = O3 + (R3.avail_in - 5), N3 = R3.next_out, G3 = R3.output, j3 = N3 - (K3 - R3.avail_out), J4 = N3 + (R3.avail_out - 257), z3 = A3.dmax, X4 = A3.wsize, Z3 = A3.whave, Q4 = A3.wnext, $4 = A3.window, P3 = A3.hold, U3 = A3.bits, ee4 = A3.lencode, te4 = A3.distcode, ne3 = (1 << A3.lenbits) - 1, oe3 = (1 << A3.distbits) - 1;
                t:
                  do {
                    for (U3 < 15 && (P3 += W3[O3++] << U3, U3 += 8, P3 += W3[O3++] << U3, U3 += 8), T3 = ee4[P3 & ne3]; ; ) {
                      if (P3 >>>= D3 = T3 >>> 24, U3 -= D3, 0 == (D3 = T3 >>> 16 & 255))
                        G3[N3++] = 65535 & T3;
                      else {
                        if (!(16 & D3)) {
                          if (0 == (64 & D3)) {
                            T3 = ee4[(65535 & T3) + (P3 & (1 << D3) - 1)];
                            continue;
                          }
                          if (32 & D3) {
                            A3.mode = 12;
                            break t;
                          }
                          R3.msg = "invalid literal/length code", A3.mode = 30;
                          break t;
                        }
                        for (E3 = 65535 & T3, (D3 &= 15) && (U3 < D3 && (P3 += W3[O3++] << U3, U3 += 8), E3 += P3 & (1 << D3) - 1, P3 >>>= D3, U3 -= D3), U3 < 15 && (P3 += W3[O3++] << U3, U3 += 8, P3 += W3[O3++] << U3, U3 += 8), T3 = te4[P3 & oe3]; ; ) {
                          if (P3 >>>= D3 = T3 >>> 24, U3 -= D3, !(16 & (D3 = T3 >>> 16 & 255))) {
                            if (0 == (64 & D3)) {
                              T3 = te4[(65535 & T3) + (P3 & (1 << D3) - 1)];
                              continue;
                            }
                            R3.msg = "invalid distance code", A3.mode = 30;
                            break t;
                          }
                          if (L3 = 65535 & T3, U3 < (D3 &= 15) && (P3 += W3[O3++] << U3, (U3 += 8) < D3) && (P3 += W3[O3++] << U3, U3 += 8), (L3 += P3 & (1 << D3) - 1) > z3) {
                            R3.msg = "invalid distance too far back", A3.mode = 30;
                            break t;
                          }
                          if (P3 >>>= D3, U3 -= D3, L3 > (D3 = N3 - j3)) {
                            if ((D3 = L3 - D3) > Z3 && A3.sane) {
                              R3.msg = "invalid distance too far back", A3.mode = 30;
                              break t;
                            }
                            if (k3 = $4, (S3 = 0) === Q4) {
                              if (S3 += X4 - D3, D3 < E3) {
                                for (E3 -= D3; G3[N3++] = $4[S3++], --D3; )
                                  ;
                                S3 = N3 - L3, k3 = G3;
                              }
                            } else if (Q4 < D3) {
                              if (S3 += X4 + Q4 - D3, (D3 -= Q4) < E3) {
                                for (E3 -= D3; G3[N3++] = $4[S3++], --D3; )
                                  ;
                                if (S3 = 0, Q4 < E3) {
                                  for (E3 -= D3 = Q4; G3[N3++] = $4[S3++], --D3; )
                                    ;
                                  S3 = N3 - L3, k3 = G3;
                                }
                              }
                            } else if (S3 += Q4 - D3, D3 < E3) {
                              for (E3 -= D3; G3[N3++] = $4[S3++], --D3; )
                                ;
                              S3 = N3 - L3, k3 = G3;
                            }
                            for (; 2 < E3; )
                              G3[N3++] = k3[S3++], G3[N3++] = k3[S3++], G3[N3++] = k3[S3++], E3 -= 3;
                            E3 && (G3[N3++] = k3[S3++], 1 < E3) && (G3[N3++] = k3[S3++]);
                          } else {
                            for (S3 = N3 - L3; G3[N3++] = G3[S3++], G3[N3++] = G3[S3++], G3[N3++] = G3[S3++], 2 < (E3 -= 3); )
                              ;
                            E3 && (G3[N3++] = G3[S3++], 1 < E3) && (G3[N3++] = G3[S3++]);
                          }
                          break;
                        }
                      }
                      break;
                    }
                  } while (O3 < Y3 && N3 < J4);
                O3 -= E3 = U3 >> 3, P3 &= (1 << (U3 -= E3 << 3)) - 1, R3.next_in = O3, R3.next_out = N3, R3.avail_in = O3 < Y3 ? Y3 - O3 + 5 : 5 - (O3 - Y3), R3.avail_out = N3 < J4 ? J4 - N3 + 257 : 257 - (N3 - J4), A3.hold = P3, A3.bits = U3, i4 = e4.next_out, w3 = e4.output, s4 = e4.avail_out, o3 = e4.next_in, n3 = e4.input, a4 = e4.avail_in, r3 = t3.hold, c4 = t3.bits, 12 === t3.mode && (t3.back = -1);
                break;
              }
              for (t3.back = 0; p4 = (I3 = t3.lencode[r3 & (1 << t3.lenbits) - 1]) >>> 16 & 255, _3 = 65535 & I3, !((d4 = I3 >>> 24) <= c4); ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              if (p4 && 0 == (240 & p4)) {
                for (h4 = d4, V3 = p4, B3 = _3; p4 = (I3 = t3.lencode[B3 + ((r3 & (1 << h4 + V3) - 1) >> h4)]) >>> 16 & 255, _3 = 65535 & I3, !(h4 + (d4 = I3 >>> 24) <= c4); ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                r3 >>>= h4, c4 -= h4, t3.back += h4;
              }
              if (r3 >>>= d4, c4 -= d4, t3.back += d4, t3.length = _3, 0 === p4) {
                t3.mode = 26;
                break;
              }
              if (32 & p4) {
                t3.back = -1, t3.mode = 12;
                break;
              }
              if (64 & p4) {
                e4.msg = "invalid literal/length code", t3.mode = 30;
                break;
              }
              t3.extra = 15 & p4, t3.mode = 22;
            case 22:
              if (t3.extra) {
                for (v4 = t3.extra; c4 < v4; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                t3.length += r3 & (1 << t3.extra) - 1, r3 >>>= t3.extra, c4 -= t3.extra, t3.back += t3.extra;
              }
              t3.was = t3.length, t3.mode = 23;
            case 23:
              for (; p4 = (I3 = t3.distcode[r3 & (1 << t3.distbits) - 1]) >>> 16 & 255, _3 = 65535 & I3, !((d4 = I3 >>> 24) <= c4); ) {
                if (0 === a4)
                  break e;
                a4--, r3 += n3[o3++] << c4, c4 += 8;
              }
              if (0 == (240 & p4)) {
                for (h4 = d4, V3 = p4, B3 = _3; p4 = (I3 = t3.distcode[B3 + ((r3 & (1 << h4 + V3) - 1) >> h4)]) >>> 16 & 255, _3 = 65535 & I3, !(h4 + (d4 = I3 >>> 24) <= c4); ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                r3 >>>= h4, c4 -= h4, t3.back += h4;
              }
              if (r3 >>>= d4, c4 -= d4, t3.back += d4, 64 & p4) {
                e4.msg = "invalid distance code", t3.mode = 30;
                break;
              }
              t3.offset = _3, t3.extra = 15 & p4, t3.mode = 24;
            case 24:
              if (t3.extra) {
                for (v4 = t3.extra; c4 < v4; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                t3.offset += r3 & (1 << t3.extra) - 1, r3 >>>= t3.extra, c4 -= t3.extra, t3.back += t3.extra;
              }
              if (t3.offset > t3.dmax) {
                e4.msg = "invalid distance too far back", t3.mode = 30;
                break;
              }
              t3.mode = 25;
            case 25:
              if (0 === s4)
                break e;
              if (t3.offset > (l3 = u3 - s4)) {
                if ((l3 = t3.offset - l3) > t3.whave && t3.sane) {
                  e4.msg = "invalid distance too far back", t3.mode = 30;
                  break;
                }
                q3 = l3 > t3.wnext ? (l3 -= t3.wnext, t3.wsize - l3) : t3.wnext - l3, l3 > t3.length && (l3 = t3.length), x3 = t3.window;
              } else
                x3 = w3, q3 = i4 - t3.offset, l3 = t3.length;
              for (s4 -= l3 = s4 < l3 ? s4 : l3, t3.length -= l3; w3[i4++] = x3[q3++], --l3; )
                ;
              0 === t3.length && (t3.mode = 21);
              break;
            case 26:
              if (0 === s4)
                break e;
              w3[i4++] = t3.length, s4--, t3.mode = 21;
              break;
            case 27:
              if (t3.wrap) {
                for (; c4 < 32; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 |= n3[o3++] << c4, c4 += 8;
                }
                if (u3 -= s4, e4.total_out += u3, t3.total += u3, u3 && (e4.adler = t3.check = (t3.flags ? Ss2 : Ls2)(t3.check, w3, u3, i4 - u3)), u3 = s4, (t3.flags ? r3 : Ps2(r3)) !== t3.check) {
                  e4.msg = "incorrect data check", t3.mode = 30;
                  break;
                }
                c4 = r3 = 0;
              }
              t3.mode = 28;
            case 28:
              if (t3.wrap && t3.flags) {
                for (; c4 < 32; ) {
                  if (0 === a4)
                    break e;
                  a4--, r3 += n3[o3++] << c4, c4 += 8;
                }
                if (r3 !== (4294967295 & t3.total)) {
                  e4.msg = "incorrect length check", t3.mode = 30;
                  break;
                }
                c4 = r3 = 0;
              }
              t3.mode = 29;
            case 29:
              f4 = 1;
              break e;
            case 30:
              f4 = -3;
              break e;
            case 31:
              return -4;
            default:
              return -2;
          }
      return e4.next_out = i4, e4.avail_out = s4, e4.next_in = o3, e4.avail_in = a4, t3.hold = r3, t3.bits = c4, (t3.wsize || u3 !== e4.avail_out && t3.mode < 30 && (t3.mode < 27 || 4 !== b3)) && Hs2(e4, e4.output, e4.next_out, u3 - e4.avail_out), F3 -= e4.avail_in, u3 -= e4.avail_out, e4.total_in += F3, e4.total_out += u3, t3.total += u3, t3.wrap && u3 && (e4.adler = t3.check = (t3.flags ? Ss2 : Ls2)(t3.check, w3, u3, e4.next_out - u3)), e4.data_type = t3.bits + (t3.last ? 64 : 0) + (12 === t3.mode ? 128 : 0) + (20 === t3.mode || 15 === t3.mode ? 256 : 0), f4 = (0 == F3 && 0 === u3 || 4 === b3) && 0 === f4 ? -5 : f4;
    }, inflateEnd: function(e4) {
      var t3;
      return e4 && e4.state ? ((t3 = e4.state).window && (t3.window = null), e4.state = null, 0) : -2;
    }, inflateGetHeader: function(e4, t3) {
      return !e4 || !e4.state || 0 == (2 & (e4 = e4.state).wrap) ? -2 : ((e4.head = t3).done = false, 0);
    }, inflateSetDictionary: function(e4, t3) {
      var n3, o3 = t3.length;
      return !e4 || !e4.state || 0 !== (n3 = e4.state).wrap && 11 !== n3.mode ? -2 : 11 === n3.mode && Ls2(1, t3, o3, 0) !== n3.check ? -3 : Hs2(e4, t3, o3, o3) ? (n3.mode = 31, -4) : (n3.havedict = 1, 0);
    }, inflateInfo: "pako inflate (from Nodeca project)" }, Ws2 = true, Ys2 = true;
    try {
      String.fromCharCode.apply(null, [0]);
    } catch (e4) {
      Ws2 = false;
    }
    try {
      String.fromCharCode.apply(null, new Uint8Array(1));
    } catch (e4) {
      Ys2 = false;
    }
    for (var js2 = new ie3.Buf8(256), Js2 = 0; Js2 < 256; Js2++)
      js2[Js2] = 252 <= Js2 ? 6 : 248 <= Js2 ? 5 : 240 <= Js2 ? 4 : 224 <= Js2 ? 3 : 192 <= Js2 ? 2 : 1;
    js2[254] = js2[254] = 1;
    function zs2(e4, t3) {
      for (var n3, o3, i4 = t3 || e4.length, a4 = new Array(2 * i4), s4 = 0, r3 = 0; r3 < i4; )
        if ((n3 = e4[r3++]) < 128)
          a4[s4++] = n3;
        else if (4 < (o3 = js2[n3]))
          a4[s4++] = 65533, r3 += o3 - 1;
        else {
          for (n3 &= 2 === o3 ? 31 : 3 === o3 ? 15 : 7; 1 < o3 && r3 < i4; )
            n3 = n3 << 6 | 63 & e4[r3++], o3--;
          1 < o3 ? a4[s4++] = 65533 : n3 < 65536 ? a4[s4++] = n3 : (n3 -= 65536, a4[s4++] = 55296 | n3 >> 10 & 1023, a4[s4++] = 56320 | 1023 & n3);
        }
      var c4 = a4, u3 = s4;
      if (u3 < 65534 && (c4.subarray && Ys2 || !c4.subarray && Ws2))
        return String.fromCharCode.apply(null, ie3.shrinkBuf(c4, u3));
      for (var l3 = "", d4 = 0; d4 < u3; d4++)
        l3 += String.fromCharCode(c4[d4]);
      return l3;
    }
    function Xs2() {
      this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
    }
    function Zs2() {
      this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = false;
    }
    var Qs2 = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }, $s2 = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }, er = Object.prototype.toString;
    function tr(e4) {
      if (!(this instanceof tr))
        return new tr(e4);
      this.options = ie3.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e4 || {});
      var t3 = this.options, e4 = (t3.raw && 0 <= t3.windowBits && t3.windowBits < 16 && (t3.windowBits = -t3.windowBits, 0 === t3.windowBits) && (t3.windowBits = -15), !(0 <= t3.windowBits && t3.windowBits < 16) || e4 && e4.windowBits || (t3.windowBits += 32), 15 < t3.windowBits && t3.windowBits < 48 && 0 == (15 & t3.windowBits) && (t3.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new Xs2(), this.strm.avail_out = 0, Ks2.inflateInit2(this.strm, t3.windowBits));
      if (e4 !== Qs2.Z_OK)
        throw new Error($s2[e4]);
      if (this.header = new Zs2(), Ks2.inflateGetHeader(this.strm, this.header), t3.dictionary && ("string" == typeof t3.dictionary ? t3.dictionary = function(e5) {
        for (var t4, n3, o3, i4, a4 = e5.length, s4 = 0, r3 = 0; r3 < a4; r3++)
          55296 == (64512 & (n3 = e5.charCodeAt(r3))) && r3 + 1 < a4 && 56320 == (64512 & (o3 = e5.charCodeAt(r3 + 1))) && (n3 = 65536 + (n3 - 55296 << 10) + (o3 - 56320), r3++), s4 += n3 < 128 ? 1 : n3 < 2048 ? 2 : n3 < 65536 ? 3 : 4;
        for (t4 = new ie3.Buf8(s4), r3 = i4 = 0; i4 < s4; r3++)
          55296 == (64512 & (n3 = e5.charCodeAt(r3))) && r3 + 1 < a4 && 56320 == (64512 & (o3 = e5.charCodeAt(r3 + 1))) && (n3 = 65536 + (n3 - 55296 << 10) + (o3 - 56320), r3++), n3 < 128 ? t4[i4++] = n3 : (n3 < 2048 ? t4[i4++] = 192 | n3 >>> 6 : (n3 < 65536 ? t4[i4++] = 224 | n3 >>> 12 : (t4[i4++] = 240 | n3 >>> 18, t4[i4++] = 128 | n3 >>> 12 & 63), t4[i4++] = 128 | n3 >>> 6 & 63), t4[i4++] = 128 | 63 & n3);
        return t4;
      }(t3.dictionary) : "[object ArrayBuffer]" === er.call(t3.dictionary) && (t3.dictionary = new Uint8Array(t3.dictionary)), t3.raw) && (e4 = Ks2.inflateSetDictionary(this.strm, t3.dictionary)) !== Qs2.Z_OK)
        throw new Error($s2[e4]);
    }
    function nr(e4, t3) {
      t3 = new tr(t3);
      if (t3.push(e4, true), t3.err)
        throw t3.msg || $s2[t3.err];
      return t3.result;
    }
    tr.prototype.push = function(e4, t3) {
      var n3, o3, i4, a4, s4, r3 = this.strm, c4 = this.options.chunkSize, u3 = this.options.dictionary, l3 = false;
      if (this.ended)
        return false;
      o3 = t3 === ~~t3 ? t3 : true === t3 ? Qs2.Z_FINISH : Qs2.Z_NO_FLUSH, "string" == typeof e4 ? r3.input = function(e5) {
        for (var t4 = new ie3.Buf8(e5.length), n4 = 0, o4 = t4.length; n4 < o4; n4++)
          t4[n4] = e5.charCodeAt(n4);
        return t4;
      }(e4) : "[object ArrayBuffer]" === er.call(e4) ? r3.input = new Uint8Array(e4) : r3.input = e4, r3.next_in = 0, r3.avail_in = r3.input.length;
      do {
        if (0 === r3.avail_out && (r3.output = new ie3.Buf8(c4), r3.next_out = 0, r3.avail_out = c4), (n3 = (n3 = Ks2.inflate(r3, Qs2.Z_NO_FLUSH)) === Qs2.Z_NEED_DICT && u3 ? Ks2.inflateSetDictionary(this.strm, u3) : n3) === Qs2.Z_BUF_ERROR && true === l3 && (n3 = Qs2.Z_OK, l3 = false), n3 !== Qs2.Z_STREAM_END && n3 !== Qs2.Z_OK)
          return this.onEnd(n3), !(this.ended = true);
        !r3.next_out || 0 !== r3.avail_out && n3 !== Qs2.Z_STREAM_END && (0 !== r3.avail_in || o3 !== Qs2.Z_FINISH && o3 !== Qs2.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i4 = function(e5, t4) {
          for (var n4 = (t4 = (t4 = t4 || e5.length) > e5.length ? e5.length : t4) - 1; 0 <= n4 && 128 == (192 & e5[n4]); )
            n4--;
          return !(n4 < 0 || 0 === n4) && n4 + js2[e5[n4]] > t4 ? n4 : t4;
        }(r3.output, r3.next_out), a4 = r3.next_out - i4, s4 = zs2(r3.output, i4), r3.next_out = a4, r3.avail_out = c4 - a4, a4 && ie3.arraySet(r3.output, r3.output, i4, a4, 0), this.onData(s4)) : this.onData(ie3.shrinkBuf(r3.output, r3.next_out))), 0 === r3.avail_in && 0 === r3.avail_out && (l3 = true);
      } while ((0 < r3.avail_in || 0 === r3.avail_out) && n3 !== Qs2.Z_STREAM_END);
      return (o3 = n3 === Qs2.Z_STREAM_END ? Qs2.Z_FINISH : o3) === Qs2.Z_FINISH ? (n3 = Ks2.inflateEnd(this.strm), this.onEnd(n3), this.ended = true, n3 === Qs2.Z_OK) : o3 !== Qs2.Z_SYNC_FLUSH || (this.onEnd(Qs2.Z_OK), !(r3.avail_out = 0));
    }, tr.prototype.onData = function(e4) {
      this.chunks.push(e4);
    }, tr.prototype.onEnd = function(e4) {
      e4 === Qs2.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = ie3.flattenChunks(this.chunks)), this.chunks = [], this.err = e4, this.msg = this.strm.msg;
    };
    var xn2 = {}, or = ((0, ie3.assign)(xn2, { Inflate: tr, inflate: nr, inflateRaw: function(e4, t3) {
      return (t3 = t3 || {}).raw = true, nr(e4, t3);
    }, ungzip: nr }, Qs2), xn2), ir = e3(function e4(t3) {
      p3(this, e4), this._m = t3, this._n = "InflateModule", this._bLogForInflateOK = false, this._bLogForInflateError = false;
    }, [{ key: "inflate", value: function(e4) {
      var t3, e4 = new Uint8Array(e4).slice(4), n3 = Date.now();
      try {
        t3 = or.inflate(e4, { to: "string" }), this._bLogForInflateOK || (this._bLogForInflateOK = true, new P2("inflateOK").end());
      } catch (e5) {
        return this._bLogForInflateError ? void 0 : (this._bLogForInflateError = true, void new P2("inflateError").setMessage(e5).end());
      }
      var e4 = e4.length + 4, o3 = t3.length;
      return M2.d("inflate ok. zipped:".concat(e4, " unzipped:").concat(o3) + " compression ratio:".concat(Math.round(100 * (o3 - e4) / o3), "% cost:").concat(Date.now() - n3)), t3;
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._bLogForInflateOK = false, this._bLogForInflateError = false;
    } }]), ar = "Message", sr2 = "User", rr = "Group", cr = "GroupMember", ur = ["count"], lr = ["conversationID", "timePosition", "timePeriod"], dr = ["miniBirthday", "maxBirthday"], pr = q2(q2(q2(q2({}, ar, G2.CS), sr2, G2.USER_CS), rr, G2.GRP_CS), cr, G2.MBR_CS), _r = (t2(vr, c3), e3(vr, [{ key: "searchCloudMessages", value: function(e4) {
      return this.search(ar, e4);
    } }, { key: "searchCloudUsers", value: function(e4) {
      return this.search(sr2, e4);
    } }, { key: "searchCloudGroups", value: function(e4) {
      return this.search(rr, e4);
    } }, { key: "searchCloudGroupMembers", value: function(e4) {
      return this.search(cr, e4);
    } }, { key: "search", value: function(i4, a4) {
      var s4 = this, e4 = "searchCloud".concat(i4, "s"), r3 = "".concat(this._n, ".").concat(e4);
      if (!a4)
        return E2({ code: k2.OPTIONS_IS_EMPTY, message: this.getErrMsg(k2.OPTIONS_IS_EMPTY, e4) });
      var t3 = a4.keywordList, n3 = lt3(t3), o3 = a4.count;
      if (a4.count && (o3 = parseInt(o3)), i4 === ar && !n3 && !lt3(a4.senderUserIDList) && !lt3(a4.messageTypeList) || i4 !== ar && !n3)
        throw M2.e("[".concat(e4, '] Missing required params: "keywordList".')), new Error("Params validate failed.");
      var c4 = Date.now(), u3 = new P2(e4), l3 = "keywordList:".concat(t3, " keywordListMatchType:").concat(a4.keywordListMatchType, " cursor:").concat(a4.cursor, " count:").concat(o3);
      return M2.l("".concat(r3, " ").concat(l3)), this.req({ P: pr[i4], data: this._genParams(i4, a4) }).then(function(e5) {
        var t4 = e5.data, n4 = t4.code, t4 = t4.message;
        if (0 !== n4)
          return 60020 === (o4 = n4) ? o4 = "SearchUnable" : i4 !== ar && 27003 === n4 ? o4 = "SearchParamsError" : i4 !== ar && 60018 === n4 && (o4 = "SearchOverLimit"), o4 = s4.getErrMsg(o4) || t4, t4 = new L2({ code: n4, message: o4 }), u3.setMessage(l3).setError(t4).end(), E2(t4);
        s4.get(27).isCSPluginEnabled();
        var n4 = e5.data, o4 = n4.cursor, t4 = void 0 === o4 ? "" : o4, o4 = n4.totalCount, n4 = "totalCount:".concat(o4, " cost:").concat(an2(c4)), n4 = (M2.l("".concat(r3, " ok. cursor:").concat(t4, " ").concat(n4)), u3.setMessage("".concat(l3, " ").concat(n4)).end(), s4._genRes(i4, a4, e5.data));
        return T2({ searchResultList: n4, cursor: t4, totalCount: o4 });
      }).catch(function(e5) {
        return u3.setMessage(l3).setError(e5).end(), E2(e5);
      });
    } }, { key: "_genParams", value: function(e4, t3) {
      var n3 = t3.count, o3 = W2(t3, ur);
      return n3 && (o3.count = parseInt(n3)), e4 === ar ? this._genMsgParams(o3) : (n3 = t3.keywordList, t3 = t3.keywordListMatchType, o3.keywords = n3, o3.keywordMatchType = "and" === t3 ? 1 : 0, e4 === sr2 ? this._genUserParams(o3) : o3);
    } }, { key: "_genMsgParams", value: function(e4) {
      var t3 = e4.conversationID, n3 = e4.timePosition, o3 = e4.timePeriod, e4 = W2(e4, lr);
      return N2(t3) || (bt3(t3) && (e4.account = t3.replace(R2.CONV_C2C, "")), wt2(t3) && (e4.groupID = t3.replace(R2.CONV_GROUP, ""))), A2(o3) && 0 < o3 && (A2(n3) && 0 < n3 ? e4.startTime = n3 - o3 : e4.startTime = He2() - o3), e4.startTime && e4.startTime < 0 && (e4.startTime = void 0), A2(n3) && 0 < n3 && (e4.endTime = n3), e4;
    } }, { key: "_genUserParams", value: function(e4) {
      var t3 = e4.miniBirthday, n3 = e4.maxBirthday, e4 = W2(e4, dr);
      return A2(t3) && (e4.miniBirthday = parseInt(t3), A2(n3) || (e4.maxBirthday = 4294967295)), A2(n3) && (e4.maxBirthday = parseInt(n3)), e4;
    } }, { key: "_genRes", value: function(e4, t3, n3) {
      switch (e4) {
        case ar:
          return this._genMsgRes(n3.searchResult, !t3.conversationID);
        case sr2:
          return this._genUserRes(n3.userList);
        case rr:
          return this._genGrpRes(n3.groupList);
        case cr:
          return this._genMemberRes(n3.groupMemberList);
        default:
          return [];
      }
    } }, { key: "_genMsgRes", value: function(e4, a4) {
      var s4 = this.get(11);
      return O2(e4) && 0 !== e4.length ? e4.map(function(e5) {
        var t3 = e5.groupID, n3 = e5.userID, o3 = e5.messageCount, e5 = e5.messageList, e5 = void 0 === e5 ? [] : e5, n3 = t3 ? "".concat(R2.CONV_GROUP).concat(t3) : "".concat(R2.CONV_C2C).concat(n3), i4 = { conversationID: n3, messageCount: o3, messageList: [] };
        return a4 && 1 < o3 || 0 < (o3 = e5.filter(function(e6) {
          return !!e6;
        })).length && (e5 = s4.onRoamingMessage(o3, n3, false), t3 && e5.reverse(), i4.messageList = e5, i4.messageCount = e5.length), i4;
      }) : [];
    } }, { key: "_genUserRes", value: function(e4) {
      var t3 = this.get(4)._profileHandler;
      if (!O2(e4))
        return [];
      for (var n3 = [], o3 = 0, i4 = e4.length; o3 < i4; o3++) {
        var a4 = e4[o3], s4 = a4.userID, a4 = a4.profileItems;
        "@TLS#NOT_FOUND" !== s4 && "" !== s4 && (s4 = t3._update(s4, t3._getLatestProfileFromResponse(s4, a4)).latestProfile, n3.push(s4));
      }
      return n3;
    } }, { key: "_genGrpRes", value: function(e4) {
      if (!O2(e4))
        return [];
      for (var t3 = [], n3 = 0, o3 = e4.length; n3 < o3; n3++)
        e4[n3] && e4[n3].groupID && t3.push(new Yo(e4[n3]));
      return t3;
    } }, { key: "_genMemberRes", value: function(e4) {
      if (!O2(e4))
        return [];
      for (var t3, n3, o3, i4, a4, s4, r3 = /* @__PURE__ */ new Map(), c4 = 0, u3 = e4.length; c4 < u3; c4++)
        e4[c4] && e4[c4].userID && e4[c4].groupID && (n3 = (t3 = e4[c4]).groupID, i4 = t3.name, a4 = t3.type, s4 = t3.avatar, o3 = t3.nick, i4 = { groupID: n3, name: i4, type: a4, avatar: s4 }, a4 = { userID: t3.userID, nick: o3, nameCard: t3.nameCard }, r3.has(n3) ? ((s4 = r3.get(n3)).memberList.push(a4), r3.set(n3, s4)) : r3.set(n3, { groupInfo: i4, memberList: [a4] }));
      return d3(r3.values());
    } }])), hr = e3(function e4(t3) {
      var n3 = this;
      p3(this, e4);
      var o3, i4 = new P2("sdkConstruct"), a4 = (this._n = "ModuleManager", this._isReady = false, this._reason = k2.USER_NOT_LOGGED_IN, this._startLoginTs = 0, this._map = /* @__PURE__ */ new Map(), this._optionalModuleMap = /* @__PURE__ */ new Map(), this._codeMsgForTUIMap = /* @__PURE__ */ new Map(), this._iEmitter = null, this._oEmitter = null, this._checkCount = 0, this._checkTimer = -1, this._map.set(12, new Ii2(this, t3)), this._map.set(37, new ir(this)), this._map.set(15, new Pi2(this)), this._map.set(27, new Qa(this)), this._map.set(23, new ba(this)), this._map.set(24, new Xa(this)), this._map.set(26, new Ba(this)), this._map.set(21, new Ma(this)), this._map.set(20, new Ua(this)), this._map.set(1, new yi2(this)), this._map.set(2, new ji2(this)), this._map.set(3, new Ji2(this)), this._map.set(34, new zi2(this)), this._map.set(31, new Xi2(this)), this._map.set(4, new vi2(this)), this._map.set(6, new Po2(this)), this._map.set(11, new Zo(this)), this._map.set(7, new li2(this)), this._map.set(10, new _i2(this)), this._map.set(13, new Ri2(this)), this._map.set(32, new os2(this)), this._map.set(14, new Oi2(this)), this._map.set(17, new xi2(this)), this._map.set(18, new Zi2(this)), this._map.set(19, new Qi2(this)), this._map.set(25, new wa(this)), this._map.set(8, new za(this)), this._map.set(28, new $a(this)), this._map.set(36, new es2(this)), this._map.set(29, new ts2(this)), this._map.set(30, new ns2(this)), this._map.set(33, new ls2(this)), this._map.set(35, new hs2(this)), this._map.set(38, new _r(this)), this._eventThrottleMap = /* @__PURE__ */ new Map(), this._eventThrottling = t3.eventThrottling, this._map.get(12).isPartialUpdatedConvs() && (this._eventThrottling = false), m3(t3.modules) ? (Object.keys(t3.modules).forEach(function(e5) {
        o3 = t3.modules[e5], "group-module" === e5 ? n3._map.set(7, new o3(n3)) : "relationship-module" === e5 ? n3._map.set(8, new o3(n3)) : "signaling-module" === e5 ? n3._map.set(33, new o3(n3)) : "follow-module" === e5 ? n3._map.set(35, new o3(n3)) : "cloud-search-module" === e5 && n3._map.set(38, new o3(n3)), n3._optionalModuleMap.set(e5, 1);
      }), this._map.get(12).setUsingChatCore(true)) : this._map.has(7) || this._map.get(12).setUsingChatCore(true), t3.instanceID), s4 = t3.SDKAppID, r3 = this._map.get(12).isIntl(), c4 = this._map.get(12).isUsingChatCore(), a4 = "instanceID:".concat(a4, " SDKAppID:").concat(s4, " isIntl:").concat(r3, " isUsingChatCore:").concat(c4, " host:").concat(Bt2()) + " isIOSWebView:".concat(be2, " platform:").concat(De3, " canIUseInflate:").concat(this.canIUseInflate()) + " workerAvailable:".concat(Ge3, " eventThrottling:").concat(this._eventThrottling, " UserAgent:").concat(Te2);
      P2.bindEventStatModule(this._map.get(14)), P2.bindNetMonitorModule(this._map.get(15)), i4.setMessage("".concat(a4, " ").concat(function() {
        var t4 = "";
        if (v3)
          try {
            var e5 = I2.getSystemInfoSync(), n4 = e5.model, o4 = e5.version, i5 = e5.system, a5 = e5.platform, s5 = e5.SDKVersion, t4 = "model:".concat(n4, " version:").concat(o4, " system:").concat(i5, " platform:").concat(a5, " SDKVersion:").concat(s5);
          } catch (e6) {
            t4 = "";
          }
        return t4;
      }())).end(), M2.i("SDK ".concat(a4)), L2.prototype._getErrMsg = this.getErrMsg.bind(this), this._readyList = void 0, this._ssoLogForReady = null, this._initReadyList();
    }, [{ key: "_startTimer", value: function() {
      var e4 = this._map.get(24), t3 = e4.isWorkerEnabled();
      M2.l("".concat(this._n, ".startTimer isWorkerEnabled:").concat(t3, " seed:").concat(this._checkTimer)), t3 ? e4.startWorkerTimer() : this._startMainThreadTimer();
    } }, { key: "_startMainThreadTimer", value: function() {
      this._checkTimer < 0 && (this._checkTimer = setInterval(this.onCheckTimer.bind(this), 1e3)), M2.l("".concat(this._n, "._startMainThreadTimer seed:").concat(this._checkTimer));
    } }, { key: "stopTimer", value: function() {
      var e4 = this._map.get(24), t3 = e4.isWorkerEnabled();
      M2.l("".concat(this._n, ".stopTimer isWorkerEnabled:").concat(t3, " seed:").concat(this._checkTimer)), t3 ? e4.stopWorkerTimer() : this._stopMainThreadTimer();
    } }, { key: "_stopMainThreadTimer", value: function() {
      M2.l("".concat(this._n, "._stopMainThreadTimer")), 0 < this._checkTimer && (clearInterval(this._checkTimer), this._checkTimer = -1, this._checkCount = 0);
    } }, { key: "_stopMainThreadSocket", value: function() {
      M2.l("".concat(this._n, "._stopMainThreadSocket"));
      var e4 = this._map.get(21);
      e4.setIsWorkerEnabled(true), e4.reConnect();
    } }, { key: "_startMainThreadSocket", value: function() {
      M2.l("".concat(this._n, "._startMainThreadSocket"));
      var e4 = this._map.get(21);
      e4.setIsWorkerEnabled(false), e4.reConnect();
    } }, { key: "onWorkerTimerEnabled", value: function() {
      M2.l("".concat(this._n, ".onWorkerTimerEnabled, disable main thread timer and socket")), this._stopMainThreadTimer(), this._stopMainThreadSocket();
    } }, { key: "onWorkerTimerDisabled", value: function() {
      M2.l("".concat(this._n, ".onWorkerTimerDisabled, enable main thread timer and socket")), this._startMainThreadTimer(), this._startMainThreadSocket();
    } }, { key: "onCheckTimer", value: function() {
      this._checkCount += 1;
      var e4, t3 = F2(this._map);
      try {
        for (t3.s(); !(e4 = t3.n()).done; ) {
          var n3 = j2(e4.value, 2)[1];
          n3.onCheckTimer && n3.onCheckTimer(this._checkCount);
        }
      } catch (e5) {
        t3.e(e5);
      } finally {
        t3.f();
      }
    } }, { key: "_initReadyList", value: function() {
      var t3 = this;
      this._readyList = [this._map.get(1)], this._readyList.forEach(function(e4) {
        e4.ready(function() {
          return t3._onModuleReady();
        });
      });
    } }, { key: "_onModuleReady", value: function() {
      var e4, t3, n3 = true;
      this._readyList.forEach(function(e5) {
        e5.isReady() || (n3 = false);
      }), n3 && !this._isReady && (this._isReady = true, this._oEmitter.emit(h3.SDK_READY), e4 = Date.now() - this._startLoginTs, M2.w("SDK is ready. cost ".concat(e4, " ms")), this._startLoginTs = Date.now(), t3 = this._ssoLogForReady.getStartTs() + We3, this._ssoLogForReady.setMessage(e4).start(t3).end());
    } }, { key: "login", value: function() {
      0 === this._startLoginTs && (Be2(), this._startLoginTs = Date.now(), this._startTimer(), this._map.get(15).start(), this._ssoLogForReady = new P2("sdkReady"), this._reason = k2.LOGGING_IN);
    } }, { key: "onLoginFailed", value: function() {
      this._startLoginTs = 0;
    } }, { key: "getOEmitInst", value: function() {
      return null === this._oEmitter && (this._oEmitter = new wi2(), e4 = this._oEmitter, Kn2 = e4, this._oEmitter._emit = this._oEmitter.emit, this._oEmitter.emit = (function(e5, t3) {
        var n3, o3, i4 = this;
        this._canIUseSignaling() && (e5 === h3.MESSAGE_RECEIVED && this.get(33).onNewMessageList(t3), e5 === h3.MESSAGE_MODIFIED) && this.get(33).onMessageModified(t3), e5 === h3.CONVERSATION_LIST_UPDATED || e5 === h3.FRIEND_LIST_UPDATED || e5 === h3.GROUP_LIST_UPDATED || e5 === h3.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED ? false !== this._eventThrottling ? this._eventThrottleMap.has(e5) ? (n3 = Date.now()) - (o3 = this._eventThrottleMap.get(e5)).last <= 1e3 ? (-1 < o3.timeoutID && clearTimeout(o3.timeoutID), o3.timeoutID = setTimeout(function() {
          o3.last = Date.now(), i4._oEmitter._emit.apply(i4._oEmitter, [e5, { name: e5, data: i4._getEventData(e5) }]);
        }, 1e3)) : (o3.last = n3, this._oEmitter._emit.apply(this._oEmitter, [e5, { name: e5, data: this._getEventData(e5) }])) : (this._eventThrottleMap.set(e5, { last: Date.now(), timeoutID: -1 }), this._oEmitter._emit.apply(this._oEmitter, [e5, { name: e5, data: this._getEventData(e5) }])) : this._oEmitter._emit.apply(this._oEmitter, [e5, { name: e5, data: this._getEventData(e5) }]) : this._oEmitter._emit.apply(this._oEmitter, [e5, { name: e5, data: t3 }]);
      }).bind(this)), this._oEmitter;
      var e4;
    } }, { key: "_canIUseSignaling", value: function() {
      var e4 = this.get(33);
      return !!e4 && e4.canIUseSignaling();
    } }, { key: "_getEventData", value: function(e4) {
      return e4 === h3.CONVERSATION_LIST_UPDATED ? this._map.get(12).isPartialUpdatedConvs() ? this._map.get(11).getPartialUpdatedConvs() : this._map.get(11).getLocalConvList() : e4 === h3.FRIEND_LIST_UPDATED ? this._map.get(8).getLocalFriendList(false) : e4 === h3.GROUP_LIST_UPDATED ? this._map.get(7).getLocalGroupList() : e4 === h3.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED ? this._map.get(11).getTotalUnreadCount() : e4 === h3.CONVERSATION_ID_LIST_UPDATED ? this._map.get(11).getUpdatedConvIDList() : void 0;
    } }, { key: "getIEmitInst", value: function() {
      return null === this._iEmitter && (this._iEmitter = new wi2(), this._iEmitter._emit = this._iEmitter.emit, this._iEmitter.emit = (function(e4, t3) {
        e4 = m3(t3) && t3.data ? [e4, { name: e4, data: t3.data }] : [e4, { name: e4, data: t3 }];
        this._iEmitter._emit.apply(this._iEmitter, e4);
      }).bind(this)), this._iEmitter;
    } }, { key: "hasModule", value: function(e4) {
      return this._map.has(e4);
    } }, { key: "get", value: function(e4) {
      return this._map.get(e4);
    } }, { key: "canIUseModule", value: function(e4) {
      return !this._map.get(12).isUsingChatCore() || this._optionalModuleMap.has(e4);
    } }, { key: "canIUseInflate", value: function() {
      return !!this._map.get(37);
    } }, { key: "isReady", value: function() {
      return this._isReady;
    } }, { key: "isIntl", value: function() {
      return this.get(12).isIntl();
    } }, { key: "getNotReadyReason", value: function() {
      return this._reason;
    } }, { key: "setNotReadyReason", value: function(e4) {
      this._reason = e4;
    } }, { key: "getErrMsg", value: function(e4, t3, n3) {
      return this._map.get(32).get({ key: e4, replacement1: t3, replacement2: n3, isIntl: this.isIntl() });
    } }, { key: "warn", value: function(e4, t3, n3) {
      e4 = this.getErrMsg(e4, t3, n3);
      e4 && M2.w(e4);
    } }, { key: "onError", value: function(e4) {
      var t3 = "code:".concat(e4.code, " message:").concat(e4.message);
      M2.w("Oops! ".concat(t3)), new P2("error").setMessage(t3).setLevel("error").end(), this.getOEmitInst().emit(h3.ERROR, e4);
    } }, { key: "restartTimer", value: function() {
      M2.l("".concat(this._n, ".restartTimer")), this.stopTimer(), this._startTimer();
      var e4 = this.get(7);
      e4 && e4.restartPolling();
    } }, { key: "getTimerID", value: function() {
      var e4 = this._map.get(24);
      return e4.isWorkerEnabled() ? e4.getTimerID() : this._checkTimer;
    } }, { key: "getPollingTimerID", value: function(e4) {
      return this._map.get(7).getPollingTimerID(e4);
    } }, { key: "statTUIKeyFeatures", value: function(e4) {
      var t3 = e4.code, e4 = e4.msg, e4 = void 0 === e4 ? "" : e4, n3 = t3 + e4;
      this._codeMsgForTUIMap.has(n3) || (this._codeMsgForTUIMap.set(n3, 1), n3 = this.get(12).getUIPlatform(), new P2("tui_key_features").setCode(t3).setMessage(e4).setUIPlatform(n3).end());
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), Be2();
      var e4, t3 = F2(this._map);
      try {
        for (t3.s(); !(e4 = t3.n()).done; ) {
          var n3 = j2(e4.value, 2)[1];
          n3.reset && n3.reset();
        }
      } catch (e5) {
        t3.e(e5);
      } finally {
        t3.f();
      }
      this._startLoginTs = 0, this._initReadyList(), this._isReady = false, this.stopTimer(), this._oEmitter.emit(h3.SDK_NOT_READY);
      var o3, i4 = F2(this._eventThrottleMap);
      try {
        for (i4.s(); !(o3 = i4.n()).done; ) {
          var a4 = j2(o3.value, 2)[1];
          -1 < a4.timeoutID && clearTimeout(a4.timeoutID);
        }
      } catch (e5) {
        i4.e(e5);
      } finally {
        i4.f();
      }
      this._eventThrottleMap.clear(), this._codeMsgForTUIMap.clear();
    } }]), gr = e3(function e4(t3) {
      p3(this, e4), this._funcMap = /* @__PURE__ */ new Map(), this._m = t3, this._n = "SafetyCallback", this._reportCount = 0;
    }, [{ key: "defense", value: function(e4, t3) {
      var n3 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : void 0;
      if ("string" != typeof e4)
        return null;
      if (0 === e4.length)
        return null;
      if ("function" != typeof t3)
        return null;
      if (this._funcMap.has(e4) && this._funcMap.get(e4).has(t3))
        return this._funcMap.get(e4).get(t3);
      this._funcMap.has(e4) || this._funcMap.set(e4, /* @__PURE__ */ new Map());
      var o3 = null;
      return this._funcMap.get(e4).has(t3) ? o3 = this._funcMap.get(e4).get(t3) : (o3 = this._pack(e4, t3, n3), this._funcMap.get(e4).set(t3, o3)), o3;
    } }, { key: "defenseOnce", value: function(e4, t3) {
      return "function" != typeof t3 ? null : this._pack(e4, t3, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : void 0);
    } }, { key: "find", value: function(e4, t3) {
      return "string" != typeof e4 || 0 === e4.length || "function" != typeof t3 ? null : this._funcMap.has(e4) && this._funcMap.get(e4).has(t3) ? this._funcMap.get(e4).get(t3) : (this._m.warn("ListenerFnNotFound", e4), null);
    } }, { key: "delete", value: function(e4, t3) {
      return "function" == typeof t3 && !!this._funcMap.has(e4) && !!this._funcMap.get(e4).has(t3) && (this._funcMap.get(e4).delete(t3), 0 === this._funcMap.get(e4).size && this._funcMap.delete(e4), true);
    } }, { key: "_pack", value: function(o3, e4, i4) {
      var a4 = this;
      return function() {
        try {
          e4.apply(i4, Array.from(arguments));
        } catch (e5) {
          var t3 = Object.values(h3).indexOf(o3), n3 = "CallbackError";
          -1 !== t3 && (t3 = Object.keys(h3)[t3], a4._m.warn(n3, t3, e5)), a4._reportCount < 5 && (new P2(n3).setMessage("eventName:".concat(o3)).setMoreMessage(e5.message).end(), a4._reportCount += 1);
        }
      };
    } }, { key: "destroy", value: function() {
      this._funcMap.clear();
    } }, { key: "reset", value: function() {
      M2.l("".concat(this._n, ".reset")), this._reportCount = 0;
    } }]), fr = e3(function e4(t3) {
      p3(this, e4);
      t3 = { SDKAppID: t3.SDKAppID, unlimitedAVChatRoom: t3.unlimitedAVChatRoom || false, scene: t3.scene || "", oversea: t3.oversea || false, instanceID: Vt2(), devMode: t3.devMode || false, testEnv: t3.testEnv || false, proxyServer: t3.proxyServer || void 0, fileUploadProxy: t3.fileUploadProxy || void 0, fileDownloadProxy: t3.fileDownloadProxy || t3.fileUploadProxy || void 0, eventThrottling: false !== t3.eventThrottling, partialUpdatedConversations: true === t3.partialUpdatedConversations, disableIndependentDomain: true === t3.disableIndependentDomain, modules: t3.modules || void 0 };
      this._m = new hr(t3), this._safetyCallbackFactory = new gr(this._m);
    }, [{ key: "onError", value: function(e4) {
      this._m.onError(e4);
    } }, { key: "login", value: function(e4) {
      return this._m.login(), this._get(1).login(e4);
    } }, { key: "logout", value: function() {
      var t3 = this;
      return this._get(1).logout().then(function(e4) {
        return t3._safetyCallbackFactory.reset(), t3._m.reset(), e4;
      });
    } }, { key: "getLoginUser", value: function() {
      return this._get(1).getLoginUser();
    } }, { key: "getServerTime", value: function() {
      return Ye3();
    } }, { key: "isReady", value: function() {
      return this._m.isReady();
    } }, { key: "isIntl", value: function() {
      return this._m.isIntl();
    } }, { key: "getNotReadyReason", value: function() {
      return this._m.getNotReadyReason();
    } }, { key: "getErrMsg", value: function(e4, t3, n3) {
      return this._m.getErrMsg(e4, t3, n3);
    } }, { key: "_get", value: function(e4) {
      return this._m.get(e4);
    } }, { key: "destroy", value: function() {
      var e4 = this, t3 = this._get(12), n3 = t3.getSDKAppID();
      return M2.w("destroy ".concat(n3, " ").concat(t3.getInstanceID())), this.logout().finally(function() {
        e4._safetyCallbackFactory.destroy(), e4._m.stopTimer(), e4._get(24).terminate(), e4._get(21).dealloc(), e4._m.getOEmitInst().emit(h3.SDK_DESTROY, { SDKAppID: n3 });
      });
    } }, { key: "on", value: function(e4, t3, n3) {
      M2.d("on", "eventName:".concat(e4)), this._m.getOEmitInst().on(e4, this._safetyCallbackFactory.defense(e4, t3, n3), n3);
    } }, { key: "once", value: function(e4, t3, n3) {
      M2.d("once", "eventName:".concat(e4)), this._m.getOEmitInst().once(e4, this._safetyCallbackFactory.defenseOnce(e4, t3, n3), n3 || this);
    } }, { key: "off", value: function(e4, t3, n3, o3) {
      M2.d("off", "eventName:".concat(e4));
      var i4 = this._safetyCallbackFactory.find(e4, t3);
      null !== i4 && (this._m.getOEmitInst().off(e4, i4, n3, o3), this._safetyCallbackFactory.delete(e4, t3));
    } }, { key: "registerPlugin", value: function(e4) {
      (N2(e4["tim-push"]) ? N2(e4["tim-offline-push-plugin"]) ? this._get(18) : this._get(28) : this._get(36)).registerPlugin(e4);
    } }, { key: "setLogLevel", value: function(e4) {
      var t3;
      e4 <= 0 && ((t3 = this.getErrMsg("TIM_ASCII_ART")) && index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", t3), (t3 = this.getErrMsg("API_REFER")) && (en2() ? index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", "%c ".concat("IM SDK API ->", " %c"), "background:#ff9d00; padding:1px; border-radius:3px; color: #fff", "background:transparent", t3) : index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", "IM SDK API ->", t3)), (t3 = this.getErrMsg("DOCS_GUIDE")) && index.__f__("log", "at node_modules/@tencentcloud/chat/index.js:1", t3), t3 = this.getErrMsg("IOS_WEBVIEW_WARNING"), be2) && t3 && index.__f__("warn", "at node_modules/@tencentcloud/chat/index.js:1", t3), M2.setLevel(e4);
    } }, { key: "createTextMessage", value: function(e4) {
      return this._get(2).createTextMessage(e4);
    } }, { key: "createTextAtMessage", value: function(e4) {
      return this._get(2).createTextMessage(e4);
    } }, { key: "createImageMessage", value: function(e4) {
      return this._get(2).createImageMessage(e4);
    } }, { key: "createAudioMessage", value: function(e4) {
      return this._get(2).createAudioMessage(e4);
    } }, { key: "createVideoMessage", value: function(e4) {
      return this._get(2).createVideoMessage(e4);
    } }, { key: "createCustomMessage", value: function(e4) {
      return this._get(2).createCustomMessage(e4);
    } }, { key: "createFaceMessage", value: function(e4) {
      return this._get(2).createFaceMessage(e4);
    } }, { key: "createFileMessage", value: function(e4) {
      return this._get(2).createFileMessage(e4);
    } }, { key: "createLocationMessage", value: function(e4) {
      return this._get(2).createLocationMessage(e4);
    } }, { key: "createMergerMessage", value: function(e4) {
      return this._get(2).createMergerMessage(e4);
    } }, { key: "downloadMergerMessage", value: function(e4) {
      return e4.type !== R2.MSG_MERGER ? E2({ code: k2.MSG_MERGER_TYPE_INVALID }) : S2(e4.payload.downloadKey) ? E2({ code: k2.MSG_MERGER_KEY_INVALID }) : this._get(2).downloadMergerMessage(e4).catch(function(e5) {
        return E2({ code: k2.MSG_MERGER_DOWNLOAD_FAIL });
      });
    } }, { key: "createForwardMessage", value: function(e4) {
      return this._get(2).createForwardMessage(e4);
    } }, { key: "sendMessage", value: function(e4, t3) {
      return e4 instanceof So2 ? this._get(2).sendMessageInstance(e4, t3) : E2({ code: k2.MSG_INSTANCE_REQUIRED });
    } }, { key: "callExperimentalAPI", value: function(e4, t3) {
      return "sendComboMessage" === e4 ? this._get(31).sendMessage(t3) : "handleGroupInvitation" === e4 ? this._get(7).handleGroupInvitation(t3) : "isCommercialAbilityEnabled" === e4 ? this._get(27).isFeatureEnabled(t3) : "isFeatureEnabledForStat" === e4 ? this._get(27).isFeatureEnabledForStat(t3) : "isIntl" === e4 ? this.isIntl() : "sendTRTCCustomData" === e4 || "sendRoomCustomData" === e4 ? this._get(30).sendTRTCCustomData(t3) : "getTimerID" === e4 ? this._m.getTimerID() : "getPollingTimerID" === e4 ? this._m.getPollingTimerID(t3) : "setApplicationID" === e4 ? (this._get(12).setApplicationID(t3), void this._get(20).updateProtocolConfig()) : "getServerConfig" === e4 ? this._get(23).getServerConfig(t3) : "canIUseModule" === e4 ? this._m.canIUseModule(t3) : "startMessageLongPolling" === e4 ? this._get(7).startMessageLongPolling(t3) : "stopMessageLongPolling" === e4 ? this._get(7).stopMessageLongPolling(t3) : "disableMessagePullOnInvite" === e4 ? this._get(11).disableMsgPullOnInvite(t3) : "clearLocalMessage" === e4 ? this._get(11).clearMemMsg(t3, false) : "setCustomLoginInfo" === e4 ? this._get(12).setCustomLoginInfo(t3) : "statTUIKeyFeatures" === e4 ? this._m.statTUIKeyFeatures(t3) : "getGroupReceiptsByUsers" === e4 ? this._get(7).getGroupReceiptsByUsers(t3) : E2({ code: k2.INVALID_OPERATION });
    } }, { key: "revokeMessage", value: function(e4) {
      return this._get(2).revokeMessage(e4);
    } }, { key: "resendMessage", value: function(e4, t3) {
      return e4 instanceof So2 ? this._get(2).resendMessage(e4, t3) : E2({ code: k2.MSG_INSTANCE_REQUIRED });
    } }, { key: "deleteMessage", value: function(e4) {
      return this._get(2).deleteMessage(e4);
    } }, { key: "translateText", value: function(e4) {
      return this._get(2).translateText(e4);
    } }, { key: "convertVoiceToText", value: function(e4) {
      return this._get(2).convertVoiceToText(e4);
    } }, { key: "setMessageExtensions", value: function(e4, t3) {
      return this._get(3).setMessageExtensions(e4, t3);
    } }, { key: "getMessageExtensions", value: function(e4) {
      return this._get(3).getMessageExtensions(e4);
    } }, { key: "deleteMessageExtensions", value: function(e4, t3) {
      return this._get(3).deleteMessageExtensions(e4, t3);
    } }, { key: "addMessageReaction", value: function(e4, t3) {
      return this._get(34).addMessageReaction(e4, t3);
    } }, { key: "removeMessageReaction", value: function(e4, t3) {
      return this._get(34).removeMessageReaction(e4, t3);
    } }, { key: "getMessageReactions", value: function(e4) {
      return this._get(34).getMessageReactions(e4);
    } }, { key: "getAllUserListOfMessageReaction", value: function(e4) {
      return this._get(34).getAllUserListOfMessageReaction(e4);
    } }, { key: "modifyMessage", value: function(e4) {
      return this._get(2).modifyRemoteMessage(e4);
    } }, { key: "getMessageList", value: function(e4) {
      return this._get(11).getMessageList(e4);
    } }, { key: "getMessageListHopping", value: function(e4) {
      return this._get(11).getMessageListHopping(e4);
    } }, { key: "sendMessageReadReceipt", value: function(e4) {
      return this._get(11).sendReadReceipt(e4);
    } }, { key: "getMessageReadReceiptList", value: function(e4) {
      return this._get(11).getReadReceiptList(e4);
    } }, { key: "getGroupMessageReadMemberList", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getReadReceiptDetail(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "findMessage", value: function(e4) {
      return this._get(11).findMessage(e4);
    } }, { key: "setMessageRead", value: function(e4) {
      return this._get(11).setMessageRead(e4);
    } }, { key: "getConversationList", value: function(e4) {
      return this._get(11).getConvList(e4);
    } }, { key: "getConversationProfile", value: function(e4) {
      return this._get(11).getConversationProfile(e4);
    } }, { key: "deleteConversation", value: function(e4) {
      return this._get(11).deleteConversation(e4);
    } }, { key: "setConversationDraft", value: function(e4) {
      return this._get(11).setConvDraft(e4);
    } }, { key: "clearHistoryMessage", value: function(e4) {
      return this._get(11).clearHistoryMessage(e4);
    } }, { key: "pinConversation", value: function(e4) {
      return this._get(11).pinConversation(e4);
    } }, { key: "setAllMessageRead", value: function(e4) {
      return this._get(11).setAllMessageRead(e4);
    } }, { key: "setMessageRemindType", value: function(e4) {
      return this._get(11).setMessageRemindType(e4);
    } }, { key: "setAllReceiveMessageOpt", value: function(e4) {
      return this._get(11).setAllRcvMsgOpt(e4);
    } }, { key: "getAllReceiveMessageOpt", value: function() {
      return this._get(11).getAllRcvMsgOpt();
    } }, { key: "getTotalUnreadMessageCount", value: function() {
      return this._get(11).getTotalUnreadCount();
    } }, { key: "setConversationCustomData", value: function(e4) {
      return this._get(11).setConvCustomData(e4);
    } }, { key: "markConversation", value: function(e4) {
      return this._get(11).markConv(e4);
    } }, { key: "getConversationGroupList", value: function() {
      return this._get(11).getConvGroupList();
    } }, { key: "createConversationGroup", value: function(e4) {
      return this._get(11).createConvGroup(e4);
    } }, { key: "deleteConversationGroup", value: function(e4) {
      return this._get(11).deleteConvGroup(e4);
    } }, { key: "renameConversationGroup", value: function(e4) {
      return this._get(11).renameConvGroup(e4);
    } }, { key: "addConversationsToGroup", value: function(e4) {
      return this._get(11).addConvsToGroup(e4);
    } }, { key: "deleteConversationsFromGroup", value: function(e4) {
      return this._get(11).deleteConvsFromGroup(e4);
    } }, { key: "searchCloudMessages", value: function(e4) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudMessages(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchCloudUsers", value: function(e4) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudUsers(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchCloudGroups", value: function(e4) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudGroups(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchCloudGroupMembers", value: function(e4) {
      var t3 = this._get(38);
      return t3 ? t3.searchCloudGroupMembers(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMyProfile", value: function() {
      return this._get(4).getMyProfile();
    } }, { key: "getUserProfile", value: function(e4) {
      return this._get(4).getUserProfile(e4);
    } }, { key: "updateMyProfile", value: function(e4) {
      return this._get(4).updateMyProfile(e4);
    } }, { key: "getBlacklist", value: function() {
      return this._get(4).getLocalBlacklist();
    } }, { key: "addToBlacklist", value: function(e4) {
      return this._get(4).addBlacklist(e4);
    } }, { key: "removeFromBlacklist", value: function(e4) {
      return this._get(4).deleteBlacklist(e4);
    } }, { key: "setSelfStatus", value: function(e4) {
      return this._get(4).setSelfStatus(e4);
    } }, { key: "getUserStatus", value: function(e4) {
      return this._get(4).getUserStatus(e4);
    } }, { key: "subscribeUserStatus", value: function(e4) {
      return this._get(4).subscribeUserStatus(e4);
    } }, { key: "unsubscribeUserStatus", value: function(e4) {
      return this._get(4).unsubscribeUserStatus(e4);
    } }, { key: "getFriendList", value: function() {
      var e4 = this._get(8);
      return e4 ? e4.getLocalFriendList() : E2({ code: k2.NO_MODULE });
    } }, { key: "addFriend", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.addFriend(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteFriend", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.deleteFriend(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "checkFriend", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.checkFriend(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getFriendProfile", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.getFriendProfile(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "updateFriend", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.updateFriend(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getFriendApplicationList", value: function() {
      var e4 = this._get(8);
      return e4 ? e4.getLocalFriendApplicationList() : E2({ code: k2.NO_MODULE });
    } }, { key: "acceptFriendApplication", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.acceptFriendApplication(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "refuseFriendApplication", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.refuseFriendApplication(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteFriendApplication", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.deleteFriendApplication(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setFriendApplicationRead", value: function() {
      var e4 = this._get(8);
      return e4 ? e4.setFriendApplicationRead() : E2({ code: k2.NO_MODULE });
    } }, { key: "getFriendGroupList", value: function() {
      var e4 = this._get(8);
      return e4 ? e4.getLocalFriendGroupList() : E2({ code: k2.NO_MODULE });
    } }, { key: "createFriendGroup", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.createFriendGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteFriendGroup", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.deleteFriendGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "addToFriendGroup", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.addToFriendGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "removeFromFriendGroup", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.removeFromFriendGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "renameFriendGroup", value: function(e4) {
      var t3 = this._get(8);
      return t3 ? t3.renameFriendGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "followUser", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.followUser(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "unfollowUser", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.unfollowUser(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMyFollowersList", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.getMyFollowersList(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMyFollowingList", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.getMyFollowingList(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getMutualFollowersList", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.getMutualFollowersList(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getUserFollowInfo", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.getUserFollowInfo(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "checkFollowType", value: function(e4) {
      var t3 = this._get(35);
      return t3 ? t3.checkFollowType(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupList", value: function() {
      var e4 = this._get(7);
      return e4 ? e4.getGroupList() : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupProfile", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupProfile(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "createGroup", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.createGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "dismissGroup", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.dismissGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "updateGroupProfile", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.updateGroupProfile(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "joinGroup", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.joinGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "quitGroup", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.quitGroup(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "searchGroupByID", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.searchGroupByID(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupOnlineMemberCount", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupOnlineMemberCount(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "changeGroupOwner", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.changeGroupOwner(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupApplicationList", value: function() {
      var e4 = this._get(7);
      return e4 ? e4.getGroupApplicationList() : E2({ code: k2.NO_MODULE });
    } }, { key: "handleGroupApplication", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.handleGroupApplication(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "initGroupAttributes", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.initGroupAttributes(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupAttributes", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupAttributes(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteGroupAttributes", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.deleteGroupAttributes(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupAttributes", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupAttributes(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupCounters", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupCounters(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "increaseGroupCounter", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.increaseGroupCounter(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "decreaseGroupCounter", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.decreaseGroupCounter(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupCounters", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupCounters(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupMemberList", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupMemberList(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getGroupMemberProfile", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.getGroupMemberProfile(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "addGroupMember", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.addGroupMember(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "deleteGroupMember", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.deleteGroupMember(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberMuteTime", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberMuteTime(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberRole", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberRole(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberNameCard", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberNameCard(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "setGroupMemberCustomField", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.setGroupMemberCustomField(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "markGroupMemberList", value: function(e4) {
      var t3 = this._get(7);
      return t3 ? t3.markGroupMemberList(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getJoinedCommunityList", value: function() {
      return this._get(10).getJoinedCommunityList();
    } }, { key: "createTopicInCommunity", value: function(e4) {
      return this._get(10).createTopicInCommunity(e4);
    } }, { key: "deleteTopicFromCommunity", value: function(e4) {
      return this._get(10).deleteTopicFromCommunity(e4);
    } }, { key: "updateTopicProfile", value: function(e4) {
      return this._get(10).updateTopicProfile(e4);
    } }, { key: "getTopicList", value: function(e4) {
      return this._get(10).getTopicList(e4);
    } }, { key: "addSignalingListener", value: function(e4, t3, n3) {
      var o3 = this._get(33);
      o3 && o3.addSignalingListener(e4, this._safetyCallbackFactory.defense(e4, t3, n3), n3);
    } }, { key: "removeSignalingListener", value: function(e4, t3, n3) {
      var o3, i4 = this._safetyCallbackFactory.find(e4, t3);
      null !== i4 && (o3 = this._get(33)) && (o3.removeSignalingListener(e4, i4, n3), this._safetyCallbackFactory.delete(e4, t3));
    } }, { key: "invite", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.invite(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "inviteSync", value: function(e4, t3, n3) {
      var o3 = this._get(33);
      return o3 ? o3.inviteSync(e4, t3, n3) : "";
    } }, { key: "inviteInGroup", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.invite(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "inviteInGroupSync", value: function(e4, t3, n3) {
      var o3 = this._get(33);
      return o3 ? o3.inviteSync(e4, t3, n3) : "";
    } }, { key: "cancel", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.cancel(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "accept", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.accept(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "reject", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.reject(e4) : E2({ code: k2.NO_MODULE });
    } }, { key: "getSignalingInfo", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.getSignalingInfo(e4) : null;
    } }, { key: "modifyInvitation", value: function(e4) {
      var t3 = this._get(33);
      return t3 ? t3.modifyInvitation(e4) : E2({ code: k2.NO_MODULE });
    } }]), mr = { login: 1, logout: 1, getLoginUser: 1, destroy: 1, on: 1, off: 1, ready: 1, setLogLevel: 1, joinGroup: 1, quitGroup: 1, registerPlugin: 1, getGroupOnlineMemberCount: 1, isReady: 1, addSignalingListener: 1, removeSignalingListener: 1, callExperimentalAPI: 1 };
    function vr(e4) {
      return p3(this, vr), (e4 = i3(this, vr, [e4]))._n = "CSModule", e4;
    }
    var Ir = {}, Vn2 = {};
    return Vn2.create = function(e4) {
      var t3 = "TencentCloudChat.create", n3 = 0, o3 = e4.SDKAppID;
      if (A2(o3))
        n3 = o3;
      else if (n3 = parseInt(o3), isNaN(o3))
        return M2.e("".concat(t3, " failed. Failed to parse the SDKAppID, please check the arguments")), null;
      if (n3 && Ir[n3])
        return Ir[n3];
      M2.l("".concat(t3));
      var s4, i4, o3 = new fr(y2(y2({}, e4), {}, { SDKAppID: n3 })), e4 = (o3.on(h3.SDK_DESTROY, function(e5) {
        Ir[e5.data.SDKAppID] = null, delete Ir[e5.data.SDKAppID];
      }), s4 = o3, i4 = /* @__PURE__ */ Object.create(null), Object.keys(Hn2).forEach(function(a4) {
        var t4;
        s4[a4] && (t4 = new Q3(), i4[a4] = function() {
          var e5 = Array.from(arguments);
          return t4.use(function(e6, t5) {
            i5 = a4;
            var n4, o4, i5 = !(!(n4 = s4).isReady() && 1 !== mr[i5]) || (o4 = { code: o4 = n4.getNotReadyReason(), message: "".concat(n4.getErrMsg(o4), " | ").concat(i5, " | ").concat(n4.getErrMsg(k2.SDK_IS_NOT_READY)) }, n4.onError(o4), o4);
            return true === i5 ? t5() : E2(i5);
          }).use(function(e6, t5) {
            if (true === function(n4, o4, i5) {
              if (void 0 === o4)
                return true;
              var a5 = true;
              if (m3(o4))
                Object.keys(o4).forEach(function(e8) {
                  var t6 = 1 === n4.length ? n4[0][e8] : void 0;
                  a5 = !!rn2(t6, o4[e8], i5, e8) && a5;
                });
              else if (O2(o4))
                for (var e7 = 0; e7 < o4.length; e7++)
                  a5 = !!rn2(n4[e7], o4[e7], i5, o4[e7].name) && a5;
              if (a5)
                return a5;
              throw new Error("Params validate failed.");
            }(e6, Bn2[a4], a4))
              return t5();
          }).use(function(e6, t5) {
            return s4[a4].apply(s4, e6);
          }), t4.run(e5);
        });
      }), i4);
      return Ir[n3] = e4, Bn2.hookGetAPITips(o3.getErrMsg.bind(o3)), M2.l("".concat(t3, " ok")), e4;
    }, Vn2.TYPES = R2, Vn2.EVENT = h3, Vn2.TSignaling = _2, Vn2.VERSION = "3.5.5", M2.l("TencentCloudChat.VERSION:".concat(Vn2.VERSION)), Vn2;
  });
})(chat);
var chatExports = chat.exports;
const e2 = /* @__PURE__ */ getDefaultExportFromCjs(chatExports);
var timUploadPlugin = { exports: {} };
(function(module2, exports2) {
  !function(e3, t2) {
    module2.exports = t2();
  }(commonjsGlobal, function() {
    function e3(e4, t3) {
      var o3 = Object.keys(e4);
      if (Object.getOwnPropertySymbols) {
        var n3 = Object.getOwnPropertySymbols(e4);
        t3 && (n3 = n3.filter(function(t4) {
          return Object.getOwnPropertyDescriptor(e4, t4).enumerable;
        })), o3.push.apply(o3, n3);
      }
      return o3;
    }
    function t2(t3) {
      for (var o3 = 1; o3 < arguments.length; o3++) {
        var n3 = null != arguments[o3] ? arguments[o3] : {};
        o3 % 2 ? e3(Object(n3), true).forEach(function(e4) {
          s3(t3, e4, n3[e4]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t3, Object.getOwnPropertyDescriptors(n3)) : e3(Object(n3)).forEach(function(e4) {
          Object.defineProperty(t3, e4, Object.getOwnPropertyDescriptor(n3, e4));
        });
      }
      return t3;
    }
    function o2(e4) {
      return (o2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e5) {
        return typeof e5;
      } : function(e5) {
        return e5 && "function" == typeof Symbol && e5.constructor === Symbol && e5 !== Symbol.prototype ? "symbol" : typeof e5;
      })(e4);
    }
    function n2(e4, t3) {
      if (!(e4 instanceof t3))
        throw new TypeError("Cannot call a class as a function");
    }
    function r2(e4, t3) {
      for (var o3 = 0; o3 < t3.length; o3++) {
        var n3 = t3[o3];
        n3.enumerable = n3.enumerable || false, n3.configurable = true, "value" in n3 && (n3.writable = true), Object.defineProperty(e4, n3.key, n3);
      }
    }
    function a3(e4, t3, o3) {
      return t3 && r2(e4.prototype, t3), o3 && r2(e4, o3), Object.defineProperty(e4, "prototype", { writable: false }), e4;
    }
    function s3(e4, t3, o3) {
      return t3 in e4 ? Object.defineProperty(e4, t3, { value: o3, enumerable: true, configurable: true, writable: true }) : e4[t3] = o3, e4;
    }
    function i3(e4, t3) {
      if (null == e4)
        return {};
      var o3, n3, r3 = function(e5, t4) {
        if (null == e5)
          return {};
        var o4, n4, r4 = {}, a5 = Object.keys(e5);
        for (n4 = 0; n4 < a5.length; n4++)
          o4 = a5[n4], t4.indexOf(o4) >= 0 || (r4[o4] = e5[o4]);
        return r4;
      }(e4, t3);
      if (Object.getOwnPropertySymbols) {
        var a4 = Object.getOwnPropertySymbols(e4);
        for (n3 = 0; n3 < a4.length; n3++)
          o3 = a4[n3], t3.indexOf(o3) >= 0 || Object.prototype.propertyIsEnumerable.call(e4, o3) && (r3[o3] = e4[o3]);
      }
      return r3;
    }
    var u2 = "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, l2 = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), f3 = "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting), c3 = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting), d3 = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting), p3 = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting), y2 = "undefined" != typeof index && "undefined" == typeof window && "function" == typeof index.requireNativePlugin, h3 = y2 && "ios" === index.getDeviceInfo().platform.toLocaleLowerCase(), g2 = (y2 && index.getDeviceInfo().platform.toLocaleLowerCase(), l2 || f3 || c3 || d3 || p3 || y2), m3 = void 0 !== u2 && (void 0 !== u2.nativeModuleProxy || void 0 !== u2.ReactNative), v3 = f3 ? qq : c3 ? tt : d3 ? swan : p3 ? my : l2 ? wx$1 : y2 ? index : {}, b2 = function(e4) {
      if ("object" !== o2(e4) || null === e4)
        return false;
      var t3 = Object.getPrototypeOf(e4);
      if (null === t3)
        return true;
      for (var n3 = t3; null !== Object.getPrototypeOf(n3); )
        n3 = Object.getPrototypeOf(n3);
      return t3 === n3;
    };
    function w2(e4) {
      if (null == e4)
        return true;
      if ("boolean" == typeof e4)
        return false;
      if ("number" == typeof e4)
        return 0 === e4;
      if ("string" == typeof e4)
        return 0 === e4.length;
      if ("function" == typeof e4)
        return 0 === e4.length;
      if (Array.isArray(e4))
        return 0 === e4.length;
      if (e4 instanceof Error)
        return "" === e4.message;
      if (b2(e4)) {
        for (var t3 in e4)
          if (Object.prototype.hasOwnProperty.call(e4, t3))
            return false;
        return true;
      }
      return false;
    }
    var O2 = function() {
      function e4() {
        n2(this, e4), this._n = "WebRequest";
      }
      return a3(e4, [{ key: "request", value: function(e5, o3) {
        var n3 = this, r3 = "".concat(this._n, ".request"), a4 = e5.downloadUrl || "", s4 = (e5.method || "PUT").toUpperCase(), i4 = e5.url;
        if (index.__f__("log", "at node_modules/tim-upload-plugin/index.js:1", "%c tim-upload-plugin %c", "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", "".concat(r3, " URL:").concat(i4)), e5.qs) {
          var u3 = function(e6) {
            var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "&", o4 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "=";
            return w2(e6) ? "" : b2(e6) ? Object.keys(e6).map(function(n4) {
              var r4 = encodeURIComponent(n4) + o4;
              return Array.isArray(e6[n4]) ? e6[n4].map(function(e7) {
                return r4 + encodeURIComponent(e7);
              }).join(t3) : r4 + encodeURIComponent(e6[n4]);
            }).filter(Boolean).join(t3) : void 0;
          }(e5.qs);
          u3 && (i4 += "".concat(-1 === i4.indexOf("?") ? "?" : "&").concat(u3));
        }
        var l3 = new XMLHttpRequest();
        l3.open(s4, i4, true), l3.responseType = e5.dataType || "text";
        var f4 = e5.headers || {};
        if (e5.uploadByIP && (f4 = t2(t2({}, f4), {}, { host: e5.uploadIP })), !w2(f4))
          for (var c4 in f4)
            f4.hasOwnProperty(c4) && "content-length" !== c4.toLowerCase() && "user-agent" !== c4.toLowerCase() && "origin" !== c4.toLowerCase() && "host" !== c4.toLowerCase() && l3.setRequestHeader(c4, f4[c4]);
        return l3.onload = function() {
          if (200 === l3.status)
            o3(null, n3._xhrRes(l3, n3._xhrBody(l3, a4, e5.uploadByIP && e5.uploadIP), f4));
          else {
            if (e5.uploadIP && -1 === e5.url.indexOf(e5.uploadIP))
              return e5.url = function(e6, t4) {
                return e6.replace(/^http(s)?:\/\/(.*?)\//, "https://".concat(t4, "/"));
              }(e5.url, e5.uploadIP), e5.uploadByIP = true, n3.request(e5, o3);
            var t3 = { code: l3.status, message: JSON.stringify(l3.responseText) };
            o3(t3, n3._xhrRes(l3, n3._xhrBody(l3, a4, e5.uploadByIP && e5.uploadIP), f4));
          }
        }, l3.onerror = function(t3) {
          var r4 = n3._xhrBody(l3, a4, e5.uploadByIP && e5.uploadIP), s5 = { code: l3.status, message: JSON.stringify(l3.responseText) };
          r4 || l3.statusText || 0 !== l3.status || (t3.message = "CORS blocked or network error"), o3(s5, n3._xhrRes(l3, r4)), s5 = null;
        }, e5.onProgress && l3.upload && (l3.upload.onprogress = function(t3) {
          var o4 = t3.total, n4 = t3.loaded, r4 = Math.floor(100 * n4 / o4);
          e5.onProgress({ total: o4, loaded: n4, percent: (r4 >= 100 ? 100 : r4) / 100 });
        }), l3.send(e5.resources), l3;
      } }, { key: "_xhrRes", value: function(e5, t3) {
        var o3 = {};
        return e5.getAllResponseHeaders().trim().split("\n").forEach(function(e6) {
          if (e6) {
            var t4 = e6.indexOf(":"), n3 = e6.substr(0, t4).trim().toLowerCase(), r3 = e6.substr(t4 + 1).trim();
            o3[n3] = r3;
          }
        }), { statusCode: e5.status, statusMessage: e5.statusText, headers: o3, data: t3 };
      } }, { key: "_xhrBody", value: function(e5, t3, o3) {
        return 200 === e5.status && t3 ? { location: t3, uploadIP: o3 } : { response: e5.responseText, uploadIP: o3 };
      } }]), e4;
    }(), S2 = ["unknown", "image", "video", "audio", "log"], P2 = ["name"], I2 = function() {
      function e4() {
        n2(this, e4);
      }
      return a3(e4, [{ key: "request", value: function(e5, o3) {
        var n3 = this, r3 = e5.resources, a4 = void 0 === r3 ? "" : r3, s4 = e5.headers, u3 = void 0 === s4 ? {} : s4, l3 = e5.url, f4 = e5.downloadUrl, c4 = void 0 === f4 ? "" : f4, d4 = l3, y3 = null, g3 = c4.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/), m4 = decodeURIComponent(g3[3]), b3 = m4.indexOf("?") > -1 ? m4.split("?")[0] : m4, w3 = { key: e5.fileKey ? e5.fileKey : b3, success_action_status: 200, "Content-Type": "" }, O3 = {};
        if (h3) {
          var I3 = l3.split("?sign=");
          if (I3.length > 1) {
            var C3 = I3[1];
            d4 = "".concat(I3[0], "?sign=").concat(encodeURIComponent("".concat(C3))), O3.sign = decodeURIComponent(C3), O3.signature = decodeURIComponent(C3);
          }
        }
        var k2 = { url: d4, header: u3, name: "file", filePath: a4, formData: t2(t2({}, w3), O3), timeout: e5.timeout || 3e5 };
        if (p3) {
          var x2 = k2;
          x2.name;
          k2 = t2(t2({}, i3(x2, P2)), {}, { fileName: "file", fileType: S2[e5.fileType] });
        }
        return (y3 = v3.uploadFile(t2(t2({}, k2), {}, { success: function(e6) {
          n3._handleResponse({ response: e6, downloadUrl: c4, callback: o3 });
        }, fail: function(e6) {
          n3._handleResponse({ response: e6, downloadUrl: c4, callback: o3 });
        } }))).onProgressUpdate && y3.onProgressUpdate(function(t3) {
          e5.onProgress && e5.onProgress({ total: t3.totalBytesExpectedToSend, loaded: t3.totalBytesSent, percent: Math.floor(t3.progress) / 100 });
        }), y3;
      } }, { key: "_handleResponse", value: function(e5) {
        var o3 = e5.downloadUrl, n3 = e5.response, r3 = e5.callback, a4 = n3.header, s4 = {};
        if (a4)
          for (var i4 in a4)
            a4.hasOwnProperty(i4) && (s4[i4.toLowerCase()] = a4[i4]);
        var u3 = +n3.statusCode;
        200 === u3 ? r3(null, { statusCode: u3, headers: s4, data: t2(t2({}, n3.data), {}, { location: o3 }) }) : r3({ code: u3, message: JSON.stringify(n3.data) }, { statusCode: u3, headers: s4, data: void 0 });
      } }]), e4;
    }(), C2 = function() {
      function e4() {
        n2(this, e4);
      }
      return a3(e4, [{ key: "request", value: function(e5, t3) {
        var o3 = this, n3 = e5.resources, r3 = void 0 === n3 ? "" : n3, a4 = e5.fileKey, s4 = void 0 === a4 ? "" : a4, i4 = e5.url, u3 = e5.downloadUrl, l3 = void 0 === u3 ? "" : u3, f4 = new FormData();
        f4.append("key", s4), f4.append("success_action_status", 200), f4.append("file", { uri: r3, type: "application/octet-stream", name: "uploaded_file" }), fetch(i4, { method: "POST", headers: { "Content-Type": "multipart/form-data" }, body: f4 }).then(function(e6) {
          o3._handleResponse({ response: e6, downloadUrl: l3, callback: t3 });
        }).catch(function(e6) {
          o3._handleResponse({ response: e6, downloadUrl: l3, callback: t3 });
        });
      } }, { key: "_handleResponse", value: function(e5) {
        var t3 = e5.downloadUrl, o3 = e5.response, n3 = e5.callback, r3 = o3.headers, a4 = o3.status, s4 = r3 && r3.map || {};
        200 === a4 ? n3(null, { statusCode: 200, headers: s4, data: { location: t3 } }) : n3({ code: a4, message: JSON.stringify(o3) }, { statusCode: a4, headers: s4, data: void 0 });
      } }]), e4;
    }();
    return function() {
      function e4() {
        n2(this, e4), this.retry = 1, this.tryCount = 0, this.systemClockOffset = 0, this.httpRequest = g2 ? new I2() : m3 ? new C2() : new O2(), index.__f__("log", "at node_modules/tim-upload-plugin/index.js:1", "TIMUploadPlugin.VERSION: ".concat("1.4.2"));
      }
      return a3(e4, [{ key: "uploadFile", value: function(e5, t3) {
        var o3 = this;
        return this.httpRequest.request(e5, function(n3, r3) {
          n3 && o3.tryCount < o3.retry && o3.allowRetry(n3) ? (o3.tryCount++, o3.uploadFile(e5, t3)) : (o3.tryCount = 0, t3(n3, r3));
        });
      } }, { key: "allowRetry", value: function(e5) {
        var t3 = false, o3 = false;
        if (e5) {
          var n3 = e5.headers && (e5.headers.date || e5.headers.Date) || e5.error && e5.error.ServerTime;
          try {
            var r3 = e5.error && e5.error.Code, a4 = e5.error && e5.error.Message;
            ("RequestTimeTooSkewed" === r3 || "AccessDenied" === r3 && "Request has expired" === a4) && (o3 = true);
          } catch (u3) {
          }
          if (o3 && n3) {
            var s4 = Date.now(), i4 = Date.parse(n3);
            Math.abs(s4 + this.systemClockOffset - i4) >= 3e4 && (this.systemClockOffset = i4 - s4, t3 = true);
          } else
            5 === Math.floor(e5.statusCode / 100) && (t3 = true);
        }
        return t3;
      } }], [{ key: "getVersion", value: function() {
        return "1.4.2";
      } }]), e4;
    }();
  });
})(timUploadPlugin);
var timUploadPluginExports = timUploadPlugin.exports;
const t = /* @__PURE__ */ getDefaultExportFromCjs(timUploadPluginExports);
var timProfanityFilterPlugin = { exports: {} };
(function(module2, exports2) {
  !function(t2, e3) {
    module2.exports = e3();
  }(commonjsGlobal, function() {
    function t2(t3, e4) {
      if (!(t3 instanceof e4))
        throw new TypeError("Cannot call a class as a function");
    }
    function e3(t3, e4) {
      for (var r3 = 0; r3 < e4.length; r3++) {
        var i4 = e4[r3];
        i4.enumerable = i4.enumerable || false, i4.configurable = true, "value" in i4 && (i4.writable = true), Object.defineProperty(t3, (n3 = i4.key, o3 = void 0, "symbol" == typeof (o3 = function(t4, e5) {
          if ("object" != typeof t4 || null === t4)
            return t4;
          var r4 = t4[Symbol.toPrimitive];
          if (void 0 !== r4) {
            var i5 = r4.call(t4, e5 || "default");
            if ("object" != typeof i5)
              return i5;
            throw new TypeError("@@toPrimitive must return a primitive value.");
          }
          return ("string" === e5 ? String : Number)(t4);
        }(n3, "string")) ? o3 : String(o3)), i4);
      }
      var n3, o3;
    }
    function r2(t3, r3, i4) {
      return r3 && e3(t3.prototype, r3), i4 && e3(t3, i4), Object.defineProperty(t3, "prototype", { writable: false }), t3;
    }
    function i3(t3, e4) {
      return function(t4) {
        if (Array.isArray(t4))
          return t4;
      }(t3) || function(t4, e5) {
        var r3 = null == t4 ? null : "undefined" != typeof Symbol && t4[Symbol.iterator] || t4["@@iterator"];
        if (null != r3) {
          var i4, n3, o3, s4, a4 = [], c4 = true, h4 = false;
          try {
            if (o3 = (r3 = r3.call(t4)).next, 0 === e5) {
              if (Object(r3) !== r3)
                return;
              c4 = false;
            } else
              for (; !(c4 = (i4 = o3.call(r3)).done) && (a4.push(i4.value), a4.length !== e5); c4 = true)
                ;
          } catch (t5) {
            h4 = true, n3 = t5;
          } finally {
            try {
              if (!c4 && null != r3.return && (s4 = r3.return(), Object(s4) !== s4))
                return;
            } finally {
              if (h4)
                throw n3;
            }
          }
          return a4;
        }
      }(t3, e4) || o2(t3, e4) || function() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function n2(t3) {
      return function(t4) {
        if (Array.isArray(t4))
          return s3(t4);
      }(t3) || function(t4) {
        if ("undefined" != typeof Symbol && null != t4[Symbol.iterator] || null != t4["@@iterator"])
          return Array.from(t4);
      }(t3) || o2(t3) || function() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }();
    }
    function o2(t3, e4) {
      if (t3) {
        if ("string" == typeof t3)
          return s3(t3, e4);
        var r3 = Object.prototype.toString.call(t3).slice(8, -1);
        return "Object" === r3 && t3.constructor && (r3 = t3.constructor.name), "Map" === r3 || "Set" === r3 ? Array.from(t3) : "Arguments" === r3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r3) ? s3(t3, e4) : void 0;
      }
    }
    function s3(t3, e4) {
      (null == e4 || e4 > t3.length) && (e4 = t3.length);
      for (var r3 = 0, i4 = new Array(e4); r3 < e4; r3++)
        i4[r3] = t3[r3];
      return i4;
    }
    function a3(t3, e4) {
      var r3 = "undefined" != typeof Symbol && t3[Symbol.iterator] || t3["@@iterator"];
      if (!r3) {
        if (Array.isArray(t3) || (r3 = o2(t3)) || e4 && t3 && "number" == typeof t3.length) {
          r3 && (t3 = r3);
          var i4 = 0, n3 = function() {
          };
          return { s: n3, n: function() {
            return i4 >= t3.length ? { done: true } : { done: false, value: t3[i4++] };
          }, e: function(t4) {
            throw t4;
          }, f: n3 };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      var s4, a4 = true, c4 = false;
      return { s: function() {
        r3 = r3.call(t3);
      }, n: function() {
        var t4 = r3.next();
        return a4 = t4.done, t4;
      }, e: function(t4) {
        c4 = true, s4 = t4;
      }, f: function() {
        try {
          a4 || null == r3.return || r3.return();
        } finally {
          if (c4)
            throw s4;
        }
      } };
    }
    var c3 = function() {
      for (var t3 = ` 	\r
~!@#$%^&*()_+-=【】、{}|;':"，。、《》？αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。，、；：？！…—·ˉ¨‘’“”々～‖∶＂＇｀｜〃〔〕〈〉《》「」『』．〖〗【】（）［］｛｝ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠＝≤≥＜＞≮≯∷±＋－×÷／∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°＃＆＠＼︿＿￣―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄`, e4 = /* @__PURE__ */ new Map(), r3 = 0, i4 = t3.length; r3 < i4; r3++)
        e4.set(t3.charCodeAt(0), true);
      return e4;
    }(), h3 = function() {
      function e4(r3) {
        t2(this, e4);
        var i4, o3 = r3.input, s4 = r3.isArray, a4 = r3.isMap;
        this._trieTree = {}, s4(o3) ? i4 = o3 : a4(o3) && (i4 = n2(o3.keys()), this._map = o3);
        for (var c4 = 0, h4 = i4.length; c4 < h4; c4++)
          if (i4[c4]) {
            for (var l3 = this._trieTree, f4 = i4[c4], u3 = 0, d3 = f4.length; u3 < d3; u3++)
              l3[f4[u3]] || (l3[f4[u3]] = {}), l3 = l3[f4[u3]];
            l3.isEnd = true;
          }
      }
      return r2(e4, [{ key: "filter", value: function(t3) {
        var e5 = t3.text, r3 = t3.replacingEnabled;
        if (0 === Object.keys(this._trieTree).length)
          return { isMatched: false, modifiedText: e5 };
        for (var i4 = this._trieTree, n3 = e5.toLowerCase(), o3 = "", s4 = false, a4 = n3.length, h4 = 0; h4 < a4; h4++)
          if (true !== c3.get(n3.charCodeAt(h4))) {
            for (var l3 = 0, f4 = "", u3 = false, d3 = h4; d3 < a4; d3++) {
              if (!i4[n3[d3]]) {
                i4 = this._trieTree;
                break;
              }
              if (f4 += n3[d3], i4[n3[d3]].isEnd) {
                u3 = true, l3 = d3 - h4, i4 = this._trieTree;
                break;
              }
              i4 = i4[n3[d3]];
            }
            if (l3 > 1 && (h4 += l3), u3) {
              if (s4 = true, !r3)
                break;
              var p3 = this._map.get(f4) || "*";
              o3 = e5.replace(new RegExp(f4, "gi"), p3);
            }
          }
        return { isMatched: s4, modifiedText: o3 };
      } }, { key: "reset", value: function() {
        this._trieTree = {}, this._map = null;
      } }]), e4;
    }(), l2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : {};
    var f3 = {}, u2 = function(t3, e4) {
      return t3(e4 = { exports: {} }, e4.exports), e4.exports;
    }(function(t3, e4) {
      var r3, i4, n3, o3, s4, a4;
      t3.exports = (a4 = a4 || function(t4, e5) {
        var r4;
        if ("undefined" != typeof window && window.crypto && (r4 = window.crypto), !r4 && "undefined" != typeof window && window.msCrypto && (r4 = window.msCrypto), !r4 && void 0 !== l2 && l2.crypto && (r4 = l2.crypto), !r4)
          try {
            r4 = f3;
          } catch (v3) {
          }
        var i5 = function() {
          if (r4) {
            if ("function" == typeof r4.getRandomValues)
              try {
                return r4.getRandomValues(new Uint32Array(1))[0];
              } catch (v3) {
              }
            if ("function" == typeof r4.randomBytes)
              try {
                return r4.randomBytes(4).readInt32LE();
              } catch (v3) {
              }
          }
          throw new Error("Native crypto module could not be used to get secure random number.");
        }, n4 = Object.create || /* @__PURE__ */ function() {
          function t5() {
          }
          return function(e6) {
            var r5;
            return t5.prototype = e6, r5 = new t5(), t5.prototype = null, r5;
          };
        }(), o4 = {}, s5 = o4.lib = {}, a5 = s5.Base = { extend: function(t5) {
          var e6 = n4(this);
          return t5 && e6.mixIn(t5), e6.hasOwnProperty("init") && this.init !== e6.init || (e6.init = function() {
            e6.$super.init.apply(this, arguments);
          }), e6.init.prototype = e6, e6.$super = this, e6;
        }, create: function() {
          var t5 = this.extend();
          return t5.init.apply(t5, arguments), t5;
        }, init: function() {
        }, mixIn: function(t5) {
          for (var e6 in t5)
            t5.hasOwnProperty(e6) && (this[e6] = t5[e6]);
          t5.hasOwnProperty("toString") && (this.toString = t5.toString);
        }, clone: function() {
          return this.init.prototype.extend(this);
        } }, c4 = s5.WordArray = a5.extend({ init: function(t5, e6) {
          t5 = this.words = t5 || [], this.sigBytes = null != e6 ? e6 : 4 * t5.length;
        }, toString: function(t5) {
          return (t5 || u3).stringify(this);
        }, concat: function(t5) {
          var e6 = this.words, r5 = t5.words, i6 = this.sigBytes, n5 = t5.sigBytes;
          if (this.clamp(), i6 % 4)
            for (var o5 = 0; o5 < n5; o5++) {
              var s6 = r5[o5 >>> 2] >>> 24 - o5 % 4 * 8 & 255;
              e6[i6 + o5 >>> 2] |= s6 << 24 - (i6 + o5) % 4 * 8;
            }
          else
            for (o5 = 0; o5 < n5; o5 += 4)
              e6[i6 + o5 >>> 2] = r5[o5 >>> 2];
          return this.sigBytes += n5, this;
        }, clamp: function() {
          var e6 = this.words, r5 = this.sigBytes;
          e6[r5 >>> 2] &= 4294967295 << 32 - r5 % 4 * 8, e6.length = t4.ceil(r5 / 4);
        }, clone: function() {
          var t5 = a5.clone.call(this);
          return t5.words = this.words.slice(0), t5;
        }, random: function(t5) {
          for (var e6 = [], r5 = 0; r5 < t5; r5 += 4)
            e6.push(i5());
          return new c4.init(e6, t5);
        } }), h4 = o4.enc = {}, u3 = h4.Hex = { stringify: function(t5) {
          for (var e6 = t5.words, r5 = t5.sigBytes, i6 = [], n5 = 0; n5 < r5; n5++) {
            var o5 = e6[n5 >>> 2] >>> 24 - n5 % 4 * 8 & 255;
            i6.push((o5 >>> 4).toString(16)), i6.push((15 & o5).toString(16));
          }
          return i6.join("");
        }, parse: function(t5) {
          for (var e6 = t5.length, r5 = [], i6 = 0; i6 < e6; i6 += 2)
            r5[i6 >>> 3] |= parseInt(t5.substr(i6, 2), 16) << 24 - i6 % 8 * 4;
          return new c4.init(r5, e6 / 2);
        } }, d3 = h4.Latin1 = { stringify: function(t5) {
          for (var e6 = t5.words, r5 = t5.sigBytes, i6 = [], n5 = 0; n5 < r5; n5++) {
            var o5 = e6[n5 >>> 2] >>> 24 - n5 % 4 * 8 & 255;
            i6.push(String.fromCharCode(o5));
          }
          return i6.join("");
        }, parse: function(t5) {
          for (var e6 = t5.length, r5 = [], i6 = 0; i6 < e6; i6++)
            r5[i6 >>> 2] |= (255 & t5.charCodeAt(i6)) << 24 - i6 % 4 * 8;
          return new c4.init(r5, e6);
        } }, p3 = h4.Utf8 = { stringify: function(t5) {
          try {
            return decodeURIComponent(escape(d3.stringify(t5)));
          } catch (e6) {
            throw new Error("Malformed UTF-8 data");
          }
        }, parse: function(t5) {
          return d3.parse(unescape(encodeURIComponent(t5)));
        } }, _2 = s5.BufferedBlockAlgorithm = a5.extend({ reset: function() {
          this._data = new c4.init(), this._nDataBytes = 0;
        }, _append: function(t5) {
          "string" == typeof t5 && (t5 = p3.parse(t5)), this._data.concat(t5), this._nDataBytes += t5.sigBytes;
        }, _process: function(e6) {
          var r5, i6 = this._data, n5 = i6.words, o5 = i6.sigBytes, s6 = this.blockSize, a6 = o5 / (4 * s6), h5 = (a6 = e6 ? t4.ceil(a6) : t4.max((0 | a6) - this._minBufferSize, 0)) * s6, l3 = t4.min(4 * h5, o5);
          if (h5) {
            for (var f4 = 0; f4 < h5; f4 += s6)
              this._doProcessBlock(n5, f4);
            r5 = n5.splice(0, h5), i6.sigBytes -= l3;
          }
          return new c4.init(r5, l3);
        }, clone: function() {
          var t5 = a5.clone.call(this);
          return t5._data = this._data.clone(), t5;
        }, _minBufferSize: 0 }), y2 = (s5.Hasher = _2.extend({ cfg: a5.extend(), init: function(t5) {
          this.cfg = this.cfg.extend(t5), this.reset();
        }, reset: function() {
          _2.reset.call(this), this._doReset();
        }, update: function(t5) {
          return this._append(t5), this._process(), this;
        }, finalize: function(t5) {
          return t5 && this._append(t5), this._doFinalize();
        }, blockSize: 16, _createHelper: function(t5) {
          return function(e6, r5) {
            return new t5.init(r5).finalize(e6);
          };
        }, _createHmacHelper: function(t5) {
          return function(e6, r5) {
            return new y2.HMAC.init(t5, r5).finalize(e6);
          };
        } }), o4.algo = {});
        return o4;
      }(Math), s4 = (o3 = a4).lib.WordArray, o3.enc.Base64 = { stringify: function(t4) {
        var e5 = t4.words, r4 = t4.sigBytes, i5 = this._map;
        t4.clamp();
        for (var n4 = [], o4 = 0; o4 < r4; o4 += 3)
          for (var s5 = (e5[o4 >>> 2] >>> 24 - o4 % 4 * 8 & 255) << 16 | (e5[o4 + 1 >>> 2] >>> 24 - (o4 + 1) % 4 * 8 & 255) << 8 | e5[o4 + 2 >>> 2] >>> 24 - (o4 + 2) % 4 * 8 & 255, a5 = 0; a5 < 4 && o4 + 0.75 * a5 < r4; a5++)
            n4.push(i5.charAt(s5 >>> 6 * (3 - a5) & 63));
        var c4 = i5.charAt(64);
        if (c4)
          for (; n4.length % 4; )
            n4.push(c4);
        return n4.join("");
      }, parse: function(t4) {
        var e5 = t4.length, r4 = this._map, i5 = this._reverseMap;
        if (!i5) {
          i5 = this._reverseMap = [];
          for (var n4 = 0; n4 < r4.length; n4++)
            i5[r4.charCodeAt(n4)] = n4;
        }
        var o4 = r4.charAt(64);
        if (o4) {
          var a5 = t4.indexOf(o4);
          -1 !== a5 && (e5 = a5);
        }
        return function(t5, e6, r5) {
          for (var i6 = [], n5 = 0, o5 = 0; o5 < e6; o5++)
            if (o5 % 4) {
              var a6 = r5[t5.charCodeAt(o5 - 1)] << o5 % 4 * 2, c4 = r5[t5.charCodeAt(o5)] >>> 6 - o5 % 4 * 2, h4 = a6 | c4;
              i6[n5 >>> 2] |= h4 << 24 - n5 % 4 * 8, n5++;
            }
          return s4.create(i6, n5);
        }(t4, e5, i5);
      }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" }, function(t4) {
        var e5 = a4, r4 = e5.lib, i5 = r4.WordArray, n4 = r4.Hasher, o4 = e5.algo, s5 = [];
        !function() {
          for (var e6 = 0; e6 < 64; e6++)
            s5[e6] = 4294967296 * t4.abs(t4.sin(e6 + 1)) | 0;
        }();
        var c4 = o4.MD5 = n4.extend({ _doReset: function() {
          this._hash = new i5.init([1732584193, 4023233417, 2562383102, 271733878]);
        }, _doProcessBlock: function(t5, e6) {
          for (var r5 = 0; r5 < 16; r5++) {
            var i6 = e6 + r5, n5 = t5[i6];
            t5[i6] = 16711935 & (n5 << 8 | n5 >>> 24) | 4278255360 & (n5 << 24 | n5 >>> 8);
          }
          var o5 = this._hash.words, a5 = t5[e6 + 0], c5 = t5[e6 + 1], d3 = t5[e6 + 2], p3 = t5[e6 + 3], _2 = t5[e6 + 4], y2 = t5[e6 + 5], v3 = t5[e6 + 6], g2 = t5[e6 + 7], w2 = t5[e6 + 8], B2 = t5[e6 + 9], k2 = t5[e6 + 10], m3 = t5[e6 + 11], b2 = t5[e6 + 12], x2 = t5[e6 + 13], S2 = t5[e6 + 14], A2 = t5[e6 + 15], H2 = o5[0], C2 = o5[1], z2 = o5[2], E2 = o5[3];
          H2 = h4(H2, C2, z2, E2, a5, 7, s5[0]), E2 = h4(E2, H2, C2, z2, c5, 12, s5[1]), z2 = h4(z2, E2, H2, C2, d3, 17, s5[2]), C2 = h4(C2, z2, E2, H2, p3, 22, s5[3]), H2 = h4(H2, C2, z2, E2, _2, 7, s5[4]), E2 = h4(E2, H2, C2, z2, y2, 12, s5[5]), z2 = h4(z2, E2, H2, C2, v3, 17, s5[6]), C2 = h4(C2, z2, E2, H2, g2, 22, s5[7]), H2 = h4(H2, C2, z2, E2, w2, 7, s5[8]), E2 = h4(E2, H2, C2, z2, B2, 12, s5[9]), z2 = h4(z2, E2, H2, C2, k2, 17, s5[10]), C2 = h4(C2, z2, E2, H2, m3, 22, s5[11]), H2 = h4(H2, C2, z2, E2, b2, 7, s5[12]), E2 = h4(E2, H2, C2, z2, x2, 12, s5[13]), z2 = h4(z2, E2, H2, C2, S2, 17, s5[14]), H2 = l3(H2, C2 = h4(C2, z2, E2, H2, A2, 22, s5[15]), z2, E2, c5, 5, s5[16]), E2 = l3(E2, H2, C2, z2, v3, 9, s5[17]), z2 = l3(z2, E2, H2, C2, m3, 14, s5[18]), C2 = l3(C2, z2, E2, H2, a5, 20, s5[19]), H2 = l3(H2, C2, z2, E2, y2, 5, s5[20]), E2 = l3(E2, H2, C2, z2, k2, 9, s5[21]), z2 = l3(z2, E2, H2, C2, A2, 14, s5[22]), C2 = l3(C2, z2, E2, H2, _2, 20, s5[23]), H2 = l3(H2, C2, z2, E2, B2, 5, s5[24]), E2 = l3(E2, H2, C2, z2, S2, 9, s5[25]), z2 = l3(z2, E2, H2, C2, p3, 14, s5[26]), C2 = l3(C2, z2, E2, H2, w2, 20, s5[27]), H2 = l3(H2, C2, z2, E2, x2, 5, s5[28]), E2 = l3(E2, H2, C2, z2, d3, 9, s5[29]), z2 = l3(z2, E2, H2, C2, g2, 14, s5[30]), H2 = f4(H2, C2 = l3(C2, z2, E2, H2, b2, 20, s5[31]), z2, E2, y2, 4, s5[32]), E2 = f4(E2, H2, C2, z2, w2, 11, s5[33]), z2 = f4(z2, E2, H2, C2, m3, 16, s5[34]), C2 = f4(C2, z2, E2, H2, S2, 23, s5[35]), H2 = f4(H2, C2, z2, E2, c5, 4, s5[36]), E2 = f4(E2, H2, C2, z2, _2, 11, s5[37]), z2 = f4(z2, E2, H2, C2, g2, 16, s5[38]), C2 = f4(C2, z2, E2, H2, k2, 23, s5[39]), H2 = f4(H2, C2, z2, E2, x2, 4, s5[40]), E2 = f4(E2, H2, C2, z2, a5, 11, s5[41]), z2 = f4(z2, E2, H2, C2, p3, 16, s5[42]), C2 = f4(C2, z2, E2, H2, v3, 23, s5[43]), H2 = f4(H2, C2, z2, E2, B2, 4, s5[44]), E2 = f4(E2, H2, C2, z2, b2, 11, s5[45]), z2 = f4(z2, E2, H2, C2, A2, 16, s5[46]), H2 = u3(H2, C2 = f4(C2, z2, E2, H2, d3, 23, s5[47]), z2, E2, a5, 6, s5[48]), E2 = u3(E2, H2, C2, z2, g2, 10, s5[49]), z2 = u3(z2, E2, H2, C2, S2, 15, s5[50]), C2 = u3(C2, z2, E2, H2, y2, 21, s5[51]), H2 = u3(H2, C2, z2, E2, b2, 6, s5[52]), E2 = u3(E2, H2, C2, z2, p3, 10, s5[53]), z2 = u3(z2, E2, H2, C2, k2, 15, s5[54]), C2 = u3(C2, z2, E2, H2, c5, 21, s5[55]), H2 = u3(H2, C2, z2, E2, w2, 6, s5[56]), E2 = u3(E2, H2, C2, z2, A2, 10, s5[57]), z2 = u3(z2, E2, H2, C2, v3, 15, s5[58]), C2 = u3(C2, z2, E2, H2, x2, 21, s5[59]), H2 = u3(H2, C2, z2, E2, _2, 6, s5[60]), E2 = u3(E2, H2, C2, z2, m3, 10, s5[61]), z2 = u3(z2, E2, H2, C2, d3, 15, s5[62]), C2 = u3(C2, z2, E2, H2, B2, 21, s5[63]), o5[0] = o5[0] + H2 | 0, o5[1] = o5[1] + C2 | 0, o5[2] = o5[2] + z2 | 0, o5[3] = o5[3] + E2 | 0;
        }, _doFinalize: function() {
          var e6 = this._data, r5 = e6.words, i6 = 8 * this._nDataBytes, n5 = 8 * e6.sigBytes;
          r5[n5 >>> 5] |= 128 << 24 - n5 % 32;
          var o5 = t4.floor(i6 / 4294967296), s6 = i6;
          r5[15 + (n5 + 64 >>> 9 << 4)] = 16711935 & (o5 << 8 | o5 >>> 24) | 4278255360 & (o5 << 24 | o5 >>> 8), r5[14 + (n5 + 64 >>> 9 << 4)] = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), e6.sigBytes = 4 * (r5.length + 1), this._process();
          for (var a5 = this._hash, c5 = a5.words, h5 = 0; h5 < 4; h5++) {
            var l4 = c5[h5];
            c5[h5] = 16711935 & (l4 << 8 | l4 >>> 24) | 4278255360 & (l4 << 24 | l4 >>> 8);
          }
          return a5;
        }, clone: function() {
          var t5 = n4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        function h4(t5, e6, r5, i6, n5, o5, s6) {
          var a5 = t5 + (e6 & r5 | ~e6 & i6) + n5 + s6;
          return (a5 << o5 | a5 >>> 32 - o5) + e6;
        }
        function l3(t5, e6, r5, i6, n5, o5, s6) {
          var a5 = t5 + (e6 & i6 | r5 & ~i6) + n5 + s6;
          return (a5 << o5 | a5 >>> 32 - o5) + e6;
        }
        function f4(t5, e6, r5, i6, n5, o5, s6) {
          var a5 = t5 + (e6 ^ r5 ^ i6) + n5 + s6;
          return (a5 << o5 | a5 >>> 32 - o5) + e6;
        }
        function u3(t5, e6, r5, i6, n5, o5, s6) {
          var a5 = t5 + (r5 ^ (e6 | ~i6)) + n5 + s6;
          return (a5 << o5 | a5 >>> 32 - o5) + e6;
        }
        e5.MD5 = n4._createHelper(c4), e5.HmacMD5 = n4._createHmacHelper(c4);
      }(Math), function() {
        var t4 = a4, e5 = t4.lib, r4 = e5.WordArray, i5 = e5.Hasher, n4 = t4.algo, o4 = [], s5 = n4.SHA1 = i5.extend({ _doReset: function() {
          this._hash = new r4.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
        }, _doProcessBlock: function(t5, e6) {
          for (var r5 = this._hash.words, i6 = r5[0], n5 = r5[1], s6 = r5[2], a5 = r5[3], c4 = r5[4], h4 = 0; h4 < 80; h4++) {
            if (h4 < 16)
              o4[h4] = 0 | t5[e6 + h4];
            else {
              var l3 = o4[h4 - 3] ^ o4[h4 - 8] ^ o4[h4 - 14] ^ o4[h4 - 16];
              o4[h4] = l3 << 1 | l3 >>> 31;
            }
            var f4 = (i6 << 5 | i6 >>> 27) + c4 + o4[h4];
            f4 += h4 < 20 ? 1518500249 + (n5 & s6 | ~n5 & a5) : h4 < 40 ? 1859775393 + (n5 ^ s6 ^ a5) : h4 < 60 ? (n5 & s6 | n5 & a5 | s6 & a5) - 1894007588 : (n5 ^ s6 ^ a5) - 899497514, c4 = a5, a5 = s6, s6 = n5 << 30 | n5 >>> 2, n5 = i6, i6 = f4;
          }
          r5[0] = r5[0] + i6 | 0, r5[1] = r5[1] + n5 | 0, r5[2] = r5[2] + s6 | 0, r5[3] = r5[3] + a5 | 0, r5[4] = r5[4] + c4 | 0;
        }, _doFinalize: function() {
          var t5 = this._data, e6 = t5.words, r5 = 8 * this._nDataBytes, i6 = 8 * t5.sigBytes;
          return e6[i6 >>> 5] |= 128 << 24 - i6 % 32, e6[14 + (i6 + 64 >>> 9 << 4)] = Math.floor(r5 / 4294967296), e6[15 + (i6 + 64 >>> 9 << 4)] = r5, t5.sigBytes = 4 * e6.length, this._process(), this._hash;
        }, clone: function() {
          var t5 = i5.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        t4.SHA1 = i5._createHelper(s5), t4.HmacSHA1 = i5._createHmacHelper(s5);
      }(), function(t4) {
        var e5 = a4, r4 = e5.lib, i5 = r4.WordArray, n4 = r4.Hasher, o4 = e5.algo, s5 = [], c4 = [];
        !function() {
          function e6(e7) {
            for (var r6 = t4.sqrt(e7), i7 = 2; i7 <= r6; i7++)
              if (!(e7 % i7))
                return false;
            return true;
          }
          function r5(t5) {
            return 4294967296 * (t5 - (0 | t5)) | 0;
          }
          for (var i6 = 2, n5 = 0; n5 < 64; )
            e6(i6) && (n5 < 8 && (s5[n5] = r5(t4.pow(i6, 0.5))), c4[n5] = r5(t4.pow(i6, 1 / 3)), n5++), i6++;
        }();
        var h4 = [], l3 = o4.SHA256 = n4.extend({ _doReset: function() {
          this._hash = new i5.init(s5.slice(0));
        }, _doProcessBlock: function(t5, e6) {
          for (var r5 = this._hash.words, i6 = r5[0], n5 = r5[1], o5 = r5[2], s6 = r5[3], a5 = r5[4], l4 = r5[5], f4 = r5[6], u3 = r5[7], d3 = 0; d3 < 64; d3++) {
            if (d3 < 16)
              h4[d3] = 0 | t5[e6 + d3];
            else {
              var p3 = h4[d3 - 15], _2 = (p3 << 25 | p3 >>> 7) ^ (p3 << 14 | p3 >>> 18) ^ p3 >>> 3, y2 = h4[d3 - 2], v3 = (y2 << 15 | y2 >>> 17) ^ (y2 << 13 | y2 >>> 19) ^ y2 >>> 10;
              h4[d3] = _2 + h4[d3 - 7] + v3 + h4[d3 - 16];
            }
            var g2 = i6 & n5 ^ i6 & o5 ^ n5 & o5, w2 = (i6 << 30 | i6 >>> 2) ^ (i6 << 19 | i6 >>> 13) ^ (i6 << 10 | i6 >>> 22), B2 = u3 + ((a5 << 26 | a5 >>> 6) ^ (a5 << 21 | a5 >>> 11) ^ (a5 << 7 | a5 >>> 25)) + (a5 & l4 ^ ~a5 & f4) + c4[d3] + h4[d3];
            u3 = f4, f4 = l4, l4 = a5, a5 = s6 + B2 | 0, s6 = o5, o5 = n5, n5 = i6, i6 = B2 + (w2 + g2) | 0;
          }
          r5[0] = r5[0] + i6 | 0, r5[1] = r5[1] + n5 | 0, r5[2] = r5[2] + o5 | 0, r5[3] = r5[3] + s6 | 0, r5[4] = r5[4] + a5 | 0, r5[5] = r5[5] + l4 | 0, r5[6] = r5[6] + f4 | 0, r5[7] = r5[7] + u3 | 0;
        }, _doFinalize: function() {
          var e6 = this._data, r5 = e6.words, i6 = 8 * this._nDataBytes, n5 = 8 * e6.sigBytes;
          return r5[n5 >>> 5] |= 128 << 24 - n5 % 32, r5[14 + (n5 + 64 >>> 9 << 4)] = t4.floor(i6 / 4294967296), r5[15 + (n5 + 64 >>> 9 << 4)] = i6, e6.sigBytes = 4 * r5.length, this._process(), this._hash;
        }, clone: function() {
          var t5 = n4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        e5.SHA256 = n4._createHelper(l3), e5.HmacSHA256 = n4._createHmacHelper(l3);
      }(Math), function() {
        var t4 = a4, e5 = t4.lib.WordArray, r4 = t4.enc;
        function i5(t5) {
          return t5 << 8 & 4278255360 | t5 >>> 8 & 16711935;
        }
        r4.Utf16 = r4.Utf16BE = { stringify: function(t5) {
          for (var e6 = t5.words, r5 = t5.sigBytes, i6 = [], n4 = 0; n4 < r5; n4 += 2) {
            var o4 = e6[n4 >>> 2] >>> 16 - n4 % 4 * 8 & 65535;
            i6.push(String.fromCharCode(o4));
          }
          return i6.join("");
        }, parse: function(t5) {
          for (var r5 = t5.length, i6 = [], n4 = 0; n4 < r5; n4++)
            i6[n4 >>> 1] |= t5.charCodeAt(n4) << 16 - n4 % 2 * 16;
          return e5.create(i6, 2 * r5);
        } }, r4.Utf16LE = { stringify: function(t5) {
          for (var e6 = t5.words, r5 = t5.sigBytes, n4 = [], o4 = 0; o4 < r5; o4 += 2) {
            var s5 = i5(e6[o4 >>> 2] >>> 16 - o4 % 4 * 8 & 65535);
            n4.push(String.fromCharCode(s5));
          }
          return n4.join("");
        }, parse: function(t5) {
          for (var r5 = t5.length, n4 = [], o4 = 0; o4 < r5; o4++)
            n4[o4 >>> 1] |= i5(t5.charCodeAt(o4) << 16 - o4 % 2 * 16);
          return e5.create(n4, 2 * r5);
        } };
      }(), function() {
        if ("function" == typeof ArrayBuffer) {
          var t4 = a4.lib.WordArray, e5 = t4.init;
          (t4.init = function(t5) {
            if (t5 instanceof ArrayBuffer && (t5 = new Uint8Array(t5)), (t5 instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t5 instanceof Uint8ClampedArray || t5 instanceof Int16Array || t5 instanceof Uint16Array || t5 instanceof Int32Array || t5 instanceof Uint32Array || t5 instanceof Float32Array || t5 instanceof Float64Array) && (t5 = new Uint8Array(t5.buffer, t5.byteOffset, t5.byteLength)), t5 instanceof Uint8Array) {
              for (var r4 = t5.byteLength, i5 = [], n4 = 0; n4 < r4; n4++)
                i5[n4 >>> 2] |= t5[n4] << 24 - n4 % 4 * 8;
              e5.call(this, i5, r4);
            } else
              e5.apply(this, arguments);
          }).prototype = t4;
        }
      }(), /** @preserve
            (c) 2012 by C��dric Mesnil. All rights reserved.
             Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
                 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
                - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
             THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
            */
      function(t4) {
        var e5 = a4, r4 = e5.lib, i5 = r4.WordArray, n4 = r4.Hasher, o4 = e5.algo, s5 = i5.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]), c4 = i5.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]), h4 = i5.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]), l3 = i5.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]), f4 = i5.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), u3 = i5.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), d3 = o4.RIPEMD160 = n4.extend({ _doReset: function() {
          this._hash = i5.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
        }, _doProcessBlock: function(t5, e6) {
          for (var r5 = 0; r5 < 16; r5++) {
            var i6 = e6 + r5, n5 = t5[i6];
            t5[i6] = 16711935 & (n5 << 8 | n5 >>> 24) | 4278255360 & (n5 << 24 | n5 >>> 8);
          }
          var o5, a5, d4, B2, k2, m3, b2, x2, S2, A2, H2, C2 = this._hash.words, z2 = f4.words, E2 = u3.words, M2 = s5.words, R2 = c4.words, D2 = h4.words, P2 = l3.words;
          for (m3 = o5 = C2[0], b2 = a5 = C2[1], x2 = d4 = C2[2], S2 = B2 = C2[3], A2 = k2 = C2[4], r5 = 0; r5 < 80; r5 += 1)
            H2 = o5 + t5[e6 + M2[r5]] | 0, H2 += r5 < 16 ? p3(a5, d4, B2) + z2[0] : r5 < 32 ? _2(a5, d4, B2) + z2[1] : r5 < 48 ? y2(a5, d4, B2) + z2[2] : r5 < 64 ? v3(a5, d4, B2) + z2[3] : g2(a5, d4, B2) + z2[4], H2 = (H2 = w2(H2 |= 0, D2[r5])) + k2 | 0, o5 = k2, k2 = B2, B2 = w2(d4, 10), d4 = a5, a5 = H2, H2 = m3 + t5[e6 + R2[r5]] | 0, H2 += r5 < 16 ? g2(b2, x2, S2) + E2[0] : r5 < 32 ? v3(b2, x2, S2) + E2[1] : r5 < 48 ? y2(b2, x2, S2) + E2[2] : r5 < 64 ? _2(b2, x2, S2) + E2[3] : p3(b2, x2, S2) + E2[4], H2 = (H2 = w2(H2 |= 0, P2[r5])) + A2 | 0, m3 = A2, A2 = S2, S2 = w2(x2, 10), x2 = b2, b2 = H2;
          H2 = C2[1] + d4 + S2 | 0, C2[1] = C2[2] + B2 + A2 | 0, C2[2] = C2[3] + k2 + m3 | 0, C2[3] = C2[4] + o5 + b2 | 0, C2[4] = C2[0] + a5 + x2 | 0, C2[0] = H2;
        }, _doFinalize: function() {
          var t5 = this._data, e6 = t5.words, r5 = 8 * this._nDataBytes, i6 = 8 * t5.sigBytes;
          e6[i6 >>> 5] |= 128 << 24 - i6 % 32, e6[14 + (i6 + 64 >>> 9 << 4)] = 16711935 & (r5 << 8 | r5 >>> 24) | 4278255360 & (r5 << 24 | r5 >>> 8), t5.sigBytes = 4 * (e6.length + 1), this._process();
          for (var n5 = this._hash, o5 = n5.words, s6 = 0; s6 < 5; s6++) {
            var a5 = o5[s6];
            o5[s6] = 16711935 & (a5 << 8 | a5 >>> 24) | 4278255360 & (a5 << 24 | a5 >>> 8);
          }
          return n5;
        }, clone: function() {
          var t5 = n4.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        } });
        function p3(t5, e6, r5) {
          return t5 ^ e6 ^ r5;
        }
        function _2(t5, e6, r5) {
          return t5 & e6 | ~t5 & r5;
        }
        function y2(t5, e6, r5) {
          return (t5 | ~e6) ^ r5;
        }
        function v3(t5, e6, r5) {
          return t5 & r5 | e6 & ~r5;
        }
        function g2(t5, e6, r5) {
          return t5 ^ (e6 | ~r5);
        }
        function w2(t5, e6) {
          return t5 << e6 | t5 >>> 32 - e6;
        }
        e5.RIPEMD160 = n4._createHelper(d3), e5.HmacRIPEMD160 = n4._createHmacHelper(d3);
      }(), function() {
        var t4 = a4, e5 = t4.lib.Base, r4 = t4.enc.Utf8;
        t4.algo.HMAC = e5.extend({ init: function(t5, e6) {
          t5 = this._hasher = new t5.init(), "string" == typeof e6 && (e6 = r4.parse(e6));
          var i5 = t5.blockSize, n4 = 4 * i5;
          e6.sigBytes > n4 && (e6 = t5.finalize(e6)), e6.clamp();
          for (var o4 = this._oKey = e6.clone(), s5 = this._iKey = e6.clone(), a5 = o4.words, c4 = s5.words, h4 = 0; h4 < i5; h4++)
            a5[h4] ^= 1549556828, c4[h4] ^= 909522486;
          o4.sigBytes = s5.sigBytes = n4, this.reset();
        }, reset: function() {
          var t5 = this._hasher;
          t5.reset(), t5.update(this._iKey);
        }, update: function(t5) {
          return this._hasher.update(t5), this;
        }, finalize: function(t5) {
          var e6 = this._hasher, r5 = e6.finalize(t5);
          return e6.reset(), e6.finalize(this._oKey.clone().concat(r5));
        } });
      }(), function() {
        var t4 = a4, e5 = t4.lib, r4 = e5.Base, i5 = e5.WordArray, n4 = t4.algo, o4 = n4.SHA1, s5 = n4.HMAC, c4 = n4.PBKDF2 = r4.extend({ cfg: r4.extend({ keySize: 4, hasher: o4, iterations: 1 }), init: function(t5) {
          this.cfg = this.cfg.extend(t5);
        }, compute: function(t5, e6) {
          for (var r5 = this.cfg, n5 = s5.create(r5.hasher, t5), o5 = i5.create(), a5 = i5.create([1]), c5 = o5.words, h4 = a5.words, l3 = r5.keySize, f4 = r5.iterations; c5.length < l3; ) {
            var u3 = n5.update(e6).finalize(a5);
            n5.reset();
            for (var d3 = u3.words, p3 = d3.length, _2 = u3, y2 = 1; y2 < f4; y2++) {
              _2 = n5.finalize(_2), n5.reset();
              for (var v3 = _2.words, g2 = 0; g2 < p3; g2++)
                d3[g2] ^= v3[g2];
            }
            o5.concat(u3), h4[0]++;
          }
          return o5.sigBytes = 4 * l3, o5;
        } });
        t4.PBKDF2 = function(t5, e6, r5) {
          return c4.create(r5).compute(t5, e6);
        };
      }(), function() {
        var t4 = a4, e5 = t4.lib, r4 = e5.Base, i5 = e5.WordArray, n4 = t4.algo, o4 = n4.MD5, s5 = n4.EvpKDF = r4.extend({ cfg: r4.extend({ keySize: 4, hasher: o4, iterations: 1 }), init: function(t5) {
          this.cfg = this.cfg.extend(t5);
        }, compute: function(t5, e6) {
          for (var r5, n5 = this.cfg, o5 = n5.hasher.create(), s6 = i5.create(), a5 = s6.words, c4 = n5.keySize, h4 = n5.iterations; a5.length < c4; ) {
            r5 && o5.update(r5), r5 = o5.update(t5).finalize(e6), o5.reset();
            for (var l3 = 1; l3 < h4; l3++)
              r5 = o5.finalize(r5), o5.reset();
            s6.concat(r5);
          }
          return s6.sigBytes = 4 * c4, s6;
        } });
        t4.EvpKDF = function(t5, e6, r5) {
          return s5.create(r5).compute(t5, e6);
        };
      }(), function() {
        var t4 = a4, e5 = t4.lib.WordArray, r4 = t4.algo, i5 = r4.SHA256, n4 = r4.SHA224 = i5.extend({ _doReset: function() {
          this._hash = new e5.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
        }, _doFinalize: function() {
          var t5 = i5._doFinalize.call(this);
          return t5.sigBytes -= 4, t5;
        } });
        t4.SHA224 = i5._createHelper(n4), t4.HmacSHA224 = i5._createHmacHelper(n4);
      }(), function(t4) {
        var e5 = a4, r4 = e5.lib, i5 = r4.Base, n4 = r4.WordArray, o4 = e5.x64 = {};
        o4.Word = i5.extend({ init: function(t5, e6) {
          this.high = t5, this.low = e6;
        } }), o4.WordArray = i5.extend({ init: function(t5, e6) {
          t5 = this.words = t5 || [], this.sigBytes = null != e6 ? e6 : 8 * t5.length;
        }, toX32: function() {
          for (var t5 = this.words, e6 = t5.length, r5 = [], i6 = 0; i6 < e6; i6++) {
            var o5 = t5[i6];
            r5.push(o5.high), r5.push(o5.low);
          }
          return n4.create(r5, this.sigBytes);
        }, clone: function() {
          for (var t5 = i5.clone.call(this), e6 = t5.words = this.words.slice(0), r5 = e6.length, n5 = 0; n5 < r5; n5++)
            e6[n5] = e6[n5].clone();
          return t5;
        } });
      }(), function(t4) {
        var e5 = a4, r4 = e5.lib, i5 = r4.WordArray, n4 = r4.Hasher, o4 = e5.x64.Word, s5 = e5.algo, c4 = [], h4 = [], l3 = [];
        !function() {
          for (var t5 = 1, e6 = 0, r5 = 0; r5 < 24; r5++) {
            c4[t5 + 5 * e6] = (r5 + 1) * (r5 + 2) / 2 % 64;
            var i6 = (2 * t5 + 3 * e6) % 5;
            t5 = e6 % 5, e6 = i6;
          }
          for (t5 = 0; t5 < 5; t5++)
            for (e6 = 0; e6 < 5; e6++)
              h4[t5 + 5 * e6] = e6 + (2 * t5 + 3 * e6) % 5 * 5;
          for (var n5 = 1, s6 = 0; s6 < 24; s6++) {
            for (var a5 = 0, f5 = 0, u4 = 0; u4 < 7; u4++) {
              if (1 & n5) {
                var d3 = (1 << u4) - 1;
                d3 < 32 ? f5 ^= 1 << d3 : a5 ^= 1 << d3 - 32;
              }
              128 & n5 ? n5 = n5 << 1 ^ 113 : n5 <<= 1;
            }
            l3[s6] = o4.create(a5, f5);
          }
        }();
        var f4 = [];
        !function() {
          for (var t5 = 0; t5 < 25; t5++)
            f4[t5] = o4.create();
        }();
        var u3 = s5.SHA3 = n4.extend({ cfg: n4.cfg.extend({ outputLength: 512 }), _doReset: function() {
          for (var t5 = this._state = [], e6 = 0; e6 < 25; e6++)
            t5[e6] = new o4.init();
          this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
        }, _doProcessBlock: function(t5, e6) {
          for (var r5 = this._state, i6 = this.blockSize / 2, n5 = 0; n5 < i6; n5++) {
            var o5 = t5[e6 + 2 * n5], s6 = t5[e6 + 2 * n5 + 1];
            o5 = 16711935 & (o5 << 8 | o5 >>> 24) | 4278255360 & (o5 << 24 | o5 >>> 8), s6 = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), (C2 = r5[n5]).high ^= s6, C2.low ^= o5;
          }
          for (var a5 = 0; a5 < 24; a5++) {
            for (var u4 = 0; u4 < 5; u4++) {
              for (var d3 = 0, p3 = 0, _2 = 0; _2 < 5; _2++)
                d3 ^= (C2 = r5[u4 + 5 * _2]).high, p3 ^= C2.low;
              var y2 = f4[u4];
              y2.high = d3, y2.low = p3;
            }
            for (u4 = 0; u4 < 5; u4++) {
              var v3 = f4[(u4 + 4) % 5], g2 = f4[(u4 + 1) % 5], w2 = g2.high, B2 = g2.low;
              for (d3 = v3.high ^ (w2 << 1 | B2 >>> 31), p3 = v3.low ^ (B2 << 1 | w2 >>> 31), _2 = 0; _2 < 5; _2++)
                (C2 = r5[u4 + 5 * _2]).high ^= d3, C2.low ^= p3;
            }
            for (var k2 = 1; k2 < 25; k2++) {
              var m3 = (C2 = r5[k2]).high, b2 = C2.low, x2 = c4[k2];
              x2 < 32 ? (d3 = m3 << x2 | b2 >>> 32 - x2, p3 = b2 << x2 | m3 >>> 32 - x2) : (d3 = b2 << x2 - 32 | m3 >>> 64 - x2, p3 = m3 << x2 - 32 | b2 >>> 64 - x2);
              var S2 = f4[h4[k2]];
              S2.high = d3, S2.low = p3;
            }
            var A2 = f4[0], H2 = r5[0];
            for (A2.high = H2.high, A2.low = H2.low, u4 = 0; u4 < 5; u4++)
              for (_2 = 0; _2 < 5; _2++) {
                var C2 = r5[k2 = u4 + 5 * _2], z2 = f4[k2], E2 = f4[(u4 + 1) % 5 + 5 * _2], M2 = f4[(u4 + 2) % 5 + 5 * _2];
                C2.high = z2.high ^ ~E2.high & M2.high, C2.low = z2.low ^ ~E2.low & M2.low;
              }
            C2 = r5[0];
            var R2 = l3[a5];
            C2.high ^= R2.high, C2.low ^= R2.low;
          }
        }, _doFinalize: function() {
          var e6 = this._data, r5 = e6.words, n5 = (this._nDataBytes, 8 * e6.sigBytes), o5 = 32 * this.blockSize;
          r5[n5 >>> 5] |= 1 << 24 - n5 % 32, r5[(t4.ceil((n5 + 1) / o5) * o5 >>> 5) - 1] |= 128, e6.sigBytes = 4 * r5.length, this._process();
          for (var s6 = this._state, a5 = this.cfg.outputLength / 8, c5 = a5 / 8, h5 = [], l4 = 0; l4 < c5; l4++) {
            var f5 = s6[l4], u4 = f5.high, d3 = f5.low;
            u4 = 16711935 & (u4 << 8 | u4 >>> 24) | 4278255360 & (u4 << 24 | u4 >>> 8), d3 = 16711935 & (d3 << 8 | d3 >>> 24) | 4278255360 & (d3 << 24 | d3 >>> 8), h5.push(d3), h5.push(u4);
          }
          return new i5.init(h5, a5);
        }, clone: function() {
          for (var t5 = n4.clone.call(this), e6 = t5._state = this._state.slice(0), r5 = 0; r5 < 25; r5++)
            e6[r5] = e6[r5].clone();
          return t5;
        } });
        e5.SHA3 = n4._createHelper(u3), e5.HmacSHA3 = n4._createHmacHelper(u3);
      }(Math), function() {
        var t4 = a4, e5 = t4.lib.Hasher, r4 = t4.x64, i5 = r4.Word, n4 = r4.WordArray, o4 = t4.algo;
        function s5() {
          return i5.create.apply(i5, arguments);
        }
        var c4 = [s5(1116352408, 3609767458), s5(1899447441, 602891725), s5(3049323471, 3964484399), s5(3921009573, 2173295548), s5(961987163, 4081628472), s5(1508970993, 3053834265), s5(2453635748, 2937671579), s5(2870763221, 3664609560), s5(3624381080, 2734883394), s5(310598401, 1164996542), s5(607225278, 1323610764), s5(1426881987, 3590304994), s5(1925078388, 4068182383), s5(2162078206, 991336113), s5(2614888103, 633803317), s5(3248222580, 3479774868), s5(3835390401, 2666613458), s5(4022224774, 944711139), s5(264347078, 2341262773), s5(604807628, 2007800933), s5(770255983, 1495990901), s5(1249150122, 1856431235), s5(1555081692, 3175218132), s5(1996064986, 2198950837), s5(2554220882, 3999719339), s5(2821834349, 766784016), s5(2952996808, 2566594879), s5(3210313671, 3203337956), s5(3336571891, 1034457026), s5(3584528711, 2466948901), s5(113926993, 3758326383), s5(338241895, 168717936), s5(666307205, 1188179964), s5(773529912, 1546045734), s5(1294757372, 1522805485), s5(1396182291, 2643833823), s5(1695183700, 2343527390), s5(1986661051, 1014477480), s5(2177026350, 1206759142), s5(2456956037, 344077627), s5(2730485921, 1290863460), s5(2820302411, 3158454273), s5(3259730800, 3505952657), s5(3345764771, 106217008), s5(3516065817, 3606008344), s5(3600352804, 1432725776), s5(4094571909, 1467031594), s5(275423344, 851169720), s5(430227734, 3100823752), s5(506948616, 1363258195), s5(659060556, 3750685593), s5(883997877, 3785050280), s5(958139571, 3318307427), s5(1322822218, 3812723403), s5(1537002063, 2003034995), s5(1747873779, 3602036899), s5(1955562222, 1575990012), s5(2024104815, 1125592928), s5(2227730452, 2716904306), s5(2361852424, 442776044), s5(2428436474, 593698344), s5(2756734187, 3733110249), s5(3204031479, 2999351573), s5(3329325298, 3815920427), s5(3391569614, 3928383900), s5(3515267271, 566280711), s5(3940187606, 3454069534), s5(4118630271, 4000239992), s5(116418474, 1914138554), s5(174292421, 2731055270), s5(289380356, 3203993006), s5(460393269, 320620315), s5(685471733, 587496836), s5(852142971, 1086792851), s5(1017036298, 365543100), s5(1126000580, 2618297676), s5(1288033470, 3409855158), s5(1501505948, 4234509866), s5(1607167915, 987167468), s5(1816402316, 1246189591)], h4 = [];
        !function() {
          for (var t5 = 0; t5 < 80; t5++)
            h4[t5] = s5();
        }();
        var l3 = o4.SHA512 = e5.extend({ _doReset: function() {
          this._hash = new n4.init([new i5.init(1779033703, 4089235720), new i5.init(3144134277, 2227873595), new i5.init(1013904242, 4271175723), new i5.init(2773480762, 1595750129), new i5.init(1359893119, 2917565137), new i5.init(2600822924, 725511199), new i5.init(528734635, 4215389547), new i5.init(1541459225, 327033209)]);
        }, _doProcessBlock: function(t5, e6) {
          for (var r5 = this._hash.words, i6 = r5[0], n5 = r5[1], o5 = r5[2], s6 = r5[3], a5 = r5[4], l4 = r5[5], f4 = r5[6], u3 = r5[7], d3 = i6.high, p3 = i6.low, _2 = n5.high, y2 = n5.low, v3 = o5.high, g2 = o5.low, w2 = s6.high, B2 = s6.low, k2 = a5.high, m3 = a5.low, b2 = l4.high, x2 = l4.low, S2 = f4.high, A2 = f4.low, H2 = u3.high, C2 = u3.low, z2 = d3, E2 = p3, M2 = _2, R2 = y2, D2 = v3, P2 = g2, F2 = w2, O2 = B2, L2 = k2, T2 = m3, I2 = b2, W2 = x2, j2 = S2, U2 = A2, K2 = H2, X3 = C2, N2 = 0; N2 < 80; N2++) {
            var q2, V2, Z2 = h4[N2];
            if (N2 < 16)
              V2 = Z2.high = 0 | t5[e6 + 2 * N2], q2 = Z2.low = 0 | t5[e6 + 2 * N2 + 1];
            else {
              var $3 = h4[N2 - 15], G2 = $3.high, J3 = $3.low, Q3 = (G2 >>> 1 | J3 << 31) ^ (G2 >>> 8 | J3 << 24) ^ G2 >>> 7, Y2 = (J3 >>> 1 | G2 << 31) ^ (J3 >>> 8 | G2 << 24) ^ (J3 >>> 7 | G2 << 25), tt2 = h4[N2 - 2], et3 = tt2.high, rt3 = tt2.low, it3 = (et3 >>> 19 | rt3 << 13) ^ (et3 << 3 | rt3 >>> 29) ^ et3 >>> 6, nt3 = (rt3 >>> 19 | et3 << 13) ^ (rt3 << 3 | et3 >>> 29) ^ (rt3 >>> 6 | et3 << 26), ot3 = h4[N2 - 7], st3 = ot3.high, at3 = ot3.low, ct3 = h4[N2 - 16], ht3 = ct3.high, lt3 = ct3.low;
              V2 = (V2 = (V2 = Q3 + st3 + ((q2 = Y2 + at3) >>> 0 < Y2 >>> 0 ? 1 : 0)) + it3 + ((q2 += nt3) >>> 0 < nt3 >>> 0 ? 1 : 0)) + ht3 + ((q2 += lt3) >>> 0 < lt3 >>> 0 ? 1 : 0), Z2.high = V2, Z2.low = q2;
            }
            var ft3, ut3 = L2 & I2 ^ ~L2 & j2, dt3 = T2 & W2 ^ ~T2 & U2, pt3 = z2 & M2 ^ z2 & D2 ^ M2 & D2, _t2 = E2 & R2 ^ E2 & P2 ^ R2 & P2, yt3 = (z2 >>> 28 | E2 << 4) ^ (z2 << 30 | E2 >>> 2) ^ (z2 << 25 | E2 >>> 7), vt3 = (E2 >>> 28 | z2 << 4) ^ (E2 << 30 | z2 >>> 2) ^ (E2 << 25 | z2 >>> 7), gt3 = (L2 >>> 14 | T2 << 18) ^ (L2 >>> 18 | T2 << 14) ^ (L2 << 23 | T2 >>> 9), wt2 = (T2 >>> 14 | L2 << 18) ^ (T2 >>> 18 | L2 << 14) ^ (T2 << 23 | L2 >>> 9), Bt2 = c4[N2], kt2 = Bt2.high, mt3 = Bt2.low, bt3 = K2 + gt3 + ((ft3 = X3 + wt2) >>> 0 < X3 >>> 0 ? 1 : 0), xt2 = vt3 + _t2;
            K2 = j2, X3 = U2, j2 = I2, U2 = W2, I2 = L2, W2 = T2, L2 = F2 + (bt3 = (bt3 = (bt3 = bt3 + ut3 + ((ft3 += dt3) >>> 0 < dt3 >>> 0 ? 1 : 0)) + kt2 + ((ft3 += mt3) >>> 0 < mt3 >>> 0 ? 1 : 0)) + V2 + ((ft3 += q2) >>> 0 < q2 >>> 0 ? 1 : 0)) + ((T2 = O2 + ft3 | 0) >>> 0 < O2 >>> 0 ? 1 : 0) | 0, F2 = D2, O2 = P2, D2 = M2, P2 = R2, M2 = z2, R2 = E2, z2 = bt3 + (yt3 + pt3 + (xt2 >>> 0 < vt3 >>> 0 ? 1 : 0)) + ((E2 = ft3 + xt2 | 0) >>> 0 < ft3 >>> 0 ? 1 : 0) | 0;
          }
          p3 = i6.low = p3 + E2, i6.high = d3 + z2 + (p3 >>> 0 < E2 >>> 0 ? 1 : 0), y2 = n5.low = y2 + R2, n5.high = _2 + M2 + (y2 >>> 0 < R2 >>> 0 ? 1 : 0), g2 = o5.low = g2 + P2, o5.high = v3 + D2 + (g2 >>> 0 < P2 >>> 0 ? 1 : 0), B2 = s6.low = B2 + O2, s6.high = w2 + F2 + (B2 >>> 0 < O2 >>> 0 ? 1 : 0), m3 = a5.low = m3 + T2, a5.high = k2 + L2 + (m3 >>> 0 < T2 >>> 0 ? 1 : 0), x2 = l4.low = x2 + W2, l4.high = b2 + I2 + (x2 >>> 0 < W2 >>> 0 ? 1 : 0), A2 = f4.low = A2 + U2, f4.high = S2 + j2 + (A2 >>> 0 < U2 >>> 0 ? 1 : 0), C2 = u3.low = C2 + X3, u3.high = H2 + K2 + (C2 >>> 0 < X3 >>> 0 ? 1 : 0);
        }, _doFinalize: function() {
          var t5 = this._data, e6 = t5.words, r5 = 8 * this._nDataBytes, i6 = 8 * t5.sigBytes;
          return e6[i6 >>> 5] |= 128 << 24 - i6 % 32, e6[30 + (i6 + 128 >>> 10 << 5)] = Math.floor(r5 / 4294967296), e6[31 + (i6 + 128 >>> 10 << 5)] = r5, t5.sigBytes = 4 * e6.length, this._process(), this._hash.toX32();
        }, clone: function() {
          var t5 = e5.clone.call(this);
          return t5._hash = this._hash.clone(), t5;
        }, blockSize: 32 });
        t4.SHA512 = e5._createHelper(l3), t4.HmacSHA512 = e5._createHmacHelper(l3);
      }(), function() {
        var t4 = a4, e5 = t4.x64, r4 = e5.Word, i5 = e5.WordArray, n4 = t4.algo, o4 = n4.SHA512, s5 = n4.SHA384 = o4.extend({ _doReset: function() {
          this._hash = new i5.init([new r4.init(3418070365, 3238371032), new r4.init(1654270250, 914150663), new r4.init(2438529370, 812702999), new r4.init(355462360, 4144912697), new r4.init(1731405415, 4290775857), new r4.init(2394180231, 1750603025), new r4.init(3675008525, 1694076839), new r4.init(1203062813, 3204075428)]);
        }, _doFinalize: function() {
          var t5 = o4._doFinalize.call(this);
          return t5.sigBytes -= 16, t5;
        } });
        t4.SHA384 = o4._createHelper(s5), t4.HmacSHA384 = o4._createHmacHelper(s5);
      }(), a4.lib.Cipher || function(t4) {
        var e5 = a4, r4 = e5.lib, i5 = r4.Base, n4 = r4.WordArray, o4 = r4.BufferedBlockAlgorithm, s5 = e5.enc, c4 = (s5.Utf8, s5.Base64), h4 = e5.algo.EvpKDF, l3 = r4.Cipher = o4.extend({ cfg: i5.extend(), createEncryptor: function(t5, e6) {
          return this.create(this._ENC_XFORM_MODE, t5, e6);
        }, createDecryptor: function(t5, e6) {
          return this.create(this._DEC_XFORM_MODE, t5, e6);
        }, init: function(t5, e6, r5) {
          this.cfg = this.cfg.extend(r5), this._xformMode = t5, this._key = e6, this.reset();
        }, reset: function() {
          o4.reset.call(this), this._doReset();
        }, process: function(t5) {
          return this._append(t5), this._process();
        }, finalize: function(t5) {
          return t5 && this._append(t5), this._doFinalize();
        }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: /* @__PURE__ */ function() {
          function t5(t6) {
            return "string" == typeof t6 ? w2 : v3;
          }
          return function(e6) {
            return { encrypt: function(r5, i6, n5) {
              return t5(i6).encrypt(e6, r5, i6, n5);
            }, decrypt: function(r5, i6, n5) {
              return t5(i6).decrypt(e6, r5, i6, n5);
            } };
          };
        }() }), f4 = (r4.StreamCipher = l3.extend({ _doFinalize: function() {
          return this._process(true);
        }, blockSize: 1 }), e5.mode = {}), u3 = r4.BlockCipherMode = i5.extend({ createEncryptor: function(t5, e6) {
          return this.Encryptor.create(t5, e6);
        }, createDecryptor: function(t5, e6) {
          return this.Decryptor.create(t5, e6);
        }, init: function(t5, e6) {
          this._cipher = t5, this._iv = e6;
        } }), d3 = f4.CBC = function() {
          var t5 = u3.extend();
          function e6(t6, e7, r5) {
            var i6, n5 = this._iv;
            n5 ? (i6 = n5, this._iv = void 0) : i6 = this._prevBlock;
            for (var o5 = 0; o5 < r5; o5++)
              t6[e7 + o5] ^= i6[o5];
          }
          return t5.Encryptor = t5.extend({ processBlock: function(t6, r5) {
            var i6 = this._cipher, n5 = i6.blockSize;
            e6.call(this, t6, r5, n5), i6.encryptBlock(t6, r5), this._prevBlock = t6.slice(r5, r5 + n5);
          } }), t5.Decryptor = t5.extend({ processBlock: function(t6, r5) {
            var i6 = this._cipher, n5 = i6.blockSize, o5 = t6.slice(r5, r5 + n5);
            i6.decryptBlock(t6, r5), e6.call(this, t6, r5, n5), this._prevBlock = o5;
          } }), t5;
        }(), p3 = (e5.pad = {}).Pkcs7 = { pad: function(t5, e6) {
          for (var r5 = 4 * e6, i6 = r5 - t5.sigBytes % r5, o5 = i6 << 24 | i6 << 16 | i6 << 8 | i6, s6 = [], a5 = 0; a5 < i6; a5 += 4)
            s6.push(o5);
          var c5 = n4.create(s6, i6);
          t5.concat(c5);
        }, unpad: function(t5) {
          var e6 = 255 & t5.words[t5.sigBytes - 1 >>> 2];
          t5.sigBytes -= e6;
        } }, _2 = (r4.BlockCipher = l3.extend({ cfg: l3.cfg.extend({ mode: d3, padding: p3 }), reset: function() {
          var t5;
          l3.reset.call(this);
          var e6 = this.cfg, r5 = e6.iv, i6 = e6.mode;
          this._xformMode == this._ENC_XFORM_MODE ? t5 = i6.createEncryptor : (t5 = i6.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == t5 ? this._mode.init(this, r5 && r5.words) : (this._mode = t5.call(i6, this, r5 && r5.words), this._mode.__creator = t5);
        }, _doProcessBlock: function(t5, e6) {
          this._mode.processBlock(t5, e6);
        }, _doFinalize: function() {
          var t5, e6 = this.cfg.padding;
          return this._xformMode == this._ENC_XFORM_MODE ? (e6.pad(this._data, this.blockSize), t5 = this._process(true)) : (t5 = this._process(true), e6.unpad(t5)), t5;
        }, blockSize: 4 }), r4.CipherParams = i5.extend({ init: function(t5) {
          this.mixIn(t5);
        }, toString: function(t5) {
          return (t5 || this.formatter).stringify(this);
        } })), y2 = (e5.format = {}).OpenSSL = { stringify: function(t5) {
          var e6 = t5.ciphertext, r5 = t5.salt;
          return (r5 ? n4.create([1398893684, 1701076831]).concat(r5).concat(e6) : e6).toString(c4);
        }, parse: function(t5) {
          var e6, r5 = c4.parse(t5), i6 = r5.words;
          return 1398893684 == i6[0] && 1701076831 == i6[1] && (e6 = n4.create(i6.slice(2, 4)), i6.splice(0, 4), r5.sigBytes -= 16), _2.create({ ciphertext: r5, salt: e6 });
        } }, v3 = r4.SerializableCipher = i5.extend({ cfg: i5.extend({ format: y2 }), encrypt: function(t5, e6, r5, i6) {
          i6 = this.cfg.extend(i6);
          var n5 = t5.createEncryptor(r5, i6), o5 = n5.finalize(e6), s6 = n5.cfg;
          return _2.create({ ciphertext: o5, key: r5, iv: s6.iv, algorithm: t5, mode: s6.mode, padding: s6.padding, blockSize: t5.blockSize, formatter: i6.format });
        }, decrypt: function(t5, e6, r5, i6) {
          return i6 = this.cfg.extend(i6), e6 = this._parse(e6, i6.format), t5.createDecryptor(r5, i6).finalize(e6.ciphertext);
        }, _parse: function(t5, e6) {
          return "string" == typeof t5 ? e6.parse(t5, this) : t5;
        } }), g2 = (e5.kdf = {}).OpenSSL = { execute: function(t5, e6, r5, i6) {
          i6 || (i6 = n4.random(8));
          var o5 = h4.create({ keySize: e6 + r5 }).compute(t5, i6), s6 = n4.create(o5.words.slice(e6), 4 * r5);
          return o5.sigBytes = 4 * e6, _2.create({ key: o5, iv: s6, salt: i6 });
        } }, w2 = r4.PasswordBasedCipher = v3.extend({ cfg: v3.cfg.extend({ kdf: g2 }), encrypt: function(t5, e6, r5, i6) {
          var n5 = (i6 = this.cfg.extend(i6)).kdf.execute(r5, t5.keySize, t5.ivSize);
          i6.iv = n5.iv;
          var o5 = v3.encrypt.call(this, t5, e6, n5.key, i6);
          return o5.mixIn(n5), o5;
        }, decrypt: function(t5, e6, r5, i6) {
          i6 = this.cfg.extend(i6), e6 = this._parse(e6, i6.format);
          var n5 = i6.kdf.execute(r5, t5.keySize, t5.ivSize, e6.salt);
          return i6.iv = n5.iv, v3.decrypt.call(this, t5, e6, n5.key, i6);
        } });
      }(), a4.mode.CFB = function() {
        var t4 = a4.lib.BlockCipherMode.extend();
        function e5(t5, e6, r4, i5) {
          var n4, o4 = this._iv;
          o4 ? (n4 = o4.slice(0), this._iv = void 0) : n4 = this._prevBlock, i5.encryptBlock(n4, 0);
          for (var s5 = 0; s5 < r4; s5++)
            t5[e6 + s5] ^= n4[s5];
        }
        return t4.Encryptor = t4.extend({ processBlock: function(t5, r4) {
          var i5 = this._cipher, n4 = i5.blockSize;
          e5.call(this, t5, r4, n4, i5), this._prevBlock = t5.slice(r4, r4 + n4);
        } }), t4.Decryptor = t4.extend({ processBlock: function(t5, r4) {
          var i5 = this._cipher, n4 = i5.blockSize, o4 = t5.slice(r4, r4 + n4);
          e5.call(this, t5, r4, n4, i5), this._prevBlock = o4;
        } }), t4;
      }(), a4.mode.ECB = ((n3 = a4.lib.BlockCipherMode.extend()).Encryptor = n3.extend({ processBlock: function(t4, e5) {
        this._cipher.encryptBlock(t4, e5);
      } }), n3.Decryptor = n3.extend({ processBlock: function(t4, e5) {
        this._cipher.decryptBlock(t4, e5);
      } }), n3), a4.pad.AnsiX923 = { pad: function(t4, e5) {
        var r4 = t4.sigBytes, i5 = 4 * e5, n4 = i5 - r4 % i5, o4 = r4 + n4 - 1;
        t4.clamp(), t4.words[o4 >>> 2] |= n4 << 24 - o4 % 4 * 8, t4.sigBytes += n4;
      }, unpad: function(t4) {
        var e5 = 255 & t4.words[t4.sigBytes - 1 >>> 2];
        t4.sigBytes -= e5;
      } }, a4.pad.Iso10126 = { pad: function(t4, e5) {
        var r4 = 4 * e5, i5 = r4 - t4.sigBytes % r4;
        t4.concat(a4.lib.WordArray.random(i5 - 1)).concat(a4.lib.WordArray.create([i5 << 24], 1));
      }, unpad: function(t4) {
        var e5 = 255 & t4.words[t4.sigBytes - 1 >>> 2];
        t4.sigBytes -= e5;
      } }, a4.pad.Iso97971 = { pad: function(t4, e5) {
        t4.concat(a4.lib.WordArray.create([2147483648], 1)), a4.pad.ZeroPadding.pad(t4, e5);
      }, unpad: function(t4) {
        a4.pad.ZeroPadding.unpad(t4), t4.sigBytes--;
      } }, a4.mode.OFB = (r3 = a4.lib.BlockCipherMode.extend(), i4 = r3.Encryptor = r3.extend({ processBlock: function(t4, e5) {
        var r4 = this._cipher, i5 = r4.blockSize, n4 = this._iv, o4 = this._keystream;
        n4 && (o4 = this._keystream = n4.slice(0), this._iv = void 0), r4.encryptBlock(o4, 0);
        for (var s5 = 0; s5 < i5; s5++)
          t4[e5 + s5] ^= o4[s5];
      } }), r3.Decryptor = i4, r3), a4.pad.NoPadding = { pad: function() {
      }, unpad: function() {
      } }, function(t4) {
        var e5 = a4, r4 = e5.lib.CipherParams, i5 = e5.enc.Hex;
        e5.format.Hex = { stringify: function(t5) {
          return t5.ciphertext.toString(i5);
        }, parse: function(t5) {
          var e6 = i5.parse(t5);
          return r4.create({ ciphertext: e6 });
        } };
      }(), function() {
        var t4 = a4, e5 = t4.lib.BlockCipher, r4 = t4.algo, i5 = [], n4 = [], o4 = [], s5 = [], c4 = [], h4 = [], l3 = [], f4 = [], u3 = [], d3 = [];
        !function() {
          for (var t5 = [], e6 = 0; e6 < 256; e6++)
            t5[e6] = e6 < 128 ? e6 << 1 : e6 << 1 ^ 283;
          var r5 = 0, a5 = 0;
          for (e6 = 0; e6 < 256; e6++) {
            var p4 = a5 ^ a5 << 1 ^ a5 << 2 ^ a5 << 3 ^ a5 << 4;
            p4 = p4 >>> 8 ^ 255 & p4 ^ 99, i5[r5] = p4, n4[p4] = r5;
            var _3 = t5[r5], y2 = t5[_3], v3 = t5[y2], g2 = 257 * t5[p4] ^ 16843008 * p4;
            o4[r5] = g2 << 24 | g2 >>> 8, s5[r5] = g2 << 16 | g2 >>> 16, c4[r5] = g2 << 8 | g2 >>> 24, h4[r5] = g2, g2 = 16843009 * v3 ^ 65537 * y2 ^ 257 * _3 ^ 16843008 * r5, l3[p4] = g2 << 24 | g2 >>> 8, f4[p4] = g2 << 16 | g2 >>> 16, u3[p4] = g2 << 8 | g2 >>> 24, d3[p4] = g2, r5 ? (r5 = _3 ^ t5[t5[t5[v3 ^ _3]]], a5 ^= t5[t5[a5]]) : r5 = a5 = 1;
          }
        }();
        var p3 = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], _2 = r4.AES = e5.extend({ _doReset: function() {
          if (!this._nRounds || this._keyPriorReset !== this._key) {
            for (var t5 = this._keyPriorReset = this._key, e6 = t5.words, r5 = t5.sigBytes / 4, n5 = 4 * ((this._nRounds = r5 + 6) + 1), o5 = this._keySchedule = [], s6 = 0; s6 < n5; s6++)
              s6 < r5 ? o5[s6] = e6[s6] : (h5 = o5[s6 - 1], s6 % r5 ? r5 > 6 && s6 % r5 == 4 && (h5 = i5[h5 >>> 24] << 24 | i5[h5 >>> 16 & 255] << 16 | i5[h5 >>> 8 & 255] << 8 | i5[255 & h5]) : (h5 = i5[(h5 = h5 << 8 | h5 >>> 24) >>> 24] << 24 | i5[h5 >>> 16 & 255] << 16 | i5[h5 >>> 8 & 255] << 8 | i5[255 & h5], h5 ^= p3[s6 / r5 | 0] << 24), o5[s6] = o5[s6 - r5] ^ h5);
            for (var a5 = this._invKeySchedule = [], c5 = 0; c5 < n5; c5++) {
              if (s6 = n5 - c5, c5 % 4)
                var h5 = o5[s6];
              else
                h5 = o5[s6 - 4];
              a5[c5] = c5 < 4 || s6 <= 4 ? h5 : l3[i5[h5 >>> 24]] ^ f4[i5[h5 >>> 16 & 255]] ^ u3[i5[h5 >>> 8 & 255]] ^ d3[i5[255 & h5]];
            }
          }
        }, encryptBlock: function(t5, e6) {
          this._doCryptBlock(t5, e6, this._keySchedule, o4, s5, c4, h4, i5);
        }, decryptBlock: function(t5, e6) {
          var r5 = t5[e6 + 1];
          t5[e6 + 1] = t5[e6 + 3], t5[e6 + 3] = r5, this._doCryptBlock(t5, e6, this._invKeySchedule, l3, f4, u3, d3, n4), r5 = t5[e6 + 1], t5[e6 + 1] = t5[e6 + 3], t5[e6 + 3] = r5;
        }, _doCryptBlock: function(t5, e6, r5, i6, n5, o5, s6, a5) {
          for (var c5 = this._nRounds, h5 = t5[e6] ^ r5[0], l4 = t5[e6 + 1] ^ r5[1], f5 = t5[e6 + 2] ^ r5[2], u4 = t5[e6 + 3] ^ r5[3], d4 = 4, p4 = 1; p4 < c5; p4++) {
            var _3 = i6[h5 >>> 24] ^ n5[l4 >>> 16 & 255] ^ o5[f5 >>> 8 & 255] ^ s6[255 & u4] ^ r5[d4++], y2 = i6[l4 >>> 24] ^ n5[f5 >>> 16 & 255] ^ o5[u4 >>> 8 & 255] ^ s6[255 & h5] ^ r5[d4++], v3 = i6[f5 >>> 24] ^ n5[u4 >>> 16 & 255] ^ o5[h5 >>> 8 & 255] ^ s6[255 & l4] ^ r5[d4++], g2 = i6[u4 >>> 24] ^ n5[h5 >>> 16 & 255] ^ o5[l4 >>> 8 & 255] ^ s6[255 & f5] ^ r5[d4++];
            h5 = _3, l4 = y2, f5 = v3, u4 = g2;
          }
          _3 = (a5[h5 >>> 24] << 24 | a5[l4 >>> 16 & 255] << 16 | a5[f5 >>> 8 & 255] << 8 | a5[255 & u4]) ^ r5[d4++], y2 = (a5[l4 >>> 24] << 24 | a5[f5 >>> 16 & 255] << 16 | a5[u4 >>> 8 & 255] << 8 | a5[255 & h5]) ^ r5[d4++], v3 = (a5[f5 >>> 24] << 24 | a5[u4 >>> 16 & 255] << 16 | a5[h5 >>> 8 & 255] << 8 | a5[255 & l4]) ^ r5[d4++], g2 = (a5[u4 >>> 24] << 24 | a5[h5 >>> 16 & 255] << 16 | a5[l4 >>> 8 & 255] << 8 | a5[255 & f5]) ^ r5[d4++], t5[e6] = _3, t5[e6 + 1] = y2, t5[e6 + 2] = v3, t5[e6 + 3] = g2;
        }, keySize: 8 });
        t4.AES = e5._createHelper(_2);
      }(), function() {
        var t4 = a4, e5 = t4.lib, r4 = e5.WordArray, i5 = e5.BlockCipher, n4 = t4.algo, o4 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4], s5 = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32], c4 = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], h4 = [{ 0: 8421888, 268435456: 32768, 536870912: 8421378, 805306368: 2, 1073741824: 512, 1342177280: 8421890, 1610612736: 8389122, 1879048192: 8388608, 2147483648: 514, 2415919104: 8389120, 2684354560: 33280, 2952790016: 8421376, 3221225472: 32770, 3489660928: 8388610, 3758096384: 0, 4026531840: 33282, 134217728: 0, 402653184: 8421890, 671088640: 33282, 939524096: 32768, 1207959552: 8421888, 1476395008: 512, 1744830464: 8421378, 2013265920: 2, 2281701376: 8389120, 2550136832: 33280, 2818572288: 8421376, 3087007744: 8389122, 3355443200: 8388610, 3623878656: 32770, 3892314112: 514, 4160749568: 8388608, 1: 32768, 268435457: 2, 536870913: 8421888, 805306369: 8388608, 1073741825: 8421378, 1342177281: 33280, 1610612737: 512, 1879048193: 8389122, 2147483649: 8421890, 2415919105: 8421376, 2684354561: 8388610, 2952790017: 33282, 3221225473: 514, 3489660929: 8389120, 3758096385: 32770, 4026531841: 0, 134217729: 8421890, 402653185: 8421376, 671088641: 8388608, 939524097: 512, 1207959553: 32768, 1476395009: 8388610, 1744830465: 2, 2013265921: 33282, 2281701377: 32770, 2550136833: 8389122, 2818572289: 514, 3087007745: 8421888, 3355443201: 8389120, 3623878657: 0, 3892314113: 33280, 4160749569: 8421378 }, { 0: 1074282512, 16777216: 16384, 33554432: 524288, 50331648: 1074266128, 67108864: 1073741840, 83886080: 1074282496, 100663296: 1073758208, 117440512: 16, 134217728: 540672, 150994944: 1073758224, 167772160: 1073741824, 184549376: 540688, 201326592: 524304, 218103808: 0, 234881024: 16400, 251658240: 1074266112, 8388608: 1073758208, 25165824: 540688, 41943040: 16, 58720256: 1073758224, 75497472: 1074282512, 92274688: 1073741824, 109051904: 524288, 125829120: 1074266128, 142606336: 524304, 159383552: 0, 176160768: 16384, 192937984: 1074266112, 209715200: 1073741840, 226492416: 540672, 243269632: 1074282496, 260046848: 16400, 268435456: 0, 285212672: 1074266128, 301989888: 1073758224, 318767104: 1074282496, 335544320: 1074266112, 352321536: 16, 369098752: 540688, 385875968: 16384, 402653184: 16400, 419430400: 524288, 436207616: 524304, 452984832: 1073741840, 469762048: 540672, 486539264: 1073758208, 503316480: 1073741824, 520093696: 1074282512, 276824064: 540688, 293601280: 524288, 310378496: 1074266112, 327155712: 16384, 343932928: 1073758208, 360710144: 1074282512, 377487360: 16, 394264576: 1073741824, 411041792: 1074282496, 427819008: 1073741840, 444596224: 1073758224, 461373440: 524304, 478150656: 0, 494927872: 16400, 511705088: 1074266128, 528482304: 540672 }, { 0: 260, 1048576: 0, 2097152: 67109120, 3145728: 65796, 4194304: 65540, 5242880: 67108868, 6291456: 67174660, 7340032: 67174400, 8388608: 67108864, 9437184: 67174656, 10485760: 65792, 11534336: 67174404, 12582912: 67109124, 13631488: 65536, 14680064: 4, 15728640: 256, 524288: 67174656, 1572864: 67174404, 2621440: 0, 3670016: 67109120, 4718592: 67108868, 5767168: 65536, 6815744: 65540, 7864320: 260, 8912896: 4, 9961472: 256, 11010048: 67174400, 12058624: 65796, 13107200: 65792, 14155776: 67109124, 15204352: 67174660, 16252928: 67108864, 16777216: 67174656, 17825792: 65540, 18874368: 65536, 19922944: 67109120, 20971520: 256, 22020096: 67174660, 23068672: 67108868, 24117248: 0, 25165824: 67109124, 26214400: 67108864, 27262976: 4, 28311552: 65792, 29360128: 67174400, 30408704: 260, 31457280: 65796, 32505856: 67174404, 17301504: 67108864, 18350080: 260, 19398656: 67174656, 20447232: 0, 21495808: 65540, 22544384: 67109120, 23592960: 256, 24641536: 67174404, 25690112: 65536, 26738688: 67174660, 27787264: 65796, 28835840: 67108868, 29884416: 67109124, 30932992: 67174400, 31981568: 4, 33030144: 65792 }, { 0: 2151682048, 65536: 2147487808, 131072: 4198464, 196608: 2151677952, 262144: 0, 327680: 4198400, 393216: 2147483712, 458752: 4194368, 524288: 2147483648, 589824: 4194304, 655360: 64, 720896: 2147487744, 786432: 2151678016, 851968: 4160, 917504: 4096, 983040: 2151682112, 32768: 2147487808, 98304: 64, 163840: 2151678016, 229376: 2147487744, 294912: 4198400, 360448: 2151682112, 425984: 0, 491520: 2151677952, 557056: 4096, 622592: 2151682048, 688128: 4194304, 753664: 4160, 819200: 2147483648, 884736: 4194368, 950272: 4198464, 1015808: 2147483712, 1048576: 4194368, 1114112: 4198400, 1179648: 2147483712, 1245184: 0, 1310720: 4160, 1376256: 2151678016, 1441792: 2151682048, 1507328: 2147487808, 1572864: 2151682112, 1638400: 2147483648, 1703936: 2151677952, 1769472: 4198464, 1835008: 2147487744, 1900544: 4194304, 1966080: 64, 2031616: 4096, 1081344: 2151677952, 1146880: 2151682112, 1212416: 0, 1277952: 4198400, 1343488: 4194368, 1409024: 2147483648, 1474560: 2147487808, 1540096: 64, 1605632: 2147483712, 1671168: 4096, 1736704: 2147487744, 1802240: 2151678016, 1867776: 4160, 1933312: 2151682048, 1998848: 4194304, 2064384: 4198464 }, { 0: 128, 4096: 17039360, 8192: 262144, 12288: 536870912, 16384: 537133184, 20480: 16777344, 24576: 553648256, 28672: 262272, 32768: 16777216, 36864: 537133056, 40960: 536871040, 45056: 553910400, 49152: 553910272, 53248: 0, 57344: 17039488, 61440: 553648128, 2048: 17039488, 6144: 553648256, 10240: 128, 14336: 17039360, 18432: 262144, 22528: 537133184, 26624: 553910272, 30720: 536870912, 34816: 537133056, 38912: 0, 43008: 553910400, 47104: 16777344, 51200: 536871040, 55296: 553648128, 59392: 16777216, 63488: 262272, 65536: 262144, 69632: 128, 73728: 536870912, 77824: 553648256, 81920: 16777344, 86016: 553910272, 90112: 537133184, 94208: 16777216, 98304: 553910400, 102400: 553648128, 106496: 17039360, 110592: 537133056, 114688: 262272, 118784: 536871040, 122880: 0, 126976: 17039488, 67584: 553648256, 71680: 16777216, 75776: 17039360, 79872: 537133184, 83968: 536870912, 88064: 17039488, 92160: 128, 96256: 553910272, 100352: 262272, 104448: 553910400, 108544: 0, 112640: 553648128, 116736: 16777344, 120832: 262144, 124928: 537133056, 129024: 536871040 }, { 0: 268435464, 256: 8192, 512: 270532608, 768: 270540808, 1024: 268443648, 1280: 2097152, 1536: 2097160, 1792: 268435456, 2048: 0, 2304: 268443656, 2560: 2105344, 2816: 8, 3072: 270532616, 3328: 2105352, 3584: 8200, 3840: 270540800, 128: 270532608, 384: 270540808, 640: 8, 896: 2097152, 1152: 2105352, 1408: 268435464, 1664: 268443648, 1920: 8200, 2176: 2097160, 2432: 8192, 2688: 268443656, 2944: 270532616, 3200: 0, 3456: 270540800, 3712: 2105344, 3968: 268435456, 4096: 268443648, 4352: 270532616, 4608: 270540808, 4864: 8200, 5120: 2097152, 5376: 268435456, 5632: 268435464, 5888: 2105344, 6144: 2105352, 6400: 0, 6656: 8, 6912: 270532608, 7168: 8192, 7424: 268443656, 7680: 270540800, 7936: 2097160, 4224: 8, 4480: 2105344, 4736: 2097152, 4992: 268435464, 5248: 268443648, 5504: 8200, 5760: 270540808, 6016: 270532608, 6272: 270540800, 6528: 270532616, 6784: 8192, 7040: 2105352, 7296: 2097160, 7552: 0, 7808: 268435456, 8064: 268443656 }, { 0: 1048576, 16: 33555457, 32: 1024, 48: 1049601, 64: 34604033, 80: 0, 96: 1, 112: 34603009, 128: 33555456, 144: 1048577, 160: 33554433, 176: 34604032, 192: 34603008, 208: 1025, 224: 1049600, 240: 33554432, 8: 34603009, 24: 0, 40: 33555457, 56: 34604032, 72: 1048576, 88: 33554433, 104: 33554432, 120: 1025, 136: 1049601, 152: 33555456, 168: 34603008, 184: 1048577, 200: 1024, 216: 34604033, 232: 1, 248: 1049600, 256: 33554432, 272: 1048576, 288: 33555457, 304: 34603009, 320: 1048577, 336: 33555456, 352: 34604032, 368: 1049601, 384: 1025, 400: 34604033, 416: 1049600, 432: 1, 448: 0, 464: 34603008, 480: 33554433, 496: 1024, 264: 1049600, 280: 33555457, 296: 34603009, 312: 1, 328: 33554432, 344: 1048576, 360: 1025, 376: 34604032, 392: 33554433, 408: 34603008, 424: 0, 440: 34604033, 456: 1049601, 472: 1024, 488: 33555456, 504: 1048577 }, { 0: 134219808, 1: 131072, 2: 134217728, 3: 32, 4: 131104, 5: 134350880, 6: 134350848, 7: 2048, 8: 134348800, 9: 134219776, 10: 133120, 11: 134348832, 12: 2080, 13: 0, 14: 134217760, 15: 133152, 2147483648: 2048, 2147483649: 134350880, 2147483650: 134219808, 2147483651: 134217728, 2147483652: 134348800, 2147483653: 133120, 2147483654: 133152, 2147483655: 32, 2147483656: 134217760, 2147483657: 2080, 2147483658: 131104, 2147483659: 134350848, 2147483660: 0, 2147483661: 134348832, 2147483662: 134219776, 2147483663: 131072, 16: 133152, 17: 134350848, 18: 32, 19: 2048, 20: 134219776, 21: 134217760, 22: 134348832, 23: 131072, 24: 0, 25: 131104, 26: 134348800, 27: 134219808, 28: 134350880, 29: 133120, 30: 2080, 31: 134217728, 2147483664: 131072, 2147483665: 2048, 2147483666: 134348832, 2147483667: 133152, 2147483668: 32, 2147483669: 134348800, 2147483670: 134217728, 2147483671: 134219808, 2147483672: 134350880, 2147483673: 134217760, 2147483674: 134219776, 2147483675: 0, 2147483676: 133120, 2147483677: 2080, 2147483678: 131104, 2147483679: 134350848 }], l3 = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679], f4 = n4.DES = i5.extend({ _doReset: function() {
          for (var t5 = this._key.words, e6 = [], r5 = 0; r5 < 56; r5++) {
            var i6 = o4[r5] - 1;
            e6[r5] = t5[i6 >>> 5] >>> 31 - i6 % 32 & 1;
          }
          for (var n5 = this._subKeys = [], a5 = 0; a5 < 16; a5++) {
            var h5 = n5[a5] = [], l4 = c4[a5];
            for (r5 = 0; r5 < 24; r5++)
              h5[r5 / 6 | 0] |= e6[(s5[r5] - 1 + l4) % 28] << 31 - r5 % 6, h5[4 + (r5 / 6 | 0)] |= e6[28 + (s5[r5 + 24] - 1 + l4) % 28] << 31 - r5 % 6;
            for (h5[0] = h5[0] << 1 | h5[0] >>> 31, r5 = 1; r5 < 7; r5++)
              h5[r5] = h5[r5] >>> 4 * (r5 - 1) + 3;
            h5[7] = h5[7] << 5 | h5[7] >>> 27;
          }
          var f5 = this._invSubKeys = [];
          for (r5 = 0; r5 < 16; r5++)
            f5[r5] = n5[15 - r5];
        }, encryptBlock: function(t5, e6) {
          this._doCryptBlock(t5, e6, this._subKeys);
        }, decryptBlock: function(t5, e6) {
          this._doCryptBlock(t5, e6, this._invSubKeys);
        }, _doCryptBlock: function(t5, e6, r5) {
          this._lBlock = t5[e6], this._rBlock = t5[e6 + 1], u3.call(this, 4, 252645135), u3.call(this, 16, 65535), d3.call(this, 2, 858993459), d3.call(this, 8, 16711935), u3.call(this, 1, 1431655765);
          for (var i6 = 0; i6 < 16; i6++) {
            for (var n5 = r5[i6], o5 = this._lBlock, s6 = this._rBlock, a5 = 0, c5 = 0; c5 < 8; c5++)
              a5 |= h4[c5][((s6 ^ n5[c5]) & l3[c5]) >>> 0];
            this._lBlock = s6, this._rBlock = o5 ^ a5;
          }
          var f5 = this._lBlock;
          this._lBlock = this._rBlock, this._rBlock = f5, u3.call(this, 1, 1431655765), d3.call(this, 8, 16711935), d3.call(this, 2, 858993459), u3.call(this, 16, 65535), u3.call(this, 4, 252645135), t5[e6] = this._lBlock, t5[e6 + 1] = this._rBlock;
        }, keySize: 2, ivSize: 2, blockSize: 2 });
        function u3(t5, e6) {
          var r5 = (this._lBlock >>> t5 ^ this._rBlock) & e6;
          this._rBlock ^= r5, this._lBlock ^= r5 << t5;
        }
        function d3(t5, e6) {
          var r5 = (this._rBlock >>> t5 ^ this._lBlock) & e6;
          this._lBlock ^= r5, this._rBlock ^= r5 << t5;
        }
        t4.DES = i5._createHelper(f4);
        var p3 = n4.TripleDES = i5.extend({ _doReset: function() {
          var t5 = this._key.words;
          if (2 !== t5.length && 4 !== t5.length && t5.length < 6)
            throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
          var e6 = t5.slice(0, 2), i6 = t5.length < 4 ? t5.slice(0, 2) : t5.slice(2, 4), n5 = t5.length < 6 ? t5.slice(0, 2) : t5.slice(4, 6);
          this._des1 = f4.createEncryptor(r4.create(e6)), this._des2 = f4.createEncryptor(r4.create(i6)), this._des3 = f4.createEncryptor(r4.create(n5));
        }, encryptBlock: function(t5, e6) {
          this._des1.encryptBlock(t5, e6), this._des2.decryptBlock(t5, e6), this._des3.encryptBlock(t5, e6);
        }, decryptBlock: function(t5, e6) {
          this._des3.decryptBlock(t5, e6), this._des2.encryptBlock(t5, e6), this._des1.decryptBlock(t5, e6);
        }, keySize: 6, ivSize: 2, blockSize: 2 });
        t4.TripleDES = i5._createHelper(p3);
      }(), function() {
        var t4 = a4, e5 = t4.lib.StreamCipher, r4 = t4.algo, i5 = r4.RC4 = e5.extend({ _doReset: function() {
          for (var t5 = this._key, e6 = t5.words, r5 = t5.sigBytes, i6 = this._S = [], n5 = 0; n5 < 256; n5++)
            i6[n5] = n5;
          n5 = 0;
          for (var o5 = 0; n5 < 256; n5++) {
            var s5 = n5 % r5, a5 = e6[s5 >>> 2] >>> 24 - s5 % 4 * 8 & 255;
            o5 = (o5 + i6[n5] + a5) % 256;
            var c4 = i6[n5];
            i6[n5] = i6[o5], i6[o5] = c4;
          }
          this._i = this._j = 0;
        }, _doProcessBlock: function(t5, e6) {
          t5[e6] ^= n4.call(this);
        }, keySize: 8, ivSize: 0 });
        function n4() {
          for (var t5 = this._S, e6 = this._i, r5 = this._j, i6 = 0, n5 = 0; n5 < 4; n5++) {
            r5 = (r5 + t5[e6 = (e6 + 1) % 256]) % 256;
            var o5 = t5[e6];
            t5[e6] = t5[r5], t5[r5] = o5, i6 |= t5[(t5[e6] + t5[r5]) % 256] << 24 - 8 * n5;
          }
          return this._i = e6, this._j = r5, i6;
        }
        t4.RC4 = e5._createHelper(i5);
        var o4 = r4.RC4Drop = i5.extend({ cfg: i5.cfg.extend({ drop: 192 }), _doReset: function() {
          i5._doReset.call(this);
          for (var t5 = this.cfg.drop; t5 > 0; t5--)
            n4.call(this);
        } });
        t4.RC4Drop = e5._createHelper(o4);
      }(), /** @preserve
             * Counter block mode compatible with  Dr Brian Gladman fileenc.c
             * derived from CryptoJS.mode.CTR
             * Jan Hruby jhruby.web@gmail.com
             */
      a4.mode.CTRGladman = function() {
        var t4 = a4.lib.BlockCipherMode.extend();
        function e5(t5) {
          if (255 == (t5 >> 24 & 255)) {
            var e6 = t5 >> 16 & 255, r5 = t5 >> 8 & 255, i5 = 255 & t5;
            255 === e6 ? (e6 = 0, 255 === r5 ? (r5 = 0, 255 === i5 ? i5 = 0 : ++i5) : ++r5) : ++e6, t5 = 0, t5 += e6 << 16, t5 += r5 << 8, t5 += i5;
          } else
            t5 += 1 << 24;
          return t5;
        }
        var r4 = t4.Encryptor = t4.extend({ processBlock: function(t5, r5) {
          var i5 = this._cipher, n4 = i5.blockSize, o4 = this._iv, s5 = this._counter;
          o4 && (s5 = this._counter = o4.slice(0), this._iv = void 0), function(t6) {
            0 === (t6[0] = e5(t6[0])) && (t6[1] = e5(t6[1]));
          }(s5);
          var a5 = s5.slice(0);
          i5.encryptBlock(a5, 0);
          for (var c4 = 0; c4 < n4; c4++)
            t5[r5 + c4] ^= a5[c4];
        } });
        return t4.Decryptor = r4, t4;
      }(), function() {
        var t4 = a4, e5 = t4.lib.StreamCipher, r4 = t4.algo, i5 = [], n4 = [], o4 = [], s5 = r4.Rabbit = e5.extend({ _doReset: function() {
          for (var t5 = this._key.words, e6 = this.cfg.iv, r5 = 0; r5 < 4; r5++)
            t5[r5] = 16711935 & (t5[r5] << 8 | t5[r5] >>> 24) | 4278255360 & (t5[r5] << 24 | t5[r5] >>> 8);
          var i6 = this._X = [t5[0], t5[3] << 16 | t5[2] >>> 16, t5[1], t5[0] << 16 | t5[3] >>> 16, t5[2], t5[1] << 16 | t5[0] >>> 16, t5[3], t5[2] << 16 | t5[1] >>> 16], n5 = this._C = [t5[2] << 16 | t5[2] >>> 16, 4294901760 & t5[0] | 65535 & t5[1], t5[3] << 16 | t5[3] >>> 16, 4294901760 & t5[1] | 65535 & t5[2], t5[0] << 16 | t5[0] >>> 16, 4294901760 & t5[2] | 65535 & t5[3], t5[1] << 16 | t5[1] >>> 16, 4294901760 & t5[3] | 65535 & t5[0]];
          for (this._b = 0, r5 = 0; r5 < 4; r5++)
            c4.call(this);
          for (r5 = 0; r5 < 8; r5++)
            n5[r5] ^= i6[r5 + 4 & 7];
          if (e6) {
            var o5 = e6.words, s6 = o5[0], a5 = o5[1], h4 = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), l3 = 16711935 & (a5 << 8 | a5 >>> 24) | 4278255360 & (a5 << 24 | a5 >>> 8), f4 = h4 >>> 16 | 4294901760 & l3, u3 = l3 << 16 | 65535 & h4;
            for (n5[0] ^= h4, n5[1] ^= f4, n5[2] ^= l3, n5[3] ^= u3, n5[4] ^= h4, n5[5] ^= f4, n5[6] ^= l3, n5[7] ^= u3, r5 = 0; r5 < 4; r5++)
              c4.call(this);
          }
        }, _doProcessBlock: function(t5, e6) {
          var r5 = this._X;
          c4.call(this), i5[0] = r5[0] ^ r5[5] >>> 16 ^ r5[3] << 16, i5[1] = r5[2] ^ r5[7] >>> 16 ^ r5[5] << 16, i5[2] = r5[4] ^ r5[1] >>> 16 ^ r5[7] << 16, i5[3] = r5[6] ^ r5[3] >>> 16 ^ r5[1] << 16;
          for (var n5 = 0; n5 < 4; n5++)
            i5[n5] = 16711935 & (i5[n5] << 8 | i5[n5] >>> 24) | 4278255360 & (i5[n5] << 24 | i5[n5] >>> 8), t5[e6 + n5] ^= i5[n5];
        }, blockSize: 4, ivSize: 2 });
        function c4() {
          for (var t5 = this._X, e6 = this._C, r5 = 0; r5 < 8; r5++)
            n4[r5] = e6[r5];
          for (e6[0] = e6[0] + 1295307597 + this._b | 0, e6[1] = e6[1] + 3545052371 + (e6[0] >>> 0 < n4[0] >>> 0 ? 1 : 0) | 0, e6[2] = e6[2] + 886263092 + (e6[1] >>> 0 < n4[1] >>> 0 ? 1 : 0) | 0, e6[3] = e6[3] + 1295307597 + (e6[2] >>> 0 < n4[2] >>> 0 ? 1 : 0) | 0, e6[4] = e6[4] + 3545052371 + (e6[3] >>> 0 < n4[3] >>> 0 ? 1 : 0) | 0, e6[5] = e6[5] + 886263092 + (e6[4] >>> 0 < n4[4] >>> 0 ? 1 : 0) | 0, e6[6] = e6[6] + 1295307597 + (e6[5] >>> 0 < n4[5] >>> 0 ? 1 : 0) | 0, e6[7] = e6[7] + 3545052371 + (e6[6] >>> 0 < n4[6] >>> 0 ? 1 : 0) | 0, this._b = e6[7] >>> 0 < n4[7] >>> 0 ? 1 : 0, r5 = 0; r5 < 8; r5++) {
            var i6 = t5[r5] + e6[r5], s6 = 65535 & i6, a5 = i6 >>> 16, c5 = ((s6 * s6 >>> 17) + s6 * a5 >>> 15) + a5 * a5, h4 = ((4294901760 & i6) * i6 | 0) + ((65535 & i6) * i6 | 0);
            o4[r5] = c5 ^ h4;
          }
          t5[0] = o4[0] + (o4[7] << 16 | o4[7] >>> 16) + (o4[6] << 16 | o4[6] >>> 16) | 0, t5[1] = o4[1] + (o4[0] << 8 | o4[0] >>> 24) + o4[7] | 0, t5[2] = o4[2] + (o4[1] << 16 | o4[1] >>> 16) + (o4[0] << 16 | o4[0] >>> 16) | 0, t5[3] = o4[3] + (o4[2] << 8 | o4[2] >>> 24) + o4[1] | 0, t5[4] = o4[4] + (o4[3] << 16 | o4[3] >>> 16) + (o4[2] << 16 | o4[2] >>> 16) | 0, t5[5] = o4[5] + (o4[4] << 8 | o4[4] >>> 24) + o4[3] | 0, t5[6] = o4[6] + (o4[5] << 16 | o4[5] >>> 16) + (o4[4] << 16 | o4[4] >>> 16) | 0, t5[7] = o4[7] + (o4[6] << 8 | o4[6] >>> 24) + o4[5] | 0;
        }
        t4.Rabbit = e5._createHelper(s5);
      }(), a4.mode.CTR = function() {
        var t4 = a4.lib.BlockCipherMode.extend(), e5 = t4.Encryptor = t4.extend({ processBlock: function(t5, e6) {
          var r4 = this._cipher, i5 = r4.blockSize, n4 = this._iv, o4 = this._counter;
          n4 && (o4 = this._counter = n4.slice(0), this._iv = void 0);
          var s5 = o4.slice(0);
          r4.encryptBlock(s5, 0), o4[i5 - 1] = o4[i5 - 1] + 1 | 0;
          for (var a5 = 0; a5 < i5; a5++)
            t5[e6 + a5] ^= s5[a5];
        } });
        return t4.Decryptor = e5, t4;
      }(), function() {
        var t4 = a4, e5 = t4.lib.StreamCipher, r4 = t4.algo, i5 = [], n4 = [], o4 = [], s5 = r4.RabbitLegacy = e5.extend({ _doReset: function() {
          var t5 = this._key.words, e6 = this.cfg.iv, r5 = this._X = [t5[0], t5[3] << 16 | t5[2] >>> 16, t5[1], t5[0] << 16 | t5[3] >>> 16, t5[2], t5[1] << 16 | t5[0] >>> 16, t5[3], t5[2] << 16 | t5[1] >>> 16], i6 = this._C = [t5[2] << 16 | t5[2] >>> 16, 4294901760 & t5[0] | 65535 & t5[1], t5[3] << 16 | t5[3] >>> 16, 4294901760 & t5[1] | 65535 & t5[2], t5[0] << 16 | t5[0] >>> 16, 4294901760 & t5[2] | 65535 & t5[3], t5[1] << 16 | t5[1] >>> 16, 4294901760 & t5[3] | 65535 & t5[0]];
          this._b = 0;
          for (var n5 = 0; n5 < 4; n5++)
            c4.call(this);
          for (n5 = 0; n5 < 8; n5++)
            i6[n5] ^= r5[n5 + 4 & 7];
          if (e6) {
            var o5 = e6.words, s6 = o5[0], a5 = o5[1], h4 = 16711935 & (s6 << 8 | s6 >>> 24) | 4278255360 & (s6 << 24 | s6 >>> 8), l3 = 16711935 & (a5 << 8 | a5 >>> 24) | 4278255360 & (a5 << 24 | a5 >>> 8), f4 = h4 >>> 16 | 4294901760 & l3, u3 = l3 << 16 | 65535 & h4;
            for (i6[0] ^= h4, i6[1] ^= f4, i6[2] ^= l3, i6[3] ^= u3, i6[4] ^= h4, i6[5] ^= f4, i6[6] ^= l3, i6[7] ^= u3, n5 = 0; n5 < 4; n5++)
              c4.call(this);
          }
        }, _doProcessBlock: function(t5, e6) {
          var r5 = this._X;
          c4.call(this), i5[0] = r5[0] ^ r5[5] >>> 16 ^ r5[3] << 16, i5[1] = r5[2] ^ r5[7] >>> 16 ^ r5[5] << 16, i5[2] = r5[4] ^ r5[1] >>> 16 ^ r5[7] << 16, i5[3] = r5[6] ^ r5[3] >>> 16 ^ r5[1] << 16;
          for (var n5 = 0; n5 < 4; n5++)
            i5[n5] = 16711935 & (i5[n5] << 8 | i5[n5] >>> 24) | 4278255360 & (i5[n5] << 24 | i5[n5] >>> 8), t5[e6 + n5] ^= i5[n5];
        }, blockSize: 4, ivSize: 2 });
        function c4() {
          for (var t5 = this._X, e6 = this._C, r5 = 0; r5 < 8; r5++)
            n4[r5] = e6[r5];
          for (e6[0] = e6[0] + 1295307597 + this._b | 0, e6[1] = e6[1] + 3545052371 + (e6[0] >>> 0 < n4[0] >>> 0 ? 1 : 0) | 0, e6[2] = e6[2] + 886263092 + (e6[1] >>> 0 < n4[1] >>> 0 ? 1 : 0) | 0, e6[3] = e6[3] + 1295307597 + (e6[2] >>> 0 < n4[2] >>> 0 ? 1 : 0) | 0, e6[4] = e6[4] + 3545052371 + (e6[3] >>> 0 < n4[3] >>> 0 ? 1 : 0) | 0, e6[5] = e6[5] + 886263092 + (e6[4] >>> 0 < n4[4] >>> 0 ? 1 : 0) | 0, e6[6] = e6[6] + 1295307597 + (e6[5] >>> 0 < n4[5] >>> 0 ? 1 : 0) | 0, e6[7] = e6[7] + 3545052371 + (e6[6] >>> 0 < n4[6] >>> 0 ? 1 : 0) | 0, this._b = e6[7] >>> 0 < n4[7] >>> 0 ? 1 : 0, r5 = 0; r5 < 8; r5++) {
            var i6 = t5[r5] + e6[r5], s6 = 65535 & i6, a5 = i6 >>> 16, c5 = ((s6 * s6 >>> 17) + s6 * a5 >>> 15) + a5 * a5, h4 = ((4294901760 & i6) * i6 | 0) + ((65535 & i6) * i6 | 0);
            o4[r5] = c5 ^ h4;
          }
          t5[0] = o4[0] + (o4[7] << 16 | o4[7] >>> 16) + (o4[6] << 16 | o4[6] >>> 16) | 0, t5[1] = o4[1] + (o4[0] << 8 | o4[0] >>> 24) + o4[7] | 0, t5[2] = o4[2] + (o4[1] << 16 | o4[1] >>> 16) + (o4[0] << 16 | o4[0] >>> 16) | 0, t5[3] = o4[3] + (o4[2] << 8 | o4[2] >>> 24) + o4[1] | 0, t5[4] = o4[4] + (o4[3] << 16 | o4[3] >>> 16) + (o4[2] << 16 | o4[2] >>> 16) | 0, t5[5] = o4[5] + (o4[4] << 8 | o4[4] >>> 24) + o4[3] | 0, t5[6] = o4[6] + (o4[5] << 16 | o4[5] >>> 16) + (o4[4] << 16 | o4[4] >>> 16) | 0, t5[7] = o4[7] + (o4[6] << 8 | o4[6] >>> 24) + o4[5] | 0;
        }
        t4.RabbitLegacy = e5._createHelper(s5);
      }(), a4.pad.ZeroPadding = { pad: function(t4, e5) {
        var r4 = 4 * e5;
        t4.clamp(), t4.sigBytes += r4 - (t4.sigBytes % r4 || r4);
      }, unpad: function(t4) {
        var e5 = t4.words, r4 = t4.sigBytes - 1;
        for (r4 = t4.sigBytes - 1; r4 >= 0; r4--)
          if (e5[r4 >>> 2] >>> 24 - r4 % 4 * 8 & 255) {
            t4.sigBytes = r4 + 1;
            break;
          }
      } }, a4);
    });
    return function() {
      function e4(r3) {
        t2(this, e4);
        var i4 = r3.isArray, n3 = r3.isMap, o3 = r3.isDevMode;
        this._isArray = i4, this._isMap = n3, this._isDevMode = o3, this._interceptProfanityList = [], this._interceptFilter = null, this._interceptRegExpList = [], this._replacingProfanityMap = /* @__PURE__ */ new Map(), this._replacingFilter = null, this._replacingRegExpMap = /* @__PURE__ */ new Map(), this._key = "", this._iv = "", this._decryptOptions = void 0, this._n = "TIMProfanityFilterPlugin", true === o3 && index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, ".VERSION:").concat("1.1.0"));
      }
      return r2(e4, [{ key: "onToken", value: function(t3) {
        this._key = u2.enc.Utf8.parse(t3.slice(0, 32)), this._iv = this._key, this._decryptOptions = { iv: this._iv, mode: u2.mode.CBC, padding: u2.pad.Pkcs7 };
      } }, { key: "onLexiconSliced", value: function(t3) {
        if (this._isArray(t3) && 0 !== t3.length) {
          var e5, r3, i4, n3 = a3(t3);
          try {
            for (n3.s(); !(i4 = n3.n()).done; ) {
              var o3 = i4.value, s4 = o3.filterType, c4 = o3.profanityType, h4 = o3.profanity, l3 = o3.replacement;
              e5 = this._getDecryptedString(h4), r3 = this._getDecryptedString(l3), 1 === s4 ? 1 === c4 ? this._interceptProfanityList.push(e5) : 2 === c4 && this._interceptRegExpList.push(e5) : 2 === s4 && (1 === c4 ? this._replacingProfanityMap.set(e5, r3) : 2 === c4 && this._replacingRegExpMap.set(e5, r3));
            }
          } catch (f4) {
            n3.e(f4);
          } finally {
            n3.f();
          }
        }
      } }, { key: "_getDecryptedString", value: function(t3) {
        var e5 = u2.AES.decrypt(t3, this._key, this._decryptOptions);
        return u2.enc.Utf8.stringify(e5).toLowerCase();
      } }, { key: "onLexiconCompleted", value: function(t3) {
        this.onLexiconSliced(t3), this._interceptFilter = new h3({ input: this._interceptProfanityList, isArray: this._isArray, isMap: this._isMap }), this._replacingFilter = new h3({ input: this._replacingProfanityMap, isArray: this._isArray, isMap: this._isMap }), true === this._isDevMode && (index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _interceptProfanityList ->"), this._interceptProfanityList), index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _interceptRegExpList ->"), this._interceptRegExpList), index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _replacingProfanityMap ->"), this._replacingProfanityMap), index.__f__("log", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, " _replacingRegExpMap ->"), this._replacingRegExpMap));
      } }, { key: "filter", value: function(t3) {
        var e5 = { type: 0, modifiedText: t3 };
        if ("string" != typeof t3)
          return true === this._isDevMode && index.__f__("warn", "at node_modules/tim-profanity-filter-plugin/index.js:15", "".concat(this._n, ".filter invalid params, string required!")), e5;
        if (true === this._interceptFilter.filter({ text: t3, replacingEnabled: false }).isMatched)
          return e5.type = 1, e5;
        for (var r3 = false, n3 = 0, o3 = this._interceptRegExpList.length; n3 < o3; n3++)
          if (new RegExp(this._interceptRegExpList[n3], "gi").test(t3.toLowerCase())) {
            r3 = true;
            break;
          }
        if (r3)
          return e5.type = 1, e5;
        var s4 = this._replacingFilter.filter({ text: t3, replacingEnabled: true });
        true === s4.isMatched && (e5.type = 2, e5.modifiedText = s4.modifiedText);
        var c4, h4 = e5.modifiedText, l3 = null, f4 = a3(this._replacingRegExpMap);
        try {
          for (f4.s(); !(c4 = f4.n()).done; ) {
            var u3 = i3(c4.value, 2), d3 = u3[0], p3 = u3[1];
            l3 = new RegExp(d3, "gi"), h4 = h4.replace(l3, p3);
          }
        } catch (_2) {
          f4.e(_2);
        } finally {
          f4.f();
        }
        return h4 !== t3 && (e5.type = 2, e5.modifiedText = h4), e5;
      } }, { key: "reset", value: function() {
        this._isArray = null, this._isMap = null, this._interceptProfanityList.length = 0, this._interceptRegExpList.length = 0, this._replacingProfanityMap.clear(), this._replacingRegExpMap.clear(), this._key = "", this._iv = "", this._decryptOptions = {}, this._interceptFilter && this._interceptFilter.reset(), this._replacingFilter && this._replacingFilter.reset();
      } }]), e4;
    }();
  });
})(timProfanityFilterPlugin);
var timProfanityFilterPluginExports = timProfanityFilterPlugin.exports;
const s2 = /* @__PURE__ */ getDefaultExportFromCjs(timProfanityFilterPluginExports);
function n(e3, t2) {
  var s3 = {};
  for (var n2 in e3)
    Object.prototype.hasOwnProperty.call(e3, n2) && t2.indexOf(n2) < 0 && (s3[n2] = e3[n2]);
  if (null != e3 && "function" == typeof Object.getOwnPropertySymbols) {
    var i3 = 0;
    for (n2 = Object.getOwnPropertySymbols(e3); i3 < n2.length; i3++)
      t2.indexOf(n2[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(e3, n2[i3]) && (s3[n2[i3]] = e3[n2[i3]]);
  }
  return s3;
}
function i2(e3, t2, s3, n2) {
  return new (s3 || (s3 = Promise))(function(i3, r2) {
    function a3(e4) {
      try {
        u2(n2.next(e4));
      } catch (e5) {
        r2(e5);
      }
    }
    function o2(e4) {
      try {
        u2(n2.throw(e4));
      } catch (e5) {
        r2(e5);
      }
    }
    function u2(e4) {
      var t3;
      e4.done ? i3(e4.value) : (t3 = e4.value, t3 instanceof s3 ? t3 : new s3(function(e5) {
        e5(t3);
      })).then(a3, o2);
    }
    u2((n2 = n2.apply(e3, t2 || [])).next());
  });
}
"function" == typeof SuppressedError && SuppressedError;
class r {
  constructor(e3) {
    return r.instance || (r.instance = this, this.engine = e3, this.events = {}, this.bindIMEvents()), r.instance;
  }
  addEvent(e3, t2) {
    this.events[e3] || (this.events[e3] = /* @__PURE__ */ new Map()), this.events[e3].set(t2, 1);
  }
  removeEvents() {
    Object.keys(this.events).forEach((e3) => {
      this.events[e3].clear();
    }), this.events = {};
  }
  dispatch(e3, t2) {
    if (this.events[e3])
      for (const s3 of this.events[e3].keys())
        s3.call(this, t2);
  }
  bindIMEvents() {
    this.engine.chat.on(this.engine.EVENT.SDK_READY, this.onSDKReady, this), this.engine.chat.on(this.engine.EVENT.SDK_NOT_READY, this.onSDKNotReady, this), this.engine.chat.on(this.engine.EVENT.KICKED_OUT, this.onKickedOut, this), this.engine.chat.on(this.engine.EVENT.NET_STATE_CHANGE, this.onNetStateChange, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_MODIFIED, this.onMessageModified, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_REVOKED, this.onMessageRevoked, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_BY_PEER, this.onMessageReadByPeer, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, this.onMessageReadReceiptReceived, this), this.engine.chat.on(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED, this.onMessageReactionsUpdated, this), this.engine.chat.on(this.engine.EVENT.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated, this), this.engine.chat.on(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalMessageCountUpdated, this), this.engine.chat.on(this.engine.EVENT.PROFILE_UPDATED, this.onProfileUpdated, this), this.engine.chat.on(this.engine.EVENT.BLACKLIST_UPDATED, this.onBlacklistUpdated, this), this.engine.chat.on(this.engine.EVENT.USER_STATUS_UPDATED, this.onUserStatusUpdated, this), this.engine.chat.on(this.engine.EVENT.GROUP_LIST_UPDATED, this.onGroupListUpdated, this), this.engine.chat.on(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED, this.onGroupAttributesUpdated, this), this.engine.chat.on(this.engine.EVENT.GROUP_COUNTER_UPDATED, this.onGroupCounterUpdated, this), this.engine.chat.on(this.engine.EVENT.FRIEND_LIST_UPDATED, this.onFriendListUpdated, this), this.engine.chat.on(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED, this.onFriendApplicationListUpdated, this);
  }
  unbindIMEvents() {
    this.engine.chat.off(this.engine.EVENT.SDK_READY, this.onSDKReady, this), this.engine.chat.off(this.engine.EVENT.SDK_NOT_READY, this.onSDKNotReady, this), this.engine.chat.off(this.engine.EVENT.KICKED_OUT, this.onKickedOut, this), this.engine.chat.off(this.engine.EVENT.NET_STATE_CHANGE, this.onNetStateChange, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_MODIFIED, this.onMessageModified, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_REVOKED, this.onMessageRevoked, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_BY_PEER, this.onMessageReadByPeer, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, this.onMessageReadReceiptReceived, this), this.engine.chat.off(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED, this.onMessageReactionsUpdated, this), this.engine.chat.off(this.engine.EVENT.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated, this), this.engine.chat.off(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalMessageCountUpdated, this), this.engine.chat.off(this.engine.EVENT.PROFILE_UPDATED, this.onProfileUpdated, this), this.engine.chat.off(this.engine.EVENT.BLACKLIST_UPDATED, this.onBlacklistUpdated, this), this.engine.chat.off(this.engine.EVENT.USER_STATUS_UPDATED, this.onUserStatusUpdated, this), this.engine.chat.off(this.engine.EVENT.GROUP_LIST_UPDATED, this.onGroupListUpdated, this), this.engine.chat.off(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED, this.onGroupAttributesUpdated, this), this.engine.chat.off(this.engine.EVENT.GROUP_COUNTER_UPDATED, this.onGroupCounterUpdated, this), this.engine.chat.off(this.engine.EVENT.FRIEND_LIST_UPDATED, this.onFriendListUpdated, this), this.engine.chat.off(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED, this.onFriendApplicationListUpdated, this), r.instance = null;
  }
  onSDKReady(e3) {
    this.dispatch(this.engine.EVENT.SDK_READY, e3.data);
  }
  onSDKNotReady(e3) {
    this.dispatch(this.engine.EVENT.SDK_NOT_READY, e3.data);
  }
  onKickedOut(e3) {
    this.dispatch(this.engine.EVENT.KICKED_OUT, e3.data);
  }
  onNetStateChange(e3) {
    this.dispatch(this.engine.EVENT.NET_STATE_CHANGE, e3.data);
  }
  onReceiveMessage(e3) {
    this.dispatch(this.engine.EVENT.MESSAGE_RECEIVED, e3.data);
  }
  onMessageModified(e3) {
    this.dispatch(this.engine.EVENT.MESSAGE_MODIFIED, e3.data);
  }
  onMessageRevoked(e3) {
    this.dispatch(this.engine.EVENT.MESSAGE_REVOKED, e3.data);
  }
  onMessageReadByPeer(e3) {
    this.dispatch(this.engine.EVENT.MESSAGE_READ_BY_PEER, e3.data);
  }
  onMessageReadReceiptReceived(e3) {
    this.dispatch(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, e3.data);
  }
  onMessageReactionsUpdated(e3) {
    this.dispatch(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED, e3.data);
  }
  onConversationListUpdated(e3) {
    this.dispatch(this.engine.EVENT.CONVERSATION_LIST_UPDATED, e3.data);
  }
  onTotalMessageCountUpdated(e3) {
    this.dispatch(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, e3.data);
  }
  onProfileUpdated(e3) {
    this.dispatch(this.engine.EVENT.PROFILE_UPDATED, e3.data);
  }
  onBlacklistUpdated(e3) {
    this.dispatch(this.engine.EVENT.BLACKLIST_UPDATED, e3.data);
  }
  onUserStatusUpdated(e3) {
    this.dispatch(this.engine.EVENT.USER_STATUS_UPDATED, e3.data);
  }
  onGroupListUpdated(e3) {
    this.dispatch(this.engine.EVENT.GROUP_LIST_UPDATED, e3.data);
  }
  onGroupAttributesUpdated(e3) {
    this.dispatch(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED, e3.data);
  }
  onGroupCounterUpdated(e3) {
    this.dispatch(this.engine.EVENT.GROUP_COUNTER_UPDATED, e3.data);
  }
  onFriendListUpdated(e3) {
    this.dispatch(this.engine.EVENT.FRIEND_LIST_UPDATED, e3.data);
  }
  onFriendApplicationListUpdated(e3) {
    this.dispatch(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED, e3.data);
  }
}
var a2, o, u, c2, g, l, h2, p2, d2;
!function(e3) {
  e3.TUIStore = "TUIStore", e3.TUITranslate = "TUITranslate", e3.TUIConversation = "TUIConversation", e3.TUIChat = "TUIChat", e3.TUIGroup = "TUIGroup", e3.TUIUser = "TUIUser", e3.TUIFriend = "TUIFriend", e3.TUIReport = "TUIReport";
}(a2 || (a2 = {})), function(e3) {
  e3.APP = "application", e3.CONV = "conversation", e3.CHAT = "chat", e3.GRP = "group", e3.USER = "user", e3.FRIEND = "friend", e3.SEARCH = "search", e3.CUSTOM = "custom";
}(o || (o = {})), function(e3) {
  e3[e3.UNSUB_USER = -1] = "UNSUB_USER";
}(u || (u = {})), function(e3) {
  e3.BUSINESS_ID = "user_typing_status", e3[e3.STATUS_START = 1] = "STATUS_START", e3[e3.STATUS_END = 0] = "STATUS_END", e3[e3.VERSION = 1] = "VERSION", e3[e3.ACTION_START_ID = 14] = "ACTION_START_ID", e3[e3.ACTION_END_ID = 0] = "ACTION_END_ID", e3.ACTION_START = "EIMAMSG_InputStatus_Ing", e3.ACTION_END = "EIMAMSG_InputStatus_End", e3[e3.NEED_TYPING = 1] = "NEED_TYPING";
}(c2 || (c2 = {})), function(e3) {
  e3.ADD = "add", e3.REMOVE = "remove";
}(g || (g = {})), function(e3) {
  e3[e3.MSG_MODIFY_CONFLICT = 2480] = "MSG_MODIFY_CONFLICT", e3[e3.MSG_MODIFY_DISABLED_IN_AVCHATROOM = 2481] = "MSG_MODIFY_DISABLED_IN_AVCHATROOM", e3[e3.MODIFY_MESSAGE_NOT_EXIST = 20026] = "MODIFY_MESSAGE_NOT_EXIST";
}(l || (l = {})), function(e3) {
  e3[e3.NOT_INIT = -1e5] = "NOT_INIT", e3[e3.INVALID_CONV_ID = -100001] = "INVALID_CONV_ID", e3[e3.CONV_ID_SAME = -100002] = "CONV_ID_SAME", e3[e3.CONV_NOT_EXIST = -100003] = "CONV_NOT_EXIST", e3[e3.GET_MSG_LIST_ERROR = -100004] = "GET_MSG_LIST_ERROR", e3[e3.MISMATCH_TYPE_AND_PAYLOAD = -100005] = "MISMATCH_TYPE_AND_PAYLOAD";
}(h2 || (h2 = {})), function(e3) {
  e3.MSG_MODIFY_CONFLICT = "MODIFY_MESSAGE_ERROR,修改消息发生冲突, data.message 是最新的消息", e3.MSG_MODIFY_DISABLED_IN_AVCHATROOM = "MODIFY_MESSAGE_ERROR,不支持修改直播群消息.", e3.MODIFY_MESSAGE_NOT_EXIST = "MODIFY_MESSAGE_ERROR,消息不存在.";
}(p2 || (p2 = {})), function(e3) {
  e3.NOT_INIT = "TUIChatEngine 初始化未完成，请确认 TUIChatEngine.login 接口调用是否正常。", e3.INVALID_CONV_ID = "会话 ID 无效", e3.CONV_ID_SAME = "您切换的是同一个会话 ID", e3.CONV_NOT_EXIST = "会话不存在", e3.GET_MSG_LIST_ERROR = "Chat SDK is not ready.", e3.MISMATCH_TYPE_AND_PAYLOAD = "type 与 payload 不匹配.";
}(d2 || (d2 = {}));
const f2 = { logout: 1, destroy: 1 }, m2 = { deleteConversation: 1, pinConversation: 1, muteConversation: 1, switchConversation: 1, getConversationProfile: 1, clearHistoryMessage: 1 }, v2 = { modifyMessage: 1, revokeMessage: 1, resendMessage: 1, deleteMessage: 1, quoteMessage: 1, replyMessage: 1, setMessageExtensions: 1, deleteMessageExtensions: 1, getMessageExtensions: 1, sendTextMessage: 1, sendTextAtMessage: 1, sendImageMessage: 1, sendAudioMessage: 1, sendVideoMessage: 1, sendFileMessage: 1, sendCustomMessage: 1, sendFaceMessage: 1, sendLocationMessage: 1, sendForwardMessage: 1, enterTypingState: 1, leaveTypingState: 1, sendMessageReadReceipt: 1, getGroupMessageReadMemberList: 1, getMessageList: 1, downloadMergedMessages: 1, setTranslationLanguage: 1, translateText: 1, searchCloudMessages: 1, addMessageReaction: 1, removeMessageReaction: 1, getMessageReactions: 1, getAllUserListOfMessageReaction: 1 }, T = { switchGroup: 1, getGroupProfile: 1, updateGroupProfile: 1, createGroup: 1, dismissGroup: 1, searchGroupByID: 1, joinGroup: 1, quitGroup: 1, getGroupApplicationList: 1, handleGroupApplication: 1, getGroupOnlineMemberCount: 1, changeGroupOwner: 1, initGroupAttributes: 1, setGroupAttributes: 1, deleteGroupAttributes: 1, getGroupAttributes: 1, setGroupCounters: 1, increaseGroupCounter: 1, decreaseGroupCounter: 1, getGroupCounters: 1, getGroupMemberList: 1, getGroupMemberProfile: 1, addGroupMember: 1, deleteGroupMember: 1, setGroupMemberMuteTime: 1, setGroupMemberRole: 1, setGroupMemberNameCard: 1, setGroupMemberCustomField: 1, markGroupMemberList: 1 }, E = { switchUserStatus: 1, switchMessageReadStatus: 1, getUserProfile: 1, updateMyProfile: 1, addToBlacklist: 1, removeFromBlacklist: 1 }, I = { getFriendList: 1, addFriend: 1, deleteFriend: 1, checkFriend: 1, getFriendProfile: 1, updateFriend: 1, acceptFriendApplication: 1, refuseFriendApplication: 1, deleteFriendApplication: 1, setFriendApplicationRead: 1 }, S = function(e3) {
  return void 0 === e3;
}, y = function(e3) {
  return e3.startsWith("_");
}, b = function(e3) {
  return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e3);
};
const U = function(e3) {
  return e3 && function(e4) {
    if ("string" == typeof e4)
      try {
        return !!JSON.parse(e4);
      } catch (e5) {
        return false;
      }
    return false;
  }(e3) ? JSON.parse(e3) : e3;
}, C = function(e3) {
  let t2 = "";
  return t2 = e3 >= 1048576 ? `${(e3 / 1048576).toFixed(2)} Mb` : e3 >= 1024 ? `${(e3 / 1024).toFixed(2)} Kb` : `${e3.toFixed(2)}B`, t2;
}, M = "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_16.png", O = "https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.png", _ = "https://web.sdk.qcloud.com/component/TUIKit/assets/group_avatar.png", D = "https://web.sdk.qcloud.com/im/assets/emoji-plugin/", P = "https://web.sdk.qcloud.com/im/assets/face-elem/", R = "https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&", L = "https://apis.map.qq.com/ws/staticmap/v2/?", A = { "[TUIEmoji_Expect]": "emoji_0@2x.png", "[TUIEmoji_Blink]": "emoji_1@2x.png", "[TUIEmoji_Guffaw]": "emoji_2@2x.png", "[TUIEmoji_KindSmile]": "emoji_3@2x.png", "[TUIEmoji_Haha]": "emoji_4@2x.png", "[TUIEmoji_Cheerful]": "emoji_5@2x.png", "[TUIEmoji_Smile]": "emoji_6@2x.png", "[TUIEmoji_Sorrow]": "emoji_7@2x.png", "[TUIEmoji_Speechless]": "emoji_8@2x.png", "[TUIEmoji_Amazed]": "emoji_9@2x.png", "[TUIEmoji_Complacent]": "emoji_10@2x.png", "[TUIEmoji_Lustful]": "emoji_11@2x.png", "[TUIEmoji_Stareyes]": "emoji_12@2x.png", "[TUIEmoji_Giggle]": "emoji_13@2x.png", "[TUIEmoji_Daemon]": "emoji_14@2x.png", "[TUIEmoji_Rage]": "emoji_15@2x.png", "[TUIEmoji_Yawn]": "emoji_16@2x.png", "[TUIEmoji_TearsLaugh]": "emoji_17@2x.png", "[TUIEmoji_Silly]": "emoji_18@2x.png", "[TUIEmoji_Wail]": "emoji_19@2x.png", "[TUIEmoji_Kiss]": "emoji_20@2x.png", "[TUIEmoji_Trapped]": "emoji_21@2x.png", "[TUIEmoji_Fear]": "emoji_22@2x.png", "[TUIEmoji_BareTeeth]": "emoji_23@2x.png", "[TUIEmoji_FlareUp]": "emoji_24@2x.png", "[TUIEmoji_Tact]": "emoji_25@2x.png", "[TUIEmoji_Shit]": "emoji_26@2x.png", "[TUIEmoji_ShutUp]": "emoji_27@2x.png", "[TUIEmoji_Sigh]": "emoji_28@2x.png", "[TUIEmoji_Hehe]": "emoji_29@2x.png", "[TUIEmoji_Silent]": "emoji_30@2x.png", "[TUIEmoji_Skull]": "emoji_31@2x.png", "[TUIEmoji_Mask]": "emoji_32@2x.png", "[TUIEmoji_Beer]": "emoji_33@2x.png", "[TUIEmoji_Cake]": "emoji_34@2x.png", "[TUIEmoji_RedPacket]": "emoji_35@2x.png", "[TUIEmoji_Bombs]": "emoji_36@2x.png", "[TUIEmoji_Ai]": "emoji_37@2x.png", "[TUIEmoji_Celebrate]": "emoji_38@2x.png", "[TUIEmoji_Bless]": "emoji_39@2x.png", "[TUIEmoji_Flower]": "emoji_40@2x.png", "[TUIEmoji_Watermelon]": "emoji_41@2x.png", "[TUIEmoji_Cow]": "emoji_42@2x.png", "[TUIEmoji_Fool]": "emoji_43@2x.png", "[TUIEmoji_Surprised]": "emoji_44@2x.png", "[TUIEmoji_Askance]": "emoji_45@2x.png", "[TUIEmoji_Monster]": "emoji_46@2x.png", "[TUIEmoji_Pig]": "emoji_47@2x.png", "[TUIEmoji_Coffee]": "emoji_48@2x.png", "[TUIEmoji_Ok]": "emoji_49@2x.png", "[TUIEmoji_Heart]": "emoji_50@2x.png", "[TUIEmoji_Sun]": "emoji_51@2x.png", "[TUIEmoji_Moon]": "emoji_52@2x.png", "[TUIEmoji_Star]": "emoji_53@2x.png", "[TUIEmoji_Rich]": "emoji_54@2x.png", "[TUIEmoji_Fortune]": "emoji_55@2x.png", "[TUIEmoji_857]": "emoji_56@2x.png", "[TUIEmoji_666]": "emoji_57@2x.png", "[TUIEmoji_Prohibit]": "emoji_58@2x.png", "[TUIEmoji_Convinced]": "emoji_59@2x.png", "[TUIEmoji_Knife]": "emoji_60@2x.png", "[TUIEmoji_Like]": "emoji_61@2x.png" }, j = { "[TUIEmoji_Smile]": "[微笑]", "[TUIEmoji_Expect]": "[期待]", "[TUIEmoji_Blink]": "[眨眼]", "[TUIEmoji_Guffaw]": "[大笑]", "[TUIEmoji_KindSmile]": "[姨母笑]", "[TUIEmoji_Haha]": "[哈哈哈]", "[TUIEmoji_Cheerful]": "[愉快]", "[TUIEmoji_Speechless]": "[无语]", "[TUIEmoji_Amazed]": "[惊讶]", "[TUIEmoji_Sorrow]": "[悲伤]", "[TUIEmoji_Complacent]": "[得意]", "[TUIEmoji_Silly]": "[傻了]", "[TUIEmoji_Lustful]": "[色]", "[TUIEmoji_Giggle]": "[憨笑]", "[TUIEmoji_Kiss]": "[亲亲]", "[TUIEmoji_Wail]": "[大哭]", "[TUIEmoji_TearsLaugh]": "[哭笑]", "[TUIEmoji_Trapped]": "[困]", "[TUIEmoji_Mask]": "[口罩]", "[TUIEmoji_Fear]": "[恐惧]", "[TUIEmoji_BareTeeth]": "[龇牙]", "[TUIEmoji_FlareUp]": "[发怒]", "[TUIEmoji_Yawn]": "[打哈欠]", "[TUIEmoji_Tact]": "[机智]", "[TUIEmoji_Stareyes]": "[星星眼]", "[TUIEmoji_ShutUp]": "[闭嘴]", "[TUIEmoji_Sigh]": "[叹气]", "[TUIEmoji_Hehe]": "[呵呵]", "[TUIEmoji_Silent]": "[收声]", "[TUIEmoji_Surprised]": "[惊喜]", "[TUIEmoji_Askance]": "[白眼]", "[TUIEmoji_Ok]": "[OK]", "[TUIEmoji_Shit]": "[便便]", "[TUIEmoji_Monster]": "[怪兽]", "[TUIEmoji_Daemon]": "[恶魔]", "[TUIEmoji_Rage]": "[恶魔怒]", "[TUIEmoji_Fool]": "[衰]", "[TUIEmoji_Pig]": "[猪]", "[TUIEmoji_Cow]": "[牛]", "[TUIEmoji_Ai]": "[AI]", "[TUIEmoji_Skull]": "[骷髅]", "[TUIEmoji_Bombs]": "[炸弹]", "[TUIEmoji_Coffee]": "[咖啡]", "[TUIEmoji_Cake]": "[蛋糕]", "[TUIEmoji_Beer]": "[啤酒]", "[TUIEmoji_Flower]": "[花]", "[TUIEmoji_Watermelon]": "[瓜]", "[TUIEmoji_Rich]": "[壕]", "[TUIEmoji_Heart]": "[爱心]", "[TUIEmoji_Moon]": "[月亮]", "[TUIEmoji_Sun]": "[太阳]", "[TUIEmoji_Star]": "[星星]", "[TUIEmoji_RedPacket]": "[红包]", "[TUIEmoji_Celebrate]": "[庆祝]", "[TUIEmoji_Bless]": "[福]", "[TUIEmoji_Fortune]": "[发]", "[TUIEmoji_Convinced]": "[服]", "[TUIEmoji_Prohibit]": "[禁]", "[TUIEmoji_666]": "[666]", "[TUIEmoji_857]": "[857]", "[TUIEmoji_Knife]": "[刀]", "[TUIEmoji_Like]": "[赞]" }, k = { enabledMessageReadReceipt: Math.pow(2, 5), enabledEmojiPlugin: Math.pow(2, 48), enabledOnlineStatus: Math.pow(2, 7), enabledCustomerServicePlugin: Math.pow(2, 40), enabledTranslationPlugin: Math.pow(2, 38), enabledVoiceToText: Math.pow(2, 39) }, N = ["messageList", "conversationList", "newMessageList"], x = ["translateTextInfo", "voiceToTextInfo"], G = "undefined" != typeof wx$1 && "function" == typeof wx$1.getSystemInfoSync && Boolean(wx$1.getSystemInfoSync().fontSizeSetting), w = "undefined" != typeof index && "undefined" == typeof window, V = G || w, F = "undefined" != typeof index, $2 = ("undefined" != typeof index || "undefined" != typeof window) && !V, H = G ? wx$1 : F ? index : window, Y = $2 && window && window.navigator && window.navigator.userAgent || "", B = /Android/i.test(Y), K = /(?:Windows Phone)/.test(Y), q = /(?:SymbianOS)/.test(Y), z = /iPad/i.test(Y) || /iPhone/i.test(Y) || /iPod/i.test(Y), J2 = B || K || q || z, W = $2 && !J2;
class X2 {
  constructor() {
    this.global = H, this.isOfficial = false;
  }
  static getInstance() {
    return X2.instance || (X2.instance = new X2()), X2.instance;
  }
  initOfficial(e3) {
    this.isOfficial = e3;
  }
  getPlatform() {
    let e3 = "";
    return W ? e3 = "pc" : J2 ? e3 = "h5" : G ? e3 = "wechat" : w && !G && (e3 = "app"), e3;
  }
}
const Z = "group-module", Q2 = "relationship-module";
class ee2 {
  constructor() {
    this.EVENT = e2.EVENT, this.TYPES = e2.TYPES, this.loginStatusPromise = /* @__PURE__ */ new Map(), this.userID = "", this.isInited = false;
  }
  static getInstance() {
    return ee2.instance || (ee2.instance = new ee2()), ee2.instance;
  }
  mount(e3, t2) {
    this[e3] = t2;
  }
  login(t2) {
    const { chat: s3, SDKAppID: n2, userID: i3 } = t2, a3 = 1400187352 === n2 || 1400188366 === n2;
    return this.createChat(t2), this.userID = i3, X2.getInstance().initOfficial(a3), this.TUIStore.update(o.APP, "isOfficial", a3), this.TUIStore.update(o.APP, "SDKVersion", e2.VERSION), this.eventCenter = new r(this), this.eventCenter.removeEvents(), this.resetStore(), this.initService(), s3 && s3.isReady() ? (index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.login ok, from TUICore."), this.TUIUser.getUserProfile(), this.checkCommercialAbility(), Promise.resolve({})) : (this.registerPlugin(t2), this.eventCenter.addEvent(this.EVENT.SDK_READY, () => {
      this.onSDKReady();
    }), this.eventCenter.addEvent(this.EVENT.SDK_NOT_READY, () => {
      this.onSDKNotReady();
    }), this.loginChat(t2));
  }
  logout() {
    return this.userID = "", this.isInited = false, this.resetStore(), this.chat.logout();
  }
  isReady() {
    var e3;
    return (null === (e3 = this.chat) || void 0 === e3 ? void 0 : e3.isReady()) || false;
  }
  setLogLevel(e3) {
    this.chat ? this.chat.setLogLevel(e3) : index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine 初始化未完成，请确认 TUIChatEngine.login 接口调用是否正常。");
  }
  destroy() {
    return this.eventCenter.unbindIMEvents(), this.isInited = false, this.resetStore(), this.chat.destroy();
  }
  getMyUserID() {
    return this.userID;
  }
  resetStore() {
    this.TUIStore.reset(o.CHAT), this.TUIStore.reset(o.CONV), this.TUIStore.reset(o.GRP), this.TUIStore.reset(o.USER), this.TUIStore.reset(o.SEARCH), this.TUIStore.reset(o.FRIEND), this.TUIStore.reset(o.CUSTOM), index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.resetStore ok.");
  }
  initService() {
    this.TUIChat.init(), this.TUIConversation.init(), this.TUIUser.init(), this.initOptionalServices(), this.isInited = true, index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.initService ok.");
  }
  initOptionalServices() {
    const t2 = e2.VERSION.split(".");
    t2[0] > 3 || 3 === t2[0] && t2[1] >= 3 && t2[2] > 0 ? (true === this.chat.callExperimentalAPI("canIUseModule", [Z]) && this.TUIGroup.init(), true === this.chat.callExperimentalAPI("canIUseModule", [Q2]) && this.TUIFriend.init()) : (this.TUIGroup.init(), this.TUIFriend.init());
  }
  createChat(t2) {
    const { chat: s3 } = t2, i3 = n(t2, ["chat"]);
    S(s3) ? this.chat = e2.create(Object.assign(Object.assign({}, i3), { scene: "chat-uikit-engine" })) : this.chat = s3;
  }
  loginChat(e3) {
    const { userID: t2, userSig: s3 } = e3;
    return new Promise((e4, n2) => {
      this.chat.login({ userID: t2, userSig: s3 }).then((t3) => {
        index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.loginChat ok."), this.checkCommercialAbility(), t3.data.repeatLogin && this.chat.isReady() && e4(t3), this.loginStatusPromise.set("login", { resolve: e4, reject: n2, imResponse: t3 });
      }).catch((e5) => {
        n2(e5);
      });
    });
  }
  registerPlugin(e3) {
    const { useUploadPlugin: n2 = false, useProfanityFilterPlugin: i3 = false, TIMPush: r2, pushConfig: a3, TUIOfflinePush: o2, offlinePushConfig: u2 } = e3;
    true === n2 && this.chat.registerPlugin({ "tim-upload-plugin": t }), true === i3 && this.chat.registerPlugin({ "tim-profanity-filter-plugin": s2 }), !w || G || S(r2) || S(a3) || this.chat.registerPlugin({ "tim-push": r2, pushConfig: a3 }), !w || G || S(o2) || S(u2) || this.chat.registerPlugin({ "tim-offline-push-plugin": o2, offlinePushConfig: u2 });
  }
  onSDKReady() {
    if (this.loginStatusPromise.has("login")) {
      const e3 = this.loginStatusPromise.get("login");
      e3.resolve(e3.imResponse), this.TUIUser.getUserProfile();
    }
    this.loginStatusPromise.delete("login");
  }
  onSDKNotReady() {
    if (this.loginStatusPromise.has("login")) {
      this.loginStatusPromise.get("login").reject(new Error("sdk not ready"));
    }
    this.loginStatusPromise.delete("login"), this.resetStore();
  }
  checkCommercialAbility() {
    Object.keys(k).forEach((e3) => {
      const t2 = k[e3];
      this.chat.callExperimentalAPI("isCommercialAbilityEnabled", t2).then((t3) => {
        const { enabled: s3 = false } = t3.data;
        this.TUIStore.update(o.APP, e3, s3);
      });
    });
  }
}
class te2 {
  constructor() {
    this.defaultStore = { enabledMessageReadReceipt: false, enabledEmojiPlugin: false, enabledOnlineStatus: false, enabledCustomerServicePlugin: false, enabledTranslationPlugin: false, enabledVoiceToText: false, enableTyping: true, enableConversationDraft: true, isOfficial: false, SDKVersion: "3.0.0", tasks: { sendMessage: false, revokeMessage: false, modifyNickName: false, groupChat: false, muteGroup: false, dismissGroup: false, call: false, searchCloudMessage: false, customerService: false, translateTextMessage: false } }, this.store = { enabledEmojiPlugin: false, enabledMessageReadReceipt: false, enabledOnlineStatus: false, enabledCustomerServicePlugin: false, enabledTranslationPlugin: false, enabledVoiceToText: false, enableTyping: true, enableConversationDraft: true, isOfficial: false, SDKVersion: "3.0.0", tasks: { sendMessage: false, revokeMessage: false, modifyNickName: false, groupChat: false, muteGroup: false, dismissGroup: false, call: false, searchCloudMessage: false, customerService: false, translateTextMessage: false } };
  }
  update(e3, t2) {
    this.store[e3] = t2;
  }
  getData(e3) {
    return this.store[e3];
  }
  reset(e3 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: this.defaultStore[t2] }), {}));
  }
}
class se {
  constructor() {
    this.defaultStore = { userProfile: {}, displayOnlineStatus: false, displayMessageReadReceipt: true, userStatusList: /* @__PURE__ */ new Map(), kickedOut: "", netStateChange: "", userBlacklist: [], targetLanguage: "zh" }, this.store = { userProfile: {}, displayOnlineStatus: false, displayMessageReadReceipt: true, userStatusList: /* @__PURE__ */ new Map(), kickedOut: "", netStateChange: "", userBlacklist: [], targetLanguage: "zh" };
  }
  update(e3, t2) {
    if ("userStatusList" === e3)
      this.updateUserStatusList(t2);
    else
      this.store[e3] = t2;
  }
  getData(e3) {
    return this.store[e3];
  }
  reset(e3 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: this.defaultStore[t2] }), {}));
  }
  updateUserStatusList(e3) {
    0 !== e3.length ? e3.forEach((e4) => {
      const { userID: t2, statusType: s3 = 0, customStatus: n2 = "" } = e4;
      s3 === u.UNSUB_USER ? this.store.userStatusList.delete(t2) : this.store.userStatusList.set(t2, { statusType: s3, customStatus: n2 });
    }) : this.store.userStatusList.clear();
  }
}
class ne {
  getEngine() {
    return ee2.getInstance();
  }
}
const ie2 = function(e3) {
  if (null == e3)
    return true;
  if ("boolean" == typeof e3)
    return false;
  if ("number" == typeof e3)
    return 0 === e3;
  if ("string" == typeof e3)
    return 0 === e3.length;
  if ("function" == typeof e3)
    return 0 === e3.length;
  if (Array.isArray(e3))
    return 0 === e3.length;
  if (e3 instanceof Error)
    return "" === e3.message;
  if (function(e4) {
    if ("object" != typeof e4 || null === e4)
      return false;
    const t2 = Object.getPrototypeOf(e4);
    if (null === t2)
      return true;
    let s3 = t2;
    for (; null !== Object.getPrototypeOf(s3); )
      s3 = Object.getPrototypeOf(s3);
    return t2 === s3;
  }(e3)) {
    for (const t2 in e3)
      if (Object.prototype.hasOwnProperty.call(e3, t2))
        return false;
    return true;
  }
  return false;
}, re2 = ["[图片]", "[语音]", "[视频]", "[文件]", "[位置]", "[地理位置]", "[动画表情]", "[自定义消息]", "[群提示消息]", "[聊天记录]"];
class ae2 extends ne {
  constructor(e3) {
    super(), this.initProxy(e3), this.isMuted = this.messageRemindType === this.getEngine().TYPES.MSG_REMIND_ACPT_NOT_NOTE || this.messageRemindType === this.getEngine().TYPES.MSG_REMIND_DISCARD, this.operationType = 0, this._conversation = e3;
  }
  initProxy(e3) {
    Object.keys(e3).forEach((t2) => {
      y(t2) || (this[t2] = e3[t2]);
    });
  }
  updateProperties(e3) {
    Object.keys(e3).forEach((t2) => {
      y(t2) || (this[t2] = e3[t2]);
    });
  }
  updateOperationType(e3) {
    this.operationType = e3;
  }
  getConversation() {
    return this._conversation;
  }
  deleteConversation() {
    return this.getEngine().TUIConversation.deleteConversation(this.conversationID);
  }
  pinConversation() {
    return this.getEngine().TUIConversation.pinConversation({ conversationID: this.conversationID, isPinned: !this.isPinned });
  }
  muteConversation() {
    const e3 = this.getEngine(), t2 = { messageRemindType: true === this.isMuted ? e3.TYPES.MSG_REMIND_ACPT_AND_NOTE : e3.TYPES.MSG_REMIND_ACPT_NOT_NOTE };
    if (this.type === e3.TYPES.CONV_C2C) {
      const s3 = this.conversationID.replace(e3.TYPES.CONV_C2C, "");
      t2.userIDList = [s3];
    } else if (this.type === e3.TYPES.CONV_GROUP) {
      const s3 = this.conversationID.replace(e3.TYPES.CONV_GROUP, "");
      t2.groupID = s3;
    }
    return e3.TUIConversation.muteConversation(t2);
  }
  getAvatar() {
    var e3, t2, s3, n2, i3, r2;
    const a3 = this.getEngine();
    let o2 = "";
    switch (this.type) {
      case a3.TYPES.CONV_C2C:
        o2 = b(null === (e3 = this.userProfile) || void 0 === e3 ? void 0 : e3.avatar) ? null === (t2 = this.userProfile) || void 0 === t2 ? void 0 : t2.avatar : M;
        break;
      case a3.TYPES.CONV_GROUP:
        o2 = b(null === (s3 = this.groupProfile) || void 0 === s3 ? void 0 : s3.avatar) ? null === (n2 = this.groupProfile) || void 0 === n2 ? void 0 : n2.avatar : O;
        break;
      case a3.TYPES.CONV_SYSTEM:
        o2 = b(null === (i3 = this.groupProfile) || void 0 === i3 ? void 0 : i3.avatar) ? null === (r2 = this.groupProfile) || void 0 === r2 ? void 0 : r2.avatar : _;
    }
    return o2;
  }
  getShowName() {
    var e3, t2, s3, n2;
    const i3 = this.getEngine();
    let r2 = "";
    switch (this.type) {
      case i3.TYPES.CONV_C2C:
        r2 = this.remark || (null === (e3 = this.userProfile) || void 0 === e3 ? void 0 : e3.nick) || (null === (t2 = this.userProfile) || void 0 === t2 ? void 0 : t2.userID) || "";
        break;
      case i3.TYPES.CONV_GROUP:
        r2 = (null === (s3 = this.groupProfile) || void 0 === s3 ? void 0 : s3.name) || (null === (n2 = this.groupProfile) || void 0 === n2 ? void 0 : n2.groupID) || "";
        break;
      case i3.TYPES.CONV_SYSTEM:
        r2 = i3.TUITranslate.t("系统通知");
    }
    return r2;
  }
  getGroupAtInfo() {
    const e3 = this.getEngine(), t2 = e3.TUITranslate.t.bind(e3.TUITranslate), s3 = [`[${t2("TUIConversation.有人@我")}]`, `[${t2("TUIConversation.@所有人")}]`, `[${t2("TUIConversation.@所有人")}][${t2("TUIConversation.有人@我")}]`];
    let n2 = "";
    for (let e4 = 0; e4 < this.groupAtInfoList.length; e4++)
      this.groupAtInfoList[e4].atTypeArray[0] && this.unreadCount > 0 && (n2 = s3[this.groupAtInfoList[e4].atTypeArray[0] - 1]);
    return n2;
  }
  getLastMessage(e3) {
    return "time" === e3 ? this.getLastMessageTime() : "text" === e3 ? this.getLastMessageText() : (index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `ConversationModel.getLastMessage key:${e3} is invalid.`), null);
  }
  getLastMessageTime() {
    var e3;
    const t2 = this.getEngine();
    let s3 = "";
    return (null === (e3 = this.lastMessage) || void 0 === e3 ? void 0 : e3.lastTime) > 0 && (s3 = function(e4, t3) {
      const s4 = 6e4, n2 = 36e5, i3 = 24 * n2, r2 = 7 * i3, a3 = (/* @__PURE__ */ new Date()).getTime() - e4;
      let o2 = "";
      if (a3 < 0)
        return o2;
      const u2 = a3 / s4, c3 = a3 / n2, g2 = a3 / i3, l2 = a3 / r2;
      if (l2 >= 1 && l2 <= 4)
        o2 = ` ${parseInt(`${l2}`, 10)} ${t3("time.周")}${t3("time.前")}`;
      else if (g2 >= 1 && g2 <= 6)
        o2 = ` ${parseInt(`${g2}`, 10)} ${t3("time.天")}${t3("time.前")}`;
      else if (c3 >= 1 && c3 <= 23)
        o2 = ` ${parseInt(`${c3}`, 10)} ${t3("time.小时")}${t3("time.前")}`;
      else if (u2 >= 1 && u2 <= 59)
        o2 = ` ${parseInt(`${u2}`, 10)} ${t3("time.分钟")}${t3("time.前")}`;
      else if (a3 >= 0 && a3 <= s4)
        o2 = `${t3("time.刚刚")}`;
      else {
        const t4 = /* @__PURE__ */ new Date();
        t4.setTime(e4), o2 = `${t4.getFullYear()}-${t4.getMonth() + 1 < 10 ? `0${t4.getMonth() + 1}` : t4.getMonth() + 1}-${t4.getDate() < 10 ? `0${t4.getDate()}` : t4.getDate()}`;
      }
      return o2;
    }(1e3 * this.lastMessage.lastTime, t2.TUITranslate.t.bind(t2.TUITranslate))), s3;
  }
  getLastMessageText() {
    var e3;
    if (this.draftText) {
      return U(this.draftText).abstract;
    }
    const t2 = this.getEngine(), s3 = t2.TUITranslate.t.bind(t2.TUITranslate);
    if (4 === this.operationType)
      return s3("TUIConversation.您已被群管理员移出群聊");
    if (5 === this.operationType)
      return s3("TUIConversation.该群聊已被解散");
    if (8 === this.operationType)
      return s3("TUIConversation.您已退出该群聊");
    const n2 = this._conversation, { lastMessage: i3 } = this;
    let r2 = "", a3 = "";
    const o2 = n2.unreadCount > 0 && n2.messageRemindType === t2.TYPES.MSG_REMIND_ACPT_NOT_NOTE ? `[${n2.unreadCount > 99 ? "99+" : n2.unreadCount}${s3("TUIConversation.条")}]` : "";
    if (n2.type === t2.TYPES.CONV_GROUP)
      if (i3.fromAccount === t2.getMyUserID())
        r2 = s3("TUIConversation.我");
      else {
        const e4 = i3.fromAccount;
        r2 = t2.TUIFriend.getFriendRemark([e4])[e4] || i3.nameCard || i3.nick || e4;
      }
    if (i3.type === t2.TYPES.MSG_TEXT)
      a3 = this.decodeTextMessage(i3.payload.text);
    else if (i3.type === t2.TYPES.MSG_CUSTOM) {
      const n3 = U(null === (e3 = null == i3 ? void 0 : i3.payload) || void 0 === e3 ? void 0 : e3.data);
      if (1 === (null == n3 ? void 0 : n3.businessID))
        return a3 = t2.TUIChat.messageHandler.handleCallKitSignaling(i3), a3;
      a3 = re2.includes(i3.messageForShow) ? s3(`TUIChat.${i3.messageForShow}`) : i3.messageForShow;
    } else
      a3 = re2.includes(i3.messageForShow) ? s3(`TUIChat.${i3.messageForShow}`) : i3.messageForShow;
    return i3.isRevoked && (a3 = s3("TUIChat.撤回了一条消息")), n2.type === t2.TYPES.CONV_GROUP && i3.type === t2.TYPES.MSG_GRP_TIP ? a3 : `${o2}${r2 ? `${r2}:` : ""}${a3}`;
  }
  decodeTextMessage(e3) {
    if (ie2(e3))
      return e3;
    const t2 = /(\[.+?\])/g;
    let s3 = e3;
    if (t2.test(e3)) {
      const n2 = this.getEngine(), i3 = n2.TUITranslate.t.bind(n2.TUITranslate);
      s3 = e3.replace(t2, (e4) => {
        const t3 = i3(`Emoji.${e4}`);
        return G || !t3 || t3.startsWith("Emoji.") ? j[e4] || e4 : t3;
      });
    }
    return s3;
  }
}
class oe {
  constructor() {
    this.defaultStore = { currentConversationID: "", totalUnreadCount: 0, conversationList: [], currentConversation: null, operationTypeMap: /* @__PURE__ */ new Map() }, this.store = { currentConversationID: "", totalUnreadCount: 0, conversationList: [], currentConversation: null, operationTypeMap: /* @__PURE__ */ new Map() };
  }
  update(e3, t2) {
    switch (e3) {
      case "conversationList":
        this.updateConversationList(t2);
        break;
      case "operationTypeMap":
        this.updateOperationTypeMap(t2);
        break;
      default:
        this.store[e3] = t2;
    }
  }
  getData(e3) {
    return this.store[e3];
  }
  getModel(e3) {
    return this.store.conversationList.find((t2) => t2.conversationID === e3);
  }
  reset(e3 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: this.defaultStore[t2] }), {}));
  }
  updateConversationList(e3) {
    const t2 = [];
    e3.forEach((e4) => {
      let s3 = e4;
      e4 instanceof ae2 ? s3.updateProperties(e4) : s3 = new ae2(e4);
      const n2 = this.getOperationType(e4);
      s3.updateOperationType(n2), t2.push(s3);
    }), this.store.conversationList = t2;
  }
  updateOperationTypeMap(e3) {
    const { conversationID: t2, operationType: s3 = 0 } = e3;
    this.store.operationTypeMap.set(t2, s3);
  }
  getOperationType(e3) {
    const { conversationID: t2 } = e3;
    return this.store.operationTypeMap.get(t2) || 0;
  }
}
class ue extends ne {
  constructor(e3) {
    super(), this.messageHandlers = { [this.getEngine().TYPES.MSG_TEXT]: (e4) => this.getEngine().TUIChat.messageHandler.handleTextMessage(e4), [this.getEngine().TYPES.MSG_FACE]: (e4) => this.getEngine().TUIChat.messageHandler.handleFaceMessage(e4), [this.getEngine().TYPES.MSG_LOCATION]: (e4) => this.getEngine().TUIChat.messageHandler.handleLocationMessage(e4), [this.getEngine().TYPES.MSG_IMAGE]: (e4) => this.getEngine().TUIChat.messageHandler.handleImageMessage(e4), [this.getEngine().TYPES.MSG_AUDIO]: (e4) => this.getEngine().TUIChat.messageHandler.handleAudioMessage(e4), [this.getEngine().TYPES.MSG_VIDEO]: (e4) => this.getEngine().TUIChat.messageHandler.handleVideoMessage(e4), [this.getEngine().TYPES.MSG_FILE]: (e4) => this.getEngine().TUIChat.messageHandler.handleFileMessage(e4), [this.getEngine().TYPES.MSG_CUSTOM]: (e4) => this.getEngine().TUIChat.messageHandler.handleCustomMessage(e4), [this.getEngine().TYPES.MSG_MERGER]: (e4) => this.getEngine().TUIChat.messageHandler.handleMergeMessage(e4), [this.getEngine().TYPES.MSG_GRP_TIP]: (e4) => this.getEngine().TUIChat.messageHandler.handleGroupTipsMessage(e4) }, this._message = e3, this._signalingInfo = void 0, this.progress = 0, this.reactionList = [], this.initProperties(e3);
  }
  initProperties(e3) {
    Object.keys(e3).forEach((t2) => {
      y(t2) || (this[t2] = e3[t2]);
    });
  }
  updateProperties(e3) {
    this._message = e3, Object.keys(e3).forEach((t2) => {
      y(t2) || (this[t2] = e3[t2]);
    });
  }
  getMessage() {
    return this._message;
  }
  modifyMessage(e3) {
    return e3.type && this._message.type !== e3.type && !e3.payload ? Promise.reject({ code: h2.MISMATCH_TYPE_AND_PAYLOAD, message: d2.MISMATCH_TYPE_AND_PAYLOAD }) : (this._message.type = e3.type || this._message.type, this._message.payload = e3.payload || this._message.payload, this._message.cloudCustomData = e3.cloudCustomData || this._message.cloudCustomData, this.getEngine().TUIChat.modifyMessage(this._message));
  }
  revokeMessage() {
    return this.getEngine().TUIChat.revokeMessage(this._message);
  }
  resendMessage() {
    return this.getEngine().TUIChat.resendMessage(this._message);
  }
  deleteMessage() {
    return this.getEngine().TUIChat.deleteMessage([this._message]);
  }
  quoteMessage() {
    return this.getEngine().TUIChat.quoteMessage(this._message);
  }
  replyMessage() {
    return this.getEngine().TUIChat.replyMessage(this._message);
  }
  setMessageExtensions(e3) {
    return this.getEngine().TUIChat.setMessageExtensions(this._message, e3);
  }
  getMessageExtensions() {
    return this.getEngine().TUIChat.getMessageExtensions(this._message);
  }
  deleteMessageExtensions(e3) {
    return this.getEngine().TUIChat.deleteMessageExtensions(this._message, e3);
  }
  getSignalingInfo() {
    return this.type !== this.getEngine().TYPES.MSG_CUSTOM ? null : S(this._signalingInfo) ? (this._signalingInfo = this.getEngine().chat.getSignalingInfo(this._message), this._signalingInfo) : this._signalingInfo;
  }
  getMessageContent() {
    const e3 = this.messageHandlers[this.type];
    if (S(e3))
      return {};
    if (this.type === this.getEngine().TYPES.MSG_GRP_TIP)
      return e3(this._message);
    const t2 = this.getEngine().TUIFriend.getFriendRemark([this.from]);
    return Object.assign(Object.assign({}, e3(this._message)), { showName: t2[this.from] || this.nameCard || this.nick || this.from });
  }
  sendForwardMessage(e3) {
    return this.getEngine().TUIChat.sendForwardMessage(e3, [this._message]);
  }
}
class ce2 {
  constructor() {
    this.defaultStore = { messageList: [], isCompleted: false, nextReqMessageID: "", quoteMessage: {}, newMessageList: [], typingStatus: false, messageSource: void 0, translateTextInfo: void 0, voiceToTextInfo: void 0, userInfo: {} }, this.store = { messageList: [], isCompleted: false, nextReqMessageID: "", quoteMessage: {}, newMessageList: [], typingStatus: false, messageSource: void 0, translateTextInfo: void 0, voiceToTextInfo: void 0, userInfo: {} };
  }
  update(e3, t2) {
    switch (e3) {
      case "messageList":
        this.updateMessageList(t2);
        break;
      case "translateTextInfo":
        this.updateTranslateTextInfo(t2);
        break;
      case "voiceToTextInfo":
        this.updateVoiceToTextInfo(t2);
        break;
      default:
        this.store[e3] = t2;
    }
  }
  getData(e3) {
    return this.store[e3];
  }
  getModel(e3) {
    return this.store.messageList.find((t2) => t2.ID === e3);
  }
  reset(e3 = []) {
    const t2 = e3.filter((e4) => !x.includes(e4));
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), null == t2 ? void 0 : t2.reduce((e4, t3) => Object.assign(Object.assign({}, e4), { [t3]: this.defaultStore[t3] }), {}));
  }
  updateMessageList(e3) {
    const t2 = [];
    e3.forEach((e4) => {
      let s3 = e4;
      e4 instanceof ue || (s3 = this.getModel(e4.ID), s3 ? s3.updateProperties(e4) : s3 = new ue(e4)), t2.push(s3);
    }), this.store.messageList = t2;
  }
  updateTranslateTextInfo(e3) {
    this.updateBykey("translateTextInfo", e3);
  }
  updateVoiceToTextInfo(e3) {
    this.updateBykey("voiceToTextInfo", e3);
  }
  updateBykey(e3, t2) {
    const { conversationID: s3, messageID: n2, visible: i3 = false } = t2;
    this.store[e3] || (this.store[e3] = /* @__PURE__ */ new Map()), this.store[e3].has(s3) || this.store[e3].set(s3, []);
    const r2 = this.store[e3].get(s3) || [];
    let a3 = true;
    for (let e4 = 0; e4 < r2.length; e4++)
      if (r2[e4].messageID === n2) {
        r2[e4].visible = i3, a3 = false;
        break;
      }
    a3 && r2.push({ messageID: n2, visible: i3 }), this.store[e3].set(s3, r2);
  }
}
class ge {
  constructor(e3) {
    this.groupAttributes = {}, this.groupCounters = {}, this.initProxy(e3);
  }
  initProxy(e3) {
    Object.keys(e3).forEach((t2) => {
      y(t2) || (this[t2] = e3[t2]);
    });
  }
}
class le {
  constructor() {
    this.defaultStore = { currentGroupID: "", currentGroup: {}, currentGroupAttributes: {}, currentGroupCounters: {}, currentGroupMemberList: [], groupList: [], groupSystemNoticeList: [], isCompleted: false, offset: 0 }, this.store = { currentGroupID: "", currentGroup: void 0, currentGroupAttributes: {}, currentGroupCounters: {}, currentGroupMemberList: [], groupList: [], groupSystemNoticeList: [], isCompleted: false, offset: 0 };
  }
  update(e3, t2) {
    switch (e3) {
      case "groupList":
        this.updateGroupList(t2);
        break;
      case "currentGroup":
        this.store.currentGroup = t2 instanceof ge ? t2 : new ge(t2);
        break;
      default:
        this.store[e3] = t2;
    }
  }
  getData(e3) {
    if ("groupSystemNoticeList" === e3) {
      const e4 = [...this.store.groupSystemNoticeList];
      return this.store.groupSystemNoticeList.length = 0, e4;
    }
    return this.store[e3];
  }
  reset(e3 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: this.defaultStore[t2] }), {}));
  }
  updateGroupList(e3) {
    this.store.groupList = e3.map((e4) => e4 instanceof ge ? e4 : new ge(e4));
  }
}
class he2 {
  constructor() {
    this.store = {};
  }
  update(e3, t2) {
    this.store[e3] = t2;
  }
  getData(e3) {
    return this.store[e3];
  }
  reset(e3 = []) {
    0 === e3.length && (this.store = {}), this.store = Object.assign(Object.assign({}, this.store), e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: void 0 }), {}));
  }
}
class pe2 {
  constructor() {
    this.defaultStore = { friendList: [], friendApplicationList: [], friendApplicationUnreadCount: 0 }, this.store = { friendList: [], friendApplicationList: [], friendApplicationUnreadCount: 0 };
  }
  update(e3, t2) {
    this.store[e3] = t2;
  }
  getData(e3) {
    return this.store[e3];
  }
  reset(e3 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: this.defaultStore[t2] }), {}));
  }
}
class de {
  constructor() {
    this.defaultStore = { currentSearchInputValue: { value: "", searchType: "global" }, currentSearchMessageType: { value: { key: "", label: "", value: "" }, searchType: "global" }, currentSearchMessageTime: { value: { key: "", label: "", value: { timePosition: 0, timePeriod: 0 } }, searchType: "global" }, currentSearchingStatus: { isSearching: false, searchType: "global" }, isShowInConversationSearch: false }, this.store = { currentSearchInputValue: { value: "", searchType: "global" }, currentSearchMessageType: { value: { key: "", label: "", value: "" }, searchType: "global" }, currentSearchMessageTime: { value: { key: "", label: "", value: { timePosition: 0, timePeriod: 0 } }, searchType: "global" }, currentSearchingStatus: { isSearching: false, searchType: "global" }, isShowInConversationSearch: false };
  }
  update(e3, t2) {
    this.store[e3] = t2;
  }
  getData(e3) {
    return this.store[e3];
  }
  reset(e3 = []) {
    this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), null == e3 ? void 0 : e3.reduce((e4, t2) => Object.assign(Object.assign({}, e4), { [t2]: this.defaultStore[t2] }), {}));
  }
}
class fe {
  constructor() {
    this.storeMap = { [o.APP]: new te2(), [o.USER]: new se(), [o.CONV]: new oe(), [o.CHAT]: new ce2(), [o.GRP]: new le(), [o.FRIEND]: new pe2(), [o.SEARCH]: new de() }, this.task = {};
  }
  static getInstance() {
    return fe.instance || (fe.instance = new fe()), fe.instance;
  }
  watch(e3, t2) {
    this.task[e3] || (this.task[e3] = {});
    const s3 = this.task[e3];
    Object.keys(t2).forEach((n2) => {
      const i3 = t2[n2];
      s3[n2] || (s3[n2] = /* @__PURE__ */ new Map()), s3[n2].set(i3, 1), this.notifyOnWatch(e3, n2, i3);
    });
  }
  unwatch(e3, t2) {
    if (!this.task[e3])
      return;
    const s3 = this.task[e3];
    Object.keys(t2).forEach((e4) => {
      var n2;
      null === (n2 = s3[e4]) || void 0 === n2 || n2.delete(t2[e4]);
    });
  }
  update(e3, t2, s3) {
    var n2;
    e3 !== o.CUSTOM || this.storeMap[e3] || (this.storeMap[e3] = new he2()), null === (n2 = this.storeMap[e3]) || void 0 === n2 || n2.update(t2, s3), this.notify(e3, t2);
  }
  getData(e3, t2) {
    var s3;
    return e3 !== o.CUSTOM || this.storeMap[e3] || (this.storeMap[e3] = new he2()), null === (s3 = this.storeMap[e3]) || void 0 === s3 ? void 0 : s3.getData(t2);
  }
  getConversationModel(e3) {
    var t2;
    return null === (t2 = this.storeMap[o.CONV]) || void 0 === t2 ? void 0 : t2.getModel(e3);
  }
  getMessageModel(e3) {
    var t2;
    return null === (t2 = this.storeMap[o.CHAT]) || void 0 === t2 ? void 0 : t2.getModel(e3);
  }
  reset(e3, t2 = [], s3 = false) {
    if (e3 in this.storeMap) {
      const n2 = this.storeMap[e3];
      0 === t2.length && (t2 = Object.keys(null == n2 ? void 0 : n2.store)), n2.reset(t2), s3 && t2.forEach((t3) => {
        this.notify(e3, t3);
      });
    }
  }
  notifyOnWatch(e3, t2, s3) {
    const n2 = this.getData(e3, t2);
    N.indexOf(t2) > -1 && 0 === n2.length || s3 && s3.call(this, n2);
  }
  notify(e3, t2) {
    if (!this.task[e3])
      return;
    const s3 = this.task[e3];
    if (s3[t2]) {
      const n2 = s3[t2], i3 = this.getData(e3, t2);
      for (const [e4] of n2.entries())
        e4.call(this, i3);
    }
  }
}
function me(e3) {
  return me = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
    return typeof e4;
  } : function(e4) {
    return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
  }, me(e3);
}
function ve2(e3, t2) {
  if (!(e3 instanceof t2))
    throw new TypeError("Cannot call a class as a function");
}
function Te(e3) {
  var t2 = function(e4, t3) {
    if ("object" != me(e4) || !e4)
      return e4;
    var s3 = e4[Symbol.toPrimitive];
    if (void 0 !== s3) {
      var n2 = s3.call(e4, t3 || "default");
      if ("object" != me(n2))
        return n2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === t3 ? String : Number)(e4);
  }(e3, "string");
  return "symbol" == me(t2) ? t2 : t2 + "";
}
function Ee2(e3, t2) {
  for (var s3 = 0; s3 < t2.length; s3++) {
    var n2 = t2[s3];
    n2.enumerable = n2.enumerable || false, n2.configurable = true, "value" in n2 && (n2.writable = true), Object.defineProperty(e3, Te(n2.key), n2);
  }
}
function Ie(e3, t2, s3) {
  return t2 && Ee2(e3.prototype, t2), s3 && Ee2(e3, s3), Object.defineProperty(e3, "prototype", { writable: false }), e3;
}
function Se2(e3) {
  if (void 0 === e3)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e3;
}
function ye2(e3, t2) {
  return ye2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e4, t3) {
    return e4.__proto__ = t3, e4;
  }, ye2(e3, t2);
}
function be(e3, t2) {
  if ("function" != typeof t2 && null !== t2)
    throw new TypeError("Super expression must either be null or a function");
  e3.prototype = Object.create(t2 && t2.prototype, { constructor: { value: e3, writable: true, configurable: true } }), Object.defineProperty(e3, "prototype", { writable: false }), t2 && ye2(e3, t2);
}
function Ue(e3, t2) {
  if (t2 && ("object" == me(t2) || "function" == typeof t2))
    return t2;
  if (void 0 !== t2)
    throw new TypeError("Derived constructors may only return object or undefined");
  return Se2(e3);
}
function Ce2(e3) {
  return Ce2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e4) {
    return e4.__proto__ || Object.getPrototypeOf(e4);
  }, Ce2(e3);
}
function Me2(e3, t2, s3) {
  return (t2 = Te(t2)) in e3 ? Object.defineProperty(e3, t2, { value: s3, enumerable: true, configurable: true, writable: true }) : e3[t2] = s3, e3;
}
function Oe(e3, t2) {
  (null == t2 || t2 > e3.length) && (t2 = e3.length);
  for (var s3 = 0, n2 = Array(t2); s3 < t2; s3++)
    n2[s3] = e3[s3];
  return n2;
}
function _e2(e3) {
  return function(e4) {
    if (Array.isArray(e4))
      return e4;
  }(e3) || function(e4) {
    if ("undefined" != typeof Symbol && null != e4[Symbol.iterator] || null != e4["@@iterator"])
      return Array.from(e4);
  }(e3) || function(e4, t2) {
    if (e4) {
      if ("string" == typeof e4)
        return Oe(e4, t2);
      var s3 = {}.toString.call(e4).slice(8, -1);
      return "Object" === s3 && e4.constructor && (s3 = e4.constructor.name), "Map" === s3 || "Set" === s3 ? Array.from(e4) : "Arguments" === s3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s3) ? Oe(e4, t2) : void 0;
    }
  }(e3) || function() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }();
}
function De2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Pe(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? De2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : De2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
var Re = { type: "logger", log: function(e3) {
  this.output("log", e3);
}, warn: function(e3) {
  this.output("warn", e3);
}, error: function(e3) {
  this.output("error", e3);
}, output: function(e3, t2) {
  console && console[e3] && console[e3].apply(console, t2);
} }, Le2 = new (function() {
  function e3(t2) {
    var s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ve2(this, e3), this.init(t2, s3);
  }
  return Ie(e3, [{ key: "init", value: function(e4) {
    var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    this.prefix = t2.prefix || "i18next:", this.logger = e4 || Re, this.options = t2, this.debug = t2.debug;
  } }, { key: "setDebug", value: function(e4) {
    this.debug = e4;
  } }, { key: "log", value: function() {
    for (var e4 = arguments.length, t2 = new Array(e4), s3 = 0; s3 < e4; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "log", "", true);
  } }, { key: "warn", value: function() {
    for (var e4 = arguments.length, t2 = new Array(e4), s3 = 0; s3 < e4; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "warn", "", true);
  } }, { key: "error", value: function() {
    for (var e4 = arguments.length, t2 = new Array(e4), s3 = 0; s3 < e4; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "error", "");
  } }, { key: "deprecate", value: function() {
    for (var e4 = arguments.length, t2 = new Array(e4), s3 = 0; s3 < e4; s3++)
      t2[s3] = arguments[s3];
    return this.forward(t2, "warn", "WARNING DEPRECATED: ", true);
  } }, { key: "forward", value: function(e4, t2, s3, n2) {
    return n2 && !this.debug ? null : ("string" == typeof e4[0] && (e4[0] = "".concat(s3).concat(this.prefix, " ").concat(e4[0])), this.logger[t2](e4));
  } }, { key: "create", value: function(t2) {
    return new e3(this.logger, Pe(Pe({}, { prefix: "".concat(this.prefix, ":").concat(t2, ":") }), this.options));
  } }, { key: "clone", value: function(t2) {
    return (t2 = t2 || this.options).prefix = t2.prefix || this.prefix, new e3(this.logger, t2);
  } }]), e3;
}())(), Ae2 = function() {
  function e3() {
    ve2(this, e3), this.observers = {};
  }
  return Ie(e3, [{ key: "on", value: function(e4, t2) {
    var s3 = this;
    return e4.split(" ").forEach(function(e5) {
      s3.observers[e5] = s3.observers[e5] || [], s3.observers[e5].push(t2);
    }), this;
  } }, { key: "off", value: function(e4, t2) {
    this.observers[e4] && (t2 ? this.observers[e4] = this.observers[e4].filter(function(e5) {
      return e5 !== t2;
    }) : delete this.observers[e4]);
  } }, { key: "emit", value: function(e4) {
    for (var t2 = arguments.length, s3 = new Array(t2 > 1 ? t2 - 1 : 0), n2 = 1; n2 < t2; n2++)
      s3[n2 - 1] = arguments[n2];
    this.observers[e4] && [].concat(this.observers[e4]).forEach(function(e5) {
      e5.apply(void 0, s3);
    });
    this.observers["*"] && [].concat(this.observers["*"]).forEach(function(t3) {
      t3.apply(t3, [e4].concat(s3));
    });
  } }]), e3;
}();
function je() {
  var e3, t2, s3 = new Promise(function(s4, n2) {
    e3 = s4, t2 = n2;
  });
  return s3.resolve = e3, s3.reject = t2, s3;
}
function ke2(e3) {
  return null == e3 ? "" : "" + e3;
}
function Ne(e3, t2, s3) {
  function n2(e4) {
    return e4 && e4.indexOf("###") > -1 ? e4.replace(/###/g, ".") : e4;
  }
  function i3() {
    return !e3 || "string" == typeof e3;
  }
  for (var r2 = "string" != typeof t2 ? [].concat(t2) : t2.split("."); r2.length > 1; ) {
    if (i3())
      return {};
    var a3 = n2(r2.shift());
    !e3[a3] && s3 && (e3[a3] = new s3()), e3 = Object.prototype.hasOwnProperty.call(e3, a3) ? e3[a3] : {};
  }
  return i3() ? {} : { obj: e3, k: n2(r2.shift()) };
}
function xe(e3, t2, s3) {
  var n2 = Ne(e3, t2, Object);
  n2.obj[n2.k] = s3;
}
function Ge2(e3, t2) {
  var s3 = Ne(e3, t2), n2 = s3.obj, i3 = s3.k;
  if (n2)
    return n2[i3];
}
function we2(e3, t2, s3) {
  for (var n2 in t2)
    "__proto__" !== n2 && "constructor" !== n2 && (n2 in e3 ? "string" == typeof e3[n2] || e3[n2] instanceof String || "string" == typeof t2[n2] || t2[n2] instanceof String ? s3 && (e3[n2] = t2[n2]) : we2(e3[n2], t2[n2], s3) : e3[n2] = t2[n2]);
  return e3;
}
function Ve2(e3) {
  return e3.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
var Fe = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;", "/": "&#x2F;" };
function $e2(e3) {
  return "string" == typeof e3 ? e3.replace(/[&<>"'\/]/g, function(e4) {
    return Fe[e4];
  }) : e3;
}
var He = "undefined" != typeof window && window.navigator && void 0 === window.navigator.userAgentData && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1, Ye2 = [" ", ",", "?", "!", ";"];
function Be(e3, t2) {
  var s3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ".";
  if (e3) {
    if (e3[t2])
      return e3[t2];
    for (var n2 = t2.split(s3), i3 = e3, r2 = 0; r2 < n2.length; ++r2) {
      if (!i3)
        return;
      if ("string" == typeof i3[n2[r2]] && r2 + 1 < n2.length)
        return;
      if (void 0 === i3[n2[r2]]) {
        for (var a3 = 2, o2 = n2.slice(r2, r2 + a3).join(s3), u2 = i3[o2]; void 0 === u2 && n2.length > r2 + a3; )
          a3++, u2 = i3[o2 = n2.slice(r2, r2 + a3).join(s3)];
        if (void 0 === u2)
          return;
        if (null === u2)
          return null;
        if (t2.endsWith(o2)) {
          if ("string" == typeof u2)
            return u2;
          if (o2 && "string" == typeof u2[o2])
            return u2[o2];
        }
        var c3 = n2.slice(r2 + a3).join(s3);
        return c3 ? Be(u2, c3, s3) : void 0;
      }
      i3 = i3[n2[r2]];
    }
    return i3;
  }
}
function Ke2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function qe(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? Ke2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : Ke2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
function ze2(e3) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e4) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce2(e3);
    if (t2) {
      var i3 = Ce2(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
var Je2 = function() {
  be(t2, Ae2);
  var e3 = ze2(t2);
  function t2(s3) {
    var n2, i3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { ns: ["translation"], defaultNS: "translation" };
    return ve2(this, t2), n2 = e3.call(this), He && Ae2.call(Se2(n2)), n2.data = s3 || {}, n2.options = i3, void 0 === n2.options.keySeparator && (n2.options.keySeparator = "."), void 0 === n2.options.ignoreJSONStructure && (n2.options.ignoreJSONStructure = true), n2;
  }
  return Ie(t2, [{ key: "addNamespaces", value: function(e4) {
    this.options.ns.indexOf(e4) < 0 && this.options.ns.push(e4);
  } }, { key: "removeNamespaces", value: function(e4) {
    var t3 = this.options.ns.indexOf(e4);
    t3 > -1 && this.options.ns.splice(t3, 1);
  } }, { key: "getResource", value: function(e4, t3, s3) {
    var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, i3 = void 0 !== n2.keySeparator ? n2.keySeparator : this.options.keySeparator, r2 = void 0 !== n2.ignoreJSONStructure ? n2.ignoreJSONStructure : this.options.ignoreJSONStructure, a3 = [e4, t3];
    s3 && "string" != typeof s3 && (a3 = a3.concat(s3)), s3 && "string" == typeof s3 && (a3 = a3.concat(i3 ? s3.split(i3) : s3)), e4.indexOf(".") > -1 && (a3 = e4.split("."));
    var o2 = Ge2(this.data, a3);
    return o2 || !r2 || "string" != typeof s3 ? o2 : Be(this.data && this.data[e4] && this.data[e4][t3], s3, i3);
  } }, { key: "addResource", value: function(e4, t3, s3, n2) {
    var i3 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : { silent: false }, r2 = void 0 !== i3.keySeparator ? i3.keySeparator : this.options.keySeparator, a3 = [e4, t3];
    s3 && (a3 = a3.concat(r2 ? s3.split(r2) : s3)), e4.indexOf(".") > -1 && (n2 = t3, t3 = (a3 = e4.split("."))[1]), this.addNamespaces(t3), xe(this.data, a3, n2), i3.silent || this.emit("added", e4, t3, s3, n2);
  } }, { key: "addResources", value: function(e4, t3, s3) {
    var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { silent: false };
    for (var i3 in s3)
      "string" != typeof s3[i3] && "[object Array]" !== Object.prototype.toString.apply(s3[i3]) || this.addResource(e4, t3, i3, s3[i3], { silent: true });
    n2.silent || this.emit("added", e4, t3, s3);
  } }, { key: "addResourceBundle", value: function(e4, t3, s3, n2, i3) {
    var r2 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : { silent: false }, a3 = [e4, t3];
    e4.indexOf(".") > -1 && (n2 = s3, s3 = t3, t3 = (a3 = e4.split("."))[1]), this.addNamespaces(t3);
    var o2 = Ge2(this.data, a3) || {};
    n2 ? we2(o2, s3, i3) : o2 = qe(qe({}, o2), s3), xe(this.data, a3, o2), r2.silent || this.emit("added", e4, t3, s3);
  } }, { key: "removeResourceBundle", value: function(e4, t3) {
    this.hasResourceBundle(e4, t3) && delete this.data[e4][t3], this.removeNamespaces(t3), this.emit("removed", e4, t3);
  } }, { key: "hasResourceBundle", value: function(e4, t3) {
    return void 0 !== this.getResource(e4, t3);
  } }, { key: "getResourceBundle", value: function(e4, t3) {
    return t3 || (t3 = this.options.defaultNS), "v1" === this.options.compatibilityAPI ? qe(qe({}, {}), this.getResource(e4, t3)) : this.getResource(e4, t3);
  } }, { key: "getDataByLanguage", value: function(e4) {
    return this.data[e4];
  } }, { key: "hasLanguageSomeTranslations", value: function(e4) {
    var t3 = this.getDataByLanguage(e4);
    return !!(t3 && Object.keys(t3) || []).find(function(e5) {
      return t3[e5] && Object.keys(t3[e5]).length > 0;
    });
  } }, { key: "toJSON", value: function() {
    return this.data;
  } }]), t2;
}(), We2 = { processors: {}, addPostProcessor: function(e3) {
  this.processors[e3.name] = e3;
}, handle: function(e3, t2, s3, n2, i3) {
  var r2 = this;
  return e3.forEach(function(e4) {
    r2.processors[e4] && (t2 = r2.processors[e4].process(t2, s3, n2, i3));
  }), t2;
} };
function Xe2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Ze2(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? Xe2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : Xe2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
function Qe2(e3) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e4) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce2(e3);
    if (t2) {
      var i3 = Ce2(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
var et2 = {}, tt$1 = function() {
  be(t2, Ae2);
  var e3 = Qe2(t2);
  function t2(s3) {
    var n2, i3, r2, a3, o2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    return ve2(this, t2), n2 = e3.call(this), He && Ae2.call(Se2(n2)), i3 = ["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], r2 = s3, a3 = Se2(n2), i3.forEach(function(e4) {
      r2[e4] && (a3[e4] = r2[e4]);
    }), n2.options = o2, void 0 === n2.options.keySeparator && (n2.options.keySeparator = "."), n2.logger = Le2.create("translator"), n2;
  }
  return Ie(t2, [{ key: "changeLanguage", value: function(e4) {
    e4 && (this.language = e4);
  } }, { key: "exists", value: function(e4) {
    var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} };
    if (null == e4)
      return false;
    var s3 = this.resolve(e4, t3);
    return s3 && void 0 !== s3.res;
  } }, { key: "extractFromKey", value: function(e4, t3) {
    var s3 = void 0 !== t3.nsSeparator ? t3.nsSeparator : this.options.nsSeparator;
    void 0 === s3 && (s3 = ":");
    var n2 = void 0 !== t3.keySeparator ? t3.keySeparator : this.options.keySeparator, i3 = t3.ns || this.options.defaultNS || [], r2 = s3 && e4.indexOf(s3) > -1, a3 = !(this.options.userDefinedKeySeparator || t3.keySeparator || this.options.userDefinedNsSeparator || t3.nsSeparator || function(e5, t4, s4) {
      t4 = t4 || "", s4 = s4 || "";
      var n3 = Ye2.filter(function(e6) {
        return t4.indexOf(e6) < 0 && s4.indexOf(e6) < 0;
      });
      if (0 === n3.length)
        return true;
      var i4 = new RegExp("(".concat(n3.map(function(e6) {
        return "?" === e6 ? "\\?" : e6;
      }).join("|"), ")")), r3 = !i4.test(e5);
      if (!r3) {
        var a4 = e5.indexOf(s4);
        a4 > 0 && !i4.test(e5.substring(0, a4)) && (r3 = true);
      }
      return r3;
    }(e4, s3, n2));
    if (r2 && !a3) {
      var o2 = e4.match(this.interpolator.nestingRegexp);
      if (o2 && o2.length > 0)
        return { key: e4, namespaces: i3 };
      var u2 = e4.split(s3);
      (s3 !== n2 || s3 === n2 && this.options.ns.indexOf(u2[0]) > -1) && (i3 = u2.shift()), e4 = u2.join(n2);
    }
    return "string" == typeof i3 && (i3 = [i3]), { key: e4, namespaces: i3 };
  } }, { key: "translate", value: function(e4, s3, n2) {
    var i3 = this;
    if ("object" !== me(s3) && this.options.overloadTranslationOptionHandler && (s3 = this.options.overloadTranslationOptionHandler(arguments)), "object" === me(s3) && (s3 = Ze2({}, s3)), s3 || (s3 = {}), null == e4)
      return "";
    Array.isArray(e4) || (e4 = [String(e4)]);
    var r2 = void 0 !== s3.returnDetails ? s3.returnDetails : this.options.returnDetails, a3 = void 0 !== s3.keySeparator ? s3.keySeparator : this.options.keySeparator, o2 = this.extractFromKey(e4[e4.length - 1], s3), u2 = o2.key, c3 = o2.namespaces, g2 = c3[c3.length - 1], l2 = s3.lng || this.language, h3 = s3.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
    if (l2 && "cimode" === l2.toLowerCase()) {
      if (h3) {
        var p3 = s3.nsSeparator || this.options.nsSeparator;
        return r2 ? { res: "".concat(g2).concat(p3).concat(u2), usedKey: u2, exactUsedKey: u2, usedLng: l2, usedNS: g2 } : "".concat(g2).concat(p3).concat(u2);
      }
      return r2 ? { res: u2, usedKey: u2, exactUsedKey: u2, usedLng: l2, usedNS: g2 } : u2;
    }
    var d3 = this.resolve(e4, s3), f3 = d3 && d3.res, m3 = d3 && d3.usedKey || u2, v3 = d3 && d3.exactUsedKey || u2, T2 = Object.prototype.toString.apply(f3), E2 = void 0 !== s3.joinArrays ? s3.joinArrays : this.options.joinArrays, I2 = !this.i18nFormat || this.i18nFormat.handleAsObject;
    if (I2 && f3 && ("string" != typeof f3 && "boolean" != typeof f3 && "number" != typeof f3) && ["[object Number]", "[object Function]", "[object RegExp]"].indexOf(T2) < 0 && ("string" != typeof E2 || "[object Array]" !== T2)) {
      if (!s3.returnObjects && !this.options.returnObjects) {
        this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
        var S2 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m3, f3, Ze2(Ze2({}, s3), {}, { ns: c3 })) : "key '".concat(u2, " (").concat(this.language, ")' returned an object instead of string.");
        return r2 ? (d3.res = S2, d3) : S2;
      }
      if (a3) {
        var y2 = "[object Array]" === T2, b2 = y2 ? [] : {}, U2 = y2 ? v3 : m3;
        for (var C2 in f3)
          if (Object.prototype.hasOwnProperty.call(f3, C2)) {
            var M2 = "".concat(U2).concat(a3).concat(C2);
            b2[C2] = this.translate(M2, Ze2(Ze2({}, s3), { joinArrays: false, ns: c3 })), b2[C2] === M2 && (b2[C2] = f3[C2]);
          }
        f3 = b2;
      }
    } else if (I2 && "string" == typeof E2 && "[object Array]" === T2)
      (f3 = f3.join(E2)) && (f3 = this.extendTranslation(f3, e4, s3, n2));
    else {
      var O2 = false, _2 = false, D2 = void 0 !== s3.count && "string" != typeof s3.count, P2 = t2.hasDefaultValue(s3), R2 = D2 ? this.pluralResolver.getSuffix(l2, s3.count, s3) : "", L2 = s3["defaultValue".concat(R2)] || s3.defaultValue;
      !this.isValidLookup(f3) && P2 && (O2 = true, f3 = L2), this.isValidLookup(f3) || (_2 = true, f3 = u2);
      var A2 = (s3.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && _2 ? void 0 : f3, j2 = P2 && L2 !== f3 && this.options.updateMissing;
      if (_2 || O2 || j2) {
        if (this.logger.log(j2 ? "updateKey" : "missingKey", l2, g2, u2, j2 ? L2 : f3), a3) {
          var k2 = this.resolve(u2, Ze2(Ze2({}, s3), {}, { keySeparator: false }));
          k2 && k2.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
        }
        var N2 = [], x2 = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s3.lng || this.language);
        if ("fallback" === this.options.saveMissingTo && x2 && x2[0])
          for (var G2 = 0; G2 < x2.length; G2++)
            N2.push(x2[G2]);
        else
          "all" === this.options.saveMissingTo ? N2 = this.languageUtils.toResolveHierarchy(s3.lng || this.language) : N2.push(s3.lng || this.language);
        var w2 = function(e5, t3, n3) {
          var r3 = P2 && n3 !== f3 ? n3 : A2;
          i3.options.missingKeyHandler ? i3.options.missingKeyHandler(e5, g2, t3, r3, j2, s3) : i3.backendConnector && i3.backendConnector.saveMissing && i3.backendConnector.saveMissing(e5, g2, t3, r3, j2, s3), i3.emit("missingKey", e5, g2, t3, f3);
        };
        this.options.saveMissing && (this.options.saveMissingPlurals && D2 ? N2.forEach(function(e5) {
          i3.pluralResolver.getSuffixes(e5, s3).forEach(function(t3) {
            w2([e5], u2 + t3, s3["defaultValue".concat(t3)] || L2);
          });
        }) : w2(N2, u2, L2));
      }
      f3 = this.extendTranslation(f3, e4, s3, d3, n2), _2 && f3 === u2 && this.options.appendNamespaceToMissingKey && (f3 = "".concat(g2, ":").concat(u2)), (_2 || O2) && this.options.parseMissingKeyHandler && (f3 = "v1" !== this.options.compatibilityAPI ? this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(g2, ":").concat(u2) : u2, O2 ? f3 : void 0) : this.options.parseMissingKeyHandler(f3));
    }
    return r2 ? (d3.res = f3, d3) : f3;
  } }, { key: "extendTranslation", value: function(e4, t3, s3, n2, i3) {
    var r2 = this;
    if (this.i18nFormat && this.i18nFormat.parse)
      e4 = this.i18nFormat.parse(e4, Ze2(Ze2({}, this.options.interpolation.defaultVariables), s3), n2.usedLng, n2.usedNS, n2.usedKey, { resolved: n2 });
    else if (!s3.skipInterpolation) {
      s3.interpolation && this.interpolator.init(Ze2(Ze2({}, s3), { interpolation: Ze2(Ze2({}, this.options.interpolation), s3.interpolation) }));
      var a3, o2 = "string" == typeof e4 && (s3 && s3.interpolation && void 0 !== s3.interpolation.skipOnVariables ? s3.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
      if (o2) {
        var u2 = e4.match(this.interpolator.nestingRegexp);
        a3 = u2 && u2.length;
      }
      var c3 = s3.replace && "string" != typeof s3.replace ? s3.replace : s3;
      if (this.options.interpolation.defaultVariables && (c3 = Ze2(Ze2({}, this.options.interpolation.defaultVariables), c3)), e4 = this.interpolator.interpolate(e4, c3, s3.lng || this.language, s3), o2) {
        var g2 = e4.match(this.interpolator.nestingRegexp);
        a3 < (g2 && g2.length) && (s3.nest = false);
      }
      !s3.lng && "v1" !== this.options.compatibilityAPI && n2 && n2.res && (s3.lng = n2.usedLng), false !== s3.nest && (e4 = this.interpolator.nest(e4, function() {
        for (var e5 = arguments.length, n3 = new Array(e5), a4 = 0; a4 < e5; a4++)
          n3[a4] = arguments[a4];
        return i3 && i3[0] === n3[0] && !s3.context ? (r2.logger.warn("It seems you are nesting recursively key: ".concat(n3[0], " in key: ").concat(t3[0])), null) : r2.translate.apply(r2, n3.concat([t3]));
      }, s3)), s3.interpolation && this.interpolator.reset();
    }
    var l2 = s3.postProcess || this.options.postProcess, h3 = "string" == typeof l2 ? [l2] : l2;
    return null != e4 && h3 && h3.length && false !== s3.applyPostProcessor && (e4 = We2.handle(h3, e4, t3, this.options && this.options.postProcessPassResolved ? Ze2({ i18nResolved: n2 }, s3) : s3, this)), e4;
  } }, { key: "resolve", value: function(e4) {
    var t3, s3, n2, i3, r2, a3 = this, o2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    return "string" == typeof e4 && (e4 = [e4]), e4.forEach(function(e5) {
      if (!a3.isValidLookup(t3)) {
        var u2 = a3.extractFromKey(e5, o2), c3 = u2.key;
        s3 = c3;
        var g2 = u2.namespaces;
        a3.options.fallbackNS && (g2 = g2.concat(a3.options.fallbackNS));
        var l2 = void 0 !== o2.count && "string" != typeof o2.count, h3 = l2 && !o2.ordinal && 0 === o2.count && a3.pluralResolver.shouldUseIntlApi(), p3 = void 0 !== o2.context && ("string" == typeof o2.context || "number" == typeof o2.context) && "" !== o2.context, d3 = o2.lngs ? o2.lngs : a3.languageUtils.toResolveHierarchy(o2.lng || a3.language, o2.fallbackLng);
        g2.forEach(function(e6) {
          a3.isValidLookup(t3) || (r2 = e6, !et2["".concat(d3[0], "-").concat(e6)] && a3.utils && a3.utils.hasLoadedNamespace && !a3.utils.hasLoadedNamespace(r2) && (et2["".concat(d3[0], "-").concat(e6)] = true, a3.logger.warn('key "'.concat(s3, '" for languages "').concat(d3.join(", "), `" won't get resolved as namespace "`).concat(r2, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), d3.forEach(function(s4) {
            if (!a3.isValidLookup(t3)) {
              i3 = s4;
              var r3, u3 = [c3];
              if (a3.i18nFormat && a3.i18nFormat.addLookupKeys)
                a3.i18nFormat.addLookupKeys(u3, c3, s4, e6, o2);
              else {
                var g3;
                l2 && (g3 = a3.pluralResolver.getSuffix(s4, o2.count, o2));
                var d4 = "".concat(a3.options.pluralSeparator, "zero");
                if (l2 && (u3.push(c3 + g3), h3 && u3.push(c3 + d4)), p3) {
                  var f3 = "".concat(c3).concat(a3.options.contextSeparator).concat(o2.context);
                  u3.push(f3), l2 && (u3.push(f3 + g3), h3 && u3.push(f3 + d4));
                }
              }
              for (; r3 = u3.pop(); )
                a3.isValidLookup(t3) || (n2 = r3, t3 = a3.getResource(s4, e6, r3, o2));
            }
          }));
        });
      }
    }), { res: t3, usedKey: s3, exactUsedKey: n2, usedLng: i3, usedNS: r2 };
  } }, { key: "isValidLookup", value: function(e4) {
    return !(void 0 === e4 || !this.options.returnNull && null === e4 || !this.options.returnEmptyString && "" === e4);
  } }, { key: "getResource", value: function(e4, t3, s3) {
    var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e4, t3, s3, n2) : this.resourceStore.getResource(e4, t3, s3, n2);
  } }], [{ key: "hasDefaultValue", value: function(e4) {
    var t3 = "defaultValue";
    for (var s3 in e4)
      if (Object.prototype.hasOwnProperty.call(e4, s3) && t3 === s3.substring(0, 12) && void 0 !== e4[s3])
        return true;
    return false;
  } }]), t2;
}();
function st2(e3) {
  return e3.charAt(0).toUpperCase() + e3.slice(1);
}
var nt2 = function() {
  function e3(t2) {
    ve2(this, e3), this.options = t2, this.supportedLngs = this.options.supportedLngs || false, this.logger = Le2.create("languageUtils");
  }
  return Ie(e3, [{ key: "getScriptPartFromCode", value: function(e4) {
    if (!e4 || e4.indexOf("-") < 0)
      return null;
    var t2 = e4.split("-");
    return 2 === t2.length ? null : (t2.pop(), "x" === t2[t2.length - 1].toLowerCase() ? null : this.formatLanguageCode(t2.join("-")));
  } }, { key: "getLanguagePartFromCode", value: function(e4) {
    if (!e4 || e4.indexOf("-") < 0)
      return e4;
    var t2 = e4.split("-");
    return this.formatLanguageCode(t2[0]);
  } }, { key: "formatLanguageCode", value: function(e4) {
    if ("string" == typeof e4 && e4.indexOf("-") > -1) {
      var t2 = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"], s3 = e4.split("-");
      return this.options.lowerCaseLng ? s3 = s3.map(function(e5) {
        return e5.toLowerCase();
      }) : 2 === s3.length ? (s3[0] = s3[0].toLowerCase(), s3[1] = s3[1].toUpperCase(), t2.indexOf(s3[1].toLowerCase()) > -1 && (s3[1] = st2(s3[1].toLowerCase()))) : 3 === s3.length && (s3[0] = s3[0].toLowerCase(), 2 === s3[1].length && (s3[1] = s3[1].toUpperCase()), "sgn" !== s3[0] && 2 === s3[2].length && (s3[2] = s3[2].toUpperCase()), t2.indexOf(s3[1].toLowerCase()) > -1 && (s3[1] = st2(s3[1].toLowerCase())), t2.indexOf(s3[2].toLowerCase()) > -1 && (s3[2] = st2(s3[2].toLowerCase()))), s3.join("-");
    }
    return this.options.cleanCode || this.options.lowerCaseLng ? e4.toLowerCase() : e4;
  } }, { key: "isSupportedCode", value: function(e4) {
    return ("languageOnly" === this.options.load || this.options.nonExplicitSupportedLngs) && (e4 = this.getLanguagePartFromCode(e4)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e4) > -1;
  } }, { key: "getBestMatchFromCodes", value: function(e4) {
    var t2, s3 = this;
    return e4 ? (e4.forEach(function(e5) {
      if (!t2) {
        var n2 = s3.formatLanguageCode(e5);
        s3.options.supportedLngs && !s3.isSupportedCode(n2) || (t2 = n2);
      }
    }), !t2 && this.options.supportedLngs && e4.forEach(function(e5) {
      if (!t2) {
        var n2 = s3.getLanguagePartFromCode(e5);
        if (s3.isSupportedCode(n2))
          return t2 = n2;
        t2 = s3.options.supportedLngs.find(function(e6) {
          return e6 === n2 ? e6 : e6.indexOf("-") < 0 && n2.indexOf("-") < 0 ? void 0 : 0 === e6.indexOf(n2) ? e6 : void 0;
        });
      }
    }), t2 || (t2 = this.getFallbackCodes(this.options.fallbackLng)[0]), t2) : null;
  } }, { key: "getFallbackCodes", value: function(e4, t2) {
    if (!e4)
      return [];
    if ("function" == typeof e4 && (e4 = e4(t2)), "string" == typeof e4 && (e4 = [e4]), "[object Array]" === Object.prototype.toString.apply(e4))
      return e4;
    if (!t2)
      return e4.default || [];
    var s3 = e4[t2];
    return s3 || (s3 = e4[this.getScriptPartFromCode(t2)]), s3 || (s3 = e4[this.formatLanguageCode(t2)]), s3 || (s3 = e4[this.getLanguagePartFromCode(t2)]), s3 || (s3 = e4.default), s3 || [];
  } }, { key: "toResolveHierarchy", value: function(e4, t2) {
    var s3 = this, n2 = this.getFallbackCodes(t2 || this.options.fallbackLng || [], e4), i3 = [], r2 = function(e5) {
      e5 && (s3.isSupportedCode(e5) ? i3.push(e5) : s3.logger.warn("rejecting language code not found in supportedLngs: ".concat(e5)));
    };
    return "string" == typeof e4 && e4.indexOf("-") > -1 ? ("languageOnly" !== this.options.load && r2(this.formatLanguageCode(e4)), "languageOnly" !== this.options.load && "currentOnly" !== this.options.load && r2(this.getScriptPartFromCode(e4)), "currentOnly" !== this.options.load && r2(this.getLanguagePartFromCode(e4))) : "string" == typeof e4 && r2(this.formatLanguageCode(e4)), n2.forEach(function(e5) {
      i3.indexOf(e5) < 0 && r2(s3.formatLanguageCode(e5));
    }), i3;
  } }]), e3;
}(), it2 = [{ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], nr: [1, 2], fc: 1 }, { lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"], nr: [1, 2], fc: 2 }, { lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], nr: [1], fc: 3 }, { lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], nr: [1, 2, 5], fc: 4 }, { lngs: ["ar"], nr: [0, 1, 2, 3, 11, 100], fc: 5 }, { lngs: ["cs", "sk"], nr: [1, 2, 5], fc: 6 }, { lngs: ["csb", "pl"], nr: [1, 2, 5], fc: 7 }, { lngs: ["cy"], nr: [1, 2, 3, 8], fc: 8 }, { lngs: ["fr"], nr: [1, 2], fc: 9 }, { lngs: ["ga"], nr: [1, 2, 3, 7, 11], fc: 10 }, { lngs: ["gd"], nr: [1, 2, 3, 20], fc: 11 }, { lngs: ["is"], nr: [1, 2], fc: 12 }, { lngs: ["jv"], nr: [0, 1], fc: 13 }, { lngs: ["kw"], nr: [1, 2, 3, 4], fc: 14 }, { lngs: ["lt"], nr: [1, 2, 10], fc: 15 }, { lngs: ["lv"], nr: [1, 2, 0], fc: 16 }, { lngs: ["mk"], nr: [1, 2], fc: 17 }, { lngs: ["mnk"], nr: [0, 1, 2], fc: 18 }, { lngs: ["mt"], nr: [1, 2, 11, 20], fc: 19 }, { lngs: ["or"], nr: [2, 1], fc: 2 }, { lngs: ["ro"], nr: [1, 2, 20], fc: 20 }, { lngs: ["sl"], nr: [5, 1, 2, 3], fc: 21 }, { lngs: ["he", "iw"], nr: [1, 2, 20, 21], fc: 22 }], rt2 = { 1: function(e3) {
  return Number(e3 > 1);
}, 2: function(e3) {
  return Number(1 != e3);
}, 3: function(e3) {
  return 0;
}, 4: function(e3) {
  return Number(e3 % 10 == 1 && e3 % 100 != 11 ? 0 : e3 % 10 >= 2 && e3 % 10 <= 4 && (e3 % 100 < 10 || e3 % 100 >= 20) ? 1 : 2);
}, 5: function(e3) {
  return Number(0 == e3 ? 0 : 1 == e3 ? 1 : 2 == e3 ? 2 : e3 % 100 >= 3 && e3 % 100 <= 10 ? 3 : e3 % 100 >= 11 ? 4 : 5);
}, 6: function(e3) {
  return Number(1 == e3 ? 0 : e3 >= 2 && e3 <= 4 ? 1 : 2);
}, 7: function(e3) {
  return Number(1 == e3 ? 0 : e3 % 10 >= 2 && e3 % 10 <= 4 && (e3 % 100 < 10 || e3 % 100 >= 20) ? 1 : 2);
}, 8: function(e3) {
  return Number(1 == e3 ? 0 : 2 == e3 ? 1 : 8 != e3 && 11 != e3 ? 2 : 3);
}, 9: function(e3) {
  return Number(e3 >= 2);
}, 10: function(e3) {
  return Number(1 == e3 ? 0 : 2 == e3 ? 1 : e3 < 7 ? 2 : e3 < 11 ? 3 : 4);
}, 11: function(e3) {
  return Number(1 == e3 || 11 == e3 ? 0 : 2 == e3 || 12 == e3 ? 1 : e3 > 2 && e3 < 20 ? 2 : 3);
}, 12: function(e3) {
  return Number(e3 % 10 != 1 || e3 % 100 == 11);
}, 13: function(e3) {
  return Number(0 !== e3);
}, 14: function(e3) {
  return Number(1 == e3 ? 0 : 2 == e3 ? 1 : 3 == e3 ? 2 : 3);
}, 15: function(e3) {
  return Number(e3 % 10 == 1 && e3 % 100 != 11 ? 0 : e3 % 10 >= 2 && (e3 % 100 < 10 || e3 % 100 >= 20) ? 1 : 2);
}, 16: function(e3) {
  return Number(e3 % 10 == 1 && e3 % 100 != 11 ? 0 : 0 !== e3 ? 1 : 2);
}, 17: function(e3) {
  return Number(1 == e3 || e3 % 10 == 1 && e3 % 100 != 11 ? 0 : 1);
}, 18: function(e3) {
  return Number(0 == e3 ? 0 : 1 == e3 ? 1 : 2);
}, 19: function(e3) {
  return Number(1 == e3 ? 0 : 0 == e3 || e3 % 100 > 1 && e3 % 100 < 11 ? 1 : e3 % 100 > 10 && e3 % 100 < 20 ? 2 : 3);
}, 20: function(e3) {
  return Number(1 == e3 ? 0 : 0 == e3 || e3 % 100 > 0 && e3 % 100 < 20 ? 1 : 2);
}, 21: function(e3) {
  return Number(e3 % 100 == 1 ? 1 : e3 % 100 == 2 ? 2 : e3 % 100 == 3 || e3 % 100 == 4 ? 3 : 0);
}, 22: function(e3) {
  return Number(1 == e3 ? 0 : 2 == e3 ? 1 : (e3 < 0 || e3 > 10) && e3 % 10 == 0 ? 2 : 3);
} }, at2 = ["v1", "v2", "v3"], ot2 = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
var ut2 = function() {
  function e3(t2) {
    var s3, n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    ve2(this, e3), this.languageUtils = t2, this.options = n2, this.logger = Le2.create("pluralResolver"), this.options.compatibilityJSON && "v4" !== this.options.compatibilityJSON || "undefined" != typeof Intl && Intl.PluralRules || (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = (s3 = {}, it2.forEach(function(e4) {
      e4.lngs.forEach(function(t3) {
        s3[t3] = { numbers: e4.nr, plurals: rt2[e4.fc] };
      });
    }), s3);
  }
  return Ie(e3, [{ key: "addRule", value: function(e4, t2) {
    this.rules[e4] = t2;
  } }, { key: "getRule", value: function(e4) {
    var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    if (this.shouldUseIntlApi())
      try {
        return new Intl.PluralRules(e4, { type: t2.ordinal ? "ordinal" : "cardinal" });
      } catch (e5) {
        return;
      }
    return this.rules[e4] || this.rules[this.languageUtils.getLanguagePartFromCode(e4)];
  } }, { key: "needsPlural", value: function(e4) {
    var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, s3 = this.getRule(e4, t2);
    return this.shouldUseIntlApi() ? s3 && s3.resolvedOptions().pluralCategories.length > 1 : s3 && s3.numbers.length > 1;
  } }, { key: "getPluralFormsOfKey", value: function(e4, t2) {
    var s3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    return this.getSuffixes(e4, s3).map(function(e5) {
      return "".concat(t2).concat(e5);
    });
  } }, { key: "getSuffixes", value: function(e4) {
    var t2 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n2 = this.getRule(e4, s3);
    return n2 ? this.shouldUseIntlApi() ? n2.resolvedOptions().pluralCategories.sort(function(e5, t3) {
      return ot2[e5] - ot2[t3];
    }).map(function(e5) {
      return "".concat(t2.options.prepend).concat(e5);
    }) : n2.numbers.map(function(n3) {
      return t2.getSuffix(e4, n3, s3);
    }) : [];
  } }, { key: "getSuffix", value: function(e4, t2) {
    var s3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n2 = this.getRule(e4, s3);
    return n2 ? this.shouldUseIntlApi() ? "".concat(this.options.prepend).concat(n2.select(t2)) : this.getSuffixRetroCompatible(n2, t2) : (this.logger.warn("no plural rule found for: ".concat(e4)), "");
  } }, { key: "getSuffixRetroCompatible", value: function(e4, t2) {
    var s3 = this, n2 = e4.noAbs ? e4.plurals(t2) : e4.plurals(Math.abs(t2)), i3 = e4.numbers[n2];
    this.options.simplifyPluralSuffix && 2 === e4.numbers.length && 1 === e4.numbers[0] && (2 === i3 ? i3 = "plural" : 1 === i3 && (i3 = ""));
    var r2 = function() {
      return s3.options.prepend && i3.toString() ? s3.options.prepend + i3.toString() : i3.toString();
    };
    return "v1" === this.options.compatibilityJSON ? 1 === i3 ? "" : "number" == typeof i3 ? "_plural_".concat(i3.toString()) : r2() : "v2" === this.options.compatibilityJSON || this.options.simplifyPluralSuffix && 2 === e4.numbers.length && 1 === e4.numbers[0] ? r2() : this.options.prepend && n2.toString() ? this.options.prepend + n2.toString() : n2.toString();
  } }, { key: "shouldUseIntlApi", value: function() {
    return !at2.includes(this.options.compatibilityJSON);
  } }]), e3;
}();
function ct2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function gt2(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? ct2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : ct2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
function lt2(e3, t2, s3) {
  var n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ".", i3 = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], r2 = function(e4, t3, s4) {
    var n3 = Ge2(e4, s4);
    return void 0 !== n3 ? n3 : Ge2(t3, s4);
  }(e3, t2, s3);
  return !r2 && i3 && "string" == typeof s3 && void 0 === (r2 = Be(e3, s3, n2)) && (r2 = Be(t2, s3, n2)), r2;
}
var ht2 = function() {
  function e3() {
    var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    ve2(this, e3), this.logger = Le2.create("interpolator"), this.options = t2, this.format = t2.interpolation && t2.interpolation.format || function(e4) {
      return e4;
    }, this.init(t2);
  }
  return Ie(e3, [{ key: "init", value: function() {
    var e4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    e4.interpolation || (e4.interpolation = { escapeValue: true });
    var t2 = e4.interpolation;
    this.escape = void 0 !== t2.escape ? t2.escape : $e2, this.escapeValue = void 0 === t2.escapeValue || t2.escapeValue, this.useRawValueToEscape = void 0 !== t2.useRawValueToEscape && t2.useRawValueToEscape, this.prefix = t2.prefix ? Ve2(t2.prefix) : t2.prefixEscaped || "{{", this.suffix = t2.suffix ? Ve2(t2.suffix) : t2.suffixEscaped || "}}", this.formatSeparator = t2.formatSeparator ? t2.formatSeparator : t2.formatSeparator || ",", this.unescapePrefix = t2.unescapeSuffix ? "" : t2.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t2.unescapeSuffix || "", this.nestingPrefix = t2.nestingPrefix ? Ve2(t2.nestingPrefix) : t2.nestingPrefixEscaped || Ve2("$t("), this.nestingSuffix = t2.nestingSuffix ? Ve2(t2.nestingSuffix) : t2.nestingSuffixEscaped || Ve2(")"), this.nestingOptionsSeparator = t2.nestingOptionsSeparator ? t2.nestingOptionsSeparator : t2.nestingOptionsSeparator || ",", this.maxReplaces = t2.maxReplaces ? t2.maxReplaces : 1e3, this.alwaysFormat = void 0 !== t2.alwaysFormat && t2.alwaysFormat, this.resetRegExp();
  } }, { key: "reset", value: function() {
    this.options && this.init(this.options);
  } }, { key: "resetRegExp", value: function() {
    var e4 = "".concat(this.prefix, "(.+?)").concat(this.suffix);
    this.regexp = new RegExp(e4, "g");
    var t2 = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
    this.regexpUnescape = new RegExp(t2, "g");
    var s3 = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
    this.nestingRegexp = new RegExp(s3, "g");
  } }, { key: "interpolate", value: function(e4, t2, s3, n2) {
    var i3, r2, a3, o2 = this, u2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
    function c3(e5) {
      return e5.replace(/\$/g, "$$$$");
    }
    var g2 = function(e5) {
      if (e5.indexOf(o2.formatSeparator) < 0) {
        var i4 = lt2(t2, u2, e5, o2.options.keySeparator, o2.options.ignoreJSONStructure);
        return o2.alwaysFormat ? o2.format(i4, void 0, s3, gt2(gt2(gt2({}, n2), t2), {}, { interpolationkey: e5 })) : i4;
      }
      var r3 = e5.split(o2.formatSeparator), a4 = r3.shift().trim(), c4 = r3.join(o2.formatSeparator).trim();
      return o2.format(lt2(t2, u2, a4, o2.options.keySeparator, o2.options.ignoreJSONStructure), c4, s3, gt2(gt2(gt2({}, n2), t2), {}, { interpolationkey: a4 }));
    };
    this.resetRegExp();
    var l2 = n2 && n2.missingInterpolationHandler || this.options.missingInterpolationHandler, h3 = n2 && n2.interpolation && void 0 !== n2.interpolation.skipOnVariables ? n2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
    return [{ regex: this.regexpUnescape, safeValue: function(e5) {
      return c3(e5);
    } }, { regex: this.regexp, safeValue: function(e5) {
      return o2.escapeValue ? c3(o2.escape(e5)) : c3(e5);
    } }].forEach(function(t3) {
      for (a3 = 0; i3 = t3.regex.exec(e4); ) {
        var s4 = i3[1].trim();
        if (void 0 === (r2 = g2(s4)))
          if ("function" == typeof l2) {
            var u3 = l2(e4, i3, n2);
            r2 = "string" == typeof u3 ? u3 : "";
          } else if (n2 && Object.prototype.hasOwnProperty.call(n2, s4))
            r2 = "";
          else {
            if (h3) {
              r2 = i3[0];
              continue;
            }
            o2.logger.warn("missed to pass in variable ".concat(s4, " for interpolating ").concat(e4)), r2 = "";
          }
        else
          "string" == typeof r2 || o2.useRawValueToEscape || (r2 = ke2(r2));
        var c4 = t3.safeValue(r2);
        if (e4 = e4.replace(i3[0], c4), h3 ? (t3.regex.lastIndex += r2.length, t3.regex.lastIndex -= i3[0].length) : t3.regex.lastIndex = 0, ++a3 >= o2.maxReplaces)
          break;
      }
    }), e4;
  } }, { key: "nest", value: function(e4, t2) {
    var s3, n2, i3, r2 = this, a3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
    function o2(e5, t3) {
      var s4 = this.nestingOptionsSeparator;
      if (e5.indexOf(s4) < 0)
        return e5;
      var n3 = e5.split(new RegExp("".concat(s4, "[ ]*{"))), r3 = "{".concat(n3[1]);
      e5 = n3[0];
      var a4 = (r3 = this.interpolate(r3, i3)).match(/'/g), o3 = r3.match(/"/g);
      (a4 && a4.length % 2 == 0 && !o3 || o3.length % 2 != 0) && (r3 = r3.replace(/'/g, '"'));
      try {
        i3 = JSON.parse(r3), t3 && (i3 = gt2(gt2({}, t3), i3));
      } catch (t4) {
        return this.logger.warn("failed parsing options string in nesting for key ".concat(e5), t4), "".concat(e5).concat(s4).concat(r3);
      }
      return delete i3.defaultValue, e5;
    }
    for (; s3 = this.nestingRegexp.exec(e4); ) {
      var u2 = [];
      (i3 = (i3 = gt2({}, a3)).replace && "string" != typeof i3.replace ? i3.replace : i3).applyPostProcessor = false, delete i3.defaultValue;
      var c3 = false;
      if (-1 !== s3[0].indexOf(this.formatSeparator) && !/{.*}/.test(s3[1])) {
        var g2 = s3[1].split(this.formatSeparator).map(function(e5) {
          return e5.trim();
        });
        s3[1] = g2.shift(), u2 = g2, c3 = true;
      }
      if ((n2 = t2(o2.call(this, s3[1].trim(), i3), i3)) && s3[0] === e4 && "string" != typeof n2)
        return n2;
      "string" != typeof n2 && (n2 = ke2(n2)), n2 || (this.logger.warn("missed to resolve ".concat(s3[1], " for nesting ").concat(e4)), n2 = ""), c3 && (n2 = u2.reduce(function(e5, t3) {
        return r2.format(e5, t3, a3.lng, gt2(gt2({}, a3), {}, { interpolationkey: s3[1].trim() }));
      }, n2.trim())), e4 = e4.replace(s3[0], n2), this.regexp.lastIndex = 0;
    }
    return e4;
  } }]), e3;
}();
function pt2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function dt2(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? pt2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : pt2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
function ft2(e3) {
  var t2 = {};
  return function(s3, n2, i3) {
    var r2 = n2 + JSON.stringify(i3), a3 = t2[r2];
    return a3 || (a3 = e3(n2, i3), t2[r2] = a3), a3(s3);
  };
}
var mt2 = function() {
  function e3() {
    var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
    ve2(this, e3), this.logger = Le2.create("formatter"), this.options = t2, this.formats = { number: ft2(function(e4, t3) {
      var s3 = new Intl.NumberFormat(e4, dt2({}, t3));
      return function(e5) {
        return s3.format(e5);
      };
    }), currency: ft2(function(e4, t3) {
      var s3 = new Intl.NumberFormat(e4, dt2(dt2({}, t3), {}, { style: "currency" }));
      return function(e5) {
        return s3.format(e5);
      };
    }), datetime: ft2(function(e4, t3) {
      var s3 = new Intl.DateTimeFormat(e4, dt2({}, t3));
      return function(e5) {
        return s3.format(e5);
      };
    }), relativetime: ft2(function(e4, t3) {
      var s3 = new Intl.RelativeTimeFormat(e4, dt2({}, t3));
      return function(e5) {
        return s3.format(e5, t3.range || "day");
      };
    }), list: ft2(function(e4, t3) {
      var s3 = new Intl.ListFormat(e4, dt2({}, t3));
      return function(e5) {
        return s3.format(e5);
      };
    }) }, this.init(t2);
  }
  return Ie(e3, [{ key: "init", value: function(e4) {
    var t2 = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { interpolation: {} }).interpolation;
    this.formatSeparator = t2.formatSeparator ? t2.formatSeparator : t2.formatSeparator || ",";
  } }, { key: "add", value: function(e4, t2) {
    this.formats[e4.toLowerCase().trim()] = t2;
  } }, { key: "addCached", value: function(e4, t2) {
    this.formats[e4.toLowerCase().trim()] = ft2(t2);
  } }, { key: "format", value: function(e4, t2, s3) {
    var n2 = this, i3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return t2.split(this.formatSeparator).reduce(function(e5, t3) {
      var r2 = function(e6) {
        var t4 = e6.toLowerCase().trim(), s4 = {};
        if (e6.indexOf("(") > -1) {
          var n3 = e6.split("(");
          t4 = n3[0].toLowerCase().trim();
          var i4 = n3[1].substring(0, n3[1].length - 1);
          "currency" === t4 && i4.indexOf(":") < 0 ? s4.currency || (s4.currency = i4.trim()) : "relativetime" === t4 && i4.indexOf(":") < 0 ? s4.range || (s4.range = i4.trim()) : i4.split(";").forEach(function(e7) {
            if (e7) {
              var t5 = _e2(e7.split(":")), n4 = t5[0], i5 = t5.slice(1).join(":").trim().replace(/^'+|'+$/g, "");
              s4[n4.trim()] || (s4[n4.trim()] = i5), "false" === i5 && (s4[n4.trim()] = false), "true" === i5 && (s4[n4.trim()] = true), isNaN(i5) || (s4[n4.trim()] = parseInt(i5, 10));
            }
          });
        }
        return { formatName: t4, formatOptions: s4 };
      }(t3), a3 = r2.formatName, o2 = r2.formatOptions;
      if (n2.formats[a3]) {
        var u2 = e5;
        try {
          var c3 = i3 && i3.formatParams && i3.formatParams[i3.interpolationkey] || {}, g2 = c3.locale || c3.lng || i3.locale || i3.lng || s3;
          u2 = n2.formats[a3](e5, g2, dt2(dt2(dt2({}, o2), i3), c3));
        } catch (e6) {
          n2.logger.warn(e6);
        }
        return u2;
      }
      return n2.logger.warn("there was no format function for ".concat(a3)), e5;
    }, e4);
  } }]), e3;
}();
function vt2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Tt(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? vt2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : vt2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
function Et2(e3) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e4) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce2(e3);
    if (t2) {
      var i3 = Ce2(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
var It = function() {
  be(t2, Ae2);
  var e3 = Et2(t2);
  function t2(s3, n2, i3) {
    var r2, a3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return ve2(this, t2), r2 = e3.call(this), He && Ae2.call(Se2(r2)), r2.backend = s3, r2.store = n2, r2.services = i3, r2.languageUtils = i3.languageUtils, r2.options = a3, r2.logger = Le2.create("backendConnector"), r2.waitingReads = [], r2.maxParallelReads = a3.maxParallelReads || 10, r2.readingCalls = 0, r2.maxRetries = a3.maxRetries >= 0 ? a3.maxRetries : 5, r2.retryTimeout = a3.retryTimeout >= 1 ? a3.retryTimeout : 350, r2.state = {}, r2.queue = [], r2.backend && r2.backend.init && r2.backend.init(i3, a3.backend, a3), r2;
  }
  return Ie(t2, [{ key: "queueLoad", value: function(e4, t3, s3, n2) {
    var i3 = this, r2 = {}, a3 = {}, o2 = {}, u2 = {};
    return e4.forEach(function(e5) {
      var n3 = true;
      t3.forEach(function(t4) {
        var o3 = "".concat(e5, "|").concat(t4);
        !s3.reload && i3.store.hasResourceBundle(e5, t4) ? i3.state[o3] = 2 : i3.state[o3] < 0 || (1 === i3.state[o3] ? void 0 === a3[o3] && (a3[o3] = true) : (i3.state[o3] = 1, n3 = false, void 0 === a3[o3] && (a3[o3] = true), void 0 === r2[o3] && (r2[o3] = true), void 0 === u2[t4] && (u2[t4] = true)));
      }), n3 || (o2[e5] = true);
    }), (Object.keys(r2).length || Object.keys(a3).length) && this.queue.push({ pending: a3, pendingCount: Object.keys(a3).length, loaded: {}, errors: [], callback: n2 }), { toLoad: Object.keys(r2), pending: Object.keys(a3), toLoadLanguages: Object.keys(o2), toLoadNamespaces: Object.keys(u2) };
  } }, { key: "loaded", value: function(e4, t3, s3) {
    var n2 = e4.split("|"), i3 = n2[0], r2 = n2[1];
    t3 && this.emit("failedLoading", i3, r2, t3), s3 && this.store.addResourceBundle(i3, r2, s3), this.state[e4] = t3 ? -1 : 2;
    var a3 = {};
    this.queue.forEach(function(s4) {
      var n3, o2, c3, g2, l2;
      n3 = s4.loaded, o2 = r2, c3 = Ne(n3, [i3], Object), g2 = c3.obj, l2 = c3.k, g2[l2] = g2[l2] || [], g2[l2].push(o2), function(e5, t4) {
        void 0 !== e5.pending[t4] && (delete e5.pending[t4], e5.pendingCount--);
      }(s4, e4), t3 && s4.errors.push(t3), 0 !== s4.pendingCount || s4.done || (Object.keys(s4.loaded).forEach(function(e5) {
        a3[e5] || (a3[e5] = {});
        var t4 = s4.loaded[e5];
        t4.length && t4.forEach(function(t5) {
          void 0 === a3[e5][t5] && (a3[e5][t5] = true);
        });
      }), s4.done = true, s4.errors.length ? s4.callback(s4.errors) : s4.callback());
    }), this.emit("loaded", a3), this.queue = this.queue.filter(function(e5) {
      return !e5.done;
    });
  } }, { key: "read", value: function(e4, t3, s3) {
    var n2 = this, i3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, r2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.retryTimeout, a3 = arguments.length > 5 ? arguments[5] : void 0;
    if (!e4.length)
      return a3(null, {});
    if (this.readingCalls >= this.maxParallelReads)
      this.waitingReads.push({ lng: e4, ns: t3, fcName: s3, tried: i3, wait: r2, callback: a3 });
    else {
      this.readingCalls++;
      var o2 = function(o3, u3) {
        if (n2.readingCalls--, n2.waitingReads.length > 0) {
          var c4 = n2.waitingReads.shift();
          n2.read(c4.lng, c4.ns, c4.fcName, c4.tried, c4.wait, c4.callback);
        }
        o3 && u3 && i3 < n2.maxRetries ? setTimeout(function() {
          n2.read.call(n2, e4, t3, s3, i3 + 1, 2 * r2, a3);
        }, r2) : a3(o3, u3);
      }, u2 = this.backend[s3].bind(this.backend);
      if (2 !== u2.length)
        return u2(e4, t3, o2);
      try {
        var c3 = u2(e4, t3);
        c3 && "function" == typeof c3.then ? c3.then(function(e5) {
          return o2(null, e5);
        }).catch(o2) : o2(null, c3);
      } catch (e5) {
        o2(e5);
      }
    }
  } }, { key: "prepareLoading", value: function(e4, t3) {
    var s3 = this, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i3 = arguments.length > 3 ? arguments[3] : void 0;
    if (!this.backend)
      return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i3 && i3();
    "string" == typeof e4 && (e4 = this.languageUtils.toResolveHierarchy(e4)), "string" == typeof t3 && (t3 = [t3]);
    var r2 = this.queueLoad(e4, t3, n2, i3);
    if (!r2.toLoad.length)
      return r2.pending.length || i3(), null;
    r2.toLoad.forEach(function(e5) {
      s3.loadOne(e5);
    });
  } }, { key: "load", value: function(e4, t3, s3) {
    this.prepareLoading(e4, t3, {}, s3);
  } }, { key: "reload", value: function(e4, t3, s3) {
    this.prepareLoading(e4, t3, { reload: true }, s3);
  } }, { key: "loadOne", value: function(e4) {
    var t3 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", n2 = e4.split("|"), i3 = n2[0], r2 = n2[1];
    this.read(i3, r2, "read", void 0, void 0, function(n3, a3) {
      n3 && t3.logger.warn("".concat(s3, "loading namespace ").concat(r2, " for language ").concat(i3, " failed"), n3), !n3 && a3 && t3.logger.log("".concat(s3, "loaded namespace ").concat(r2, " for language ").concat(i3), a3), t3.loaded(e4, n3, a3);
    });
  } }, { key: "saveMissing", value: function(e4, t3, s3, n2, i3) {
    var r2 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : {}, a3 = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : function() {
    };
    if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t3))
      this.logger.warn('did not save key "'.concat(s3, '" as the namespace "').concat(t3, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
    else if (null != s3 && "" !== s3) {
      if (this.backend && this.backend.create) {
        var o2 = Tt(Tt({}, r2), {}, { isUpdate: i3 }), u2 = this.backend.create.bind(this.backend);
        if (u2.length < 6)
          try {
            var c3;
            (c3 = 5 === u2.length ? u2(e4, t3, s3, n2, o2) : u2(e4, t3, s3, n2)) && "function" == typeof c3.then ? c3.then(function(e5) {
              return a3(null, e5);
            }).catch(a3) : a3(null, c3);
          } catch (e5) {
            a3(e5);
          }
        else
          u2(e4, t3, s3, n2, a3, o2);
      }
      e4 && e4[0] && this.store.addResource(e4[0], t3, s3, n2);
    }
  } }]), t2;
}();
function St2() {
  return { debug: false, initImmediate: true, ns: ["translation"], defaultNS: ["translation"], fallbackLng: ["dev"], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: "all", preload: false, simplifyPluralSuffix: true, keySeparator: ".", nsSeparator: ":", pluralSeparator: "_", contextSeparator: "_", partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: "fallback", saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: true, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: function(e3) {
    var t2 = {};
    if ("object" === me(e3[1]) && (t2 = e3[1]), "string" == typeof e3[1] && (t2.defaultValue = e3[1]), "string" == typeof e3[2] && (t2.tDescription = e3[2]), "object" === me(e3[2]) || "object" === me(e3[3])) {
      var s3 = e3[3] || e3[2];
      Object.keys(s3).forEach(function(e4) {
        t2[e4] = s3[e4];
      });
    }
    return t2;
  }, interpolation: { escapeValue: true, format: function(e3, t2, s3, n2) {
    return e3;
  }, prefix: "{{", suffix: "}}", formatSeparator: ",", unescapePrefix: "-", nestingPrefix: "$t(", nestingSuffix: ")", nestingOptionsSeparator: ",", maxReplaces: 1e3, skipOnVariables: true } };
}
function yt2(e3) {
  return "string" == typeof e3.ns && (e3.ns = [e3.ns]), "string" == typeof e3.fallbackLng && (e3.fallbackLng = [e3.fallbackLng]), "string" == typeof e3.fallbackNS && (e3.fallbackNS = [e3.fallbackNS]), e3.supportedLngs && e3.supportedLngs.indexOf("cimode") < 0 && (e3.supportedLngs = e3.supportedLngs.concat(["cimode"])), e3;
}
function bt2(e3, t2) {
  var s3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var n2 = Object.getOwnPropertySymbols(e3);
    t2 && (n2 = n2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
    })), s3.push.apply(s3, n2);
  }
  return s3;
}
function Ut(e3) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var s3 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? bt2(Object(s3), true).forEach(function(t3) {
      Me2(e3, t3, s3[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(s3)) : bt2(Object(s3)).forEach(function(t3) {
      Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(s3, t3));
    });
  }
  return e3;
}
function Ct2(e3) {
  var t2 = function() {
    if ("undefined" == typeof Reflect || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if ("function" == typeof Proxy)
      return true;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), true;
    } catch (e4) {
      return false;
    }
  }();
  return function() {
    var s3, n2 = Ce2(e3);
    if (t2) {
      var i3 = Ce2(this).constructor;
      s3 = Reflect.construct(n2, arguments, i3);
    } else
      s3 = n2.apply(this, arguments);
    return Ue(this, s3);
  };
}
function Mt() {
}
var Ot = function() {
  be(t2, Ae2);
  var e3 = Ct2(t2);
  function t2() {
    var s3, n2, i3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r2 = arguments.length > 1 ? arguments[1] : void 0;
    if (ve2(this, t2), s3 = e3.call(this), He && Ae2.call(Se2(s3)), s3.options = yt2(i3), s3.services = {}, s3.logger = Le2, s3.modules = { external: [] }, n2 = Se2(s3), Object.getOwnPropertyNames(Object.getPrototypeOf(n2)).forEach(function(e4) {
      "function" == typeof n2[e4] && (n2[e4] = n2[e4].bind(n2));
    }), r2 && !s3.isInitialized && !i3.isClone) {
      if (!s3.options.initImmediate)
        return s3.init(i3, r2), Ue(s3, Se2(s3));
      setTimeout(function() {
        s3.init(i3, r2);
      }, 0);
    }
    return s3;
  }
  return Ie(t2, [{ key: "init", value: function() {
    var e4 = this, t3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, s3 = arguments.length > 1 ? arguments[1] : void 0;
    "function" == typeof t3 && (s3 = t3, t3 = {}), !t3.defaultNS && false !== t3.defaultNS && t3.ns && ("string" == typeof t3.ns ? t3.defaultNS = t3.ns : t3.ns.indexOf("translation") < 0 && (t3.defaultNS = t3.ns[0]));
    var n2 = St2();
    function i3(e5) {
      return e5 ? "function" == typeof e5 ? new e5() : e5 : null;
    }
    if (this.options = Ut(Ut(Ut({}, n2), this.options), yt2(t3)), "v1" !== this.options.compatibilityAPI && (this.options.interpolation = Ut(Ut({}, n2.interpolation), this.options.interpolation)), void 0 !== t3.keySeparator && (this.options.userDefinedKeySeparator = t3.keySeparator), void 0 !== t3.nsSeparator && (this.options.userDefinedNsSeparator = t3.nsSeparator), !this.options.isClone) {
      var r2;
      this.modules.logger ? Le2.init(i3(this.modules.logger), this.options) : Le2.init(null, this.options), this.modules.formatter ? r2 = this.modules.formatter : "undefined" != typeof Intl && (r2 = mt2);
      var a3 = new nt2(this.options);
      this.store = new Je2(this.options.resources, this.options);
      var o2 = this.services;
      o2.logger = Le2, o2.resourceStore = this.store, o2.languageUtils = a3, o2.pluralResolver = new ut2(a3, { prepend: this.options.pluralSeparator, compatibilityJSON: this.options.compatibilityJSON, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), !r2 || this.options.interpolation.format && this.options.interpolation.format !== n2.interpolation.format || (o2.formatter = i3(r2), o2.formatter.init(o2, this.options), this.options.interpolation.format = o2.formatter.format.bind(o2.formatter)), o2.interpolator = new ht2(this.options), o2.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, o2.backendConnector = new It(i3(this.modules.backend), o2.resourceStore, o2, this.options), o2.backendConnector.on("*", function(t4) {
        for (var s4 = arguments.length, n3 = new Array(s4 > 1 ? s4 - 1 : 0), i4 = 1; i4 < s4; i4++)
          n3[i4 - 1] = arguments[i4];
        e4.emit.apply(e4, [t4].concat(n3));
      }), this.modules.languageDetector && (o2.languageDetector = i3(this.modules.languageDetector), o2.languageDetector.init && o2.languageDetector.init(o2, this.options.detection, this.options)), this.modules.i18nFormat && (o2.i18nFormat = i3(this.modules.i18nFormat), o2.i18nFormat.init && o2.i18nFormat.init(this)), this.translator = new tt$1(this.services, this.options), this.translator.on("*", function(t4) {
        for (var s4 = arguments.length, n3 = new Array(s4 > 1 ? s4 - 1 : 0), i4 = 1; i4 < s4; i4++)
          n3[i4 - 1] = arguments[i4];
        e4.emit.apply(e4, [t4].concat(n3));
      }), this.modules.external.forEach(function(t4) {
        t4.init && t4.init(e4);
      });
    }
    if (this.format = this.options.interpolation.format, s3 || (s3 = Mt), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
      var u2 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
      u2.length > 0 && "dev" !== u2[0] && (this.options.lng = u2[0]);
    }
    this.services.languageDetector || this.options.lng || this.logger.warn("init: no languageDetector is used and no lng is defined");
    ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach(function(t4) {
      e4[t4] = function() {
        var s4;
        return (s4 = e4.store)[t4].apply(s4, arguments);
      };
    });
    ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach(function(t4) {
      e4[t4] = function() {
        var s4;
        return (s4 = e4.store)[t4].apply(s4, arguments), e4;
      };
    });
    var c3 = je(), g2 = function() {
      var t4 = function(t5, n3) {
        e4.isInitialized && !e4.initializedStoreOnce && e4.logger.warn("init: i18next is already initialized. You should call init just once!"), e4.isInitialized = true, e4.options.isClone || e4.logger.log("initialized", e4.options), e4.emit("initialized", e4.options), c3.resolve(n3), s3(t5, n3);
      };
      if (e4.languages && "v1" !== e4.options.compatibilityAPI && !e4.isInitialized)
        return t4(null, e4.t.bind(e4));
      e4.changeLanguage(e4.options.lng, t4);
    };
    return this.options.resources || !this.options.initImmediate ? g2() : setTimeout(g2, 0), c3;
  } }, { key: "loadResources", value: function(e4) {
    var t3 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Mt, n2 = "string" == typeof e4 ? e4 : this.language;
    if ("function" == typeof e4 && (s3 = e4), !this.options.resources || this.options.partialBundledLanguages) {
      if (n2 && "cimode" === n2.toLowerCase())
        return s3();
      var i3 = [], r2 = function(e5) {
        e5 && t3.services.languageUtils.toResolveHierarchy(e5).forEach(function(e6) {
          i3.indexOf(e6) < 0 && i3.push(e6);
        });
      };
      if (n2)
        r2(n2);
      else
        this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(e5) {
          return r2(e5);
        });
      this.options.preload && this.options.preload.forEach(function(e5) {
        return r2(e5);
      }), this.services.backendConnector.load(i3, this.options.ns, function(e5) {
        e5 || t3.resolvedLanguage || !t3.language || t3.setResolvedLanguage(t3.language), s3(e5);
      });
    } else
      s3(null);
  } }, { key: "reloadResources", value: function(e4, t3, s3) {
    var n2 = je();
    return e4 || (e4 = this.languages), t3 || (t3 = this.options.ns), s3 || (s3 = Mt), this.services.backendConnector.reload(e4, t3, function(e5) {
      n2.resolve(), s3(e5);
    }), n2;
  } }, { key: "use", value: function(e4) {
    if (!e4)
      throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
    if (!e4.type)
      throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
    return "backend" === e4.type && (this.modules.backend = e4), ("logger" === e4.type || e4.log && e4.warn && e4.error) && (this.modules.logger = e4), "languageDetector" === e4.type && (this.modules.languageDetector = e4), "i18nFormat" === e4.type && (this.modules.i18nFormat = e4), "postProcessor" === e4.type && We2.addPostProcessor(e4), "formatter" === e4.type && (this.modules.formatter = e4), "3rdParty" === e4.type && this.modules.external.push(e4), this;
  } }, { key: "setResolvedLanguage", value: function(e4) {
    if (e4 && this.languages && !(["cimode", "dev"].indexOf(e4) > -1))
      for (var t3 = 0; t3 < this.languages.length; t3++) {
        var s3 = this.languages[t3];
        if (!(["cimode", "dev"].indexOf(s3) > -1) && this.store.hasLanguageSomeTranslations(s3)) {
          this.resolvedLanguage = s3;
          break;
        }
      }
  } }, { key: "changeLanguage", value: function(e4, t3) {
    var s3 = this;
    this.isLanguageChangingTo = e4;
    var n2 = je();
    this.emit("languageChanging", e4);
    var i3 = function(e5) {
      s3.language = e5, s3.languages = s3.services.languageUtils.toResolveHierarchy(e5), s3.resolvedLanguage = void 0, s3.setResolvedLanguage(e5);
    }, r2 = function(r3) {
      e4 || r3 || !s3.services.languageDetector || (r3 = []);
      var a3 = "string" == typeof r3 ? r3 : s3.services.languageUtils.getBestMatchFromCodes(r3);
      a3 && (s3.language || i3(a3), s3.translator.language || s3.translator.changeLanguage(a3), s3.services.languageDetector && s3.services.languageDetector.cacheUserLanguage && s3.services.languageDetector.cacheUserLanguage(a3)), s3.loadResources(a3, function(e5) {
        !function(e6, r4) {
          r4 ? (i3(r4), s3.translator.changeLanguage(r4), s3.isLanguageChangingTo = void 0, s3.emit("languageChanged", r4), s3.logger.log("languageChanged", r4)) : s3.isLanguageChangingTo = void 0, n2.resolve(function() {
            return s3.t.apply(s3, arguments);
          }), t3 && t3(e6, function() {
            return s3.t.apply(s3, arguments);
          });
        }(e5, a3);
      });
    };
    return e4 || !this.services.languageDetector || this.services.languageDetector.async ? !e4 && this.services.languageDetector && this.services.languageDetector.async ? 0 === this.services.languageDetector.detect.length ? this.services.languageDetector.detect().then(r2) : this.services.languageDetector.detect(r2) : r2(e4) : r2(this.services.languageDetector.detect()), n2;
  } }, { key: "getFixedT", value: function(e4, t3, s3) {
    var n2 = this, i3 = function e5(t4, i4) {
      var r2;
      if ("object" !== me(i4)) {
        for (var a3 = arguments.length, o2 = new Array(a3 > 2 ? a3 - 2 : 0), u2 = 2; u2 < a3; u2++)
          o2[u2 - 2] = arguments[u2];
        r2 = n2.options.overloadTranslationOptionHandler([t4, i4].concat(o2));
      } else
        r2 = Ut({}, i4);
      r2.lng = r2.lng || e5.lng, r2.lngs = r2.lngs || e5.lngs, r2.ns = r2.ns || e5.ns, r2.keyPrefix = r2.keyPrefix || s3 || e5.keyPrefix;
      var c3, g2 = n2.options.keySeparator || ".";
      return c3 = r2.keyPrefix && Array.isArray(t4) ? t4.map(function(e6) {
        return "".concat(r2.keyPrefix).concat(g2).concat(e6);
      }) : r2.keyPrefix ? "".concat(r2.keyPrefix).concat(g2).concat(t4) : t4, n2.t(c3, r2);
    };
    return "string" == typeof e4 ? i3.lng = e4 : i3.lngs = e4, i3.ns = t3, i3.keyPrefix = s3, i3;
  } }, { key: "t", value: function() {
    var e4;
    return this.translator && (e4 = this.translator).translate.apply(e4, arguments);
  } }, { key: "exists", value: function() {
    var e4;
    return this.translator && (e4 = this.translator).exists.apply(e4, arguments);
  } }, { key: "setDefaultNamespace", value: function(e4) {
    this.options.defaultNS = e4;
  } }, { key: "hasLoadedNamespace", value: function(e4) {
    var t3 = this, s3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
    if (!this.isInitialized)
      return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), false;
    if (!this.languages || !this.languages.length)
      return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), false;
    var n2 = s3.lng || this.resolvedLanguage || this.languages[0], i3 = !!this.options && this.options.fallbackLng, r2 = this.languages[this.languages.length - 1];
    if ("cimode" === n2.toLowerCase())
      return true;
    var a3 = function(e5, s4) {
      var n3 = t3.services.backendConnector.state["".concat(e5, "|").concat(s4)];
      return -1 === n3 || 2 === n3;
    };
    if (s3.precheck) {
      var o2 = s3.precheck(this, a3);
      if (void 0 !== o2)
        return o2;
    }
    return !!this.hasResourceBundle(n2, e4) || (!(this.services.backendConnector.backend && (!this.options.resources || this.options.partialBundledLanguages)) || !(!a3(n2, e4) || i3 && !a3(r2, e4)));
  } }, { key: "loadNamespaces", value: function(e4, t3) {
    var s3 = this, n2 = je();
    return this.options.ns ? ("string" == typeof e4 && (e4 = [e4]), e4.forEach(function(e5) {
      s3.options.ns.indexOf(e5) < 0 && s3.options.ns.push(e5);
    }), this.loadResources(function(e5) {
      n2.resolve(), t3 && t3(e5);
    }), n2) : (t3 && t3(), Promise.resolve());
  } }, { key: "loadLanguages", value: function(e4, t3) {
    var s3 = je();
    "string" == typeof e4 && (e4 = [e4]);
    var n2 = this.options.preload || [], i3 = e4.filter(function(e5) {
      return n2.indexOf(e5) < 0;
    });
    return i3.length ? (this.options.preload = n2.concat(i3), this.loadResources(function(e5) {
      s3.resolve(), t3 && t3(e5);
    }), s3) : (t3 && t3(), Promise.resolve());
  } }, { key: "dir", value: function(e4) {
    if (e4 || (e4 = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e4)
      return "rtl";
    var t3 = this.services && this.services.languageUtils || new nt2(St2());
    return ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"].indexOf(t3.getLanguagePartFromCode(e4)) > -1 || e4.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
  } }, { key: "cloneInstance", value: function() {
    var e4 = this, s3 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Mt, i3 = Ut(Ut(Ut({}, this.options), s3), { isClone: true }), r2 = new t2(i3);
    void 0 === s3.debug && void 0 === s3.prefix || (r2.logger = r2.logger.clone(s3));
    return ["store", "services", "language"].forEach(function(t3) {
      r2[t3] = e4[t3];
    }), r2.services = Ut({}, this.services), r2.services.utils = { hasLoadedNamespace: r2.hasLoadedNamespace.bind(r2) }, r2.translator = new tt$1(r2.services, r2.options), r2.translator.on("*", function(e5) {
      for (var t3 = arguments.length, s4 = new Array(t3 > 1 ? t3 - 1 : 0), n3 = 1; n3 < t3; n3++)
        s4[n3 - 1] = arguments[n3];
      r2.emit.apply(r2, [e5].concat(s4));
    }), r2.init(i3, n2), r2.translator.options = r2.options, r2.translator.backendConnector.services.utils = { hasLoadedNamespace: r2.hasLoadedNamespace.bind(r2) }, r2;
  } }, { key: "toJSON", value: function() {
    return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
  } }]), t2;
}();
Me2(Ot, "createInstance", function() {
  return new Ot(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, arguments.length > 1 ? arguments[1] : void 0);
});
var _t = Ot.createInstance();
_t.createInstance = Ot.createInstance, _t.createInstance, _t.dir, _t.init, _t.loadResources, _t.reloadResources, _t.use, _t.changeLanguage, _t.getFixedT, _t.t, _t.exists, _t.setDefaultNamespace, _t.hasLoadedNamespace, _t.loadNamespaces, _t.loadLanguages;
class Dt extends ne {
  constructor() {
    super(), this.languages = null, this.keyMap = {};
  }
  static getInstance() {
    return Dt.instance || (Dt.instance = new Dt()), Dt.instance;
  }
  provideLanguages(e3) {
    var t2;
    G || (this.languages = e3, (null === (t2 = e3["zh-CN"]) || void 0 === t2 ? void 0 : t2.Chat) && this.setKeyMap(e3["zh-CN"]), index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUITranslateService.provideLanguages ok."));
  }
  useI18n(e3) {
    var t2;
    if (G)
      return;
    if (!this.languages)
      return void index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUITranslateService.useI18next not have messages.");
    const s3 = {};
    for (const [e4, t3] of Object.entries(this.languages)) {
      s3["zh_cn" === e4 ? "zh" : e4] = { translation: t3 };
    }
    _t.init({ compatibilityJSON: "v3", lng: e3 || "zh", fallbackLng: "zh", detection: { order: ["querystring", "navigator"], caches: ["localStorage", "cookie"] }, resources: s3 });
    let n2 = this.normalizeLanguageKey(e3 || "zh");
    null === (t2 = this.getEngine().TUIReport) || void 0 === t2 || t2.reportFeature(201, n2);
  }
  changeLanguage(e3) {
    let t2 = this.normalizeLanguageKey(e3);
    return this.getEngine().TUIReport.reportFeature(201, t2), _t.changeLanguage(e3);
  }
  normalizeLanguageKey(e3) {
    return e3.includes("en") ? "en-us" : e3.includes("tw") ? "zh-tw" : e3.includes("zh") || e3.includes("cn") ? "zh-cn" : e3.includes("ko") || e3.includes("kr") ? "ko-kr" : e3.includes("ja") || e3.includes("jp") ? "ja-jp" : "other-" + e3;
  }
  t(e3) {
    if (!this.languages) {
      let t3 = e3;
      return !S(e3) && e3.indexOf(".") > -1 && (t3 = e3.split(".").pop() || ""), t3;
    }
    const t2 = this.keyMap[e3];
    return t2 ? _t.t(t2) : _t.t(e3);
  }
  setKeyMap(e3, t2) {
    for (const s3 in e3)
      if (Object.prototype.hasOwnProperty.call(e3, s3)) {
        const n2 = t2 ? `${t2}.${s3}` : s3;
        if (e3[s3] && "object" == typeof e3[s3] && !Array.isArray(e3[s3]) && null !== e3[s3])
          this.setKeyMap(e3[s3], n2);
        else {
          let n3 = t2 ? `${t2}.${e3[s3]}` : e3[s3];
          n3 = this.replaceKey(n3), this.keyMap[n3] = `${t2}.${s3}`;
        }
      }
  }
  replaceKey(e3) {
    return e3.startsWith("Chat") ? e3.replace("Chat", "TUIChat") : e3.startsWith("Conversation") ? e3.replace("Conversation", "TUIConversation") : e3.startsWith("Message") ? e3.replace("Message", "message.tip") : e3.startsWith("Call") ? e3.replace("Call", "message.custom") : e3;
  }
}
class Pt extends ne {
  constructor() {
    super(), this.serv = "TUIConversationService";
  }
  static getInstance() {
    return Pt.instance || (Pt.instance = new Pt()), Pt.instance;
  }
  init() {
    const e3 = this.getEngine();
    e3.eventCenter.addEvent(e3.EVENT.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated.bind(this)), e3.eventCenter.addEvent(e3.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalUnreadCountUpdated.bind(this)), e3.eventCenter.addEvent(e3.EVENT.MESSAGE_RECEIVED, this.onMessageReceived.bind(this)), this.getConversationInitData();
  }
  onConversationListUpdated(e3) {
    const t2 = this.filterSystemConversation(e3);
    this.getEngine().TUIStore.update(o.CONV, "conversationList", t2), this.updateCurrentConversation();
  }
  onTotalUnreadCountUpdated(e3) {
    this.getEngine().TUIStore.update(o.CONV, "totalUnreadCount", e3);
  }
  onMessageReceived(e3) {
    const t2 = this.getEngine(), s3 = this.getEngine().TUIStore.getData(o.CONV, "conversationList");
    let n2 = false;
    for (let i3 = 0; i3 < e3.length; i3++) {
      if (e3[i3].type !== t2.TYPES.MSG_GRP_SYS_NOTICE)
        continue;
      const { operationType: r2 } = e3[i3].payload, a3 = `GROUP${e3[i3].to}`, u2 = 4 === r2 || 5 === r2 || 8 === r2, c3 = 2 === r2 || 6 === r2 || 7 === r2;
      if (u2 || c3) {
        for (let e4 = 0; e4 < s3.length; e4++)
          if (s3[e4].type !== t2.TYPES.CONV_C2C && s3[e4].conversationID === a3) {
            if (u2) {
              this.getEngine().TUIStore.update(o.CONV, "operationTypeMap", { conversationID: a3, operationType: r2 }), n2 = true;
              break;
            }
            if (c3 && s3[e4].operationType > 0) {
              this.getEngine().TUIStore.update(o.CONV, "operationTypeMap", { conversationID: a3, operationType: 0 }), n2 = true;
              break;
            }
          }
      }
    }
    if (n2) {
      this.getEngine().TUIStore.update(o.CONV, "conversationList", s3);
      const e4 = this.getEngine().TUIStore.getData(o.CONV, "currentConversationID") || "", t3 = this.findConversation(e4);
      t3 && this.getEngine().TUIStore.update(o.CONV, "currentConversation", t3);
    }
  }
  getConversationInitData() {
    const e3 = this.getEngine();
    e3.chat.isReady() && e3.chat.getConversationList().then((t2) => {
      const { conversationList: s3, isSyncCompleted: n2 } = t2.data;
      if (index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${this.serv}.init, getConversationList count:${s3.length} isSyncCompleted:${n2}`), s3.length > 0) {
        this.onConversationListUpdated(s3);
        const t3 = e3.chat.getTotalUnreadMessageCount();
        this.onTotalUnreadCountUpdated(t3);
      }
    });
  }
  switchConversation(e3) {
    return i2(this, void 0, void 0, function* () {
      const t2 = `${this.serv}.switchConversation`, s3 = this.getEngine();
      if (!e3)
        return s3.TUIStore.reset(o.CHAT, ["messageList", "isCompleted", "nextReqMessageID"]), s3.TUIStore.update(o.CONV, "currentConversationID", ""), s3.TUIStore.update(o.CONV, "currentConversation", null), index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} conversationID is empty, conversationID:${e3}`), Promise.resolve({});
      if (!e3.startsWith(s3.TYPES.CONV_C2C) && !e3.startsWith(s3.TYPES.CONV_GROUP))
        return index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} conversationID is invalid, conversationID:${e3}`), Promise.reject({ code: h2.INVALID_CONV_ID, message: d2.INVALID_CONV_ID });
      const n2 = s3.TUIStore.getData(o.CONV, "currentConversationID");
      if (n2 && n2 === e3)
        return this.setMessageRead(n2), index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} please check conversationID, conversationID:${e3}`), Promise.resolve({ code: h2.CONV_ID_SAME, message: d2.CONV_ID_SAME });
      const i3 = yield this.getConversationModel(e3);
      return S(i3) ? (index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${t2} target conversation is not exist, conversationID:${e3}`), Promise.reject({ code: h2.CONV_NOT_EXIST, message: d2.CONV_NOT_EXIST })) : (n2 && this.setMessageRead(n2), e3 && this.setMessageRead(e3), s3.TUIStore.reset(o.CHAT, ["messageList", "isCompleted", "nextReqMessageID"]), s3.TUIStore.update(o.CONV, "currentConversationID", e3), s3.TUIStore.update(o.CONV, "currentConversation", i3), Promise.resolve(i3));
    });
  }
  getConversationModel(e3) {
    return i2(this, void 0, void 0, function* () {
      let t2 = this.findConversation(e3);
      if (S(t2))
        try {
          const s3 = yield this.getConversationProfile(e3);
          s3.data && s3.data.conversation && (t2 = new ae2(s3.data.conversation));
        } catch (e4) {
          t2 = void 0;
        }
      return t2;
    });
  }
  findConversation(e3) {
    let t2;
    const s3 = this.getEngine().TUIStore.getData(o.CONV, "conversationList");
    for (let n2 = 0; n2 < s3.length; n2++)
      if (s3[n2].conversationID === e3) {
        t2 = s3[n2];
        break;
      }
    return t2;
  }
  updateCurrentConversation() {
    const e3 = this.getEngine(), t2 = e3.TUIStore.getData(o.CONV, "currentConversationID"), s3 = this.findConversation(t2);
    s3 && e3.TUIStore.update(o.CONV, "currentConversation", s3);
  }
  getConversationList() {
    return this.getEngine().chat.getConversationList();
  }
  getConversationProfile(e3) {
    return this.getEngine().chat.getConversationProfile(e3);
  }
  deleteConversation(e3) {
    return this.getEngine().chat.deleteConversation(e3).then((t2) => {
      const s3 = this.getEngine().TUIStore.getData(o.CONV, "currentConversationID");
      return index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${this.serv}.deleteConversation conversationID:${e3} currentConversationID:${s3}`), e3 === s3 && (this.getEngine().TUIStore.update(o.CONV, "currentConversationID", ""), this.getEngine().TUIStore.update(o.CONV, "currentConversation", null)), t2;
    });
  }
  pinConversation(e3) {
    return this.getEngine().chat.pinConversation(e3);
  }
  muteConversation(e3) {
    return this.getEngine().chat.setMessageRemindType(e3);
  }
  clearHistoryMessage(e3) {
    return this.getEngine().chat.clearHistoryMessage(e3).then((e4) => (this.getEngine().TUIStore.update(o.CHAT, "messageList", []), this.getEngine().TUIStore.update(o.CHAT, "nextReqMessageID", ""), this.getEngine().TUIStore.update(o.CHAT, "isCompleted", true), e4));
  }
  setMessageRead(e3) {
    return this.getEngine().chat.setMessageRead({ conversationID: e3 });
  }
  setConversationDraft(e3) {
    const { conversationID: t2, draftInfo: s3 } = e3;
    let n2 = "";
    return s3 && (n2 = JSON.stringify(s3)), this.getEngine().chat.setConversationDraft({ conversationID: t2, draftText: n2 }).then((e4) => {
      const { conversation: t3 } = e4.data;
      this.updateConversation(t3);
    });
  }
  updateConversation(e3) {
    let t2 = false;
    const s3 = this.getEngine().TUIStore.getData(o.CONV, "conversationList");
    for (let n2 = 0; n2 < s3.length; n2++)
      if (s3[n2].conversationID === e3.conversationID) {
        s3[n2] = e3, t2 = true;
        break;
      }
    t2 && this.getEngine().TUIStore.update(o.CONV, "conversationList", s3);
  }
  filterSystemConversation(e3) {
    return e3.filter((e4) => e4.type !== this.getEngine().TYPES.CONV_SYSTEM);
  }
}
class Rt {
  constructor(e3) {
    this.TUIUserService = e3;
  }
  getEngine() {
    return this.TUIUserService.getEngine();
  }
  init() {
    this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.PROFILE_UPDATED, this.onProfileUpdated.bind(this)), this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.BLACKLIST_UPDATED, this.onBlacklistUpdated.bind(this)), this.getUserProfileInitData();
  }
  onProfileUpdated(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.USER, "userProfile");
    e3.forEach((e4) => {
      e4.userID === s3.userID && t2.TUIStore.update(o.USER, "userProfile", e4);
    });
  }
  onBlacklistUpdated(e3) {
    const t2 = this.getEngine();
    this.getBlacklistProfile(e3).then((e4) => {
      t2.TUIStore.update(o.USER, "userBlacklist", e4);
    });
  }
  getUserProfileInitData() {
    const e3 = this.getEngine();
    e3.chat.isReady() && e3.chat.getBlacklist().then((e4) => {
      const t2 = e4.data || [];
      index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIUserProfileHandler.init, getBlacklist count:${t2.length}`), t2.length > 0 && this.onBlacklistUpdated(t2);
    });
  }
  getBlacklistProfile(e3) {
    const t2 = [];
    let s3 = 0;
    for (; s3 < e3.length; )
      t2.push(e3.slice(s3, s3 += 100));
    const n2 = [];
    t2.forEach((e4) => {
      n2.push(this.TUIUserService.getUserProfile({ userIDList: e4 }));
    });
    const i3 = [];
    return Promise.all(n2).then((e4) => (e4.forEach((e5) => {
      const t3 = e5.data.map((e6) => {
        const { userID: t4, nick: s4, avatar: n3 } = e6;
        return { userID: t4, nick: s4, avatar: n3 };
      });
      i3.push(...t3);
    }), i3));
  }
  getUserProfile(e3) {
    const t2 = this.getEngine();
    return S(e3) ? t2.chat.getMyProfile().then((e4) => (t2.TUIStore.update(o.USER, "userProfile", e4.data), e4)).catch((e4) => Promise.reject(e4)) : t2.chat.getUserProfile(e3);
  }
  updateMyProfile(e3) {
    return this.getEngine().chat.updateMyProfile(e3);
  }
  addToBlacklist(e3) {
    return this.getEngine().chat.addToBlacklist(e3);
  }
  removeFromBlacklist(e3) {
    return this.getEngine().chat.removeFromBlacklist(e3);
  }
}
function Lt(e3, t2, s3 = true) {
  !function(e4, t3) {
    V ? H.setStorageSync(e4, t3) : kt() && localStorage.setItem(e4, JSON.stringify(t3));
  }(s3 ? jt(e3) : e3, t2);
}
function At(e3, t2 = true) {
  try {
    return function(e4) {
      if (V)
        return H.getStorageSync(e4);
      if (kt()) {
        const t3 = localStorage.getItem(e4);
        if ("undefined" !== t3)
          return JSON.parse(t3);
      }
      return;
    }(t2 ? jt(e3) : e3);
  } catch (e4) {
    return void index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "Storage.getStorageItem error:", e4);
  }
}
function jt(e3) {
  return `chat_engine_${e3}`;
}
function kt() {
  return navigator && navigator.cookieEnabled && localStorage;
}
class Nt {
  constructor(e3) {
    this.TUIUserService = e3;
  }
  getEngine() {
    return this.TUIUserService.getEngine();
  }
  init() {
    const e3 = this.getEngine(), t2 = At("displayOnlineStatus") || false;
    e3.TUIStore.update(o.USER, "displayOnlineStatus", t2), e3.eventCenter.addEvent(e3.EVENT.USER_STATUS_UPDATED, this.onUserStatusUpdated.bind(this)), this.onConversationListUpdated();
  }
  onConversationListUpdated() {
    const e3 = this.getEngine();
    e3.TUIStore.watch(o.CONV, { conversationList: () => {
      const t2 = e3.TUIStore.getData(o.APP, "enabledOnlineStatus"), s3 = e3.TUIStore.getData(o.USER, "displayOnlineStatus");
      t2 && s3 && this.startToSubscribe();
    } });
  }
  onUserStatusUpdated(e3) {
    this.getEngine().TUIStore.update(o.USER, "userStatusList", e3);
  }
  switchUserStatus(e3) {
    const t2 = this.getEngine(), { displayOnlineStatus: s3 = false } = e3;
    t2.TUIStore.update(o.USER, "displayOnlineStatus", s3), Lt("displayOnlineStatus", s3);
    const n2 = t2.TUIStore.getData(o.APP, "enabledOnlineStatus");
    n2 ? true === s3 ? this.startToSubscribe() : this.unsubscribeUserStatus() : index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `UserStatusHandler.switchUserStatus enabledOnlineStatus:${n2} displayOnlineStatus:${s3}`);
  }
  getUserStatus(e3) {
    const t2 = this.getEngine();
    return t2.chat.getUserStatus(e3).then((e4) => {
      const { successUserList: s3 } = e4.data;
      return s3.length > 0 && t2.TUIStore.update(o.USER, "userStatusList", s3), e4;
    }).catch((e4) => Promise.reject(e4));
  }
  subscribeUserStatus(e3) {
    var t2;
    const s3 = (null === (t2 = null == e3 ? void 0 : e3.userIDList) || void 0 === t2 ? void 0 : t2.length) || 0;
    return 0 === s3 ? (index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `UserStatusHandler.subscribeUserStatus userID count:${s3}`), Promise.resolve()) : this.getEngine().chat.subscribeUserStatus(e3);
  }
  unsubscribeUserStatus(e3) {
    const t2 = this.getEngine(), { userIDList: s3 = [] } = e3 || {};
    return t2.chat.unsubscribeUserStatus({ userIDList: s3 }).then((e4) => {
      const { failureUserList: n2 } = e4.data, i3 = [];
      return s3.forEach((e5) => {
        n2.includes(e5) || i3.push({ userID: e5, statusType: u.UNSUB_USER });
      }), t2.TUIStore.update(o.USER, "userStatusList", i3), e4;
    }).catch((e4) => Promise.reject(e4));
  }
  startToSubscribe() {
    const e3 = this.getEngine(), t2 = e3.TUIStore.getData(o.CONV, "conversationList"), s3 = e3.TUIStore.getData(o.USER, "userStatusList"), n2 = [];
    t2.forEach((t3) => {
      if (t3.type === e3.TYPES.CONV_C2C) {
        const i3 = t3.conversationID.replace(e3.TYPES.CONV_C2C, "");
        s3.has(i3) || n2.push(i3);
      }
    }), 0 !== n2.length && e3.chat.isReady() && (this.subscribeUserStatus({ userIDList: n2 }), this.getUserStatus({ userIDList: n2 }));
  }
}
class xt extends ne {
  constructor() {
    super(), this.userProfileHandler = new Rt(this), this.userStatusHandler = new Nt(this);
  }
  static getInstance() {
    return xt.instance || (xt.instance = new xt()), xt.instance;
  }
  init() {
    const e3 = this.getEngine();
    e3.eventCenter.addEvent(e3.EVENT.KICKED_OUT, this.onKickedOut.bind(this)), e3.eventCenter.addEvent(e3.EVENT.NET_STATE_CHANGE, this.onNetStateChange.bind(this)), this.userProfileHandler.init(), this.userStatusHandler.init(), this.initMessageReadReceipt();
  }
  onKickedOut(e3) {
    this.getEngine().TUIStore.update(o.USER, "kickedOut", e3.type);
  }
  onNetStateChange(e3) {
    this.getEngine().TUIStore.update(o.USER, "netStateChange", e3.state);
  }
  initMessageReadReceipt() {
    const e3 = At("displayMessageReadReceipt") || true;
    this.getEngine().TUIStore.update(o.USER, "displayMessageReadReceipt", e3);
  }
  switchUserStatus(e3) {
    return this.userStatusHandler.switchUserStatus(e3);
  }
  switchMessageReadStatus(e3) {
    this.getEngine().TUIStore.update(o.USER, "displayMessageReadReceipt", e3), Lt("displayMessageReadReceipt", e3);
  }
  getUserProfile(e3) {
    return this.userProfileHandler.getUserProfile(e3);
  }
  updateMyProfile(e3) {
    return this.userProfileHandler.updateMyProfile(e3);
  }
  addToBlacklist(e3) {
    return this.userProfileHandler.addToBlacklist(e3);
  }
  removeFromBlacklist(e3) {
    return this.userProfileHandler.removeFromBlacklist(e3);
  }
  getUserStatus(e3) {
    return this.userStatusHandler.getUserStatus(e3);
  }
  subscribeUserStatus(e3) {
    return this.userStatusHandler.subscribeUserStatus(e3);
  }
  unsubscribeUserStatus(e3) {
    return this.userStatusHandler.unsubscribeUserStatus(e3);
  }
}
class Gt {
  constructor(e3) {
    this.TUIChatService = e3, this.userShowNameMap = /* @__PURE__ */ new Map(), this.requestedUserMap = /* @__PURE__ */ new Map();
  }
  getEngine() {
    return this.TUIChatService.getEngine();
  }
  t(e3) {
    return this.getEngine().TUITranslate.t(e3);
  }
  handleTextMessage(e3) {
    return { text: this.decodeText(e3.payload) };
  }
  handleFaceMessage(e3) {
    const t2 = { name: "", url: "", type: "" };
    return e3.payload.data.indexOf("@custom") > -1 ? (t2.name = e3.payload.data, t2.type = "custom", t2) : (t2.name = e3.payload.data.indexOf("@2x") < 0 ? `${e3.payload.data}@2x` : e3.payload.data, t2.url = `${P}${t2.name}.png`, t2);
  }
  handleLocationMessage(e3) {
    const t2 = { lon: "", lat: "", href: "", url: "", description: "" };
    return t2.lon = e3.payload.longitude.toFixed(6), t2.lat = e3.payload.latitude.toFixed(6), t2.href = `${R}pointx=${t2.lon}&pointy=${t2.lat}&name=${e3.payload.description}`, t2.url = `${L}center=${t2.lat},${t2.lon}&zoom=10&size=300*150&maptype=roadmap&markers=size:large|color:0xFFCCFF|label:k|${t2.lat},${t2.lon}&key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD`, t2.description = e3.payload.description, t2;
  }
  handleImageMessage(e3) {
    return { url: e3.payload.imageInfoArray[0].url, width: e3.payload.imageInfoArray[0].width, height: e3.payload.imageInfoArray[0].height };
  }
  handleAudioMessage(e3) {
    return { url: e3.payload.url, second: e3.payload.second };
  }
  handleVideoMessage(e3) {
    return { url: e3.payload.videoUrl, snapshotUrl: e3.payload.snapshotUrl, snapshotWidth: e3.payload.snapshotWidth, snapshotHeight: e3.payload.snapshotHeight };
  }
  handleFileMessage(e3) {
    return { url: e3.payload.fileUrl, name: e3.payload.fileName, size: C(e3.payload.fileSize) };
  }
  handleCustomMessage(e3) {
    var t2;
    const s3 = this.handleCreateGroupCustomMessage(e3);
    return { custom: this.handleCallKitSignaling(e3) || s3 || (null === (t2 = null == e3 ? void 0 : e3.payload) || void 0 === t2 ? void 0 : t2.extension) || `${this.t("TUIChat.[自定义消息]")}`, businessID: s3 ? "group_create" : "" };
  }
  handleMergeMessage(e3) {
    return Object.assign({}, e3.payload);
  }
  handleGroupTipsMessage(e3) {
    var t2, s3, n2, i3, r2, a3;
    const o2 = this.getEngine(), u2 = { text: "" };
    let c3 = (null == e3 ? void 0 : e3.nick) || (null === (s3 = null === (t2 = null == e3 ? void 0 : e3.payload) || void 0 === t2 ? void 0 : t2.userIDList) || void 0 === s3 ? void 0 : s3.join(","));
    switch ((null === (i3 = null === (n2 = null == e3 ? void 0 : e3.payload) || void 0 === n2 ? void 0 : n2.memberList) || void 0 === i3 ? void 0 : i3.length) > 0 && (c3 = "", null === (a3 = null === (r2 = null == e3 ? void 0 : e3.payload) || void 0 === r2 ? void 0 : r2.memberList) || void 0 === a3 || a3.map((e4) => {
      const t3 = (null == e4 ? void 0 : e4.nick) || (null == e4 ? void 0 : e4.userID);
      return c3 += `${this.substringByLength(t3)},`, e4;
    }), c3 = null == c3 ? void 0 : c3.slice(0, -1)), e3.payload.operationType) {
      case o2.TYPES.GRP_TIP_MBR_JOIN:
        u2.text = `${c3} ${this.t("message.tip.加入群组")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_QUIT:
        u2.text = `${this.t("message.tip.群成员")}：${c3} ${this.t("message.tip.退出群组")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_KICKED_OUT:
        u2.text = `${this.t("message.tip.群成员")}：${c3} ${this.t("message.tip.被")}${this.t("message.tip.踢出群组")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_SET_ADMIN:
        u2.text = `${this.t("message.tip.群成员")}：${c3} ${this.t("message.tip.成为管理员")}`;
        break;
      case o2.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:
        u2.text = `${this.t("message.tip.群成员")}：${c3} ${this.t("message.tip.被撤销管理员")}`;
        break;
      case o2.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:
        u2.text = this.handleGroupProfileUpdated(e3);
        break;
      case o2.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:
        for (const t3 of e3.payload.memberList)
          t3.muteTime > 0 ? u2.text = `${this.t("message.tip.群成员")}：${c3} ${this.t("message.tip.被禁言")}` : u2.text = `${this.t("message.tip.群成员")}：${c3} ${this.t("message.tip.被取消禁言")}`;
        break;
      default:
        u2.text = `[${this.t("message.tip.群提示消息")}]`;
    }
    return u2;
  }
  handleGroupSystemMessage(e3) {
    const t2 = e3.payload.groupProfile.name || e3.payload.groupProfile.groupID, s3 = { text: "" };
    switch (e3.payload.operationType) {
      case 1:
        s3.text = `${e3.payload.operatorID} ${this.t("message.tip.申请加入群组")}：${t2}`;
        break;
      case 2:
        s3.text = `${this.t("message.tip.成功加入群组")}：${t2}`;
        break;
      case 3:
        s3.text = `${this.t("message.tip.申请加入群组")}：${t2} ${this.t("message.tip.被拒绝")}`;
        break;
      case 4:
        s3.text = `${this.t("message.tip.你被管理员")}${e3.payload.operatorID} ${this.t("message.tip.踢出群组")}：${t2}`;
        break;
      case 5:
        s3.text = `${this.t("message.tip.群")}：${t2} ${this.t("message.tip.被")} ${e3.payload.operatorID} ${this.t("message.tip.解散")}`;
        break;
      case 6:
        s3.text = `${e3.payload.operatorID} ${this.t("message.tip.创建群")}：${t2}`;
        break;
      case 7:
      case 12:
        s3.text = `${e3.payload.operatorID} ${this.t("message.tip.邀请你加群")}：${t2}`;
        break;
      case 8:
        s3.text = `${this.t("message.tip.你退出群组")}：${t2}`;
        break;
      case 9:
        s3.text = `${this.t("message.tip.你被")}${e3.payload.operatorID} ${this.t("message.tip.设置为群")}：${t2} ${this.t("message.tip.的管理员")}`;
        break;
      case 10:
        s3.text = `${this.t("message.tip.你被")}${e3.payload.operatorID} ${this.t("message.tip.撤销群")}：${t2} ${this.t("message.tip.的管理员身份")}`;
        break;
      case 13:
        s3.text = `${e3.payload.operatorID} ${this.t("message.tip.同意加群")}：${t2}`;
        break;
      case 14:
        s3.text = `${e3.payload.operatorID} ${this.t("message.tip.拒接加群")}：${t2}`;
        break;
      case 255:
        s3.text = `${this.t("message.tip.自定义群系统通知")}: ${e3.payload.userDefinedField}`;
        break;
      default:
        s3.text = "未解析的群系统通知";
    }
    return s3;
  }
  handleCallKitSignaling(e3) {
    var t2, s3, n2, i3, r2, a3, o2, u2, c3, g2;
    const l2 = U(e3.payload.data);
    if (1 !== (null == l2 ? void 0 : l2.businessID))
      return "";
    const h3 = U(null == l2 ? void 0 : l2.data), p3 = e3.fromAccount || e3.from, d3 = this.getEngine().TUIFriend.getFriendRemark([p3]), f3 = this.getEngine().getMyUserID();
    let m3 = d3[p3] || e3.nameCard || e3.nick || p3;
    switch (m3 = this.substringByLength(m3), null == l2 ? void 0 : l2.actionType) {
      case 1:
        return "audioCall" !== (null === (t2 = null == h3 ? void 0 : h3.data) || void 0 === t2 ? void 0 : t2.cmd) && "videoCall" !== (null === (s3 = null == h3 ? void 0 : h3.data) || void 0 === s3 ? void 0 : s3.cmd) || !(null == l2 ? void 0 : l2.groupID) ? "hangup" === (null === (n2 = null == h3 ? void 0 : h3.data) || void 0 === n2 ? void 0 : n2.cmd) ? (null == l2 ? void 0 : l2.groupID) ? `${this.t("message.custom.通话结束")}` : `${this.t("message.custom.通话时长")}：${function(e4) {
          const t3 = e4;
          let s4, n3, i4, r3 = "";
          return t3 >= 3600 ? (s4 = parseInt("" + t3 / 3600, 10) < 10 ? `0${parseInt("" + t3 / 3600, 10)}` : parseInt("" + t3 / 3600, 10), n3 = parseInt("" + t3 % 60 / 60, 10) < 10 ? `0${parseInt("" + t3 % 60 / 60, 10)}` : parseInt("" + t3 % 60 / 60, 10), i4 = t3 % 3600 < 10 ? "0" + t3 % 3600 : t3 % 3600, i4 > 60 && (n3 = parseInt("" + i4 / 60, 10) < 10 ? `0${parseInt("" + i4 / 60, 10)}` : parseInt("" + i4 / 60, 10), i4 = i4 % 60 < 10 ? "0" + i4 % 60 : i4 % 60), r3 = `${s4}:${n3}:${i4}`) : t3 >= 60 && t3 < 3600 ? (n3 = parseInt("" + t3 / 60, 10) < 10 ? `0${parseInt("" + t3 / 60, 10)}` : parseInt("" + t3 / 60, 10), i4 = t3 % 60 < 10 ? "0" + t3 % 60 : t3 % 60, r3 = `00:${n3}:${i4}`) : t3 < 60 && (i4 = t3 < 10 ? `0${t3}` : t3, r3 = `00:00:${i4}`), r3;
        }(null == h3 ? void 0 : h3.call_end)}` : "switchToAudio" === (null === (i3 = null == h3 ? void 0 : h3.data) || void 0 === i3 ? void 0 : i3.cmd) ? `${this.t("message.custom.切换语音通话")}` : "switchToVideo" === (null === (r2 = null == h3 ? void 0 : h3.data) || void 0 === r2 ? void 0 : r2.cmd) ? `${this.t("message.custom.切换视频通话")}` : `${this.t("message.custom.发起通话")}` : `${m3} ${this.t("message.custom.发起通话")}`;
      case 2:
        return (null == l2 ? void 0 : l2.groupID) ? `${m3} ${this.t("message.custom.取消通话")}` : this.isOldUIKit("message.custom.已取消") ? this.t("message.custom.取消通话") : (null == l2 ? void 0 : l2.inviter) === f3 ? this.t("message.custom.已取消") : this.t("message.custom.对方已取消");
      case 3:
        return "switchToAudio" === (null === (a3 = null == h3 ? void 0 : h3.data) || void 0 === a3 ? void 0 : a3.cmd) ? `${this.t("message.custom.切换语音通话")}` : "switchToVideo" === (null === (o2 = null == h3 ? void 0 : h3.data) || void 0 === o2 ? void 0 : o2.cmd) ? `${this.t("message.custom.切换视频通话")}` : (null == l2 ? void 0 : l2.groupID) ? `${m3} ${this.t("message.custom.已接听")}` : this.t("message.custom.已接听");
      case 4:
        return (null == l2 ? void 0 : l2.groupID) ? `${m3} ${this.t("message.custom.拒绝通话")}` : this.isOldUIKit("message.custom.已拒绝") ? this.t("message.custom.拒绝通话") : "line_busy" === (null == h3 ? void 0 : h3.line_busy) || "lineBusy" === (null == h3 ? void 0 : h3.data.message) ? (null == l2 ? void 0 : l2.inviter) === f3 ? this.t("message.custom.对方忙线中") : this.t("message.custom.忙线未接听") : (null == l2 ? void 0 : l2.inviter) === f3 ? this.t("message.custom.对方已拒绝") : this.t("message.custom.已拒绝");
      case 5:
        if ("switchToAudio" === (null === (u2 = null == h3 ? void 0 : h3.data) || void 0 === u2 ? void 0 : u2.cmd))
          return `${this.t("message.custom.切换语音通话")}`;
        if ("switchToVideo" === (null === (c3 = null == h3 ? void 0 : h3.data) || void 0 === c3 ? void 0 : c3.cmd))
          return `${this.t("message.custom.切换视频通话")}`;
        if (null == l2 ? void 0 : l2.groupID) {
          if (p3 === (null == l2 ? void 0 : l2.inviter)) {
            this.handleCallkitTimeoutSignaling(l2.inviteeList);
            let e4 = "";
            return null === (g2 = l2.inviteeList) || void 0 === g2 || g2.forEach((t3) => {
              const s4 = this.userShowNameMap.get(t3) || t3;
              e4 += `${this.substringByLength(s4)}、`;
            }), e4 = e4.substring(0, e4.lastIndexOf("、")), `${e4} ${this.t("message.custom.无应答")}`;
          }
          return `${m3} ${this.t("message.custom.无应答")}`;
        }
        return this.isOldUIKit("message.custom.对方无应答") ? this.t("message.custom.无应答") : (null == l2 ? void 0 : l2.inviter) === f3 ? this.t("message.custom.对方无应答") : this.t("message.custom.超时无应答");
      default:
        return "";
    }
  }
  handleCreateGroupCustomMessage(e3) {
    let t2;
    const s3 = U(e3.payload.data);
    return "group_create" === (null == s3 ? void 0 : s3.businessID) && (t2 = `${s3.opUser} ${s3.content}`), t2;
  }
  decodeText(e3) {
    const t2 = [];
    let s3 = e3.text, n2 = -1, i3 = -1;
    for (; "" !== s3; )
      switch (n2 = s3.indexOf("["), i3 = s3.indexOf("]"), n2) {
        case 0:
          if (-1 === i3)
            t2.push({ name: "text", text: s3 }), s3 = "";
          else {
            const e4 = s3.slice(0, i3 + 1);
            e4.indexOf("@custom") > -1 ? (t2.push({ name: "img", src: "", type: "custom", emojiKey: e4 }), s3 = s3.substring(i3 + 1)) : A[e4] ? (t2.push({ name: "img", src: D + A[e4], emojiKey: e4 }), s3 = s3.substring(i3 + 1)) : (t2.push({ name: "text", text: "[" }), s3 = s3.slice(1));
          }
          break;
        case -1:
          t2.push({ name: "text", text: s3 }), s3 = "";
          break;
        default:
          t2.push({ name: "text", text: s3.slice(0, n2) }), s3 = s3.substring(n2);
      }
    return t2;
  }
  handleGroupProfileUpdated(e3) {
    const { nick: t2, payload: s3 } = e3, { newGroupProfile: n2, memberList: i3, operatorID: r2 } = s3;
    let a3 = "";
    const o2 = t2 || r2, u2 = Object.keys(n2)[0];
    switch (u2) {
      case "muteAllMembers":
        a3 = n2[u2] ? `${this.t("message.tip.管理员")} ${o2} ${this.t("message.tip.开启全员禁言")}` : `${this.t("message.tip.管理员")} ${o2} ${this.t("message.tip.取消全员禁言")}`;
        break;
      case "ownerID":
        a3 = `${i3[0].nick || i3[0].userID} ${this.t("message.tip.成为新的群主")}`;
        break;
      case "groupName":
        a3 = `${o2} ${this.t("message.tip.修改群名为")} ${n2[u2]}`;
        break;
      case "notification":
        a3 = this.isOldUIKit("message.tip.把群公告修改为") ? `${o2} ${this.t("message.tip.发布新公告")}` : `${o2} ${this.t("message.tip.把群公告修改为")} "${n2[u2]}"`;
    }
    return a3;
  }
  handleCallkitTimeoutSignaling(e3 = []) {
    if (0 === e3.length)
      return;
    const t2 = this.getEngine().TUIFriend.getFriendRemark(e3), s3 = [];
    e3.forEach((e4) => {
      const n2 = t2[e4];
      n2 ? this.userShowNameMap.set(e4, n2) : this.requestedUserMap.has(e4) || (s3.push(e4), this.requestedUserMap.set(e4, 1));
    }), s3.length > 0 && this.getEngine().TUIUser.getUserProfile({ userIDList: s3 }).then((e4) => {
      (e4.data || []).forEach((e5) => {
        const { userID: t3, nick: s4 } = e5, n2 = s4 || t3;
        this.userShowNameMap.set(t3, n2);
      });
    }).catch(() => {
    });
  }
  substringByLength(e3, t2 = 12) {
    return e3.length > t2 ? `${e3.slice(0, t2)}...` : e3;
  }
  isOldUIKit(e3) {
    var t2;
    const s3 = e3.lastIndexOf("."), n2 = e3.slice(0, s3 + 1);
    return null === (t2 = this.t(e3)) || void 0 === t2 ? void 0 : t2.startsWith(n2);
  }
}
class wt {
  constructor(e3) {
    this.TUIChatService = e3, this.typingTo = "", this.timer = null;
  }
  getEngine() {
    return this.TUIChatService.getEngine();
  }
  clearTypingStatus() {
    this.getEngine().TUIStore.getData(o.CHAT, "typingStatus") && this.getEngine().TUIStore.update(o.CHAT, "typingStatus", false), this.timer && clearTimeout(this.timer), this.timer = null;
  }
  handleLastMessage(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.CHAT, "typingStatus");
    if (e3.type === this.getEngine().TYPES.MSG_CUSTOM && "in" === e3.flow) {
      const n2 = U(e3.payload.data);
      if (n2.businessID === c2.BUSINESS_ID) {
        const { typingStatus: e4, userAction: i3 } = n2;
        if (e4 === c2.STATUS_START || i3 === c2.ACTION_START_ID)
          return s3 ? (this.timer && clearTimeout(this.timer), this.timer = null) : t2.TUIStore.update(o.CHAT, "typingStatus", true), this.timer = setTimeout(() => {
            this.clearTypingStatus();
          }, 3e4), t2.TUIStore.getData(o.CHAT, "typingStatus");
        e4 !== c2.STATUS_END && i3 !== c2.ACTION_END_ID || this.clearTypingStatus();
      }
    }
  }
  filterTypingMessage(e3 = []) {
    if (0 === e3.length)
      return [];
    return this.getEngine().TUIStore.getData(o.APP, "enableTyping") && this.handleLastMessage(e3[e3.length - 1]), e3.filter((e4) => {
      if (e4.type === this.getEngine().TYPES.MSG_CUSTOM) {
        return U(e4.payload.data).businessID !== c2.BUSINESS_ID;
      }
      return true;
    });
  }
  createTypingMessage(e3 = c2.STATUS_END, t2 = "") {
    const { BUSINESS_ID: s3, STATUS_START: n2, VERSION: i3, ACTION_START_ID: r2, ACTION_END_ID: a3, ACTION_START: o2, ACTION_END: u2, NEED_TYPING: g2 } = c2;
    return { to: t2, conversationType: this.getEngine().TYPES.CONV_C2C, payload: { data: JSON.stringify({ businessID: s3, typingStatus: e3, version: i3, userAction: e3 === n2 ? r2 : a3, actionParam: e3 === n2 ? o2 : u2 }), description: "", extension: "" }, cloudCustomData: JSON.stringify({ messageFeature: { needTyping: g2, version: i3 } }) };
  }
  sendTyping(e3 = false, t2 = "") {
    if (e3) {
      this.typingTo = t2;
      const e4 = this.createTypingMessage(c2.STATUS_START, t2);
      this.getEngine().TUIChat.sendCustomMessage(e4, { onlineUserOnly: true });
    } else
      this.sendTypingEnd();
  }
  sendTypingEnd() {
    if (this.typingTo) {
      const e3 = this.createTypingMessage(c2.STATUS_END, this.typingTo);
      this.getEngine().TUIChat.sendCustomMessage(e3, { onlineUserOnly: true });
    }
    this.typingTo = "";
  }
}
class Vt {
  constructor(e3) {
    this.TUIChatService = e3;
  }
  getEngine() {
    return this.TUIChatService.getEngine();
  }
  init() {
    const e3 = this.getEngine();
    e3.eventCenter.addEvent(e3.EVENT.MESSAGE_READ_RECEIPT_RECEIVED, this.onMessageReadReceiptReceived.bind(this));
  }
  onMessageReadReceiptReceived(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.CONV, "currentConversationID"), n2 = [];
    e3.forEach((e4) => {
      const { messageID: i3 } = e4, r2 = t2.chat.findMessage(i3);
      r2 && s3 === r2.conversationID && n2.push(r2);
    }), n2.length > 0 && t2.TUIChat.updateMessageList(n2, "edit");
  }
  sendMessageReadReceipt(e3) {
    const t2 = [];
    return e3.forEach((e4) => {
      const s3 = e4.getMessage();
      t2.push(s3);
    }), this.getEngine().chat.sendMessageReadReceipt(t2);
  }
  getGroupMessageReadMemberList(e3) {
    const t2 = e3.message.getMessage(), s3 = Object.assign(Object.assign({}, e3), { message: t2 });
    return this.getEngine().chat.getGroupMessageReadMemberList(s3);
  }
  getMessageReadReceiptList(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.APP, "enabledMessageReadReceipt"), n2 = t2.TUIStore.getData(o.USER, "displayMessageReadReceipt");
    !s3 || !n2 || 0 === e3.length || e3[0].conversationType !== t2.TYPES.CONV_GROUP || t2.chat.getMessageReadReceiptList(e3).then((e4) => {
      const { messageList: t3 } = e4.data;
      this.TUIChatService.updateMessageList(t3, "edit");
    }).catch((e4) => {
      index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `ReadReceiptHandler.getMessageReadReceiptList error:${e4.message}`);
    });
  }
}
class Ft extends ne {
  constructor() {
    super(), this.serv = "TUIChatService", this.messageHandler = new Gt(this), this.typingHandler = new wt(this), this.readReceiptHandler = new Vt(this), this.isSwitching = true, this.delayGetHoppingFunction = void 0, this.hoppingConfigMap = /* @__PURE__ */ new Map();
  }
  static getInstance() {
    return Ft.instance || (Ft.instance = new Ft()), Ft.instance;
  }
  init() {
    const e3 = this.getEngine();
    e3.eventCenter.addEvent(e3.EVENT.MESSAGE_RECEIVED, this.onMessageReceived.bind(this)), e3.eventCenter.addEvent(e3.EVENT.MESSAGE_MODIFIED, this.onMessageModified.bind(this)), e3.eventCenter.addEvent(e3.EVENT.MESSAGE_REVOKED, this.onMessageRevoked.bind(this)), e3.eventCenter.addEvent(e3.EVENT.MESSAGE_READ_BY_PEER, this.onMessageReadByPeer.bind(this)), e3.eventCenter.addEvent(e3.EVENT.MESSAGE_REACTIONS_UPDATED, this.onMessageReactionsUpdated.bind(this)), this.onCurrentConversationIDUpdated(), this.onMessageSource(), this.readReceiptHandler.init();
  }
  onMessageReceived(e3) {
    this.updateMessageList(e3, "received"), this.getEngine().TUIStore.update(o.CHAT, "newMessageList", e3);
  }
  onMessageModified(e3) {
    this.updateMessageList(e3, "edit");
  }
  onMessageRevoked(e3) {
    this.updateMessageList(e3, "edit");
  }
  onMessageReadByPeer(e3) {
    this.updateMessageList(e3, "edit");
  }
  onMessageReactionsUpdated(e3) {
    this.updateMessageReactionList([e3]);
  }
  onCurrentConversationIDUpdated() {
    const e3 = this.getEngine();
    e3.TUIStore.watch(o.CONV, { currentConversationID: (t2) => {
      this.isSwitching = true, this.delayGetHoppingFunction = void 0, this.hoppingConfigMap.clear(), e3.TUIStore.reset(o.CHAT), this.typingHandler.clearTypingStatus(), this.typingHandler.sendTypingEnd(), ie2(t2) || this.getMessageList().finally(() => {
        this.isSwitching = false, this.delayGetHoppingFunction && this.delayGetHoppingFunction();
      });
    } });
  }
  onMessageSource() {
    const e3 = this.getEngine();
    e3.TUIStore.watch(o.CHAT, { messageSource: (t2) => {
      const s3 = this.getStoreData(o.CONV, "currentConversationID");
      if (!s3 || t2 && t2.conversationID !== s3)
        return;
      if (S(t2))
        return this.hoppingConfigMap.clear(), e3.TUIStore.update(o.CHAT, "messageList", []), e3.TUIStore.update(o.CHAT, "nextReqMessageID", ""), e3.TUIStore.update(o.CHAT, "isCompleted", false), void this.getMessageList();
      const n2 = this.getStoreData(o.CHAT, "messageList");
      n2 && n2.find((e4) => t2 && e4.ID === t2.ID) || (this.isSwitching ? this.delayGetHoppingFunction = this.getMessageListHoppingForDown : this.getMessageListHoppingForDown());
    } });
  }
  getMessageListHoppingForDown() {
    const e3 = this.getStoreData(o.CHAT, "messageList"), { conversationID: t2, sequence: s3, time: n2, ID: i3 } = this.getStoreData(o.CHAT, "messageSource");
    if (e3 && e3.find((e4) => i3 && e4.ID === i3))
      return;
    const r2 = this.getEngine();
    r2.TUIStore.update(o.CHAT, "messageList", []), r2.TUIStore.update(o.CHAT, "nextReqMessageID", ""), r2.TUIStore.update(o.CHAT, "isCompleted", false), this.getMessageListHopping({ conversationID: t2, sequence: s3, time: n2, direction: 1 });
  }
  getStoreData(e3, t2) {
    return this.getEngine().TUIStore.getData(e3, t2);
  }
  sendMessage(e3, t2) {
    this.updateMessageList([e3], "send");
    const s3 = this.getEngine().chat.sendMessage(e3, t2);
    return this.getResponse(s3);
  }
  getResponse(e3, t2 = true, s3 = true) {
    return e3.then((e4) => {
      const s4 = e4.data.messageList ? e4.data.messageList : [e4.data.message];
      return t2 && this.updateMessageList(s4, "edit"), e4;
    }).catch((e4) => {
      var t3;
      return s3 && (null === (t3 = null == e4 ? void 0 : e4.data) || void 0 === t3 ? void 0 : t3.message) && this.updateMessageList([e4.data.message], "edit"), Promise.reject(e4);
    });
  }
  updateMessageList(e3, t2 = "") {
    if (this.getStoreData(o.CHAT, "messageSource") && "unshift" !== t2 && "edit" !== t2)
      return;
    const s3 = this.getStoreData(o.CHAT, "messageList"), n2 = this.updateTargetMessageList(e3, s3, t2);
    this.getEngine().TUIStore.update(o.CHAT, "messageList", n2);
  }
  updateTargetMessageList(e3, t2, s3 = "") {
    const n2 = this.getStoreData(o.CONV, "currentConversationID");
    let i3 = e3.filter((e4) => e4.conversationID === n2);
    if (i3 = this.handleC2CCallSignaling(i3), !s3 || 0 === i3.length)
      return t2;
    const r2 = t2 || [];
    let a3 = [];
    if ("send" === s3 || "push" === s3) {
      const e4 = this.getStoreData(o.CHAT, "userInfo");
      Object.keys(e4).length > 0 && this.updateLocalMessage(i3, e4);
    }
    switch (s3) {
      case "edit":
        for (const e4 of t2) {
          const t3 = i3.find((t4) => t4.ID === e4.ID);
          a3.push(t3 || e4);
        }
        break;
      case "resend":
        a3 = r2.filter((e4) => e4.ID !== i3[0].ID).concat(i3);
        break;
      case "send":
        a3 = r2.concat(this.typingHandler.filterTypingMessage(i3));
        break;
      case "push":
        a3 = r2.concat(this.typingHandler.filterTypingMessage(i3)), this.getEngine().chat.setMessageRead({ conversationID: n2 });
        break;
      case "received":
        a3 = r2.concat(this.typingHandler.filterTypingMessage(i3)), a3 = this.sortMessageList(a3), this.getEngine().chat.setMessageRead({ conversationID: n2 });
        break;
      case "unshift":
        a3 = i3.filter((e4) => 0 === r2.length || !r2.find((t3) => t3.ID === e4.ID)), a3.push(...r2), a3 = this.sortMessageList(a3);
    }
    return a3;
  }
  enterTypingState() {
    this.getStoreData(o.APP, "enableTyping") && this.sendTyping(true);
  }
  leaveTypingState() {
    this.getStoreData(o.APP, "enableTyping") && this.sendTyping(false);
  }
  sendTyping(e3) {
    const t2 = this.getEngine(), s3 = this.getStoreData(o.CONV, "currentConversationID");
    if (!s3.startsWith(t2.TYPES.CONV_C2C))
      return;
    const n2 = s3.replace(t2.TYPES.CONV_C2C, "");
    if (e3) {
      const e4 = this.getStoreData(o.CHAT, "messageList").filter((e5) => "in" === e5.flow);
      if (0 === e4.length)
        return;
      const t3 = 1e3 * e4[e4.length - 1].time;
      if ((/* @__PURE__ */ new Date()).getTime() - t3 > 3e4)
        return;
    }
    this.typingHandler.sendTyping(e3, n2);
  }
  quoteMessage(e3) {
    var t2;
    return this.getEngine().TUIStore.update(o.CHAT, "quoteMessage", { message: e3, type: "quote" }), null === (t2 = this.getEngine().TUIReport) || void 0 === t2 || t2.reportFeature(205), e3;
  }
  replyMessage(e3) {
    return this.getEngine().TUIStore.update(o.CHAT, "quoteMessage", { message: e3, type: "reply" }), e3;
  }
  getCurrentConvInfo() {
    const { conversationID: e3 = "", type: t2 } = this.getStoreData(o.CONV, "currentConversation") || {};
    return { to: e3.replace(t2, ""), conversationType: t2 };
  }
  t(e3) {
    return this.getEngine().TUITranslate.t(e3) || e3;
  }
  getMessageAbstractAndType(e3) {
    var t2, s3;
    const n2 = this.getEngine(), i3 = { abstract: "", type: 0 };
    switch (e3.type) {
      case n2.TYPES.MSG_TEXT:
        i3.abstract = null === (t2 = null == e3 ? void 0 : e3.payload) || void 0 === t2 ? void 0 : t2.text, i3.type = 1;
        break;
      case n2.TYPES.MSG_CUSTOM:
        i3.abstract = "[自定义消息]", i3.type = 2;
        break;
      case n2.TYPES.MSG_IMAGE:
        i3.abstract = "[图片]", i3.type = 3;
        break;
      case n2.TYPES.MSG_AUDIO:
        i3.abstract = "[语音]", i3.type = 4;
        break;
      case n2.TYPES.MSG_VIDEO:
        i3.abstract = "[视频]", i3.type = 5;
        break;
      case n2.TYPES.MSG_FILE:
        i3.abstract = "[文件]", i3.type = 6;
        break;
      case n2.TYPES.MSG_LOCATION:
        i3.type = 7;
        break;
      case n2.TYPES.MSG_FACE:
        i3.abstract = "[表情]", i3.type = 8;
        break;
      case n2.TYPES.MSG_GRP_TIP:
        i3.type = 9;
        break;
      case n2.TYPES.MSG_MERGER:
        i3.abstract = null === (s3 = null == e3 ? void 0 : e3.payload) || void 0 === s3 ? void 0 : s3.title, i3.type = 10;
    }
    return i3;
  }
  genMessageReply(e3, t2) {
    if ("reply" !== t2 && "quote" !== t2)
      return {};
    const { abstract: s3, type: n2 } = this.getMessageAbstractAndType(e3), i3 = { messageAbstract: s3, messageSender: e3.nick || e3.from, messageID: e3.ID }, r2 = Object.assign(Object.assign({}, i3), { messageType: n2, messageTime: null == e3 ? void 0 : e3.time, messageSequence: null == e3 ? void 0 : e3.sequence, version: 1 });
    if ("reply" === t2 && (r2.messageRootID = e3.ID, e3.cloudCustomData)) {
      const t3 = U(e3.cloudCustomData);
      t3.messageReply && t3.messageReply.messageRootID && (r2.messageRootID = t3.messageReply.messageRootID);
    }
    return { messageReply: r2, messageReplyRoot: i3 };
  }
  getMessageInfo(e3, t2, s3) {
    const { messageReply: n2, messageReplyRoot: i3 } = this.genMessageReply(t2, s3), r2 = e3.cloudCustomData ? U(e3.cloudCustomData) : {};
    let a3;
    if (r2.messageReply ? r2.messageReply = Object.assign(Object.assign({}, n2), r2.messageReply) : r2.messageReply = n2, "reply" === s3) {
      const { messageRootID: e4 } = n2;
      a3 = this.getEngine().chat.findMessage(e4);
      const t3 = (null == a3 ? void 0 : a3.cloudCustomData) ? U(a3.cloudCustomData) : {};
      t3.messageReplies || (t3.messageReplies = {}), o2 = t3.messageReplies.replies, ("function" == typeof Array.isArray ? Array.isArray(o2) : "array" === Object.prototype.toString.call(o2).match(/^\[object (.*)\]$/)[1].toLowerCase()) || (t3.messageReplies.replies = []), t3.messageReplies.replies.push(i3), a3.cloudCustomData = JSON.stringify(t3);
    }
    var o2;
    return { cloudCustomData: JSON.stringify(r2), rootMessage: a3 };
  }
  sendTextMessage(e3, t2) {
    const s3 = this.getEngine(), { message: n2, type: i3 } = this.getStoreData(o.CHAT, "quoteMessage");
    let r2 = { cloudCustomData: e3.cloudCustomData || "", rootMessage: void 0 };
    n2 && (r2 = this.getMessageInfo(e3, n2, i3));
    const a3 = s3.chat.createTextMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3), { cloudCustomData: r2.cloudCustomData }));
    return this.sendMessage(a3, t2).then((e4) => (r2.rootMessage && this.modifyMessage(r2.rootMessage), s3.TUIStore.reset(o.CHAT, ["quoteMessage"], true), e4));
  }
  sendTextAtMessage(e3, t2) {
    const s3 = this.getEngine(), { message: n2, type: i3 } = this.getStoreData(o.CHAT, "quoteMessage");
    let r2 = { cloudCustomData: e3.cloudCustomData || "", rootMessage: void 0 };
    n2 && (r2 = this.getMessageInfo(e3, n2, i3));
    const a3 = s3.chat.createTextAtMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3), { cloudCustomData: r2.cloudCustomData }));
    return this.sendMessage(a3, t2).then((e4) => (r2.rootMessage && this.modifyMessage(r2.rootMessage), s3.TUIStore.reset(o.CHAT, ["quoteMessage"], true), e4));
  }
  sendImageMessage(e3, t2) {
    const s3 = this.getEngine().chat.createImageMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3), { onProgress: (e4) => {
      this.onProgress(s3.ID, e4);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendAudioMessage(e3, t2) {
    const s3 = this.getEngine().chat.createAudioMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3), { onProgress: (e4) => {
      this.onProgress(s3.ID, e4);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendVideoMessage(e3, t2) {
    const s3 = this.getEngine().chat.createVideoMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3), { onProgress: (e4) => {
      this.onProgress(s3.ID, e4);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendCustomMessage(e3, t2) {
    const s3 = this.getEngine().chat.createCustomMessage(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3));
    return this.sendMessage(s3, t2);
  }
  sendFaceMessage(e3, t2) {
    const s3 = this.getEngine().chat.createFaceMessage(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3));
    return this.sendMessage(s3, t2);
  }
  sendFileMessage(e3, t2) {
    const s3 = this.getEngine().chat.createFileMessage(Object.assign(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3), { onProgress: (e4) => {
      this.onProgress(s3.ID, e4);
    } }));
    return this.sendMessage(s3, t2);
  }
  sendLocationMessage(e3, t2) {
    const s3 = this.getEngine().chat.createLocationMessage(Object.assign(Object.assign({}, this.getCurrentConvInfo()), e3));
    return this.sendMessage(s3, t2);
  }
  onProgress(e3, t2) {
    const s3 = this.getEngine().TUIStore.getMessageModel(e3);
    if (s3) {
      (t2 - s3.progress >= 0.1 || 1 === t2) && (s3.progress = t2, this.updateMessageList([s3], "edit"));
    }
  }
  setAbstractList(e3) {
    const t2 = this.getEngine(), s3 = e3.nick || e3.from;
    let n2 = "";
    switch (e3.type) {
      case t2.TYPES.MSG_TEXT:
        n2 = e3.payload.text || "", n2.length > 20 && (n2 = n2.slice(0, 20));
        break;
      case t2.TYPES.MSG_MERGER:
        n2 = `${this.t("TUIChat.[聊天记录]")}`;
        break;
      case t2.TYPES.MSG_IMAGE:
        n2 = `${this.t("TUIChat.[图片]")}`;
        break;
      case t2.TYPES.MSG_AUDIO:
        n2 = `${this.t("TUIChat.[音频]")}`;
        break;
      case t2.TYPES.MSG_VIDEO:
        n2 = `${this.t("TUIChat.[视频]")}`;
        break;
      case t2.TYPES.MSG_CUSTOM:
        n2 = `${this.t("TUIChat.[自定义消息]")}`;
        break;
      case t2.TYPES.MSG_FILE:
        n2 = `${this.t("TUIChat.[文件]")}`;
        break;
      case t2.TYPES.MSG_FACE:
        n2 = `${this.t("TUIChat.[动画表情]")}`;
    }
    return `${s3}: ${n2}`;
  }
  genMergerForwardPayload(e3, t2) {
    const { abstractList: s3 = [], compatibleText: n2 = "", title: i3 } = t2;
    return 0 === s3.length && e3.forEach((e4) => {
      s3.push(this.setAbstractList(e4));
    }), { messageList: e3, title: i3, abstractList: s3, compatibleText: n2 || this.t("TUIChat.请升级IMSDK到v2.10.1或更高版本查看此消息") };
  }
  genSendMergerForwardMessage(e3) {
    const { conversationList: t2, messageList: s3, params: n2, mergeInfo: i3, sendMessageOptions: r2 } = e3, a3 = [];
    for (let e4 = 0; e4 < t2.length; e4++) {
      const { conversationID: o2, type: u2 } = t2[e4], c3 = Object.assign({ to: o2.replace(`${u2}`, ""), conversationType: u2, payload: this.genMergerForwardPayload(s3, i3) }, n2), g2 = this.getEngine().chat.createMergerMessage(c3);
      a3.push(this.sendMessage(g2, r2));
    }
    return a3;
  }
  genTitle(e3, t2) {
    const { nick: s3, from: n2, to: i3 } = e3;
    return `${s3 || n2} ${this.t("TUIChat.和")} ${t2 || i3} ${this.t("TUIChat.的聊天记录")}`;
  }
  genMergeInfo(e3) {
    var t2;
    return i2(this, void 0, void 0, function* () {
      const { messageList: s3, mergeInfo: n2 } = e3;
      if (n2.title)
        return n2;
      if (s3[0].conversationType === this.getEngine().TYPES.CONV_GROUP)
        return n2.title = this.t("TUIChat.群聊的聊天记录"), n2;
      try {
        const { data: e4 = [] } = yield this.getEngine().TUIUser.getUserProfile({ userIDList: [s3[0].to] });
        n2.title = this.genTitle(s3[0], null === (t2 = e4[0]) || void 0 === t2 ? void 0 : t2.nick);
      } catch (e4) {
        n2.title = this.genTitle(s3[0]);
      }
      return n2;
    });
  }
  sendMergerForwardMessage(e3) {
    return i2(this, void 0, void 0, function* () {
      return e3.mergeInfo = yield this.genMergeInfo(e3), Promise.all(this.genSendMergerForwardMessage(e3));
    });
  }
  getOriginMessageList(e3) {
    return e3.map((e4) => e4 instanceof ue ? e4.getMessage() : e4);
  }
  sendForwardMessage(e3, t2, s3) {
    t2 = this.getOriginMessageList(t2);
    const i3 = s3 || {}, { needMerge: r2 = false, params: a3 = {}, mergeInfo: o2 = {} } = i3, u2 = n(i3, ["needMerge", "params", "mergeInfo"]);
    if (r2)
      return this.sendMergerForwardMessage({ conversationList: e3, messageList: t2, params: a3, mergeInfo: o2, sendMessageOptions: u2 });
    const c3 = [];
    for (let s4 = 0; s4 < e3.length; s4++) {
      const { conversationID: n2, type: i4 } = e3[s4], r3 = Object.assign({ to: n2.replace(`${i4}`, ""), conversationType: i4 }, a3), o3 = u2[n2] || u2;
      for (let e4 = 0; e4 < t2.length; e4++) {
        Reflect.set(r3, "payload", t2[e4]);
        const s5 = this.getEngine().chat.createForwardMessage(r3);
        c3.push(this.sendMessage(s5, o3));
      }
    }
    return Promise.all(c3);
  }
  revokeMessage(e3) {
    const t2 = this.getEngine().chat.revokeMessage(e3);
    return this.getResponse(t2, true, false);
  }
  resendMessage(e3) {
    e3.status = "unSend", this.updateMessageList([e3], "resend");
    const t2 = this.getEngine().chat.resendMessage(e3);
    return this.getResponse(t2, true, true);
  }
  deleteMessage(e3) {
    const t2 = this.getEngine().chat.deleteMessage(e3);
    return this.getResponse(t2, true, false);
  }
  setMessageExtensions(e3, t2) {
    return this.getEngine().chat.setMessageExtensions(e3, t2);
  }
  getMessageExtensions(e3) {
    return this.getEngine().chat.getMessageExtensions(e3);
  }
  deleteMessageExtensions(e3, t2) {
    return this.getEngine().chat.deleteMessageExtensions(e3, t2);
  }
  modifyMessage(e3) {
    const t2 = this.getEngine().chat.modifyMessage(e3);
    return this.getResponse(t2, true, false).catch((e4) => {
      const { code: t3 = 0, data: s3 = {} } = e4.code;
      throw t3 === l.MSG_MODIFY_CONFLICT ? index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${p2.MSG_MODIFY_CONFLICT} data.message: ${null == s3 ? void 0 : s3.message}`) : t3 === l.MSG_MODIFY_DISABLED_IN_AVCHATROOM ? index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", p2.MSG_MODIFY_DISABLED_IN_AVCHATROOM) : t3 === l.MODIFY_MESSAGE_NOT_EXIST && index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", p2.MODIFY_MESSAGE_NOT_EXIST), e4;
    });
  }
  getMessageList(e3 = { conversationID: this.getStoreData(o.CONV, "currentConversationID"), nextReqMessageID: this.getStoreData(o.CHAT, "nextReqMessageID") }) {
    const t2 = this.getEngine();
    if (!t2.chat.isReady())
      return Promise.reject({ code: h2.GET_MSG_LIST_ERROR, message: d2.GET_MSG_LIST_ERROR });
    if (this.getStoreData(o.CHAT, "isCompleted"))
      return Promise.resolve({ data: { messageList: [], nextReqMessageID: "", isCompleted: true } });
    const s3 = this.getStoreData(o.CHAT, "messageSource"), n2 = this.hoppingConfigMap.get("nextMessageSeq"), i3 = this.hoppingConfigMap.get("nextMessageTime"), r2 = n2 || i3;
    return s3 && s3.conversationID === (null == e3 ? void 0 : e3.conversationID) && r2 ? this.getMessageListHopping() : t2.chat.getMessageList(e3).then((e4) => {
      var s4;
      const { messageList: n3, nextReqMessageID: i4, isCompleted: r3 } = e4.data, a3 = this.getStoreData(o.CHAT, "userInfo");
      Object.keys(a3).length > 0 && this.updateLocalMessage(n3, a3), this.updateMessageList(n3, "unshift"), t2.TUIStore.update(o.CHAT, "nextReqMessageID", i4), t2.TUIStore.update(o.CHAT, "isCompleted", r3);
      const u2 = null === (s4 = n3[0]) || void 0 === s4 ? void 0 : s4.conversationID, { operationType: c3 = 0 } = this.getEngine().TUIStore.getConversationModel(u2) || {};
      return 0 === c3 && (this.getMessageReactions({ messageList: n3 }), this.readReceiptHandler.getMessageReadReceiptList(n3)), e4;
    }).catch((e4) => Promise.reject(e4));
  }
  getMessageListHopping(e3) {
    var t2;
    void 0 === e3 && (e3 = { conversationID: null === (t2 = this.getStoreData(o.CHAT, "messageSource")) || void 0 === t2 ? void 0 : t2.conversationID, sequence: this.hoppingConfigMap.get("nextMessageSeq"), time: this.hoppingConfigMap.get("nextMessageTime") });
    const s3 = this.getEngine();
    return s3.chat.getMessageListHopping(e3).then((t3) => {
      const { messageList: n2, nextMessageSeq: i3, nextMessageTime: r2, isCompleted: a3 } = t3.data, u2 = 1 === e3.direction ? e3.sequence : i3, c3 = 1 === e3.direction ? e3.time : r2;
      return this.updateMessageList(n2, "unshift"), this.delayGetHoppingFunction = void 0, this.hoppingConfigMap.set("nextMessageSeq", u2), this.hoppingConfigMap.set("nextMessageTime", c3), s3.TUIStore.update(o.CHAT, "isCompleted", a3), t3;
    }).catch((e4) => Promise.reject(e4));
  }
  sendMessageReadReceipt(e3) {
    return this.readReceiptHandler.sendMessageReadReceipt(e3);
  }
  getGroupMessageReadMemberList(e3) {
    return this.readReceiptHandler.getGroupMessageReadMemberList(e3).then((e4) => {
      const { isCompleted: t2, cursor: s3, messageID: n2, unreadUserIDList: i3, readUserIDList: r2 } = e4.data, a3 = { code: 0, data: { cursor: s3, isCompleted: t2, messageID: n2, unreadUserInfoList: [], readUserInfoList: [] } }, o2 = [...i3, ...r2];
      return 0 === o2.length ? a3 : this.getEngine().TUIUser.getUserProfile({ userIDList: o2 }).then((e5) => (i3.length > 0 ? e5.data.forEach((e6) => {
        const { userID: t3, nick: s4 = "", avatar: n3 = "" } = e6;
        a3.data.unreadUserInfoList.push({ userID: t3, nick: s4, avatar: n3 });
      }) : e5.data.forEach((e6) => {
        const { userID: t3, nick: s4 = "", avatar: n3 = "" } = e6;
        a3.data.readUserInfoList.push({ userID: t3, nick: s4, avatar: n3 });
      }), a3));
    });
  }
  downloadMergedMessages(e3) {
    return this.getEngine().chat.downloadMergerMessage(e3);
  }
  setTranslationLanguage(e3) {
    this.getEngine().TUIStore.update(o.USER, "targetLanguage", e3);
  }
  translateText(e3) {
    const t2 = this.getStoreData(o.USER, "targetLanguage"), s3 = Object.assign({ targetLanguage: t2, sourceLanguage: "auto" }, e3);
    return this.getEngine().chat.translateText(s3);
  }
  searchCloudMessages(e3) {
    const t2 = this.getStoreData(o.CONV, "conversationList");
    return this.getEngine().chat.searchCloudMessages(e3).then((e4) => {
      const { searchResultList: s3 } = e4.data;
      return e4.data.searchResultList = s3.map((e5) => {
        const { messageList: s4, conversationID: i3 } = e5, r2 = n(e5, ["messageList", "conversationID"]), a3 = s4.map((e6) => new ue(e6)), o2 = t2.find((e6) => e6.conversationID === i3);
        return Object.assign(Object.assign({}, r2), { messageList: a3.sort((e6, t3) => t3.time - e6.time), conversation: o2 });
      }), e4;
    });
  }
  addMessageReaction(e3, t2) {
    return this.getEngine().chat.addMessageReaction(e3.getMessage(), t2);
  }
  removeMessageReaction(e3, t2) {
    return this.getEngine().chat.removeMessageReaction(e3.getMessage(), t2);
  }
  getMessageReactions(e3) {
    const { messageList: t2 = [] } = e3, s3 = this.getStoreData(o.APP, "enabledEmojiPlugin");
    index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIChatService.getMessageReactions enabledEmojiPlugin:${s3} messageList length:${t2.length}`), s3 && t2.length > 0 && this.getEngine().chat.getMessageReactions(e3).then((e4) => {
      const t3 = e4.data.resultList || e4.data;
      this.updateMessageReactionList(t3);
    }).catch(() => {
    });
  }
  getAllUserListOfMessageReaction(e3) {
    var t2;
    return this.getEngine().chat.getAllUserListOfMessageReaction(Object.assign(Object.assign({}, e3), { message: null === (t2 = null == e3 ? void 0 : e3.message) || void 0 === t2 ? void 0 : t2.getMessage() }));
  }
  updateMessageReactionList(e3) {
    const t2 = [];
    e3.forEach((e4) => {
      const { messageID: s3, reactionList: n2 } = e4, i3 = this.getEngine().TUIStore.getMessageModel(s3);
      if (i3) {
        const e5 = [];
        for (let t3 = 0; t3 < n2.length; t3++) {
          let s4 = true;
          for (let e6 = 0; e6 < i3.reactionList.length; e6++)
            if (n2[t3].reactionID === i3.reactionList[e6].reactionID) {
              i3.reactionList[e6] = n2[t3], s4 = false;
              break;
            }
          s4 && e5.push(n2[t3]);
        }
        i3.reactionList.push(...e5), e5.length = 0, t2.push(i3);
      }
    }), t2.length > 0 && this.updateMessageList(t2, "edit");
  }
  convertVoiceToText(e3) {
    const { message: t2, language: s3 = "zh" } = e3, n2 = t2.getMessage();
    return this.getEngine().chat.convertVoiceToText({ message: n2, language: s3 });
  }
  clearHistoryMessage(e3) {
    const t2 = this.getEngine();
    return t2.chat.clearHistoryMessage(e3).then((e4) => (t2.TUIStore.update(o.CHAT, "messageList", []), t2.TUIStore.update(o.CHAT, "nextReqMessageID", ""), t2.TUIStore.update(o.CHAT, "isCompleted", false), e4));
  }
  updateMessageInfo(e3) {
    const t2 = this.getStoreData(o.CHAT, "userInfo");
    this.getEngine().TUIStore.update(o.CHAT, "userInfo", Object.assign(t2, e3));
    const s3 = this.getStoreData(o.CHAT, "messageList");
    if (s3.length > 0) {
      this.updateLocalMessage(s3, e3) && this.getEngine().TUIStore.update(o.CHAT, "messageList", s3);
    }
  }
  updateLocalMessage(e3, t2) {
    let s3 = false;
    return e3.forEach((e4) => {
      if (t2[e4.from]) {
        const { nick: n2, nameCard: i3, avatar: r2 } = t2[e4.from];
        n2 && (e4.nick = n2, s3 = true), i3 && (e4.nameCard = i3, s3 = true), r2 && (e4.avatar = r2, s3 = true);
      }
    }), s3;
  }
  handleC2CCallSignaling(e3) {
    const t2 = this.getEngine(), s3 = t2.getMyUserID();
    return e3.filter((e4) => {
      var n2, i3, r2, a3, u2;
      const { conversationType: c3, type: g2, payload: l2 } = e4;
      let h3 = true;
      if (c3 === t2.TYPES.CONV_C2C && g2 === t2.TYPES.MSG_CUSTOM) {
        if (t2.chat.getSignalingInfo(e4)) {
          const t3 = U(l2.data);
          if (1 === (null == t3 ? void 0 : t3.businessID)) {
            const c4 = U(t3.data);
            if (h3 = !(e4._isExcludedFromUnreadCount && e4._isExcludedFromLastMessage), h3 && true !== (null === (n2 = null == c4 ? void 0 : c4.data) || void 0 === n2 ? void 0 : n2.consumed)) {
              let n3 = null === (i3 = null == c4 ? void 0 : c4.data) || void 0 === i3 ? void 0 : i3.inviter;
              "line_busy" !== (null == c4 ? void 0 : c4.line_busy) && "lineBusy" !== (null === (r2 = null == c4 ? void 0 : c4.data) || void 0 === r2 ? void 0 : r2.message) || (n3 = t3.inviter);
              const { from: g3, to: l3 } = e4;
              if (n3 !== s3 && e4.from === s3) {
                const t4 = this.getStoreData(o.CONV, "currentConversation");
                e4.from = l3, e4.to = g3, e4.flow = "in", e4.avatar = (null === (a3 = null == t4 ? void 0 : t4.userProfile) || void 0 === a3 ? void 0 : a3.avatar) || "";
              }
              if (n3 === s3 && e4.from !== s3) {
                const t4 = this.getStoreData(o.USER, "userProfile");
                e4.from = l3, e4.to = g3, e4.flow = "out", e4.avatar = null == t4 ? void 0 : t4.avatar;
              }
              index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `${this.serv}.handleC2CCallSignaling myUserID:${s3} callSignaling.inviter:${t3.inviter} customData.data.inviter:${null === (u2 = null == c4 ? void 0 : c4.data) || void 0 === u2 ? void 0 : u2.inviter}`);
            }
          }
        }
      }
      return h3;
    });
  }
  sortMessageList(e3) {
    const { conversationType: t2 } = e3[0];
    if (t2 === this.getEngine().TYPES.CONV_C2C)
      return e3.sort((e4, t3) => e4.time - t3.time);
    const s3 = e3.filter((e4) => "success" === e4.status).sort((e4, t3) => e4.sequence - t3.sequence);
    for (let t3 = 0; t3 < e3.length; t3++)
      "success" !== e3[t3].status && s3.splice(t3, 0, e3[t3]);
    return s3;
  }
}
class $t extends ne {
  constructor() {
    super(), this.groupMap = /* @__PURE__ */ new Map();
  }
  static getInstance() {
    return $t.instance || ($t.instance = new $t()), $t.instance;
  }
  init() {
    const e3 = this.getEngine();
    e3.eventCenter.addEvent(e3.EVENT.GROUP_LIST_UPDATED, this.onGroupListUpdated.bind(this)), e3.eventCenter.addEvent(e3.EVENT.GROUP_ATTRIBUTES_UPDATED, this.onGroupAttributesUpdated.bind(this)), e3.eventCenter.addEvent(e3.EVENT.GROUP_COUNTER_UPDATED, this.onGroupCounterUpdated.bind(this)), e3.eventCenter.addEvent(e3.EVENT.MESSAGE_RECEIVED, this.onMessageReceived.bind(this)), this.getGroupInitData();
  }
  onGroupListUpdated(e3) {
    const t2 = this.getEngine();
    t2.TUIStore.update(o.GRP, "groupList", e3);
    const s3 = t2.TUIStore.getData(o.GRP, "currentGroupID");
    e3.forEach((e4) => {
      e4.groupID === s3 && t2.TUIStore.update(o.GRP, "currentGroup", e4);
    });
  }
  onGroupAttributesUpdated(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.GRP, "currentGroupID");
    let n2 = t2.TUIStore.getData(o.GRP, "groupList");
    const { groupID: i3, groupAttributes: r2 } = e3;
    s3 === i3 && t2.TUIStore.update(o.GRP, "currentGroupAttributes", r2), n2 = n2.map((e4) => (e4.groupID === i3 && (e4.groupAttributes = r2), e4)), t2.TUIStore.update(o.GRP, "groupList", n2);
  }
  onGroupCounterUpdated(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.GRP, "currentGroupID"), n2 = t2.TUIStore.getData(o.GRP, "currentGroupCounters") || {};
    let i3 = t2.TUIStore.getData(o.GRP, "groupList");
    const { groupID: r2, key: a3, value: u2 } = e3;
    s3 === r2 && (n2[a3] = u2, t2.TUIStore.update(o.GRP, "currentGroupCounters", n2)), i3 = i3.map((e4) => (e4.groupID === r2 && (e4.groupCounters = Object.assign(Object.assign({}, e4.groupCounters), { [a3]: u2 })), e4)), t2.TUIStore.update(o.GRP, "groupList", i3);
  }
  onMessageReceived(e3) {
    const t2 = this.getEngine(), s3 = [];
    e3.forEach((e4) => {
      if (e4.type === t2.TYPES.MSG_GRP_TIP) {
        const { payload: s4 } = e4, { operationType: n2, userIDList: i3 } = s4;
        switch (n2) {
          case t2.TYPES.GRP_TIP_MBR_JOIN:
            this.addMemberList(i3);
            break;
          case t2.TYPES.GRP_TIP_MBR_QUIT:
          case t2.TYPES.GRP_TIP_MBR_KICKED_OUT:
            this.removeMemberList(i3);
            break;
          case t2.TYPES.GRP_TIP_MBR_SET_ADMIN:
          case t2.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:
            this.updateGroupMember(i3);
            break;
          case t2.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:
            break;
          case t2.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:
          case t2.TYPES.GRP_TIP_BAN_AVCHATROOM_MEMBER:
          case t2.TYPES.GRP_TIP_UNBAN_AVCHATROOM_MEMBER:
            this.updateGroupMember(i3);
        }
      }
      e4.type === t2.TYPES.MSG_GRP_SYS_NOTICE && s3.push(e4);
    }), s3.length > 0 && t2.TUIStore.update(o.GRP, "groupSystemNoticeList", s3);
  }
  getGroupInitData() {
    const e3 = this.getEngine();
    e3.chat.isReady() && e3.chat.getGroupList().then((e4) => {
      const { groupList: t2 = [] } = e4.data;
      index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIGroupService.init, getGroupList count:${t2.length}`), t2.length > 0 && this.onGroupListUpdated(t2);
    });
  }
  updateGroupMember(e3) {
    return i2(this, void 0, void 0, function* () {
      const t2 = this.getEngine().TUIStore.getData(o.GRP, "currentGroupID");
      if (t2) {
        const s3 = yield this.getGroupMemberProfile({ groupID: t2, userIDList: e3 }), { memberList: n2 } = s3.data;
        this.updateMemberList(n2);
      }
    });
  }
  resetCurrentStore() {
    this.getEngine().TUIStore.reset(o.GRP, ["currentGroupID", "currentGroup", "currentGroupAttributes", "currentGroupCounters", "currentGroupMemberList"], true);
  }
  switchGroup(e3) {
    return i2(this, void 0, void 0, function* () {
      const t2 = this.getEngine();
      t2.TUIStore.update(o.GRP, "offset", 0), t2.TUIStore.update(o.GRP, "isCompleted", false);
      const s3 = t2.TUIStore.getConversationModel(`GROUP${e3}`);
      if ((null == s3 ? void 0 : s3.operationType) > 0) {
        const e4 = t2.TUIStore.getData(o.GRP, "currentGroup");
        return Promise.resolve(e4);
      }
      const n2 = t2.TUIStore.getData(o.GRP, "currentGroupID");
      if (!e3)
        return this.resetCurrentStore(), Promise.resolve({});
      if (n2 === e3) {
        const e4 = t2.TUIStore.getData(o.GRP, "currentGroup");
        return Promise.resolve(e4);
      }
      this.resetCurrentStore(), t2.TUIStore.update(o.GRP, "currentGroupID", e3);
      try {
        yield this.getGroupInfo(e3);
      } catch (e4) {
        Promise.reject(e4);
      }
      const i3 = setTimeout(() => {
        this.groupMap.delete(e3), clearTimeout(i3);
      }, 5e3), r2 = t2.TUIStore.getData(o.GRP, "currentGroup");
      return Promise.resolve(r2);
    });
  }
  getGroupInfo(e3) {
    return i2(this, void 0, void 0, function* () {
      const t2 = this.getEngine(), s3 = this.groupMap.get(e3);
      if (s3)
        return this.updateMemberList((null == s3 ? void 0 : s3.memberList) || []), t2.TUIStore.update(o.GRP, "currentGroup", s3.group), t2.TUIStore.update(o.GRP, "currentGroupAttributes", s3.groupAttributes || {}), void t2.TUIStore.update(o.GRP, "currentGroupCounters", s3.counters || {});
      const n2 = { group: {}, memberList: [], groupAttributes: void 0, counters: void 0 }, { data: { group: i3 } } = yield this.getGroupProfile({ groupID: e3 });
      n2.group = i3;
      const { data: { memberList: r2 } } = yield this.getGroupMemberList({ groupID: e3 });
      n2.memberList = r2;
      const a3 = yield this.getGroupAttributes({ groupID: e3, keyList: [] }), { groupAttributes: u2 } = a3.data;
      n2.groupAttributes = u2, t2.TUIStore.update(o.GRP, "currentGroupAttributes", u2);
      try {
        const s4 = yield this.getGroupCounters({ groupID: e3, keyList: [] }), { counters: i4 } = s4.data;
        n2.counters = i4, t2.TUIStore.update(o.GRP, "currentGroupCounters", i4);
      } catch (e4) {
        index.__f__("warn", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", null == e4 ? void 0 : e4.message);
      }
      this.groupMap.set(e3, n2);
    });
  }
  getGroupProfile(e3) {
    const t2 = this.getEngine();
    return t2.chat.getGroupProfile(e3).then((s3) => i2(this, void 0, void 0, function* () {
      if (t2.TUIStore.getData(o.GRP, "currentGroupID") === e3.groupID) {
        const { group: e4 } = s3.data;
        t2.TUIStore.update(o.GRP, "currentGroup", e4);
      }
      return s3;
    }));
  }
  updateGroupProfile(e3) {
    return this.getEngine().chat.updateGroupProfile(e3);
  }
  createGroup(e3) {
    return this.getEngine().chat.createGroup(e3);
  }
  dismissGroup(e3) {
    return this.getEngine().chat.dismissGroup(e3);
  }
  searchGroupByID(e3) {
    const t2 = this.getEngine();
    return t2.chat.searchGroupByID(e3).then((e4) => {
      const { group: s3 } = e4.data, n2 = t2.TUIStore.getData(o.GRP, "groupList");
      return e4.data.group.isJoinedGroup = n2.some((e5) => e5.groupID === s3.groupID), e4;
    });
  }
  joinGroup(e3) {
    return this.getEngine().chat.joinGroup(e3);
  }
  quitGroup(e3) {
    return this.getEngine().chat.quitGroup(e3);
  }
  getGroupApplicationList() {
    return this.getEngine().chat.getGroupApplicationList();
  }
  handleGroupApplication(e3) {
    return this.getEngine().chat.handleGroupApplication(e3);
  }
  getGroupOnlineMemberCount(e3) {
    return this.getEngine().chat.getGroupOnlineMemberCount(e3);
  }
  changeGroupOwner(e3) {
    return this.getEngine().chat.changeGroupOwner(e3);
  }
  initGroupAttributes(e3) {
    return this.getEngine().chat.initGroupAttributes(e3);
  }
  setGroupAttributes(e3) {
    return this.getEngine().chat.setGroupAttributes(e3);
  }
  deleteGroupAttributes(e3) {
    return this.getEngine().chat.deleteGroupAttributes(e3);
  }
  getGroupAttributes(e3) {
    return this.getEngine().chat.getGroupAttributes(e3);
  }
  setGroupCounters(e3) {
    return this.getEngine().chat.setGroupCounters(e3);
  }
  increaseGroupCounter(e3) {
    return this.getEngine().chat.increaseGroupCounter(e3);
  }
  decreaseGroupCounter(e3) {
    return this.getEngine().chat.decreaseGroupCounter(e3);
  }
  getGroupCounters(e3) {
    return this.getEngine().chat.getGroupCounters(e3);
  }
  updateMemberList(e3) {
    const t2 = this.getEngine(), s3 = [...(t2.TUIStore.getData(o.GRP, "currentGroupMemberList") || []).filter((t3) => !e3.find((e4) => e4.userID === t3.userID)), ...e3];
    t2.TUIStore.update(o.GRP, "currentGroupMemberList", s3);
  }
  addMemberList(e3) {
    return i2(this, void 0, void 0, function* () {
      const t2 = this.getEngine().TUIStore.getData(o.GRP, "currentGroupID");
      if (t2)
        try {
          const s3 = yield this.getGroupMemberProfile({ groupID: t2, userIDList: e3 }), { memberList: n2 } = s3.data;
          this.updateMemberList(n2);
        } catch (t3) {
          const s3 = e3.map((e4) => ({ userID: e4, avatar: "", nick: "", role: "", joinTime: 0, nameCard: "", muteUntil: 0, memberCustomField: [] }));
          this.updateMemberList(s3);
        }
    });
  }
  removeMemberList(e3) {
    const t2 = this.getEngine(), s3 = t2.TUIStore.getData(o.GRP, "currentGroupMemberList").filter((t3) => -1 === e3.indexOf(t3.userID));
    t2.TUIStore.update(o.GRP, "currentGroupMemberList", s3);
  }
  getGroupMemberList(e3) {
    const t2 = this.getEngine();
    if (S(e3.offset)) {
      const s3 = t2.TUIStore.getData(o.GRP, "offset");
      e3.offset = s3;
    }
    return t2.chat.getGroupMemberList(e3).then((s3) => {
      if (t2.TUIStore.getData(o.GRP, "currentGroupID") === e3.groupID) {
        const { memberList: e4, offset: n2 = 0 } = s3.data;
        this.updateMemberList(e4), t2.TUIStore.update(o.GRP, "offset", n2), 0 === n2 && t2.TUIStore.update(o.GRP, "isCompleted", true);
      }
      return s3;
    });
  }
  getGroupMemberProfile(e3) {
    return this.getEngine().chat.getGroupMemberProfile(e3);
  }
  addGroupMember(e3) {
    const t2 = this.getEngine();
    return t2.chat.addGroupMember(e3).then((s3) => i2(this, void 0, void 0, function* () {
      if (t2.TUIStore.getData(o.GRP, "currentGroupID") === e3.groupID) {
        const { successUserIDList: e4, group: n2 } = s3.data;
        t2.TUIStore.update(o.GRP, "currentGroup", n2), this.addMemberList(e4);
      }
      return s3;
    }));
  }
  deleteGroupMember(e3) {
    const t2 = this.getEngine();
    return t2.chat.deleteGroupMember(e3).then((s3) => {
      if (t2.TUIStore.getData(o.GRP, "currentGroupID") === e3.groupID) {
        const { userIDList: e4, group: n2 } = s3.data;
        this.removeMemberList(e4), t2.TUIStore.update(o.GRP, "currentGroup", n2);
      }
      return s3;
    });
  }
  setGroupMemberMuteTime(e3) {
    return this.getEngine().chat.setGroupMemberMuteTime(e3);
  }
  setGroupMemberRole(e3) {
    return this.getEngine().chat.setGroupMemberRole(e3);
  }
  setGroupMemberNameCard(e3) {
    return this.getEngine().chat.setGroupMemberNameCard(e3);
  }
  setGroupMemberCustomField(e3) {
    return this.getEngine().chat.setGroupMemberCustomField(e3);
  }
  markGroupMemberList(e3) {
    return this.getEngine().chat.markGroupMemberList(e3);
  }
}
class Ht extends ne {
  constructor() {
    super();
  }
  static getInstance() {
    return Ht.instance || (Ht.instance = new Ht()), Ht.instance;
  }
  init() {
    const e3 = this.getEngine();
    e3.eventCenter.addEvent(e3.EVENT.FRIEND_LIST_UPDATED, this.onFriendListUpdated.bind(this)), e3.eventCenter.addEvent(e3.EVENT.FRIEND_APPLICATION_LIST_UPDATED, this.onFriendApplicationListUpdated.bind(this)), this.getFriendInitData();
  }
  onFriendListUpdated(e3) {
    this.getEngine().TUIStore.update(o.FRIEND, "friendList", e3);
  }
  onFriendApplicationListUpdated(e3) {
    const { friendApplicationList: t2, unreadCount: s3 = 0 } = e3, n2 = this.getEngine();
    n2.TUIStore.update(o.FRIEND, "friendApplicationList", t2), n2.TUIStore.update(o.FRIEND, "friendApplicationUnreadCount", s3);
  }
  getFriendInitData() {
    const e3 = this.getEngine();
    e3.chat.isReady() && (e3.chat.getFriendList().then((e4) => {
      const t2 = e4.data || [];
      index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", `TUIFriendService.init, getFriendList count:${t2.length}`), t2.length > 0 && this.onFriendListUpdated(t2);
    }), e3.chat.getFriendApplicationList().then((e4) => {
      this.onFriendApplicationListUpdated(e4.data);
    }));
  }
  getFriendList() {
    return this.getEngine().chat.getFriendList();
  }
  getFriendRemark(e3) {
    const t2 = this.getEngine().TUIStore.getData(o.FRIEND, "friendList"), s3 = {};
    return e3.forEach((e4) => {
      for (let n2 = 0; n2 < t2.length; n2++)
        t2[n2].userID !== e4 || (s3[e4] = t2[n2].remark);
    }), s3;
  }
  addFriend(e3) {
    return this.getEngine().chat.addFriend(e3);
  }
  deleteFriend(e3) {
    return this.getEngine().chat.deleteFriend(e3);
  }
  checkFriend(e3) {
    return this.getEngine().chat.checkFriend(e3);
  }
  getFriendProfile(e3) {
    return this.getEngine().chat.getFriendProfile(e3);
  }
  updateFriend(e3) {
    return this.getEngine().chat.updateFriend(e3);
  }
  acceptFriendApplication(e3) {
    return this.getEngine().chat.acceptFriendApplication(e3);
  }
  refuseFriendApplication(e3) {
    return this.getEngine().chat.refuseFriendApplication({ userID: e3 });
  }
  deleteFriendApplication(e3) {
    return this.getEngine().chat.deleteFriendApplication(e3);
  }
  setFriendApplicationRead() {
    return this.getEngine().chat.setFriendApplicationRead();
  }
}
class Yt extends ne {
  static getInstance() {
    return Yt.instance || (Yt.instance = new Yt()), Yt.instance;
  }
  reportFeature(e3, t2) {
    var s3;
    return null === (s3 = this.getEngine().chat) || void 0 === s3 ? void 0 : s3.callExperimentalAPI("statTUIKeyFeatures", { code: e3, msg: t2 ? `${e3}-${t2}` : "" });
  }
}
class Bt {
  constructor() {
    this.cache = [], this.middlewares = [], this.options = null;
  }
  use(e3) {
    return "function" != typeof e3 && index.__f__("error", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "middleware must be a function"), this.cache.push(e3), this;
  }
  next() {
    if (this.middlewares && this.middlewares.length > 0) {
      return this.middlewares.shift().call(this, this.options, this.next.bind(this));
    }
  }
  run(e3) {
    return this.middlewares = this.cache.map((e4) => e4), this.options = e3, this.next();
  }
}
function Kt(e3, t2, s3) {
  const n2 = /* @__PURE__ */ Object.create(null);
  Object.keys(s3).forEach((s4) => {
    if (!t2[s4])
      return;
    n2[s4] = t2[s4];
    const i3 = new Bt();
    t2[s4] = function() {
      const r2 = Array.from(arguments);
      return i3.use((t3, n3) => e3.isInited ? n3() : Promise.reject({ code: h2.NOT_INIT, message: `${s4} | ${d2.NOT_INIT}` })).use((e4) => n2[s4].apply(t2, e4)), i3.run(r2);
    };
  });
}
index.__f__("log", "at node_modules/@tencentcloud/chat-uikit-engine/index.js:1", "TUIChatEngine.VERSION:2.4.4");
const qt = ee2.getInstance();
X2.getInstance();
const Jt = fe.getInstance(), Wt = Dt.getInstance(), Xt = Pt.getInstance(), Zt = xt.getInstance(), Qt = Ft.getInstance(), es = $t.getInstance(), ts = Ht.getInstance(), ss = Yt.getInstance();
qt.mount(a2.TUIStore, Jt), qt.mount(a2.TUITranslate, Wt), qt.mount(a2.TUIConversation, Xt), qt.mount(a2.TUIUser, Zt), qt.mount(a2.TUIChat, Qt), qt.mount(a2.TUIGroup, es), qt.mount(a2.TUIFriend, ts), qt.mount(a2.TUIReport, ss), Kt(qt, qt, f2), Kt(qt, Xt, m2), Kt(qt, Qt, v2), Kt(qt, es, T), Kt(qt, Zt, E), Kt(qt, ts, I), Kt(qt, ss, f2);
exports.COS = COS;
exports._export_sfc = _export_sfc;
exports.createPinia = createPinia;
exports.createSSRApp = createSSRApp;
exports.defineStore = defineStore;
exports.e = e$2;
exports.f = f$2;
exports.getCurrentInstance = getCurrentInstance;
exports.index = index;
exports.initVueI18n = initVueI18n;
exports.jo = jo;
exports.n = n$2;
exports.o = o$2;
exports.onMounted = onMounted;
exports.p = p$2;
exports.reactive = reactive;
exports.ref = ref;
exports.resolveComponent = resolveComponent;
exports.s = s$2;
exports.sr = sr;
exports.t = t$2;
exports.unref = unref;
exports.wx$1 = wx$1;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
