'use strict'
!(function(require, directRequire) {
  function a(a, b) {
    b = b.toLowerCase()
    let c
    switch (b) {
      case 'b': {
        c = a
        break
      }
      case 'kb': {
        c = a / 1024
        break
      }
      case 'mb': {
        c = a / 1024 / 1024
        break
      }
      case 'gb': {
        c = a / 1024 / 1024 / 1024
        break
      }
      default:
        c = -1
    }
    return Math.ceil(c)
  }
  module.exports = {
    safeFormatSize: function(c) {
      let d = parseInt(c, 10)
      if (isNaN(d) || 0 > d) return 0
      const e = d
      switch (!0) {
        case 1024 > e:
          return `${e} B`
        case e < 1048576:
          return `${a(e, 'kb')} KB`
        case e < 1073741824:
          return `${a(e, 'mb')} MB`
        default:
          return `${a(e, 'gb')} GB`
      }
    },
    titleForEvent: function(a) {
      const b = a.type
      return 'receivedinvalidmessage' === b
        ? '\u6536\u5230\u975E\u6CD5\u6D88\u606F'
        : 'receivedbrokenmessage' === b
          ? '\u6536\u5230\u6D88\u606F\u635F\u574F'
          : 'sendingbrokenmessage' === b
            ? '\u53D1\u9001\u6D88\u606F\u635F\u574F'
            : 'sendinginvalidmessage' === b
              ? '\u53D1\u9001\u975E\u6CD5\u6D88\u606F'
              : 'queuetoomanyrequest' === b
                ? '\u79EF\u7D2F\u6D88\u606F\u8FC7\u591A'
                : 'serverblock' === b
                  ? a.blocked
                    ? '\u670D\u52A1\u5668\u5FD9\u788C'
                    : '\u670D\u52A1\u5668\u6062\u590D\u6B63\u5E38'
                  : 'servererror' === b
                    ? '\u670D\u52A1\u5668\u9519\u8BEF'
                    : 'recoverfromcurrentcontext' === b
                      ? '\u5DF2\u6062\u590D\u8C03\u8BD5'
                      : 'losingcontext' === b
                        ? '\u5DF2\u91CD\u65B0\u5F00\u59CB\u8C03\u8BD5'
                        : 'end' === b
                          ? '\u8C03\u8BD5\u5DF2\u7ED3\u675F'
                          : 'assertion' === b
                            ? '\u5185\u90E8\u5F02\u5E38'
                            : 'receivederrorcode' === b
                              ? '\u6536\u5230\u9519\u8BEF\u4EE3\u7801'
                              : 'sessionerror' === b
                                ? '\u7F51\u7EDC\u6216\u767B\u5F55\u9519\u8BEF'
                                : b
    }
  }
})(require('lazyload'), require)
